Uhhh... a byte had eight bits last I looked... which gives 255 (256 if you include zero) combinations.
Remember binary math...
# Bits - Max Value
1 - 1
2 - 3
3 - 7
4 - 15
5 - 31
6 - 63
7 - 127
8 - 255
9 - 511
10 - 1023
11 - 2047
12 - 4095
13 - 8191
14 - 16383
15 - 32767
16 - 65535
For counts of up to 32,767 you can see you need 15 bits...
A word (16 bits) can hold a count from zero up to 65535.
Melanie
Bookmarks