Table 1
If we look at the table and take the furthest column to the right and work our way the left, we see that:
2 to the power of 0 is = 1
2 to the power of 1 is = 2 (2x1 = 2)
2 to the power of 2 is = 4 (2x2 = 4)
2 to the power of 3 is = 8 (2x2x2 = 8)
2 to the power of 4 is = 16 (2x2x2x2 = 16)
2 to the power of 5 is = 32 (2x2x2x2x2 = 32)
…….and so on.
Now that the table is done we can start converting from binary numbers to decimal. What we can say next is add a new line to the bottom of the existing table and if there is a 1 in the box then that number will be added to the total number (in decimal), this can be seen in example one
Example 1
Table 2
We see that 32, 8 and 4 have the number one under them so we add these numbers to the total.
32 + 8 + 4 = 44 (in Decimal form)
By following table 1, we can start converting the binary numbers to produce decimal numbers here are two examples.
32+8+4=44
32+16+8+2+1=59
The same process is used to produce smaller numbers as well. Zero may be shown as 0 in all the columns.
To convert back to binary we use repeated division of 2. The number I will convert back to binary will be 54. A common problem with converting back to binary is that a lot of people convert it right, but they don’t put the numbers in the right order. So what we say is, the first division number goes to the right, and then the next number goes next to it on the left, and so on. I will show how the conversion is done below.
You could also read the number bottom to top.
The Binary number is 110110.
Octal and Hexadecimal Numbers
There are eight symbols used in the octal system with the base number being 8, the symbols used are 0,1,2,3,4,5,6 and 7. Octal numbers are a short hand of binary. Octal coding uses three bits at a time, which then allows 8 different patterns of bits. Some examples of 16-bit are shown below.
The binary numbers are split into groups, of which there are 3 bits in the group. Because 16 can not be divided into 3, what we do is work our way from right to left grouping the numbers then the one at the end is put in its own group, this is called the “Most significant bit” (MSB). Also we note that the MSB can only have a value of 0 or 1.
Using the same number (54) as above I will do a new table to show how octal works.
66 is the octal code.
The conversion back to decimal is done in the same way binary is, and as you can see octal is a slight easier way and faster way of converting the number system.
Hexadecimal Coding has a base of 16, and the symbols used are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F. The symbols A, B, C, D and F are representing the numbers 10, 11,12,13,14 and 15 in decimal form. Where as octal has groups of 3 bits, hex has groups of 4 bits. This is where the letters are used. Since we know how the lower numbers are used I will show below how the symbols 9 and above work.
Now that the groups have four bits to it, we can code binary into hex, by splitting up the binary into groups then working out the symbol. An example is shown below.
Hexadecimal is used more than octal because computers organise their internal memory in 8-bit groupings or bytes and also multiples of bytes. These grouping can be divided into 4-bit nibbles, which can be coded as a short hand of hex.