Introduction
A digital system is a combination of devices {mechanical, electrical, photo
electronic, etc.} arranged to perform certain functions in which quantities are
represented digitally.
Digital systems are used in communication, business transactions, traffic control,
spacecraft guidance, medical treatment, weather monitoring, the Internet, and
many other commercial, industrial, and scientific enterprises.
Number Systems and Number‐Base Conversions:
Number System represents value of number with respect to its given base. Based on
its Base value, a number has unique representation and different number systems
have different representation of the same number.
1. Decimal number: The number system we use every day, based on 10 digits
(0,1,2,3,4,5,6,7,8,9).
Example 1: The number 2025 is interpreted as:
2025 = 2x103+0x102+2x101+5x100 = 2000+0+20+5 = 2025
Example 2: The number 250.36 is interpreted as:
250.36 = 2x102+5x101+0x100 +3x10-1+6x10-2 = 200+50+0 + 0.3+0.06 = 250.36
1
Generally:
anan-1……a1a0 .a-1a-2….am=a0×N0+a1×N1+…. +an×Nn+an-1×Nn-1+ am×Nm
Where N is the base of the system.
2. Binary System: In this System, there are only two symbols or possible digit
values, i.e., 0 and 1.
Binary [ ]2 to decimal [ ]10 conversion
Decimal [ ]10= d0×20 + d1×21 + d2×22 + ...
The decimal number is equal to the sum of binary digits (dn) times their power of 2
(2n):
Example: Find the decimal value of 1110012:
binary number: 1 1 1 0 0 1
power of 2: 25 24 23 22 21 20
1110012 = 1×25+1×24+1×23+0×22+0×21+1×20 = 5710
Decimal [ ]10 to binary [ ]2 conversion
1. Divide the number by 2.
2. Get the integer quotient for the next iteration.
3. Get the remainder for the binary digit.
4. Repeat the steps until the quotient is equal to 0.
2
Example 1: Convert 1310 to binary:
Division by 2 Quotient Remainder Bit #
13/2 6 1 0
6/2 3 0 1
3/2 1 1 2
1/2 0 1 3
So [13]10 = [1101]2
Example 2: Convert 17410 to binary:
Division by 2 Quotient Remainder Bit #
174/2 87 0 0
87/2 43 1 1
43/2 21 1 2
21/2 10 1 3
10/2 5 0 4
5/2 2 1 5
2/2 1 0 6
1/2 0 1 7
So [174]10 = [10101110]2
Generally: To convert from any base to decimal:
a2a1a0 . a-1a-2a-3= a0 × r0 + a1 × r1 + a2 × r2+ a-1 × r-1 + a-2 × r-2 + a-3 × r-3
3
Example 3: Convert the decimal number [27.15] to binary number
1.Take the integer part:
Division by 2 Quotient Remainder Bit #
27/2 13 1 0
13/2 6 1 1
6/2 3 0 2
3/2 1 1 3
1/2 0 1 4
Then [27] 10= [11011]2
2.Take the fractional part:
Multiply by 2 Integer fraction Bit #
0.15 × 2=0.3 0 0.3 0
0.3 × 2=0.6 0 0.6 1
0.6 × 2=1.2 1 0.2 2
0.2 × 2=0.4 0 0.4 3
0.4 × 2=0.8 0 0.8 4
0.8 × 2=1.6 1 0.6 5
0.6 × 2=1.2 1 0.2 6
Then [0.15]10= [0.0010011….]2
So [27.15] 10= [11011.0010011…]2
Note:
Conversion from decimal integers to any base‐r system is similar to this
example, except that division is done by r instead of 2.
4
Example: Convert the decimal number [22.5] to 4 base number system.
1.Take the integer part
Division by 2 Quotient Remainder Bit #
22/4 5 2 0
5/4 1 1 1
1/4 0 1 2 Then [22]10 = [112]4
2.Take the fractional part
Multiply by 4 Integer Fraction Bit #
0.5 × 4=2.0 2 0 0 Then [0.5] 10 = [0.2]4
So [22.5]10= [112.2] 4
3. Octal number system: It is said to be of base (8) since it uses 8 digits {0,
1, 2, ….,7}.
Example 1: Convert [560]10 to [ ]8.
Division by 8 Quotient Remainder Bit #
560/8 70 0 0
70/8 8 6 1
8/8 1 0 2
1/8 0 1 3
Then [560] 10= [1060]8
5
Example 2: Convert (0.52)10 into an octal number.
Multiply by 8 Integer Fraction Bit #
0.52×8 = 4.16 4 0.16 0
0.16 ×8=1.28 1 0.28 1
0.28×8=2.24 2 0.24 2
0.24×8=1.92 1 0.92 3
0.92×8=7.36 7 0.36 4
Then [0.52]10= [0.41217….]8
Octal to Decimal Number Conversion
Example: Suppose 2158 is an octal number, then it’s decimal form will be,
2158 = 2 × 82 + 1 × 81 + 5 × 80 = 2 × 64+ 1 × 8 + 5 × 1 = 128 + 8 + 5 = 14110
Binary to Octal Number Conversion
Octal Number Equivalent Binary Number
0 0
1 1
2 10
3 11
4 100
5 101
6 110
7 111
6
Take binary number
Divide the binary digits into groups of three (starting from
right) for integer part and start from left for fraction part.
Convert each group of three binary digits to one octal digit.
Example 1: Convert (100010)2 to octal number.
With the help of the table we can write,
100→4
and 010→2
Therefore, (100010)2 = (42)8
Similarly, we can convert an octal number to binary number with the help of the
table.
Example 2: Convert the binary number (1011011.11011) to octal system
(001011011.110110)2 = (133.66)8
Octal to Binary Number Conversion
Example: Convert the octal number [63.4] to binary number system
(63.4)8= (110011.100)2
4. Hexadecimal number system
It is said to be of base (16) since it uses 16 digits {0, 1, 2, …..,9, A, B, C, D, E, F}.
Example 1: [2C.4A]16 = 12×160 +2×161 +4×16−1 +10×16−2 = (44.2)10.
Example 2: Convert the decimal number [165.25] to hexadecimal number
system.
7
1. Take the integer part
Division by 16 Quotient Remainder Bit #
165/16 A 5 0
A/16 0 A 1
Then [165] 10=[A5]16
2. Take the fractional part
Multiply by 16 Integer Fraction Bit #
0.25 × 16=4.0 4 0 0 Then [0.25]10= [0.4]16
3. So [165.25]10=[A5.4]16
Conversion between Binary & Hexadecimal systems
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
8
Take binary number
Divide the binary digits into groups of four (starting from right) for
integer part and start from left for fraction part.
Convert each group of four binary digits to one hexadecimal digit.
Example 1: Convert the hexadecimal number [F67.19] to binary number system
(F67.19)16 = (111101100111.00011001)2
Example 2: Convert the binary number (10100111011.0110101) to hexadecimal
system
(010100111011.01101010)2 = (53B.6A)16
Example 3: Convert binary number 1010101101001 into hexadecimal number. Since
there is no binary point here and no fractional part. So,
Therefore, Binary to hexadecimal is,
= (1010101101001)2
= (1 0101 0110 1001)2
= (0001 0101 0110 1001)2
= (1 5 6 9)16
= (1569)16
9
Example 4: Convert binary number 001100101.110111 into hexadecimal number. Since
there is binary point here and fractional part. So,
Therefore, Binary to hexadecimal is,
= (001100101.110111)2
= (0 0110 0101 . 1101 1100)2
= (0110 0101 . 1101 1100)2
= (6 5 . D C)16
= (65.DC)16
10
Let’s count from zero to twenty using decimal, binary, octal, and hexadecimal to
contrast these systems of numeration:
Number Decimal Binary Octal Hexadecimal
Zero 0 0 0 0
One 1 1 1 1
Two 2 10 2 2
Three 3 11 3 3
Four 4 100 4 4
Five 5 101 5 5
Six 6 110 6 6
Seven 7 111 7 7
Eight 8 1000 10 8
Nine 9 1001 11 9
Ten 10 1010 12 A
Eleven 11 1011 13 B
Twelve 12 1100 14 C
Thirteen 13 1101 15 D
Fourteen 14 1110 16 E
Fifteen 15 1111 17 F
Sixteen 16 10000 20 10
Seventeen 17 10001 21 11
Eighteen 18 10010 22 12
Nineteen 19 10011 23 13
Twenty 20 10100 24 14
11
Homework
1. Convert the binary number 1011.1110 to decimal.
2. What is the decimal value of 2-2?
3. Convert the decimal number 12.125 to binary.
4. Convert the decimal number 6.75 to binary.
5. The binary equivalent of hexadecimal 2E is ________.
6. Convert binary 11100111 to octal.
7. (15)5=( )10
8. (88)9=( )10
9. Convert decimal fractional number 0.06640625 into hexadecimal number.
10. Convert the decimal number 101.1010 number to its equivalent in ()16 .
11.(33.22)4 = ( )8
12.(BA.C)16 =( )7
13. In base [13], list the numbers between (4 and 40).
12