Thus, we have the number 397 is really:
3 times 100 (102) 300 9 times 10 (101) 90 7 times 1 (100) 7 --- 397
The computer uses a different numbering system that is based on two symbols (which also is based on two states, on and off). The two symbols are 0 and 1. In this system, everything is based on a power of two.
This leads to 1011:
1 times 8 (23) 8 (decimal) 0 times 4 (22) 0 (decimal) 1 times 2 (21) 2 (decimal) 1 times 1 (20) 1 (decimal) --- 11 (decimal)
Examination of this example should reveal that we used the same concepts, but substituted two for ten as the base. Since there are only two values in this system, it is called the binary numbering system.
When working with large binary values, humans have a tendency tory values, humans have a tendency to make mistakes, so we use a different numbering system which is more convenient to use, the hexadecimal numbering system. Hexadecimal means sixteen. So, what sixteen symbols are used for this? Simple, use the ten from the decimal system and add the first six letters of the alphabet: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
This leads to FE08:
F times 4096 (163) 61440 (decimal) E times 256 (162) 3584 (decimal) 0 times 16 (161) 0 (decimal) 8 times 1 (160) 8 (decimal) ----- 65032 (decimal)
Binary Dec Hex 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 10000 16 10
Power | Value |
---|---|
0 | 1 |
1 | 2 |
2 | 4 |
3 | 8 |
4 | 16 |
5 | 32 |
6 | 64 |
7 | 128 |
8 | 256 |
9 | 512 |
10 | 1024 |
11 | 2048 |
12 | 4096 |
13 | 8192 |
14 | 16384 |
12 | 32768 |
12 | 65536 |
8 4 2 1 1 0 1 1 - - - - 8 + 0 + 2 + 1 = 11
11 - 8 1 ---- 3 0 Since the next value can not be subtracted, it is a zero ---- 3 - 2 1 ---- 1 - 1 1 ---- -------- 0 1011 Once zero is reached, you are done.
F E 0 8 1111 1110 0000 1000
Then convert each four bit group to hex:
1111 1110 0000 1000 F E 0 8
What do you do if you have 11 1000? Easy, you can add a zero on the left side of any number and not change its value, so make it 0011 1000.