Solution

Dependencies:   mbed

Fork of Task352Solution by Stage-1 Students SoCEM

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Tue Oct 02 07:37:08 2018 +0000
Parent:
0:e2f876895db4
Commit message:
Added solution to tasks

Changed in this revision

README.txt Show annotated file Show diff for this revision Revisions of this file
diff -r e2f876895db4 -r facc2bd1d423 README.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.txt	Tue Oct 02 07:37:08 2018 +0000
@@ -0,0 +1,15 @@
+Answer to questions
+
+Q1. 1 second
+Q2. XOR
+Q3. D3
+
+Q4. This project is one possible solution
+
+The key line is this
+
+unsigned int binaryInput = SW1 + (SW2 << 1);
+
+where SW1 and SW2 are the switches for the least and most significant bits respectively. 
+
+Note the use of << to multiply by 2. A left shift is a cheap operation in computing terms (does not require many CPU cycles).
\ No newline at end of file