Programming instructions

40
To convert from binary to decimal, just add the bit values of the bits that are set
to ‘1’.
Binary Word Decimal Value
0000 0001 ……………… 1
0000 0010 ……………… 2
0000 0100 ……………… 4
0000 1000 ……………… 8
0000 0011 ……………… 3
0000 0101 ……………… 5
0000 0110 ……………… 6
With 4 bits you can count from 0 to 15 …
0000 0000 ……………… 0
0000 1111 ……………… 15 (8+4+2+1=15)
4.2 Hexadecimal Numbers
Hexadecimal is a Base 16 number system, meaning each digit has 16 possible
values. Each digit then represents a number from 0 to 15. This is accomplished
by using letters for values greater than 9.
From 0 to 9 the count is the same as decimal …
Then starting with 10, in hexadecimal, letters are used.
Hexadecimal is also considered a shorthand method of writing BINARY.
Each Hexadecimal digit represents 4 binary bits of data.
Bit Value
128 64 32 16 8 4 2 1
0 0 0 0 0 0 0 1
7 6 5 4 3 2 1 0
Bit Number
DECIMAL 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
HEXADECIMAL 0 1 2 3 4 5 6 7 8 9 A B C D E F
BINARY 0000 0010 0011 0100 1000 1001 1010 1011 1111
HEXADECIMAL 0 2 3 4 8 9 A B F