lesson1
lesson1
identify base/radix, positional notation, most and least significant digits as they relate to
decimal, binary, octal and hexadecimal number systems.
convert values from decimal, binary, octal and hexadecimal numbers systems to each
other and back to the other systems.
1.1 Introduction
Number systems are simply ways to count things. The two number systems that we generally
come across are decimal system and Roman system. But there are several other number systems
such as binary, octal, hexadecimal etc. The binary number system, which contain only two digits
0 and 1, is widely used in electronic devices. The two states of an electronic device ‘ON’ or
‘OFF’ are denoted by 1 and 0 respectively. John Von Neumann suggested in 1946 that a
computer should also use this kind of two way binary system. Such a system is known as John
Von Neumann architecture and most of the computers use this architecture. Similar to the
case of an electronic device when the switch is said to be ‘ON’ or ‘OFF’, a computer uses two
signals; pulse and no pulse. Pulse is denoted by the digit ‘1’ and no pulse is denoted by the
digit ‘0’.
These systems are classified according to the values of the base of the number system. The
number system having the value of the base as 10 is called a decimal number system, whereas
that with a base of 2 is called a binary number system. Likewise, the number systems having
base 8 and 16 are called octal and hexadecimal number systems respectively. The decimal
system is the most commonly used number system.
5 lots of 1 (units) = 5
7 lots of 10 (tens) = 70
8 lots of 100 (hundreds) = 800
9 lots of 1000 (thousands) = 9000
Total = 9875
Each symbol in decimal system has its own absolute value and place value. In the above
example, 9 have got two values. That is one its absolute value which is 9 and its place value
1
2 ITE 1812 - Mathematic for IT
which is 9000. As the decimal system has number 10 as its base or radix, the position of the
digit in this system determines the magnitude of the numbers. For example the numbers 86
and 864 can be expressed in the base to system as
The base of number can be defined as the number which when raised to zero power assigns
the lowest position value, raised to the power one assigns the second position value, raised to
the power of two assigns third position value and so on.
A number in any number system can be expressed in general term as
N = dn+1 × rn + . . . · · · + d3 × r2 + d2 × r1 + d1 × r0 ,
where N is the any number of any base system, dn is a digit in the nth position and r is the
base of the number system. Here d is an integer in the range 0 ≤ d < r.
10012 = 1 × 23 + 0 × 22 + 0 × 21 + 1 × 20 = 8 + 0 + 0 + 1 = 910 .
The disadvantage of the binary number system against the decimal system is the increased
number of digits required in the binary system to represent a number.
2
Degree of Bachelor of Information Technology 3
Example 1.1
Convert 5310 in to binary.
Solution.
Division Quotient Remainder
53ö2 26 1
26ö2 13 0
13ö2 6 1
6ö2 3 0
3ö2 1 1
1ö2 0 1
Hence the converted binary number is 1101012 .
3
4 ITE 1812 - Mathematic for IT
have sufficient accuracy. The digits of the binary number are obtained by reading the integer
numbers from top to bottom order.
Example 1.2
Convert 0.687510 in to binary.
Solution.
Multiplication Integer Fraction
0.6875 × 2 = 1.3750 1 0.3750
0.3750 × 2 = 0.7500 0 0.7500
0.7500 × 2 = 1.5000 1 0.5000
0.5000 × 2 = 1.0000 1 0.0000
Hence the converted binary number is 0.10112 .
Remark 1.1. The conversion of decimal numbers with both integer and fraction parts is done
by converting the integer and the fraction separately and then combining the two answers. Using
the results of Examples 1.1 and 1.2, we obtain
53.687510 = 110101.10112 .
Remark 1.2. The conversion of decimal integer to any base R system is similar to the procedure
explained in section 1.7.1 except the division is done by R instead of 2.
Remark 1.3. The conversion of decimal fraction to a number expressed in base R, a similar
procedure which is explained in section 1.7.1 can be used. Multiplication is done by R instead
of 2. Therefore, integers part may range in value from 0 to R − 1, instead of 0 and 1.
Example 1.3
Convert 42610 in to an octal number.
Solution.
Division Quotient Remainder
426ö8 53 2
53ö8 6 5
6ö8 0 6
Hence the converted octal number is 6528 .
4
Degree of Bachelor of Information Technology 5
Solution.
Multiplication Integer Fraction
0.513 × 8 = 4.104 4 0.104
0.104 × 8 = 0.832 0 0.832
0.832 × 8 = 6.656 6 0.656
0.656 × 8 = 5.248 5 0.248
0.248 × 8 = 1.984 1 0.984
.. .. ..
. . .
The answer to five significant digits is 0.406518 .
Solution.
Division Quotient Remainder
348ö16 21 12
21ö16 1 5
1ö16 0 1
Hence the converted hexadecimal number is 15C16 .
Solution.
Multiplication Integer Fraction
0.85 × 16 = 13.6 13 0.6
0.6 × 16 = 9.6 9 0.6
0.6 × 16 = 9.6 9 0.6
.. .. ..
. . .
The answer to three significant digits is 0.D9916 .
5
6 ITE 1812 - Mathematic for IT
Solution.
The given binary number is 1 1 0 0 1 1
Positional weights 5 4 3 2 1 0
The positional weights for each of the digits are written below each digit. Hence
1100112 = 1 × 25 + 1 × 24 + 0 × 23 + 0 × 22 + 1 × 21 + 1 × 20
= 32 + 16 + 0 + 0 + 2 + 1
= 5110
Solution.
The given binary number is .1 1 0 1 0 1
Positional weights -1 -2 -3 -4 -5 -6
The positional weights for each of the digits are written below each digit. Hence
Solution.
The given octal number is 3 4 6 2
Positional weights 3 2 1 0
6
Degree of Bachelor of Information Technology 7
The positional weights for each of the digits are written below each digit. Hence
34628 = 3 × 83 + 4 × 82 + 6 × 81 + 2 × 80
= 1536 + 256 + 48 + 2
= 184210
Example 1.10
Convert 0.7528 in to a decimal number.
Solution.
The given octal number is .7 5 2
Positional weights -1 -2 -3
The positional weights for each of the digits are written below each digit. Hence
Example 1.11
Convert 42AD16 in to a decimal number.
Solution.
The given hexadecimal number is 4 2 A D
Positional weights 3 2 1 0
The positional weights for each of the digits are written below each digit. Hence
7
8 ITE 1812 - Mathematic for IT
Solution.
The given hexadecimal number is .1 2
Positional weights -1 -2
The positional weights for each of the digits are written below each digit. Hence
Solution.
The given octal number is 3 7 6
3-bit binary equivalent 011 111 110
Hence the converted binary number is 111111102
Example 1.14
Convert 43.02768 in to binary.
Solution.
The given octal number is 4 3 . 0 2 7 6
3-bit binary equivalent 100 011 . 000 010 111 110
Hence the converted binary number is 100011.0000101111102
8
Degree of Bachelor of Information Technology 9
Solution.
The given binary number is 1 0 1 1 1 1 0
Starting with LSB and grouping 3 bits 0 0 1 | 0 1 1 | 1 1 0
Octal equivalent 1 3 6
Hence the octal equivalent number is 1368
If the number has a fractional part then there will be two different classes of groups; one for
the integer part starting from the left of the decimal point and proceeding toward the left and
the second one starting from the right of the decimal point and proceeding toward the right.
If, for the second class, any 1 is left out, we complete the group by adding two 0s on the right
side. This is called right padding.
Example 1.16
Convert 1101.01112 into an equivalent octal number.
Solution.
The given binary number is 1 1 0 1 . 0 1 1 1
Grouping 3 bits 0 0 1 | 1 0 1 . 0 1 1 | 1 0 0
Octal equivalent 1 5 . 3 4
Hence the octal number is 15.348 .
Solution.
The given octal number is 2 9 C
4-bit binary equivalent 0010 1001 1100
Hence the equivalent binary number is 0010100111002
9
10 ITE 1812 - Mathematic for IT
Solution.
The given octal number is A 4 . E
4-bit binary equivalent 1010 0100 . 1110
Hence the equivalent binary number is 10100100.11102
Solution.
The given binary number is 1 1 0 0 1 1 1 1 0
Grouping 4 bits 0 0 0 1 | 1 0 0 1 | 1 1 1 0
Hexadecimal equivalent 1 9 E
Hence the hexadecimal number is 19E16 .
If the number has a fractional part, as in the case of octal numbers, then there will be two
different classes of groups; one for the integer part starting from the left of the decimal point
and proceeding toward the left and the second one starting from the right of the decimal point
and proceeding toward the right. If, for the second class, any uncompleted group is left out,
we complete the group by adding 0s on the right side.
Example 1.20
Convert 111011.0112 into an equivalent hexadecimal number.
Solution.
The given binary number is 1 1 1 0 1 1 . 0 1 1
Grouping 4 bits 0 0 1 1 | 1 0 1 1 . 0 1 1 0
Hexadecimal equivalent 3 B . 6
Hence the hexadecimal equivalent number is 3B.616 .
10
Degree of Bachelor of Information Technology 11
Example 1.21
Convert 328 into an equivalent hexadecimal number.
Solution.
The given octal number is 3 2
Binary equivalent is 011 010
Forming groups of 4 bits from the LSB 0 0 0 1 | 1 0 1 0
Hexadecimal equivalent 1 A
Hence the hexadecimal equivalent of 328 is 1A16 .
Example 1.22
Solution.
The given hexadecimal number is 4 7
Binary equivalent is 0100 0111
Forming groups of 3 bits from the LSB 0 0 1 | 0 0 0 | 1 1 1
Hexadecimal equivalent 1 0 7
11
12 ITE 1812 - Mathematic for IT
Self-Assessment Exercises
1. Convert the decimal number 635 to octal number.
Suggested Reading
Chapter 19: William Stallings, (2010) Computer Organization and Architecture: Designing for
Performance, 9th Edition, Prentice Hall.
12