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 bynary_counting_Hello_World by
Revision 1:77d533d0d869, committed 2016-01-28
- Comitter:
- Hikaria
- Date:
- Thu Jan 28 13:41:57 2016 +0000
- Parent:
- 0:d6f93f0e46d4
- Commit message:
- Binary counter with mask
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Dec 07 21:20:43 2010 +0000
+++ b/main.cpp Thu Jan 28 13:41:57 2016 +0000
@@ -13,10 +13,10 @@
while (1) {
for (counter = 0; counter < 16; counter++) {
- b3=(counter > 7);
- b2=((counter-(b3*8)) > 3);
- b1=((counter-(b3*8)-(b2*4)) > 1);
- b0=((counter-(b3*8)-(b2*4)-(b1*2)) > 0);
+ b3=(counter & 8) >> 3;
+ b2=(counter & 4) >> 2;
+ b1=(counter & 2) >> 1;
+ b0=(counter & 0) >> 0;
bitthree = b3;
bittwo = b2;
