Module 5
Digital Circuits
Binary arithmetic; Number base conversion; Boolean algebra:
simplification of Boolean functions using K-maps; Logic gates;
Design of basic combinational circuits: adders, multiplexers,
de-multiplexers.
4
1.3 Number system
Why Number System?
✔ Purpose of number system is to count various items
✔ Computers are working with only two digits
Binary number system or Machine level language - “0” or “1”
✔ Equivalent binary number for (25)10 – (11001)2
✔ Not possible to write for large numbers and also difficult to
remember.
2
1.3 Number system
Types of Number System
• Base : 2
Binary • Digits : 0 & 1
• Base : 8
Octal • Digits : 0,1,2,3,4,5,6,7
• Base : 10
Decimal • Digits : 0,1,2,3,4,5,6,7,8,9
• Base : 16
Hexa-decimal • Digits : 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
3
1.3 Number system
• Binary to Octal
Binary • Binary to Decimal
• Binary to Hexadecimal
• Octal to Binary
Octal • Octal to Decimal
• Octal to Hexadecimal
• Decimal to Binary
Decimal • Decimal to Octal
• Decimal to Hexadecimal
• Hexadecimal to Binary
Hexadecimal • Hexadecimal to Octal
• Hexadecimal to Decimal
4
1.3 Number system
Binary to Octal Conversion
(Group 3 bits from LSB)
0 1 2 3 4 5 6 7
000 001 010 011 100 101 110 111
✔ Combine three bits on both sides of the binary point.
✔ If one or two bits are left in a pair of three bits pair, add the required number of zeros on extreme
sides.
✔ Write the octal digits corresponding to each pair.
5
1.3 Number system
Binary to Octal Conversion
(Group 3 bits from LSB)
4 2 1 4 2 1 4 2 1
1 1 0 1 0 1 ∙ 1 0 1 B2 B1 B0
0 1 02
6 5 25
2 2= 2 1= 2 0=
1 1 0 1 0 1 ∙ 1 0 1 0 1 0 2= 4 2 1
6 5 . 5 28 × ×
×
0 1
=
1
4 + 0 + 1
6
1.3 Number system
Binary to Decimal Conversion
(Multiply by 2)
Step 1 : Determine the column (positional) value of each digit (this depends on the position of the digit and
the base of the number system [2]).
Step 2 : Multiply the obtained column values (in Step 1) by the digits in the corresponding columns.
Step 3 : Sum the products calculated in Step 2. The total is the equivalent value in decimal.
7
1.3 Number system
Binary to Decimal Conversion
(Multiply by 2)
1 0 1 0 1 02
0×2 =0× 1 = 0
0
=1× 2 = 2
1×21 =0× 4 = 0
0×2 =1× 8 = 8
2
3
= 0 × 16 = 0
1×2
4 = 1 × 32 = 32
0×2
1 × 12 50 1 0 1 =
02
4210 8
1.3 Number system
Binary to Decimal Conversion
(Multiply by 2)
1 0 1 ∙ 0 12
1 × 2 ‒2
= 1 × 0.25 = 0
. 25
0 × 2 ‒1
= 0 × 0.5= 0
1×2 =1×1 = 1
0
=0×2 = 0
0×2 =1×4 = 4
1
1 × 12 0 1 ∙ 0 1 5 ∙ 25
2
2
= 10 9
1.3 Number system
Binary to Hexadecimal Conversion
(Group 4 bits from LSB)
✔ Combine four bits on both sides of the binary point.
✔ If 1 - 3 bits are left in a pair of four bits pair, add the required number of zeros on extreme
sides.
✔ Write the Hexadecimal digits corresponding to each pair.
10
1.3 Number system
Binary to Hexadecimal Conversion
(Group 4 bits from LSB)
8 4 2 1 8 4 2 1 8 4 2 1
1 1 0 1 0 1 ∙ 1 0 1 0 B3 B2 B1 B0
0 0
13 0A2 08 0 5
3
2 =8 2
2 =4 2 1= 2 0=
1 1 0 1 0 1 ∙ 1 0 1 0 1 0 2= 3 × × 2 1
5 . A 816 × ×
0 1
0 1
=
0 + 4 + 0 + 1
11
1.3 Number system
Octal to Binary Conversion
✔ Convert each octal digit to its 3-digit binary representation. Each of the digits must be treated as a
decimal value.
✔ Combine these binary representations to form a single binary number.
3 6 7 ● 5 28
0 1 1 1 1 0 1 1 1 ●
1 0 1 0 1 0
— — — — —
4 4 4 4 4
— — — — —
2 2 2 2
3 6 7 ● 5 28 011 110 111 ● 101 2
— =—1 — 010 — —
1 1 2 1 1 12
1.3 Number system
Octal to Decimal Conversion
(Multiply by 8)
Step 1 : Determine the column (positional) value of each digit (this depends on the position of the digit and
the base of the number system [8]).
Step 2 : Multiply the obtained column values (in Step 1) by the digits in the corresponding columns.
Step 3 : Sum the products calculated in Step 2. The total is the equivalent value in decimal.
13
1.3 Number system
Octal to Decimal Conversion
(Multiply by 8)
4 0 5 7 ∙ 0 68
6 × 8 ‒2 0 .
= 6 × 0.015625
09375
=
0
0 × 8 ‒1
0
= 0 × 0.125 =
7×8 =7×1 = 7
5×81 =5×8 = 40
0 × 8 2 = 0 × 64 = 0
4×8 =4× =
3
512 2048
4057 ∙ 0 =
2095 ∙ 0937
Dr P Ponmurugan
68 14
10
1.3 Number system
Octal to Hexadecimal Conversion
Step 1 : Convert the Octal number to its equivalent Binary number.
Step 2 : Convert the Binary number to its equivalent Hexadecimal number.
756● 608
1 1 1 1 0 1 1 1 0 1 1 0● 0 0 0
0 0 01 1 1 1 0 1 1 1 0 ● 1 1 0 0 0 0
0 01 E ●
E C 0
7 5 6 ● 6 08 = 1 E E ● C 016
15
1.3 Number system
Decimal to other Number System
Step 1 : Divide the decimal number to be converted by the base of the new number system.
Step 2 : The remainder which is obtained from step 1 is the least significant bit of the new number system.
Step 3 : Divide the quotient which is obtained from the step 2 and the remainder obtained from this is the
second least significant bit of the new number system.
Step 4 : Repeat the process until the quotient remains zero.
Step 5 : The last remainder obtained from the division is the most significant bit of the new number
system. Hence arrange the number from most significant bit to the least significant bit (i.e., from bottom to
top).
16
1.3 Number system
Decimal to Binary Conversion
(Divide by 2)
35 10 = 1 0 0 0 1 1 83.24 =101001 ∙0 0 1
2 10 1 2
2 3 2 83 0 . 24 × =0.
2
5
2 17 - 1 2 41 - 48
2 8 -1 1
2 20 - 0 . 48 × =0.
2 4 -0 2
1
96
2 2 -0 2 10 -
1 -0 0
0 . 96 × = 1 . 92
2 5 -0 2
2 21 - -0
17
1
1.3 Number system
Decimal to Octal Conversion
(Divide by 8)
378 10 = 5 7 2 819.93 10
=1463 ∙73
8
8 37 48 8 81 0 . 93 × =7.
8
8 9
8 47 - 2 8 102 - 44
5 - 38 12 - 6
7 0 . 44 × =3.
1 -4 8
52
0 . 52 × =4.
8
16
18
1.3 Number system
Decimal to Hexadecimal Conversion
(Divide by 16)
378 10 = 1 7 A 819.93
10
= 3 3 3∙ E E 1
16 (E)
16 0 . 93 ×
1 37 1 81 = 14 .
6 8 6 9 88
16 23 - 10 (A) 16 51 - 3 16
1 - 3 -3 (E)
7 0 . 88 × = 14 .
08
16
0 . 08 × = 1.
28
16
19
1.3 Number system
Hexadecimal to Binary Conversion
✔ Convert each octal digit to its 3-digit binary representation. Each of the digits must be treated as a
decimal value.
✔ Combine these binary representations to form a single binary number.
4 B A C 16
4 B A C
(11) 1 0 1 (10)
0 (12)
0 1 0 0 10 1 1 1 1 0 0
—
— — — — — — — —
8 4 —8 —4 —2 1 8 8 4
— — 4 2 1 — —
2 1 4 B A C 16 =0100 1011 1010 2 1
1100 2 20
1.3 Number system
Hexadecimal to Octal Conversion
Step 1 : Convert the Hexadecimal number to its equivalent Binary number.
Step 2 : Convert the Binary number to its equivalent Octal number.
4 B A C 16
4 A (10) C (12)
B (11)
0 1 0 0 1 1 0 0
1 0 1 0
1 0 1 1
0 1 040 150 1 1 1 0 1 0 1 1
0 0 6 5 4
4 B A C16 =
456548 21
1.3 Number system
Hexadecimal to Decimal Conversion
(Multiply by 16)
Step 1 : Determine the column (positional) value of each digit (this depends on the position of the digit and
the base of the number system [16]).
Step 2 : Multiply the obtained column values (in Step 1) by the digits in the corresponding columns.
Step 3 : Sum the products calculated in Step 2. The total is the equivalent value in decimal.
22
1.3 Number system
Hexadecimal to Decimal Conversion
(Multiply by 16)
2 A5 C 2 3
16
∙ 3 × 16 ‒ 2 = 3 × 0.0039 0 . 0117
=
2 × 16 ‒ 1 = 2 × 0.0625 0 . 125
C × 16 0 = 12= × 1 = 12
5 × 16 1 = 5 × 16 = 80
A× 16 2 = 10 × 256 =
2 × 16 3 =2560
2 × 4096
=
2 A 5 C ∙ 2 316 =8192
10844 ∙ 1367
23