Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of Task352Solution by
README.txt
- Committer:
- noutram
- Date:
- 2018-10-02
- Revision:
- 2:82201f763676
File content as of revision 2:82201f763676:
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).
