Ch4_ref_Machine Logic
Ch4_ref_Machine Logic
Reference - Machine
Logic
X + Y = X •Y …………………… Equation 2
May also involve more than 2 variables, so generally,
A • B • C • • • N = A + B + C + ... + N
A + B + C + ... + N = A • B • C • • • N
➢ The L.H.S. of Equation 1 involve the NOT and AND logic operations
➢ The L.H.S. of Equation 2 involve the NOT and OR logic operations
➢ The theorems provide conversions between AND operations and OR operations
Examples of use of
DeMorgan’s theorems
➢ Ex 1: Simplify x + x’y
= x + x’y = (x + x’) (x + y)
= 1 . (x+y)
= x+y
➢ Ex 2: Simplify (A’ + B + C + D)’ + (AB’C’D)
= AB’C’D’ + AB’C’D
= AB’C’ (D’ + D)
= AB’C’
➢ Ex 3: Simplify (q + r) (q’ + r’)
= qq’ + rq’ + qr’ + rr’
= 0 + rq’ + qr’ + 0
= rq’ + qr’
Examples of DeMorgan’s
theorems
➢ Ex 4: Simplify F = A’C + A’B + AB’C + BC
➢ The following truth tables describe the logic AND, OR and NOT operations
with two inputs A, B and one output F
LogicAND LogicOR LogicNOT
A B F=AB A B F=A+B A F=A'
0 0 0 0 0 0 0 1
0 1 0 0 1 1 1 0
1 0 0 1 0 1
1 1 1 1 1 1
Logic Gates
Logic device symbol
AND gate OR gate NOT gate
A (AB) A (A+B) A A’
B B
Truth Table:
A B A B A+B AB
0 0 1 1 1 1
0 1 1 0 1 1
1 0 0 1 1 1
1 1 0 0 0 0
Example 2
Complete the truth table for the circuit
F = AB( BC + A )
A B C A BC BC + A AB( BC + A )
0 0 0 1 0 0 0
0 0 1 1 0 0 0
0 1 0 1 0 0 0
0 1 1 1 1 0 0
1 0 0 0 0 1 0
1 0 1 0 0 1 0
1 1 0 0 0 1 1
1 1 1 0 1 0 0
Example 3
Prove that A (A + B) = A B
A B A A +B A (A + B) AB
0 0 1 1 0 0
0 1 1 1 0 0
1 0 0 0 0 0
1 1 0 1 1 1
Example 4
Prove A B = A + B
A B A B AB AB A+B
0 0 1 1 0 1 1
0 1 1 0 0 1 1
1 0 0 1 0 1 1
1 1 0 0 1 0 0
Logic Gates
➢ By applying a NOT gate at the output of the AND gate and OR gate, we get
TWO commonly used logic gates
NAND gate NOR gate
A A
(AB)’ (A+B)’
B B
A
B
C F
Example 6
➢ Obtain the logic function for the following logic circuit
A X
F
B
Y
X = AB
Y = A’B’
F =X+Y
= AB + A’B’
Example 7
➢ Obtain the logic function for the following logic circuit
A X F
B
Y
X=A+B
Y = A’ + B’
F = XY
= (A+B)(A’+ B’)