By combining the digits of 0 and 1, you can create 65,536 unique values ranging from 0000 0000 0000 0000 to 1111 1111 1111 1111. I'm putting spaces between the nibbles for easier reading,
Each bit in a word represents a power of 2 as you can see in this chart. Note that the "Bit Column" represents a digit position couting upwards from the right end of the byte towards the left.
Bit Column | Power of 2 | Hex Value | Decimal Value |
---|---|---|---|
0 | 2⁰ | 1 | 1 |
1 | 2¹ | 2 | 2 |
2 | 2² | 4 | 4 |
3 | 2³ | 8 | 8 |
4 | 2⁴ | 10 | 16 |
5 | 2⁵ | 20 | 32 |
6 | 2⁶ | 40 | 64 |
7 | 2⁷ | 80 | 128 |
8 | 2⁸ | 100 | 256 |
9 | 2⁹ | 200 | 512 |
10 | 2¹⁰ | 400 | 1,024 |
11 | 2¹¹ | 800 | 2,048 |
12 | 2¹² | 1000 | 4,096 |
13 | 2¹³ | 2000 | 8,192 |
14 | 2¹⁴ | 4000 | 16,384 |
15 | 2¹⁵ | 8000 | 32,768 |
To represent, for example, a number 257 you would need a word of 0000 0001 0000 0001, with the right-most digit on the second nubble being a 256 and the right-most digit on the fourth nibble being 1, so 256 + 1 = 257. In hexadecimal, it's 01 01.
Once again, below is the bit value table. This applies to nibbles, which are bits in groups of four. Combine four of the nibbles to make a word.
Bits | Decimal Value | Hexadecimal Value |
---|---|---|
0000 | 0 | 0 |
0001 | 1 | 1 |
0010 | 2 | 2 |
0011 | 3 | 3 |
0100 | 4 | 4 |
0101 | 5 | 5 |
0110 | 6 | 6 |
0111 | 7 | 7 |
1000 | 8 | 8 |
1001 | 9 | 9 |
1010 | 10 | A |
1011 | 11 | B |
1100 | 12 | C |
1101 | 13 | D |
1110 | 14 | E |
1111 | 15 | F |
Since bits are powers of 2, nibbles are basically powers of 16, and bytes are powers of 256.
The byte on the left represents 256¹, or 256, and the byte on the right represents 256⁰, or 1. Note that the "Byte Column" represents a digit position couting upwards from the right end of the word towards the left.
Byte Column | Power of 256 | Hex Value | Decimal Value |
---|---|---|---|
0 | 256⁰ | 1 | 1 |
1 | 256¹ | 100 | 256 |
Here is an excerpt of the byte value table. Each byte is givin The actual table runs for 65,536 values.
Bytes in Decimal | Bytes in Hexadecimal | Decimal Value |
---|---|---|
0 0 | 00 00 | 0 |
0 16 | 00 10 | 16 |
0 64 | 00 40 | 64 |
0 255 | 00 FF | 255 |
1 0 | 01 00 | 256 |
4 0 | 04 00 | 1024 |
16 0 | 10 00 | 4096 |
64 0 | 40 00 | 16,384 |
128 0 | 70 00 | 32,768 |
255 255 | FF FF | 65,535 |
32 bits form a Double Word or D-Word
© 1995-2023. davesfunstuff.com. All Rights Reserved. Reproduction of any part of this website without expressed written consent is prohibited.