Binary Number 0 and 1 |
Used to describe a number system, or a number belonging to it, that has 2 rather than 10 as its base For instance, in a system called binary-coded decimal, each of the decimal digits 0 to 15 is coded in 4 bits. |
Decimal | ||||||
Base 10 | 2^{5} | 2^{4} | 2^{3} | 2^{2} | 2^{1} | 2^{0} |
0 | 0 | 0 | 0 | 0 | ||
1 | 0 | 0 | 0 | 1 | ||
2 | 0 | 0 | 1 | 0 | ||
3 | 0 | 0 | 1 | 1 | ||
4 | 0 | 1 | 0 | 0 | ||
5 | 0 | 1 | 0 | 1 | ||
6 | 0 | 1 | 1 | 0 | ||
7 | 0 | 1 | 1 | 1 | ||
8 | 1 | 0 | 0 | 0 | ||
9 | 1 | 0 | 0 | 1 | ||
10 | 1 | 0 | 1 | 0 | ||
11 | 1 | 0 | 1 | 1 | ||
12 | 1 | 1 | 0 | 0 | ||
13 | 1 | 1 | 0 | 1 | ||
14 | 1 | 1 | 1 | 0 | ||
15 | 1 | 1 | 1 | 1 |
Base 10 | Base 2 (binary) | How to calculate | Base 10 |
0 | 0000 | 0x2^{3}+0x2^{2}+0x2^{1}+0x2^{0} | 0+0+0+0 |
1 | 0001 | 0x2^{3}+0x2^{2}+0x2^{1}+1x2^{0} | 0+0+0+1 |
2 | 0010 | 0x2^{3}+0x2^{2}+1x2^{1}+0x2^{0} | 0+0+2+0 |
...... | |||
15 | 1111 | 1x2^{3}+1x2^{2}+1x2^{1}+1x2^{0} | 8+4+2+1 |