Professional Documents
Culture Documents
ELL201 L4 19aug21 1629299249057
ELL201 L4 19aug21 1629299249057
It
is your responsibility to ensure no unauthorized circulation of the course contents/materials
takes place.
Lecture 4
8 bits = 1 byte
-So you need “Ifs”, “adds”, “subtracts”, “compares” → that is a lot of logic circuits, just
to add two numbers!
Examples:
Contains only + 0
Examples:
1 + 1 + 1 = 1 1 (Carry bit)
• If a N bit system, produces a result that has N+1 bits, it leads to : carry out bit
• For now, disregard the carry out bit; will deal later in hardware design
• Any carry bit moves left to the next significant bit in the operation
• Find 2’s complement of ‘Y’ (Note: for +ve number 2s complement is same)
• Add the two numbers
• If Final Carry is ‘1’ then the result is +ve and in its true form
• If Final Carry is ‘0’ then the result is –ve and in its 2’s complement form
• Final carry bit itself is discarded from the result
5 = 0000 0101, 3 = 0000 0011
Example 1: 5 – 3
Example 2: 3 - 5
•When two signed 2's complement numbers are added, overflow is detected if:
F (inputs) → Output
• Thus for ‘n-input’ logical expression a truth table will have at least n+1 coloumns
• Number of rows in truth table = 2N for an N-input variable system (in boolean
algebra)
Truth Table
Symbol
Truth Table
X Y=X’
Y = NOT X
X Y=X’
Truth Table
X Y=X’
Y = NOT X
X Y=X’ 0 1
Truth Table
X Y=X’
Y = NOT X
X Y=X’ 0 1
1 0
X R = X+Y
Y X Y R = X+Y
R = X OR Y
X R = X+Y
Y X Y R = X+Y
R = X OR Y
0 0 0
X R = X+Y
Y X Y R = X+Y
R = X OR Y
0 0 0
0 1 1
X R = X+Y
Y X Y R = X+Y
R = X OR Y
0 0 0
0 1 1
1 0 1
X R = X+Y
Y X Y R = X+Y
R = X OR Y
0 0 0
0 1 1
1 0 1
1 1 1
2-Input OR Gate
X R = X*Y
Y X Y R=X*Y
R = X AND Y
X R = X*Y
Y X Y R=X*Y
R = X AND Y
0 0 0
X R = X*Y
Y X Y R=X*Y
R = X AND Y
0 0 0
0 1 0
X R = X*Y
Y X Y R=X*Y
R = X AND Y
0 0 0
0 1 0
1 0 0
X R = X*Y
Y X Y R=X*Y
R = X AND Y
0 0 0
0 1 0
1 0 0
1 1 1
1, 0, +, *, ’
• + and * : Binary operators
• ’ : unary operator
2.
3.
4.
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0
0 1
1 0
1 1
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0 1
0 1
1 0
1 1
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0 1
0 1 1
1 0
1 1
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0 1
0 1 1
1 0 1
1 1
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0 1
0 1 1
Symbol 1 0 1
Not-OR 1 1 0
X R = (X+Y)’ X Y R = X NOR Y
Y 0 0
0 1
1 0
1 1
ELL201, M. Suri, IIT-D, (copyright 2021), Intended for
35
Academic Fair Use Only
Universal Logic Gates – NAND & NOR
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0 1
0 1 1
Symbol 1 0 1
Not-OR 1 1 0
X R = (X+Y)’ X Y R = X NOR Y
Y 0 0 1
0 1
1 0
1 1
ELL201, M. Suri, IIT-D, (copyright 2021), Intended for
36
Academic Fair Use Only
Universal Logic Gates – NAND & NOR
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0 1
0 1 1
Symbol 1 0 1
Not-OR 1 1 0
X R = (X+Y)’ X Y R = X NOR Y
Y 0 0 1
0 1 0
1 0
1 1
ELL201, M. Suri, IIT-D, (copyright 2021), Intended for
37
Academic Fair Use Only
Universal Logic Gates – NAND & NOR
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0 1
0 1 1
Symbol 1 0 1
Not-OR 1 1 0
X R = (X+Y)’ X Y R = X NOR Y
Y 0 0 1
0 1 0
1 0 0
1 1
ELL201, M. Suri, IIT-D, (copyright 2021), Intended for
38
Academic Fair Use Only
Universal Logic Gates – NAND & NOR
Symbol
Not-AND
Truth Table
R = (X*Y)’
X X Y R = X NAND Y
Y 0 0 1
0 1 1
Symbol 1 0 1
Not-OR 1 1 0
X R = (X+Y)’ X Y R = X NOR Y
Y 0 0 1
0 1 0
1 0 0
1 1 0
ELL201, M. Suri, IIT-D, (copyright 2021), Intended for
39
Academic Fair Use Only
Prove that NAND is a Universal Gate!
Build a NOT Gate using NAND ?
Output = X’
R = (X*Y)’
X
Y
Y Y’
3 NAND Gates to build OR
ELL201, M. Suri, IIT-D, (copyright 2021), Intended for
41
Academic Fair Use Only
Prove that NOR is a Universal Gate!
Build a NOT Gate using NAND ?
Output = X’
R = (X+X)’
X
X Y=X’
X
’ + a’b
Representations of Boolean Functions
Circuit 2b
F
a
0 0 1
F=a’
X Y Z Product Symbol m0 m1 m2 m3 m4 m5 m6 m7
Term
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0-complemented
1-uncomplemented
0-complemented
1-uncomplemented
X Y Z Sum Symbol M0 M1 M2 M3 M4 M5 M6 M7
Term
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
0-UNcomplemented
1-complemented
0-UNcomplemented
1-complemented