Computer Science 9608 (Notes)
Chapter: 1.1 Information representation
Topic: 1.1.1 Number representation
Fundamentals of Data Representation:
Before we jump into the world of number systems, we'll need a point of reference; I recommend that you
copy the following table that you can refer to throughout this chapter to check your answers.
Hexadecimal Binary Denary
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15
Page 1 of 17
,Computer Science 9608 (Notes)
Chapter: 1.1 Information representation
Topic: 1.1.1 Number representation
Denary/Decimal
Denary is the number system that you have most probably grown up with. It is also another way of saying
base 10. This means that there are 10 different numbers that you can use for each digit, namely:
0,1,2,3,4,5,6,7,8,9
Notice that if we wish to say 'ten', we use two of the numbers from the above digits, 1 and 0.
Thousands Hundreds Tens Units
10^3 10^2 10^1 10^0
1000 100 10 1
5 9 7 3
Using the above table we can see that each column has a different value assigned to it. And if we know
the column values we can know the number, this will be very useful when we start looking at other base
systems. Obviously, the number above is: five-thousands, nine-hundreds, seven-tens and three-units.
5*1000 + 9*100 + 7*10 + 3*1 = (5973) 10 R
Binary Number System:
Binary is a base-2 number system, this means that there are two numbers that you can write for each digit
0, 1.
With these two numbers we should be able to write (or make an approximation) of all the numbers that we
could write in denary. Because of their digital nature, a computer's electronics can easily manipulate
numbers stored in binary by treating 1 as "on" and 0 as "off."
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
128 64 32 16 8 4 2 1
0 1 1 0 1 0 1 0
Using the above table we can see that each column has a value assigned to it that is the power of two (the
base number!), and if we take those values and the corresponding digits we can work out the value of the
number: 1*64 + 1*32 + 1*8 + 1*2 = 106.
If you are asked to work out the value of a binary number, the best place to start is by labeling each
column with its corresponding value and adding together all the columns that hold a 1. Let's take a look at
another example:
(00011111) 2
R
128 64 32 16 8 4 2 1
0 0 0 1 1 1 1 1
Page 2 of 17
, Computer Science 9608 (Notes)
Chapter: 1.1 Information representation
Topic: 1.1.1 Number representation
So now all we need to do is to add the columns containing 1s together:
1*16 + 1*8 + 1*4 + 1*2 + 1*1 = 31
Exercise: Binary
U
Convert the following binary numbers into denary
>>(00001100) 2 R
Answer :
128 64 32 16 8 4 2 1
0 0 0 0 1 1 0 0
8+4 = (12) 10
R
Convert the following binary numbers into denary
(01011001) 2 R
Answer :
128 64 32 16 8 4 2 1
0 1 0 1 1 0 0 1
64 + 16 + 8 + 1 = (89) 10 R
Convert the following binary numbers into denary
>>(00000111) 2 R
Answer :
128 64 32 16 8 4 2 1
0 0 0 0 0 1 1 1
4 + 2 + 1 = (7) 10
R
Convert the following binary numbers into denary
>>(01010101) 2 R
Answer :
128 64 32 16 8 4 2 1
0 1 0 1 0 1 0 1
64 + 16 + 4 + 1 = (85) 10 R
How do we tell if a binary number is odd?
Answer :
It's right most digit is a one
Page 3 of 17
Chapter: 1.1 Information representation
Topic: 1.1.1 Number representation
Fundamentals of Data Representation:
Before we jump into the world of number systems, we'll need a point of reference; I recommend that you
copy the following table that you can refer to throughout this chapter to check your answers.
Hexadecimal Binary Denary
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
A 1010 10
B 1011 11
C 1100 12
D 1101 13
E 1110 14
F 1111 15
Page 1 of 17
,Computer Science 9608 (Notes)
Chapter: 1.1 Information representation
Topic: 1.1.1 Number representation
Denary/Decimal
Denary is the number system that you have most probably grown up with. It is also another way of saying
base 10. This means that there are 10 different numbers that you can use for each digit, namely:
0,1,2,3,4,5,6,7,8,9
Notice that if we wish to say 'ten', we use two of the numbers from the above digits, 1 and 0.
Thousands Hundreds Tens Units
10^3 10^2 10^1 10^0
1000 100 10 1
5 9 7 3
Using the above table we can see that each column has a different value assigned to it. And if we know
the column values we can know the number, this will be very useful when we start looking at other base
systems. Obviously, the number above is: five-thousands, nine-hundreds, seven-tens and three-units.
5*1000 + 9*100 + 7*10 + 3*1 = (5973) 10 R
Binary Number System:
Binary is a base-2 number system, this means that there are two numbers that you can write for each digit
0, 1.
With these two numbers we should be able to write (or make an approximation) of all the numbers that we
could write in denary. Because of their digital nature, a computer's electronics can easily manipulate
numbers stored in binary by treating 1 as "on" and 0 as "off."
2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
128 64 32 16 8 4 2 1
0 1 1 0 1 0 1 0
Using the above table we can see that each column has a value assigned to it that is the power of two (the
base number!), and if we take those values and the corresponding digits we can work out the value of the
number: 1*64 + 1*32 + 1*8 + 1*2 = 106.
If you are asked to work out the value of a binary number, the best place to start is by labeling each
column with its corresponding value and adding together all the columns that hold a 1. Let's take a look at
another example:
(00011111) 2
R
128 64 32 16 8 4 2 1
0 0 0 1 1 1 1 1
Page 2 of 17
, Computer Science 9608 (Notes)
Chapter: 1.1 Information representation
Topic: 1.1.1 Number representation
So now all we need to do is to add the columns containing 1s together:
1*16 + 1*8 + 1*4 + 1*2 + 1*1 = 31
Exercise: Binary
U
Convert the following binary numbers into denary
>>(00001100) 2 R
Answer :
128 64 32 16 8 4 2 1
0 0 0 0 1 1 0 0
8+4 = (12) 10
R
Convert the following binary numbers into denary
(01011001) 2 R
Answer :
128 64 32 16 8 4 2 1
0 1 0 1 1 0 0 1
64 + 16 + 8 + 1 = (89) 10 R
Convert the following binary numbers into denary
>>(00000111) 2 R
Answer :
128 64 32 16 8 4 2 1
0 0 0 0 0 1 1 1
4 + 2 + 1 = (7) 10
R
Convert the following binary numbers into denary
>>(01010101) 2 R
Answer :
128 64 32 16 8 4 2 1
0 1 0 1 0 1 0 1
64 + 16 + 4 + 1 = (85) 10 R
How do we tell if a binary number is odd?
Answer :
It's right most digit is a one
Page 3 of 17