Grade 7 Conversion
Grade 7 Conversion
1 Number systems
This chapter considers the three key number systems used in computer
science, namely binary, denary and hexadecimal. It also discusses
how these number systems are used to measure the size of computer
memories and storage devices, together with how sound and images can
be represented digitally.
This chapter considers the three key number systems used in computer
science, namely binary, denary and hexadecimal. It also discusses
how these number systems are used to measure the size of computer
memories and storage devices, together with how sound and images can
be represented digitally.
Switches used in a computer make use of logic gates (see Chapter 10) and are
used to store and process data.
2 5 1 7 7
Denary uses ten separate digits, 0-9, to represent all values. Denary is known as
a base 10 number system.
The binary number system is a base 2 number system. It is based on the number 2.
Thus, only the two ‘values’ 0 and 1 can be used in this system to represent all
values. Using the same method as denary, this gives the headings 20, 21, 22, 23,
and so on. The typical headings for a binary number with eight digits would be:
1.1 Number systems
(2 )
7
(2 )
6
(2 )5
(2 )4
(2 )3
(2 )2
(21) (20)
128 64 32 16 8 4 2 1
1 1 1 0 1 1 1 0
As with the two examples above, to convert this number to denary, each time a 1
appears in a column the column value is added to the total:
Convert
the
followin
g binary
number
s into
denary:
a00110011k000111100111 b01111111l0101010101
00c10011001m111100001111d01110100n0111110
01000e11111111o011111111111 f00001111p01111
10011110000
g10001111q0011111100001101 h10110011r11000
01100111111i01110000s1000100010001000 j1110
1110t0111111111111111
Method 1
The denary number 142 is made up of 128 + 8 + 4 + 2 (that is, 142 – 128 = 14; 14 – 8 = 6;
6 – 4 = 2; 2 – 2 = 0; in each stage, subtract the largest possible power of 2 and keep
doing this until the value 0 is reached. This will give us the following 8-bit binary
number:
128 64 32 16 8 4 2 1 1 0 0 0 1 1 1 0
4
1.1 Number systems
Method 2
This method involves successive division by 2. Start with the denary number, 142, and
divide it by 2. Write the result of the division including the remainder (even if it is 0)
under the 142 (that is, 142 ÷ 2 = 71 remainder 0); then divide again by 2 (that is,
71 ÷ 2 = 35 remainder 1) and keep dividing until the result is zero. Finally write down
all the remainders in reverse order:
2 142 read the remainders from bottom to
top to get the binary number:
2 71 remainder: 0 1 0 0 0 1 1 1 0
2 35 remainder: 1
2 17 remainder: 1
2 8 remainder: 1
2 4 remainder: 0
2 2 remainder: 0
2 1 remainder: 0
0 remainder: 1
▲ Figure 1.1
We end up with an 8-bit binary number which is the same as that found by Method 1.
Method 1
Method 2
This method involves successive division by 2. Start with the denary number, 59, and
divide it by 2. Write the result of the division including the remainder (even if it is 0)
under the 59 (that is, 59 ÷ 2 = 29 remainder 1); then divide again by 2 (that is,29 ÷ 2
=
14 remainder 1) and keep dividing until the result is zero. Finally write downall the
remainders in reverse order:
5
1.1 Number systems
2 59 write the remainders from bottom to
top to get the binary number:
2 29 remainder: 1 1 1 1 0 1 1
2 14 remainder: 1
2 7 remainder: 0
2 3 remainder: 1
2 1 remainder: 1
0 remainder: 1
▲ Figure 1.1b
If we want to show this as an 8-bit binary number (as shown in Method 1), we now
simply add two 0’s from the left-hand side to give the result: 0 0 1 1 1 0 1 1. The two
results from both methods clearly agree.
Both the above examples use 8-bit binary numbers. This third example shows how the
method can still be used for any size of binary number; in this case a 16-bit binary
number.
Consider the conversion of the denary number, 35 000, into a 16-bit binary number:
Method 1
is, 35 000 – 32 768 = 2232; 2232 – 2048 = 184; 184 – 128 = 56; 56 – 32 = 24; 24 – 16
= 8;
8 – 8 = 0; in each stage, subtract the largest possible power of 2 and keep doing this
until the value 0 is reached. This will give us the following 16-bit binary number:
Method 2
This method involves successive division by 2. Start with the denary number, 35000, and
divide it by 2. Write the result of the division including the remainder (even if it is 0)
under the 35000 (that is, 35000 ÷ 2 = 17 500 remainder 0); then divide again by 2 (that
is, 17500 ÷ 2 = 8750 remainder 0) and keep dividing until the result is zero. Finally write
down all the remainders in reverse order:
6
1.1 Number systems
2 35 read the remainder from bottom to
000 top to get the binary number:
1 0 0 0 1 0 0 0 1 0 1 1 1
2 17500 remainder: 0
0 0 0
2 8750 remainder: 0
2 4375 remainder: 0
2 2187 remainder: 1
2 1093 remainder: 1
2 546 remainder: 1
2 273 remainder: 0
2 136 remainder: 1
2 68 remainder 0
2 34 remainder 0
2 17 remainder 0
2 8 remainder 1
2 4 remainder 0
2 2 remainder 0
2 1 remainder 0
0 remainder 1
▲ Figure 1.1c
Activity 1.2
Convert the following denary numbers into binary (using both methods): a 4 1 d 1
00g144j255m4095b67e111h189k33000n16400c86f1
27i200l888o62307
7
1.1 Number systems 8