Unit Digital Electronics - DR M Kumar
Unit Digital Electronics - DR M Kumar
Unit Digital Electronics - DR M Kumar
Unit-2
Digital Electronics
Customized By: Dr Mukesh Kumar
Assistant Professor
ECE Department
Outline
Looping
• Number Systems
o Binary, Octal, Decimal, Hexa-decimal, Binary arithmetic operations
• Binary Codes
• Boolean Algebra
• Logic Gates
o AND, OR, NOT, NAND, NOR, EX-OR, EX-NOR
Number System
Section - 1
Common Number Systems
Decimal Octal
Binary Hexadecimal
Example
1 x 2 5 + 0 x 24 + 1 x 23 + 0 x 22 + 1 x 21 + 1 x 20 1 x 21 + 1 x 20 + 1 x 2-1 + 1 x 2-2
32 + 0 + 8 + 0 + 2 + 1 2 + 1 + 0.5 + 0.25
7 x 82 + 2 x 81 + 4 x 80 4 x 81 + 3 x 80 + 2 x 8-1 + 5 x 8-2
448 + 16 + 4 32 + 3 + 0.25 + 0.0781
1 3 2 7
10110101112 = 132.78
2 D 7
10110101112 = 2D.716
2 3 E
10768 = 23E16
# 3130704 (DF) Unit 1 – Fundamentals of Digital systems and Logic families 16
Hexa-Decimal to Octal
Technique
Convert Hexa-Decimal to Binary
From given fractional point, group bits in threes to right and group bits in threes to left
Convert Binary to Octal
Example
1F0C16 = ?8
1 F 0 C
0 1 7 4 1 4
1F0C16 = 174148
# 3130704 (DF) Unit 1 – Fundamentals of Digital systems and Logic families 17
Binary Addition & Subtraction
Rules for binary addition Rules for binary subtraction
0+0=0 0–0=0
0+1=1 1–1=0
1+0=1 1–0=1
1 + 1 = 10 i.e. 0 0 – 1 = 1, with
with a carry of 1 a borrow 1
1 1 1 1 1 1
0 1 10 1 1 10
1 1 0 1 . 1 0 1 1 0 1 0 . 0 1 10
+ 0 1 1 1 . 0 1 1 - 0 1 1 1 . 1 1 1
1 0 1 0 1 . 0 0 0 0 0 1 0 . 0 1 1
1 1 1 1 1 1 1 . 1 1
- 1 1 0 1 - 1 0 1 . 0 1
0 0 1 0 0 1 0 . 1 0
(1’s complement of 1101) (1’s complement of 101.01)
1 1 1 1 1 1 1 . 1 1
- 1 1 0 0 - 1 0 1 . 0 1
0 0 1 1 0 1 0 . 1 0
+ 1 + 1
0 1 0 0 0 1 0 . 1 1
(2’s complement of 1100) (2’s complement of 101.01)
Shortcut: Starting from right side, all bits are same till first 1 occurs and
then invert rest of the bits
# 3130704 (DF) Unit 1 – Fundamentals of Digital systems and Logic families 22
Representation of negative number in 2’s complement form
Express -65.5 in 12 bit 2’s complement form.
2 65 1 0.5 x 2 = 1.0
2 32 0 So, result in 12-bit binary is as follows:
2 16 0 65.510 = 01000001.10002
2 8 0 For negative number, we have to
2 4 0 convert this into 2’s complement form
2 2 0 -65.510 = 10111110.10002
2 1 1
0
Maximum error due to truncation is set to be less than allowable error by solving from 𝐸10 =
2−𝑛 . This equation is written as
2−𝑛 < 0.00252
This indicates that the use of 9 bits in the binary number will guarantee an error less than 1%.
So the conversion is carried out to 9 places which results in
0.25210 = 0.0100000012
9 9 9 9 9 9 9 . 9 9
- 3 4 6 5 - 7 8 2 . 5 4
6 5 3 4 2 1 7 . 4 5
(9’s complement of 3465) (9’s complement of 782.54)
9 9 9 9 9 9 9 . 9 9
- 3 4 6 5 - 7 8 2 . 5 4
6 5 3 4 2 1 7 . 4 5
+ 1 + 1
6 5 3 5 2 1 7 . 4 6
(10’s complement of 3465) (10’s complement of 782.54)
7 4 5 . 8 1 7 4 5 . 8 1
9’s complement
- 4 3 6 . 6 2 + 5 6 3 . 3 7
3 0 9 . 1 9 1 3 0 9 . 1 8
+ 1
3 0 9 . 1 9
4 3 6 . 6 2 4 3 6 . 6 2
9’s complement
- 7 4 5 . 8 1 + 2 5 4 . 1 8
- 3 0 9 . 1 9 6 9 0 . 8 0
9’s complement
- 3 0 9 . 1 9
7 4 5 . 8 1 7 4 5 . 8 1
10’s complement
- 4 3 6 . 6 2 + 5 6 3 . 3 8
3 0 9 . 1 9 1 3 0 9 . 1 9
4 3 6 . 6 2 4 3 6 . 6 2
10’s complement
- 7 4 5 . 8 1 + 2 5 4 . 1 9
- 3 0 9 . 1 9 6 9 0 . 8 1
10’s complement
- 3 0 9 . 1 9
6 8.7 5 0 1 0 0 0 1 0 0. 1 1 0 0
1’s complement
- 2 7.50 + 1 1 1 0 0 1 0 0. 0 1 1 1
+ 4 1.25 1 0 0 1 0 1 0 0 1. 0 0 1 1
+1
0 0 1 0 1 0 0 1. 0 1 0 0
4 3.2 5 0 0 1 0 1 0 1 1. 0 1 0 0
1’s complement
- 8 9.75 + 1 0 1 0 0 1 1 0. 0 0 1 1
- 4 6.50 1 1 0 1 0 0 0 1. 0 1 1 1
1’s complement
0 0 1 0 1 1 1 0. 1 0 0 0
6 8.7 5 0 1 0 0 0 1 0 0. 1 1 0 0
2’s complement
- 2 7.50 + 1 1 1 0 0 1 0 0. 1 0 0 0
+ 4 1.25 1 0 0 1 0 1 0 0 1. 0 1 0 0
4 3.2 5 0 0 1 0 1 0 1 1. 0 1 0 0
2’s complement
- 8 9.75 + 1 0 1 0 0 1 1 0. 0 1 0 0
- 4 6.50 1 1 0 1 0 0 0 1. 1 0 0 0
2’s complement
0 0 1 0 1 1 1 0. 1 0 0 0
Decimal 1 4
1 1 1
2 5 0 0 1 0 0 1 0 1
+ 1 3 + 0 0 0 1 0 0 1 1
3 8 0 0 1 1 1 0 0 0
+1 +1 +1 +1
0001 0010 0001 0110 .0100 Corrected sum
3 8 0 0 1 1 1 0 0 0
- 1 5 - 0 0 0 1 0 1 0 1
2 3 0 0 1 0 0 0 1 1
Rule: If one 4-bit group needs to take borrow from neighbor, then subtract
0110 from the group which is receiving borrow.
# 3130704 (DF) Unit 1 – Fundamentals of Digital systems and Logic families 43
BCD Subtraction
Example - 2
Decimal 1 4
Binary 1 ⨁ 0 ⨁ 0 ⨁ 1
Gray 1 1 0 1
Gray 1 1 0 1
⨁ ⨁ ⨁
Binary 1 0 0 1
Parity Column
A B C A+B+C A+B+C ഥ
A ഥ
𝐁 𝐂ത Aഥ B
ഥCത
0 0 0 0 1 1 1 1 1
0 0 1 1 0 1 1 0 0
0 1 0 1 0 1 0 1 0
0 1 1 1 0 1 0 0 0
1 0 0 1 0 0 1 1 0
1 0 1 1 0 0 1 0 0
1 1 0 1 0 0 0 1 0
1 1 1 1 0 0 0 0 0
From truth table, it is clearly visible that L.H.S. = R.H.S. Hence, the complement of a
sum of variables is equal to the product of their individual complements.
# 3130704 (DF) Unit 1 – Fundamentals of Digital systems and Logic families 60
Proof of 𝐴𝐵𝐶 = 𝐴ҧ + 𝐵ത + 𝐶ҧ
L.H.S. R.H.S.
A B C ABC ABC ഥ
A ഥ
𝐁 𝐂ത ഥ+B
A ഥ + Cത
0 0 0 0 1 1 1 1 1
0 0 1 0 1 1 1 0 1
0 1 0 0 1 1 0 1 1
0 1 1 0 1 1 0 0 1
1 0 0 0 1 0 1 1 1
1 0 1 0 1 0 1 0 1
1 1 0 0 1 0 0 1 1
1 1 1 1 0 0 0 0 0
From truth table, it is clearly visible that L.H.S. = R.H.S. Hence, the complement of a
product of variables is equal to the sum of their individual complements.
# 3130704 (DF) Unit 1 – Fundamentals of Digital systems and Logic families 61
Reducing Boolean Expression (Example – 1)
Reduce the expression 𝑓 = 𝐴 + 𝐵[𝐴𝐶 + 𝐵 + 𝐶ҧ 𝐷]
𝑓 = 𝐴 + 𝐵[𝐴𝐶 + 𝐵 + 𝐶ҧ 𝐷]
ҧ
𝑓 = 𝐴 + 𝐵[𝐴𝐶 + 𝐵𝐷 + 𝐶𝐷] (Distributive law)
𝑓 = 𝐴 + 𝐵𝐴𝐶 + 𝐵𝐵𝐷 + 𝐵𝐶𝐷 ҧ (Distributive law)
𝑓 = 𝐴 + 𝐴𝐵𝐶 + 𝐵𝐷 + 𝐵 𝐶𝐷 ҧ (A.A = A)
𝑓 = 𝐴(1 + 𝐵𝐶) + 𝐵𝐷(1 + 𝐶)ҧ
𝑓 = 𝐴 + 𝐵𝐷 (1 + A = 1)
ҧ
𝑓 = 𝐴[𝐵 + 𝐶(𝐴𝐵 + 𝐴𝐶)] ҧ
ҧ
𝑓 = 𝐴[𝐵 + 𝐶(𝐴𝐵𝐴 ҧ
𝐶)] (De-Morgan’s law)
𝑓 = 𝐴[𝐵 + 𝐶(ҧ 𝐴ҧ + 𝐵)(
ത 𝐴ҧ + 𝐶)] (De-Morgan’s law)
𝑓 = 𝐴[𝐵 + 𝐶(ҧ 𝐴ҧ𝐴ҧ + 𝐴𝐶 ҧ + 𝐵ത 𝐴ҧ + 𝐵𝐶)]
ത (Distributive law)
𝑓 = 𝐴[𝐵 + 𝐶ҧ 𝐴ҧ + 𝐶ҧ 𝐴𝐶 ҧ + 𝐶ҧ 𝐵ത 𝐴ҧ + 𝐶ҧ 𝐵𝐶]
ത (Distributive law)
𝑓 = 𝐴[𝐵 + 𝐶ҧ 𝐴ҧ + 0 + 𝐶ҧ 𝐵ത 𝐴ҧ + 0] (A.A’ = 0)
𝑓 = 𝐴𝐵 + 𝐴𝐶ҧ 𝐴ҧ + 𝐴𝐶ҧ 𝐵ത 𝐴ҧ (Distributive law)
𝑓 = 𝐴𝐵 + 0 + 0 (A.A’ = 0)
𝑓 = 𝐴𝐵
A C 𝐶 = 𝐴ҧ 𝑜𝑟 𝐶 = 𝐴′
A C
0 1
1 0
A A B C 𝐶 = (𝐴 ∙ 𝐵)′
B C
0 0 1
0 1 1
1 0 1
1 1 0
A A B C 𝐶 =𝐴⨁𝐵
C
B 0 0 0
0 1 1
1 0 1
1 1 0
(AB)’ ((AB)’)’ = AB
A A’ A
B
NOT using NAND AND using NAND
A’
A
(A’B’)’ = (A+B)
B
B’
OR using NAND
A’
A
(A’+B’)’ = AB
B
B’
AND using NOR