CSEE 3827: Fundamentals of Computer Systems, Spring 2021: Prof. Dan Rubenstein (Danr@cs - Columbia.edu)
CSEE 3827: Fundamentals of Computer Systems, Spring 2021: Prof. Dan Rubenstein (Danr@cs - Columbia.edu)
CSEE 3827: Fundamentals of Computer Systems, Spring 2021: Prof. Dan Rubenstein (Danr@cs - Columbia.edu)
• Terminology
• Logic gates
• Circuit fabrication
• NAND, NOR
• DUAL
• XOR
2
Boolean Terminology
Terminology
X X
I sometimes say “negate”: , e.g.,
0 1 if boolean X=1, negating X makes X=0.
Negating X again changes it back to 1
1 0
Boolean Logic
0 1 0 0 0 0 0 0
1 0 0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
Terminology cont’d
• e.g., 4 expressions:
AB + C, (AB) + C, (A + B)C, ((A) + B)C
• e.g.,
(A + B)C = ((A) + B)C
0 0 0
0 1 1
1 0 1
1 1 0
8
XOR as a “control”
• Y ⊕ 0 = Y
• Y ⊕ 1 = Y
• As we XOR bits, the result “ ips” when XOR’ing a 1, and stays the same
when XOR’ing a 0
• 1 ⊕ 1 ⊕ 0 ⊕ 0 ⊕ 1 ⊕ 0 ⊕ 1 ⊕ 1 ⊕ 0 ⊕ 0 ⊕ 1 ⊕ 1 = 1
0 1 0 1 0 1
9
fl
Boolean Logic: Truth Table
10
D X A X DX L=DX + A
0 0 0 1 0 0
0 0 1 1 0 1
0 1 0 0 0 0
0 1 1 0 0 1
1 0 0 1 1 1
1 0 1 1 1 1
1 1 0 0 0 0
1 1 1 0 0 1
X Y XY + XY
0 0
0 1
1 0
1 1
12
Boolean Logic: Example 2
X Y X Y XY XY XY + XY
0 0 1 1 0 1 1
0 1 1 0 0 0 0
1 0 0 1 0 0 0
1 1 0 0 1 0 1
13
Boolean Theorems
Boolean Algebra: Identities and Theorems
For any boolean X (X ∈ {0,1}):
OR AND NOT
X+0 = X X1 = X (identity)
X+1 = 1 X0 = 0 (null)
X+X = X XX = X (idempotent)
X+X = 1 XX = 0 (complementarity)
X=X (involution)
15
Other important simpli cations:
• X + XY = X :
e.g.
X = “You are male
• X (X+Y) = X :
Y = “You are taller than 5’5”
•
16
,
fi
Boolean Algebra: Example
F = XYZ + XYZ + XZ
17
Boolean Algebra: Example
Simplify this equation using algebraic manipulation.
F = XYZ + XYZ + XZ
XY + XZ (by identity)
18
Complementing (parts of) expressions (“the big bar”)
• Precedence: the complement is performed after all other boolean ops that lie
beneath it
A B A+B A+B
0 0 0 1
0 1 1 0
1 0 1 0
1 1 1 0
19
Complementing (parts of) expressions (“the big bar”)
• Order of precedence example:
(A + BD)C
2. OR A with BD
3. Complement (A + BD)
5. Complement (A + BD) C
20
DeMorgan’s Theorem
Important!!!!!
DeMorgan’s Theorem
• 1 with 0, 0 with 1
FG = F + G
• function F with F, F with F
F + G = FG
Understanding DeMorgan
• Example:
FGH = F + G + H
F + G + H = FGH
24
Z = AB + AB
Z=
25
Boolean Algebra: Example 2
Find the complement of Z.
F G
Z = AB + AB
Z = AB + AB
(A + B) (A + B) (by DeMorgan’s)
(A + B) (A + B) (by involution)
AA + AB + BA + BB (by commutativity)
(by complementarity and
AB + BA
identity) 26
DeMorgan’s Practice
= (ABCD)(B+C)
= ABCD + ABCD
= ABCD
Consensus Theorem
• Proof:
• If YZ = 1
A
B
C
D
31
We simplify to reduce required circuitry...
F = XYZ + XYZ + XZ
XY + XZ (by identity)
32
Circuit view
33
fi
Circuit view: why reduce?
• Cost:
wire connector: black dot signi es wires are connected
34
fi
Circuit view: why reduce?
• Cost:
wire connector: black dot signi es wires are connected 3-input gate
(Actually represent depth-2
+1 +2 composition of 2-iput gates)
• pay per gate:
higher cost
+2
• more gates = more
space on chip
fi
Alternate shorthand for multiple inputs to Gate
A
• Given inputs A,B,C,D,E,F,
C
D
F
A
B
C black dot signi es connection:
no dot means no connection
D
E
F
36
fi
Bitwise parallel
operations
Bit-wise (in parallel) Logic Ops
• X = Xk-1Xk-2…X1X0, Y=Yk-1Yk-2…Y1Y0
38
Bitwise logical ops with circuitry
k
}k
…
= k wires running in parallel, same as
• extends to circuits as well, e.g., k=3
3
3
X 3 Z
Y
…
= k wires running in parallel, same as
• extends to circuits as well, e.g., k=3
x y z = xy
0 0 1
0 1 1 XY
1 0 1
Note: the “o” in a circuit
1 1 0
represents a NOT (inverter)
42
A = A NAND A A = A NOR A
Any circuit can be entirely implemented with just NAND or just NOR gates!!!
43
Duals
Duals
• Any theorem you can prove, you can also prove for its dual
• To form a dual...
X + Y = XY
What is the dual of this expression?
X + Y = XY
dual
XY = X + Y
What are the complements of these expressions?
X + Y = XY complement
dual
XY = X + Y complement
What are the complements of these expressions?
X + Y = XY complement XY = X + Y
dual
XY = X + Y complement X + Y = XY
These are also the duals of one another.
X + Y = XY complement XY = X + Y
dual
dual
XY = X + Y complement X + Y = XY
• F = X + A (Z + X (Y + W) + Y (Z + W))
51
Revisiting XOR
XOR: the parity operation
X Y X⊕Y
• X ⊕ Y = XY + XY
0 0 0 X
1
Y
0 1
1 0 1
1 1 0
53
Summary
• Subtle things that are very important to remember from this lecture:
• XOR (slide 8)
54