Professional Documents
Culture Documents
Number Bases
Number Bases
Iteration 1 0 1 2 3 4 5 6 7 8 9
Iteration 2 10 11 12 13 14 15 16 17 18 19
Iteration 3 20 21 22 23 24 25 26 27 28 29
Iteration 4 30 31 32 33 34 35 36 37 38 39
Figure 1.1: Decimal base number line
| | | | | | | | | | | | | | | | | | | | | | | | |
-4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
- Any number in decimal number base can be represented by using the ten symbols (0-9)
arranged in various positions.
- Each position is expressed in the power of 10. See Example 1.1
- If the fractional part exists, their positional values are expressed in the negative powers
of 10. See Example 1.2
5926 135.24
= 5 x 10 + 9 x 10 + 2 x 10 + 6 x 10
3 2 1 0 = 1 x 102 + 3 x 101 + 5 x 100 + 2 x 10-1 + 4 x 10-2
= 5000 + 900 + 20 + 6 = 100 + 30 + 5 + 0.2 + 0.04
From 5926, we can see that the positional From 135.24, we can see that the positional
value of 9 is 2 (from 102) value of 4 is -2 (from 10-2)
Also in the number 5926, 5 is the Most Also in the number 135.24, 1 is the Most
Significant Digit and 6 is the Least Significant Digit and 4 is the Least
Significant Digit. Significant Digit.
- Take Note: Decimal number bases cannot be used for internal data representation in
computers because it is difficult to design electronic circuits for 10 different states.
Iteration 1 0 1
Iteration 2 10 11
Iteration 3 100 101 111
Iteration 4 1000 1001 1011 1111
| | | | | | | | | |
-11 -10 -1 0 1 10 11 100 101 111
- Any number in the binary base can be represented by using the two symbols (0 and 1)
arranged in various positions.
- The binary base is a positional value base in which each position is expressed in the
powers of 2. See Example 1.3
- If the fractional part exists, their positional values are expressed in the negative powers
of 2. See Example 1.4
In the number 10110, 1 at the extreme left is the In the number 110.112, the positional value of
Most Significant Bit (MSB) and 0 at the the 1 at the extreme right is -2 (from 2-2).
extreme right is the Least Significant Bit (LSB).
The binary equivalent of the decimal number The binary equivalent of the decimal number
53 can be written as: 72 can be written as:
- To convert a real number such as 41.6875 into binary, you first separate the integer part
(41) and the fractional part (0.6875)
- You then convert the integer part on its own and the fractional part on its own
- The steps to convert the fractional part are as follows:
Multiply the number by 2
Multiply the answer again by 2
Repeat multiplying the answers by 2 until the final answer is 1.
The final solution is obtained by reading the integer part of the answers from the top
to the bottom.
Example 1.7
The binary equivalent of the integer part 41 can The binary equivalent of the fractional part
be written as: 0.6875 can be written as:
- The table and number line below shows how the numbers are counted:
Iteration 1 0 1 2 3 4 5 6 7
Iteration 2 10 11 12 13 14 15 16 17
Iteration 3 20 21 22 23 24 25 26 27
Iteration 4 30 31 32 33 34 35 36 37
Figure 1.3: Octal Number Base number line
| | | | | | | | | | | | | | | | | | | |
-3 -2 -1 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20
- Any number in the octal base can be represented by using the eight symbols arranged in
various positions.
- The octal base is a positional value base in which each position is expressed in the powers
of 8. See Example 1.8
- If the fractional part exists, their positional values are expressed in the negative powers
of 8. See Example 1.9
- An octal number is converted to decimal by multiplying each bit by its positional value
(expressed in the powers of 8) and taking the sum these products.
59268 135.248
=5x8 +9x8 +2x8 +6x8
3 2 1 0 = 1 x 82 + 3 x 81 + 5 x 80 + 2 x 8-1 + 4 x 8-2
= 2560 + 576 + 16 + 6 = 64 + 24 + 5 + 0.25 + 0.0625
= 3158 = 93.3125
- The decimal number is converted to octal by repeatedly dividing the number by 8. The
steps are as follows:
Divide the number by 8 giving the quotient and the remainder.
Repeat previous step with the new quotient until a zero quotient is obtained.
The answer is obtained by reading the remainder column from the bottom to the top.
Example 1.10 Example 1.11
The octal equivalent of the decimal The octal equivalent of the decimal number
number 53 can be written as 72 can be written as
- The octal number is converted to binary by individually converting each octal digit to its
three bit equivalent and then combining the results to form the binary representation of
the octal number.
- The binary number is converted to octal by grouping the bits of the binary number are
grouped into groups of three bits starting from binary point.
- Then each group is converted into its octal equivalent. If a group does not have three bits,
then add one or two zeros to make it a group of three.
Example 1.14
The octal equivalent of the binary number 1101001.10112 can be written as:
Example 1.15
The octal equivalent of the binary number 100112 can be written as
Iteration 1 0 1 2 3 4 5 6 7 8 9 A B C D E F
Iteration 2 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
Iteration 3 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
Iteration 4 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
Figure 1.4: Hexadecimal Number Base number line
| | | | | | | | | | | | | | | | | | | | | |
-3 -2 -1 0 1 2 3 4 5 6 7 8 9 A B C D E F 10 11 12
- Any number in the hexadecimal base can be represented by using the sixteen symbols
arranged in various positions.
- Each position is expressed in the powers of 16. See Example 1.16
- If the fractional part exists, their positional values are expressed in the negative powers
of 16. See Example 1.17
The hexadecimal equivalent of the decimal The hexadecimal equivalent of the decimal
number 53 can be written as number 72 can be written as
The binary equivalent of the hexadecimal The binary equivalent of the hexadecimal
number 5316 can be written as number 72A16 can be written as
Example 1.22
Example 1.23
a. Two’s Complement
- To represent a negative number as two’s complement you use the following steps:
Convert the number into binary
Invert every digit in the binary number i.e. a 1 becomes a 0 and a 0 becomes a 1
After inverting the digits add 1 to the result.
The two’s complement of the decimal The two’s complement of the decimal
number -53 can be written as: number -70.625 can be written as:
- The leftmost digit in a 2’s is the sign bit therefore a number in two’s complement starts
with a 1
11012 – 01112 can be solved as: 10100.012 – 11011.102 can be solved as:
DISCLAIMER NOTICE:
This study guide may contain inaccuracies or errors. I provide no guarantee
regarding the accuracy, timeliness or completeness of information contained
herein. This guide is also not intended to replace learning material recommended
by Zimsec but instead it is there to complement the leaner’s study experience.
If you discover any errors do not hesitate to get in touch with me.