Professional Documents
Culture Documents
Introduction
Since the early days of human civilization, people have been using their fingers, sticks and other things for counting.
As daily activities became more complex, the numbers became more important in trade, time, distance, and in all other
spheres of human life. It became apparent that we needed more than our fingers and toes to keep track of the number in
our daily routine. In 3400 BC, the ancient Egyptians started using special symbols for writing the numbers. This was a
major advancement, because it reduced the number of symbols required. However, it was difficult to represent large or
small numbers by using such a graphical approach. Today there are many number systems like decimal, hexadecimal
and binary that helps us to come over those limitations.
I. Definitions
A number system of base (also called radix) r is a system, which has r distinct symbols for r digits. A string of these
symbolic digits represents a number.The base or radix of the decimal system is 10. This implies that there are 10
symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.
Examples:
✓ (7592)10 is of base 10 number system.
✓ (214)8 is of base 8 number system.
✓ (123)16 is of base 16 number system
Coding is the conversion from decimal base (base 10) to any non-decimal base b ( 𝑏 ≠ 10).
To decode is to convert from a non-decimal base b (𝑏 ≠ 10) to the decimal base (base 10).
Encoding is the conversion from a non-decimal base to a non-decimal base. Some special cases would be
distinguished.
Page 1
By DEMANOU YMELE ROMEO
Number System
Digit 2 9 8
Positional value 102 101 100
Representing 2×100 9×10 8×1
value
Therefore, 2×100 + 9×10 +8×1 = 29810
3. Binary numbers
The basis of all digital data is binary representation. Binary - means ‘two’. A digit in base 2 ranges from 0 to 1. A digit
in base 2 is also called a ‘bit’. A binary number is represented as a string of bits. The base of binary number system is
2.
e.g.: (11001101)2 is a binary number.
4. Hexadecimal numbers
The hexadecimal system has 16 digits, which are represented as 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E and F. The hexadecimal
(base 16) number system is used by the computer to communicate with programmers. Example: (2A)16, DFA1 represent
hexadecimal numbers.
5. Octal numbers
An octal system has eight digit represented as 0, 1, 2, 3, 4, 5, 6, 7. Any Octal number can be represented as a string of
these digits. The base of this system is 8.
Example: (177)8 is an octal number but (199)8 is not because the digit 9 does not exist in the octal number system.
Decimal Binary Octal Hexadecimal
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Page 2
By DEMANOU YMELE ROMEO
Number System
III. Operations on binary numbers
3.1. Binary addition
The rules for binary addition are:
0 + 0 = 0, carry = 0
1 + 0 = 1, carry = 0
0 + 1 = 1, carry = 0
1 + 1 = 0, carry = 1
Decimal Binary
34 101011
+ 17 +000001
…….. ………….
15 101100
7 + 4 = 1, with carry 1 + 1 = 0, carry of 1
out of 1 to next column 1 (carry) + 1 + 0 = 0, carry of 1
1 (carry) + 3 + 1 = 5 1 (carry) + 0 + 0 = 1, no carry
answer = 51 1+0=1
0+0=0
1+0=1
answer = 1 0 1 1 0 02
V
3.3. Binary multiplication
The multiplication process for binary numbers is similar to that for decimal numbers. Partial products are formed,
with each product shifted one place to the left. This is illustrated below.
Page 3
By DEMANOU YMELE ROMEO
Number System
Page 4
By DEMANOU YMELE ROMEO
Number System
Hex to Decimal
A2Fh = 10 ×162 + 2 ×161 + 15 ×160
= 10 × 256 + 2 × 16 + 15 × 1
= 2560 + 32 + 15 = 2607
Exercise 1:
Convert the numbers 10010112, 2300158, 11101.0112 D25F3A16, F216 and 23.48 into denary numbers.
Examples:
a) Determine the decimal equivalent of (0.01101)2.
Sum of weight of all bits = 1024 + 80 + 12 +0.5 + .0429687 + .0034179 + .0000457= 1116.5464323
Page 5
By DEMANOU YMELE ROMEO
Number System
Thus, the decimal equivalent of (45C.8BE3)16 is (1116.5464323)10.
Page 6
By DEMANOU YMELE ROMEO
Number System
Exercise
convert 56210, 4310 to binary
Examples:
- Determine the binary equivalent of (0.375)10.
0.375 x 2 = 0.75 0
0.75 x 2 = 1.5 1
0.5 x 2 = 1.0 1
Finally, (0.375)10 = (0.011)2
Page 7
By DEMANOU YMELE ROMEO
Number System
- Determine the binary equivalent of (5AF)16.
(5AF)16 = (010110101111)2
(2B.6C)16 = (00101011.01101100)2.
d. Binary to Hex
Binary to Hex is just the opposite; create groups of 4 bits starting with least significant bits. If last group does not have
4 bits, then pad with zeros.
0100012 = 0101 00012 = 5116
- Determine the hexadecimal equivalent of (101011110011011001)2
(101011110011011001)2 = (2BCD9)16.
- Determine the hexadecimal equivalent of (1100001.101011110011)2.
(1100001.101011110011)2 = (61.AF3)16.
Page 8
By DEMANOU YMELE ROMEO
Number System
(2327)8 = (4D7)16.
Page 9
By DEMANOU YMELE ROMEO
Number System
This conversion follows the same steps of octal to hexadecimal conversion except that each hexadecimal digit is
converted into a four-bit binary form and then after grouping of all the four bit binary blocks, it is converted into the
three-bit binary form. Finally, these three-bit binary forms are converted into octal symbols.
Examples:
a) Determine the octal equivalent of (5DE247)16.
Dividing the group of binary numbers into the three-bit binary blocks and by converting these blocks into their respective
octal symbols, we have:
Exercise 3:
1. Consider the following numbers:
123 954 A01 001 1111 0002 0011 547 25455 25A DFA1 258
1.a. Which numbers are binary?
1.b. Identify those which are decimal but not octal
1.c. Convert numbers found in (1.b) into binary.
2. Compute:
a) 100012 + 11 b) 11101102 + 1112
c) 111002 - 100012 d) 110111002 - 11112
3. Convert 10000111010012 to the following bases: 10, 8 and 16
Page 10
By DEMANOU YMELE ROMEO