CHAPTER 4 BOOLEAN ALGEBRA AND LOGIC GATES
Computer Systems Organization FlowComputer Systems Organization Flow
IPOS (Input, Process, Output, Storage)
Process and Storage (CPU, Registers, Memory)
CPU (Binary Numbers)
Binary Numbers (Encoded as Signals in Digital Form known as Data Encoding)
Data Encoding (Made and interpret by Transistors that made up the CPU and act like switches)
Switches (Act in accordance to Binary Values)
22 / 28 / 28
Binary Logic and GatesBinary Logic and Gates
Binary variables take on one of two values.
Logical operators operate on binary values and binary variables.
Basic logical operators are the logic functions AND, OR and NOT.
Logic gates implement logic functions.
Boolean Algebra: a useful mathematical system for specifying and transforming logic gates.
We study Boolean algebra as a foundation for designing and analyzing COMPUTER SYSTEMS!
Binary VariablesBinary Variables
Recall that the two binary values have different names:
● True/False
● On/Off
● Yes/No
● 1/0
We use 1 and 0 to denote the two values.
Variable identifier examples:
● A, B, y, z, or X1 for now
● RESET, START_IT, or ADD1 later
Logical OperationsLogical Operations
The three basic logical operations are:
● AND
● OR
● NOT
AND is denoted by a dot (·).
OR is denoted by a plus (+).
NOT is denoted by an overbar ( ¯ ), a single quote mark (') after, or (~) before the variable.
Basic DefinitionsBasic Definitions
Binary Operators
● AND
z = x • y = x y z=1 if x=1 AND y=1
● OR
z = x + y z=1 if x=1 OR y=1
● NOT
z = x = x’ z=1 if x=0
Boolean Algebra
● Binary Variables: only ‘0’ and ‘1’ values
● Algebraic Manipulation 77 / 28 / 28
Boolean Algebra PostulatesBoolean Algebra Postulates
Commutative Law
x • y = y • x x + y = y + x
Identity Element
x • 1 = x x + 0 = x
Complement
x • x’ = 0 x + x’ = 1
88 / 28 / 28
Boolean Algebra TheoremsBoolean Algebra Theorems
Duality
● The dual of a Boolean algebraic expression is obtained by interchanging the AND and the OR operators and replacing the 1’s by 0’s and the 0’s by 1’s.
● x • ( y + z ) = ( x • y ) + ( x • z )
● x + ( y • z ) = ( x + y ) • ( x + z )
Theorem 1
● x • x = x x + x = x
Theorem 2
● x • 0 = 0 x + 1 = 199 / 28 / 28
Applied to a valid equation produces a valid equation
Boolean Algebra TheoremsBoolean Algebra Theorems
Theorem 3: Involution● ( x’ )’ = x ( x ) = x
Theorem 4: Associative & Distributive● ( x • y ) • z = x • ( y • z ) ( x + y ) + z = x + ( y + z )
● x • ( y + z ) = ( x • y ) + ( x • z )
x + ( y • z ) = ( x + y ) • ( x + z )
Theorem 5: DeMorgan● ( x • y )’ = x’ + y’ ( x + y )’ = x’ • y’
● ( x • y ) = x + y ( x + y ) = x • y
Theorem 6: Absorption● x • ( x + y ) = x x + ( x • y ) = x 1010 / 28 / 28
Operator PrecedenceOperator Precedence
Parentheses
( . . . ) • ( . . .)
NOT
x’ + y
AND
x + x • y
OR
1111 / 28 / 28
])([ xwzyx
])([
)(
)(
)(
)(
xwzyx
xwzy
xwz
xw
xw
DeMorgan’s TheoremDeMorgan’s Theorem
1212 / 28 / 28
)]([ edcba
)]([ edcba
))(( edcba
))(( edcba
))(( edcba
)( edcba
Boolean FunctionsBoolean Functions
Boolean Expression
Example: F = x + y’ z
Truth Table
All possible combinationsof input variables
Logic Circuit
1313 / 28 / 28
x y z F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
xyz
F
Boolean Algebra and Logic Boolean Algebra and Logic Gates Gates 1414
Using Switches
● Inputs:
♦ logic 1 is switch closed
♦ logic 0 is switch open
● Outputs:
♦ logic 1 is light on
♦ logic 0 is light off.
● NOT input:
♦ logic 1 is switch open
♦ logic 0 is switch closed
Logic Function ImplementationLogic Function Implementation
Switches in series => AND
Switches in parallel => OR
CNormally-closed switch => NOT
Boolean Algebra and Logic Boolean Algebra and Logic Gates Gates 1515
Example: Logic Using Switches
Light is on (L = 1) for
L(A, B, C, D) =
and off (L = 0), otherwise.
Useful model for relay and CMOS gate circuits, the foundation of current digital logic circuits
Logic Function Implementation – cont’dLogic Function Implementation – cont’d
B
A
D
C
A (B C + D) = A B C + A D
Boolean Algebra and Logic Boolean Algebra and Logic Gates Gates 1616
Logic GatesLogic Gates
In the earliest computers, switches were opened
and closed by magnetic fields produced by
energizing coils in relays. The switches in turn
opened and closed the current paths.
Later, vacuum tubes that open and close current
paths electronically replaced relays.
Today, transistors are used as electronic
switches that open and close current paths.
Boolean Algebra and Logic Boolean Algebra and Logic Gates Gates 1717
Logic Gate Symbols and BehaviorLogic Gate Symbols and Behavior Logic gates have special symbols:
And waveform behavior in time as follows:X 0 0 1 1
Y 0 1 0 1
X · Y(AND) 0 0 0 1
X+ Y(OR) 0 1 1 1
(NOT) X 1 1 0 0
OR gate
X
YZ= X+ Y
X
YZ= X · Y
AND gate
X Z= X
NOT gate orinverter
Algebraic ManipulationAlgebraic Manipulation
Literal:
A single variable within a term that may be complemented or not.
Use Boolean Algebra to simplify Boolean functions to produce simpler circuits
Example: Simplify to a minimum number of literals
F = x + x’ y ( 3 Literals)
= x + ( x’ y )
= ( x + x’ ) ( x + y )
= ( 1 ) ( x + y ) = x + y ( 2 Literals)1818 / 28 / 28
Distributive law (+ over •)
Complement of a FunctionComplement of a Function
DeMorgan’s Theorm
Duality & Literal Complement
1919 / 28 / 28
CBAF
CBAF
CBAF
CBAF CBAF
CBAF
Canonical FormsCanonical Forms
Minterm
● Product (AND function)
● Contains all variables
● Evaluates to ‘1’ for aspecific combination
Example
A = 0 A B C
B = 0 (0) • (0) • (0)
C = 0
2020 / 28 / 28
1 • 1 • 1 = 1
A B C Minterm
0 0 0 0 m0
1 0 0 1 m1
2 0 1 0 m2
3 0 1 1 m3
4 1 0 0 m4
5 1 0 1 m5
6 1 1 0 m6
7 1 1 1 m7
CBA
CBA
CBA
CBA
CBA
CBA
CBA
CBA
Canonical FormsCanonical Forms
Maxterm
● Sum (OR function)
● Contains all variables
● Evaluates to ‘0’ for aspecific combination
Example
A = 1 A B C
B = 1 (1) + (1) + (1)
C = 1
2121 / 28 / 28
0 + 0 + 0 = 0
A B C Maxterm
0 0 0 0 M0
1 0 0 1 M1
2 0 1 0 M2
3 0 1 1 M3
4 1 0 0 M4
5 1 0 1 M5
6 1 1 0 M6
7 1 1 1 M7
CBA
CBA CBA CBA CBA CBA CBA CBA
Canonical FormsCanonical Forms
Truth Table to Boolean Function
2222 / 28 / 28
A B C F
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
CBAF CBA CBA ABC
Canonical FormsCanonical Forms
Sum of Minterms
Product of Maxterms
2323 / 28 / 28
A B C F
0 0 0 0 0
1 0 0 1 1
2 0 1 0 0
3 0 1 1 0
4 1 0 0 1
5 1 0 1 1
6 1 1 0 0
7 1 1 1 1
ABCCBACBACBAF
7541 mmmmF
)7,5,4,1(F
CABBCACBACBAF
CABBCACBACBAF
CABBCACBACBAF ))()()(( CBACBACBACBAF
6320 MMMMF (0,2,3,6)F
F
1
0
1
1
0
0
1
0
Standard FormsStandard Forms
Sum of Products (SOP)
2424 / 28 / 28
ABCCBACBACBAF
AC
BBAC
)(
CB
AACB
)(
BA
BA
CCBA
)1(
)(
)()()( BBACCCBAAACBF
ACBACBF
Standard FormsStandard Forms
Product of Sums (POS)
2525 / 28 / 28
)( AACB
)( BBCA
)( CCBA
)()()( AACBCCBABBCAF
CBBACAF
CABBCACBACBAF
))()(( CBBACAF
TwoTwo -- Level ImplementationsLevel Implementations
Sum of Products (SOP)
Product of Sums (POS)
2626 / 28 / 28
ACBACBF
))()(( CBBACAF
B’C
FB’A
AC
AC
FB’A
B’C
Logic OperatorsLogic Operators
AND
NAND (Not AND)
2727 / 28 / 28
x y NAND0 0 10 1 11 0 11 1 0
x y AND0 0 00 1 01 0 01 1 1
xy
x • y
xy
x • y
Logic OperatorsLogic Operators
OR
NOR (Not OR)
2828 / 28 / 28
x y OR0 0 00 1 11 0 11 1 1
x y NOR0 0 10 1 01 0 01 1 0
xy
x + y
xy
x + y
Logic OperatorsLogic Operators
XOR (Exclusive-OR)
XNOR (Exclusive-NOR) (Equivalence)
2929 / 28 / 28
x y XOR0 0 00 1 11 0 11 1 0
x y XNOR0 0 10 1 01 0 01 1 1
xy
x Å yx � y
x y + x y
xy
x Å yx y + x y
Logic OperatorsLogic Operators
NOT (Inverter)
Buffer
3030 / 28 / 28
x NOT
0 1
1 0
x Buffer
0 0
1 1
x x
x x
DeMorgan’s Theorem on GatesDeMorgan’s Theorem on Gates
AND Gate
● F = x • y F = (x • y) F = x + y
OR Gate
● F = x + y F = (x + y) F = x • y
3232 / 28 / 28 Change the “Shape” and “bubble” all lines
HomeworkHomework
Mano
● Chapter 2
♦ 2-4
♦ 2-5
♦ 2-6
♦ 2-8
♦ 2-9
♦ 2-10
♦ 2-12
♦ 2-15
♦ 2-18
♦ 2-19 3333 / 28 / 28
HomeworkHomework
Mano
3434 / 28 / 28
2-4 Reduce the following Boolean expressions to the indicated number of literals:
(a) A’C’ + ABC + AC’ to three literals
(b) (x’y’ + z)’ + z + xy + wz to three literals
(c) A’B (D’ + C’D) + B (A + A’CD) to one literal
(d) (A’ + C) (A’ + C’) (A + B + C’D) to four literals
2-5 Find the complement of F = x + yz; then show thatFF’ = 0 and F + F’ = 1
HomeworkHomework
3535 / 28 / 28
2-6 Find the complement of the following expressions:
(a) xy’ + x’y (b) (AB’ + C)D’ + E
(c) (x + y’ + z) (x’ + z’) (x + y)
2-8 List the truth table of the function:F = xy + xy’ + y’z
2-9 Logical operations can be performed on strings of bits by considering each pair of corresponding bits separately (this is called bitwise operation). Given two 8-bit stringsA = 10101101 and B = 10001110, evaluate the 8-bit result after the following logical operations: (a) AND, (b) OR, (c) XOR, (d) NOT A, (e) NOT B.
HomeworkHomework
A B C T1 T2
0 0 0 1 00 0 1 1 00 1 0 1 00 1 1 0 11 0 0 0 11 0 1 0 11 1 0 0 11 1 1 0 1
3636 / 28 / 28
2-10 Draw the logic diagrams for the following Boolean expressions:
(a) Y = A’B’ + B (A + C) (b) Y = BC + AC’
(c) Y = A + CD (d) Y = (A + B) (C’ + D)
2-12 Simplify the Boolean function T1 and T2 to a minimum number of literals.
HomeworkHomework
3737 / 28 / 28
2-15 Given the Boolean functionF = xy’z + x’y’z + w’xy + wx’y + wxy
(a) Obtain the truth table of the function.(b) Draw the logic diagram using the original Boolean expression.(c) Simplify the function to a minimum number of literals using Boolean algebra.(d) Obtain the truth table of the function from the simplified expression and show that it is the same as the one in part (a)(e) Draw the logic diagram from the simplified expression and compare the total number of gates with the diagram of part (b).