Spreadsheet to help calc bitwise operations

Thanks for putting all those information into the document.
Another thing can be helpful is Windows calculator software. If you have a bit to convert that into decimal number, that calculator in "programmer" mode can do the conversion for you. The calculator is under Accessories. Programmer mode can be selected under "view". If you decide bit 5 is your flag bit for email 2 sent, simply in Bin mode enter "10000", then click on Dec, which will show "16" that you can use in PLC coding.
 
That all sounds *SO* difficult! Remember, it's just binary. Write the number out bitwise....

.....0 1 0 0 0 0 0 0
...................^---- put your pencil on this one and say "1"

Then keep moving left one digit and double the number until you get to the '1' digit.
so in this example you'd count "2", then "4", then "8", then "16", then "32". As you say "64" you land on the 1, and that's your number!

As you do this more, you do it in your head far, far quicker than you can even FIND the calculator.

If you need multiple bits, for example:

0 0 0 1 0 1 1
You do the same thing, but add them up. In this case "8" + "2" + "1". And if you can't add 8+2=10 and 10+1 = 11 in your head, you're not trying!
 
As always, you're absolutely right Ross. What I did was make it easy for some to understand how it works and be able to see how it works at the bit level. It also shows the number to use to ANDB with to unset the bit.
 
Back
Top