03 3.3 Truth Tables Logic Formulas Logic Circuits 28-54
03 3.3 Truth Tables Logic Formulas Logic Circuits 28-54
03 3.3 Truth Tables Logic Formulas Logic Circuits 28-54
Jen Davoren
Jobs done by combinational systems
▶ Encoding and Decoding of digital signals. Tech term:
codec = encoding-decoding. E.g. of encoding: buttons
on mobile phone: press button “7”on keypad, and 4-bit
encoder produces 0111 as output.
▶ Selecting and Distributing digital signals. Tech term: a
multiplexer (MUX) is a data selecter, and a demultiplexer
(DEMUX) is a data distributer.
▶ Binary arithmetic: operations of addition, subtraction,
multiplication, and more, with binary coding of negative
numbers and finite-precision real numbers.
▶ Comparison and classification: E.g. input two 4-bit
binary numbers a = a3 a2 a1 a0 and b = b3 b2 b1 b0, and
output 0 or 1 to questions “a > b?”, “a = b?” or “a < b?”.
Binary Coded Decimal (BCD) Encoder
Functional description: the system has 10 inputs for decimal digits, p0,
p1,p2, p3, p4, p5, p6, p7, p8, p9, and outputs 4-bit m = m3 m2 m1 m0 and
a 1-bit error signal r such that: if exactly one on the inputs pi is active (value
1) then r is 0 and q is the 4-bit binary value of the decimal i, while if either
zero or two or more of the inputs are active, then r is 1 and m = 0000.
BCD Encoder
p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 r m3 m2 m1 m0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 1
0 0 1 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 1 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 1 0 0 0 0 0 1 1 0
0 0 0 0 0 0 0 1 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 1 0 1 0 0 1
1 1 × × × × × × × × 1 0 0 0 0
1 × 1 × × × × × × × 1 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 1 0 0 0 0 0 0 0 0 0 1 1
0 0 0 0 1 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 1 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 1 0 0 0 0 0 1 1 0
0 0 0 0 0 0 0 1 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0 1 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 1 0 1 0 0 1
1 1 × × × × × × × × 1 0 0 0 0
r ≡ ∼(s0 ∨ s1 ∨ s2 ∨ s3 ∨ s4 ∨ s5 ∨ s6 ∨ s7 ∨ s8 ∨ s9)
Method: from truth table to logic formula
Method: from truth table to logic formula
row p q r z
0 0 0 0 0
1 0 0 1 1 (∼p & ∼q & r)
2 0 1 0 1 (∼p & q & ∼r)
3 0 1 1 1 (∼p & q & r)
4 1 0 0 0
5 1 0 1 0
6 1 1 0 0
7 1 1 1 0
(d) z ≡ ((∼p & ∼q & r) ∨ (∼p & q & ∼r) ∨ (∼p & q & r))
Disjunctive Normal Form
Disjunctive Normal Form
row p q r z
0 0 0 0 0
1 0 0 1 1 (∼p & ∼q & r)
2 0 1 0 1 (∼p & q & ∼r)
3 0 1 1 1 (∼p & q & r)
4 1 0 0 0
5 1 0 1 0
6 1 1 0 0
7 1 1 1 0
z ≡ ((∼p & ∼q & r) ∨ (∼p & q & ∼r) ∨ (∼p & q & r))
Exercise: from truth table to logic formula
row p q r z
0 0 0 0 0
1 0 0 1 1 (∼p & ∼q & r)
2 0 1 0 1 (∼p & q & ∼r)
3 0 1 1 1 (∼p & q & r)
4 1 0 0 0
5 1 0 1 0
6 1 1 0 0
7 1 1 1 0
z ≡ ((∼p & ∼q & r) ∨ (∼p & q & ∼r) ∨ (∼p & q & r))
This can in fact be simplified to a smaller DNF:
Block:
2-in MUX: truth table
row x y s z
0 0 0 0 0
1 0 0 1 0
2 0 1 0 0
3 0 1 1 1
4 1 0 0 1
5 1 0 1 0
6 1 1 0 1
7 1 1 1 1
2-in MUX: truth table
row x y s z
0 0 0 0 0 z≡x
1 0 0 1 0
2 0 1 0 0 z≡x
3 0 1 1 1
4 1 0 0 1 z≡x
5 1 0 1 0
6 1 1 0 1 z≡x
7 1 1 1 1
2-in MUX: truth table
row x y s z
0 0 0 0 0
1 0 0 1 0 z≡y
2 0 1 0 0
3 0 1 1 1 z≡y
4 1 0 0 1
5 1 0 1 0 z≡y
6 1 1 0 1
7 1 1 1 1 z≡y
2-in MUX: canonical DNF logic formula
row x y s z
0 0 0 0 0
1 0 0 1 0
2 0 1 0 0
3 0 1 1 1 (∼x & y & s)
4 1 0 0 1 (x & ∼y & ∼s)
5 1 0 1 0
6 1 1 0 1 (x & y & ∼s)
7 1 1 1 1 (x & y & s)
z ≡ ((∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s))
2-in MUX: DNF circuit
z ≡ ((∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s))
2-in MUX: DNF circuit
z ≡ ((∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s))
2-in MUX: DNF circuit
z ≡ ((∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s))
2-in MUX
z ≡ (∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s)
2-in MUX
z ≡ (∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s)
z ≡ (x & y & ∼s) ∨ (x & ∼y & ∼s) ∨ (x & y & s) ∨ (∼x & y & s)
2-in MUX
z ≡ (∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s)
z ≡ (x & y & ∼s) ∨ (x & ∼y & ∼s) ∨ (x & y & s) ∨ (∼x & y & s)
z ≡ (x & ∼s & y) ∨ (x & ∼s & ∼y) ∨ (y & s & x) ∨ (y & s & ∼x)
2-in MUX
z ≡ (∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s)
z ≡ (x & y & ∼s) ∨ (x & ∼y & ∼s) ∨ (x & y & s) ∨ (∼x & y & s)
z ≡ (x & ∼s & y) ∨ (x & ∼s & ∼y) ∨ (y & s & x) ∨ (y & s & ∼x)
z ≡ (x & ∼s & (y ∨ ∼y)) ∨ (y & s & (x ∨ ∼x))
2-in MUX
z ≡ (∼x & y & s) ∨ (x & ∼y & ∼s) ∨ (x & y & ∼s) ∨ (x & y & s)
z ≡ (x & y & ∼s) ∨ (x & ∼y & ∼s) ∨ (x & y & s) ∨ (∼x & y & s)
z ≡ (x & ∼s & y) ∨ (x & ∼s & ∼y) ∨ (y & s & x) ∨ (y & s & ∼x)
z ≡ (x & ∼s & (y ∨ ∼y)) ∨ (y & s & (x ∨ ∼x))
z ≡ (x & ∼s) ∨ (y & s)