Title: CS 150 Computer Organization
1CS 150Computer Organization Architecture
2Overview
- Quiz 3
- Boolean Operations
- Truth tables
- Logic gates
- Alternate gate shapes
- Functionally complete gates
- Boolean expressions
- Boolean theorems
- Canonical forms (SOP POS)
- Boolean minimization
- The design process
- Karnaugh maps
3A New Kind of Algebra
Boolean Algebra - a relatively simple
mathematical tool that allows us to describe the
relationship between a logic circuits output(s)
and its input(s) as an algebraic equation.
4Logical Not Operator
- Also known as complement or invert operation
Not Operation is usually denoted by X or X
This is a truth table. It gives input-output
mapping by simply enumerating all possible input
combinations and the associated output.
5NOT Gate
- Also known as complement or invert gate
X
X
This is a schematic. It is a graphical
representation of a circuit which implements the
operation.
6Logical And Operation
- Denotes AND condition Output is true iff all
inputs are true
AND Operation is usually denoted by X A B X
AB
7AND Gate
A
X
B
Boolean Expressions
X A B X AB X A x B
8Logical Or Operation
- Denotes OR condition Output is true if any
inputs are true
OR Operation is usually denoted by X A B
9OR Gate
A
X
B
C
Boolean Expression
X A B C
10NAND Gate
A
X
B
Denotes Inversion
Boolean Expressions
X (A B) X (AB) X
(A x B)
____ X A B __ X AB
____ X A x B
11NOR Gate
A
X
B
C
Denotes Inversion
Boolean Expression
X A B C X (A B C)
12XOR Gate
A
X
B
Boolean Expression
X AB AB
13Alternate Gate Shapes
- Sometimes the logic of a circuit is more easily
understood if an alternative gate shape is used. - Rules 1. Change the gate shape (AND gt OR OR
gt AND). - 2. Change the bubbles (add where missing
remove if present). - Examples
A
A
AB
AND
AB
B
B
(AB) AB
14Alternate Gate Shapes Cont
A
A
AB
AB
OR
B
B
(AB) AB
A
A
(AB)
(AB)
NAND
B
B
A B (AB)
A
A
(AB)
(AB)
NOR
B
B
AB (AB)
15One Last One
X
X
INV
X
X
16Functionally Complete Gates
Any Boolean logic equation can be implemented
with a combination of AND gates NOT
gates OR gates NOT gates Some gates are
functionally complete. These gates can implement
any combinational logic equation. These gates
are NAND gates (contain both AND NOT
functions) NOR gates (contain both OR NOT
functions)
17Functionally Complete Gates - NAND
A
A
NOT
A
AB
AND
B
A
AB
B
OR
What are the NOR Gate representation for each?
18Boolean Expressions
- Boolean expressions are made up of constants and
variables combined by AND, OR and NOT operations - Examples 1 A AB CD AB A(BC) ABC
- AB is the same as AB ( is omitted when obvious
) - Parentheses are used like in regular algebra for
grouping - A literal is each instance of a variable or
constant - This expression has 4 variables and 10 literals
- abd bcd ac ad
19Boolean Expressions
- Each Boolean expression can be specified by a
truth table which lists all possible combinations
of the values of all variables in the expression.
F A B C A B C A' B C F A' B
C 0 0 0 1 0 1 0 0 1
1 0 1 0 1 0 1
0 1 0 1 1 1 1
1 1 0 0 0 0 0 1 1
0 0 0 0 1 1 1 0
1 1
Which combination is missing?
20Boolean Expressions From Truth Tables
- Each 1 in the output of a truth table specifies
one term in the corresponding boolean expression. - The expression can be read off by inspection
- A B C F
- 0 0 0 0
- 0 0 1 0
- 0 1 0 1
- 0 1 1 0
- 0 0 0
- 1 0 1 0
- 1 1 0 1
- 1 1 1 0
F is true when A is false, B is true, and C
is false OR A is true, B is true, and C is
false F ABC ABC
21Another Example
- A B C F
- 0 0 0 0
- 0 0 1 1
- 0 1 0 1
- 0 1 1 0
- 0 0 1
- 1 0 1 0
- 1 1 0 1
- 1 1 1 0
F ABC ABC ABC ABC
22Boolean Expressions
- Each Boolean expression has a corresponding
realization with logic gates. - F A B C
A
F
B
C
23Seat Belt Buzzer
- Three digital inputs
- Car on/off
- Seat belt attached/unattached
- Timer timed out/not timed out
- C 0 if car off, 1 if car on
- B 0 if unattached, 1 if attached
- T 0 if timed out, 1 if not timed out
24Seat Belt Buzzer
- Process
- Construct Truth Table
- Construct Boolean Equation
Result O CBT
25Seat Belt Buzzer Circuit
O CBT
T
O
C
B
26More Examples
- G AB ACDE ACF
- G A(B CDE CF)
- G A(B C(DE F))
- What are the circuit representations for these?
27More Examples
A
B
C
G
D
E
F
28More Examples
G
A
B
C
D
E
F
29More Examples
A
G
B
D
E
F
C
30Some Basic Boolean Theorems
From these
We can get these
31Some Basic Boolean Theorems
From these
We can get these
32Basic Boolean Algebra Theorems
- Here are the first Boolean Algebra theorems we
will study and use.
X 0 X X 1
X X 1 1 X 0
0 X X X X X
X ( X' )' X X X' 1
X X' 0
Each can easily be proved by showing it valid for
X 0 and X 1 or by using a truth table
33Other Boolean Theorems
- Commutative Law
- X Y Y X
- X Y Y X
- Associative Law
- ( X Y ) Z X ( Y Z) X Y Z
- ( X Y ) Z X ( Y Z ) X Y Z
- Distributive Law
- X(Y Z) XY XZ
- (A B)(C D) AC AD BC BD
- X (YZ) (X Y)(X Z) ? NOT like regular
Algebra - AB CD (A C)(A D)(B C)(B D) ? NOT like
regular Algebra
34DeMorgans Theorems
- It is sometimes difficult to understand a Boolean
equation that is in the form of a NAND or NOR
function. - Using DeMorgans Theorem, it is possible to
convert the equation into an AND or OR function,
which is sometimes easier to deal with. - ( X Y ) X Y ( X Y ) X Y
35General DeMorgans Conversion
- Conversion Steps
-
- 1. Change the logic symbol ( to to ).
- 2. Break the bar over the symbol that was
changed. - Examples
- Equation to convert X (A B C)
- step 1 (A B C) change logic symbol(s)
- step 2 A B C break bar over symbol
change(s) - X A B C
- Equation to convert X (A B C)
- step 1 (A B C) change logic symbol(s)
- step 2 A B C break bar over symbol
change(s) - X ABC
36Summary of Boolean Theorems
- Commutative Law X Y Y X
- X Y Y X
- Associative Law ( X Y ) Z X ( Y Z) X
Y Z - ( X Y ) Z X ( Y Z ) X Y Z
- Distributive Law X(Y Z) XY XZ
- X (YZ) (X Y)(X Z)
- (A B)(C D) AC AD BC BD
- AB CD (A C)(A D)(B C)(B D)
- Miscellaneous Laws X 0 X
X 1 X - X 1 1 X 0
0 - X X X X X X
- ( X' )' X
- X X' 1 X X' 0
- Simplification Theorems X Y X Y X ( X Y )
(X Y ) X - X X Y X X ( X Y ) X
37Canonical Boolean Forms
- Sum-Of-Products form or SOP
- Product of Sums form or POS
38Sum of Products Form
- Sometimes called MINTERM form
- Indicates 1s in truth table
- All terms are products of single variables only
(no parentheses) - Terms are ANDed together
- X A B C D E F G H Yes
- X A B C D E Yes
- X A B C ( D E ) No
39Variations of SOP Form
- Standard SOP Form
- Every term contains every variable
- F ABC ABC ABC
- Numeric SOP or Minterm Expansion Form
- Uses numbers to represent rows in truth table
where function is 1 - F(A,B,C) Sm(0, 3, 7)
40Minterm Expansion Form
- Minterm notation is a short hand way of writing
Boolean expressions - Each row can be numbered
- Call each rows AND term a minterm
What is the Boolean expression for this TT? F
ABC ABC ABC An alternate way of
expressing this is F m1 m3 m6 or F(A,B,C)
Sm(1, 3, 6)
m0 m1 m2 m3 m4 m5 m6 m7
41Product of Sums Form
- Sometimes called MAXTERM form
- Indicates 0s in truth table
- All terms are sums of single variables only
- Terms are ORed together
- X ( A B C ) ( D E ) Yes
- X ( A B )( C D )EF Yes
- X ( A B C ) ( D E ) H No
- X ( A BC ) ( D E ) No
42Variations of POS Form
- Standard POS Form
- Every term contains every variable
- F (A B C)(A B C)(A B C)
- Numeric POS or Maxterm Expansion Form
- Uses numbers to represent rows in truth table
where function is 0 - F(A,B,C) pM(0, 3, 7)
43Maxterm Expansion Form
- Maxterm notation is a short hand way of writing
Boolean expressions - Each row can be numbered
- Call each rows OR term a maxterm
What is the boolean expression for this TT? F
(ABC)(ABC)(ABC) An alternate way of
expressing this is F (M0)(M2)(M4) or F(A,B,C)
pM(1, 2, 4)
M0 M1 M2 M3 M4 M5 M6 M7
44POS vs. SOP
- Any expression can be written either way
- Can convert from one to another using theorems
- Sometimes SOP looks simpler
- AB CD ( A C )( B C )( A D )( B D )
- Sometimes POS looks simpler
- (A B)( C D) BD AD BC AC
- SOP will be most commonly used in this class but
learn both
45Algebraic Simplification
- Why simplify??
- Simplify equations -gt Less hardware to implement
-gt less cost - Example what is the Boolean expression for this
TT?
F ABC ABC ABC ABC What hardware is
used for this? 4 3-input ANDs 1 4-input
OR What is simplified expression? F BC
AB What hardware is used for this? 2 2-input
ANDs 1 2-input OR
46Algebraic Simplification
- 3 Methods used to simplify Boolean expressions
- Combine terms (X Y X Y X)
- Eliminate terms and variables (X X Y X)
- Add redundant terms (X X X)
47Applying Methods of Algebraic Simplification
- F ABC ABC ABC
- Combine terms
- ABC ABC BC(AA) XX1, X1X
BC - F BC ABC
- Add redundant terms
- BC ABC ABC XXX
- Combine terms
- ABC ABC AC(BB) XX1, X1X
- AC
- F BC AC
48Applying Methods of Algebraic Simplification
- F (ABC)(ABC)(ABC)
- Combine terms
- (ABC)(ABC) (BC)(AA) XX0,
X0X (BC) - F (BC)(ABC)
- Add redundant terms
- (BC)(ABC)(ABC) XXX
- Combine terms
- (ABC)(ABC) (AC)(BB) XX0,
X0X - (AC)
- F (BC)(AC)
49Designing Combinational Logic Circuits
- Define the problem
- Set up the truth table
- Write the Boolean equation
- Simplify the output expression
- Draw the logic diagram
50Step 1 Define the Problem
- Converting English to Boolean
- The air conditioner should be turned on if and
only if the temperature is greater than 75, the
time is between 8am and 5pm, and it is not a
holiday.
51Step 1 Define the Problem
- Identifying phrases
- The air conditioner should be turned on if and
only if the temperature is greater than 75, the
time is between 8am and 5pm, and it is not a
holiday. - F air conditioner should be turned on
- A temperature is greater than 75
- B time is between 8am and 5 pm
- C it is a holiday
52Step 1 Define the Problem
- Identifying connective words
- The air conditioner should be turned on if and
only if the temperature is greater than 75, the
time is between 8am and 5pm, and it is not a
holiday. -
- if and only if -gt
- , implied AND
53Step 1 Define the Problem
- Be careful Boolean algebra is precise, English
is not. - A B
- The roads will be very slippery if it snows or
rains and there is oil on the road. - C
- F A BC
- OR
- F (A B) C
54Step 2 - Set up the truth table
- The air conditioner should be turned on if and
only if the temperature is greater than 75, the
time is between 8am and 5pm, and it is not a
holiday. - F air conditioner should be turned on
- A temperature is greater than 75
- B time is between 8am and 5 pm
- C it is a holiday
55Step 3 Write Boolean Equation
- The air conditioner should be turned on if and
only if the temperature is greater than 75, the
time is between 8am and 5pm, and it is not a
holiday. - F air conditioner should be turned on
- A temperature is greater than 75
- B time is between 8am and 5 pm
- C it is a holiday
F A B C
56Step 4 Simplify Expression
- F A B C
- This one is already simplified.
57Step 5 Draw Logic Diagram
A
B
F
C
58New Form of Truth Table
- Alternate form of truth table
AB
CD
00
01
11
10
00
01
11
10
59K-Map Usefulness
- Easier to see all the data than truth tables.
Smaller, more compact, etc - Because of the way K-maps are constructed, a
technique can be used to actually help minimize
complex logic circuits
60Other Sized K-Maps
AB
AB
CD
00
01
11
10
C
00
01
11
10
00
0
01
1
3 Variable Karnaugh Map
11
10
A
B
0
1
4 Variable Karnaugh Map
0
1
2 Variable Karnaugh Map
61Reducing Logic Using K-Maps
AB
CD
00
01
11
10
00
01
We can write the reduced Boolean Equation
directly X ABC
11
10
62Step 1 Create K-Map
- Construct K-Map with variables along top and
left-hand edges. - Label rows and columns using Gray code.
- Place 1s in squares corresponding to 1s in the
Truth Table. 0s elsewhere.
63Step 2 For SOP Equation
- Examine map for adjacent 1s. Create loops as
large as possible (size must be a power of 2 1,
2, 4, 8, 16). - Create fewest possible number of loops.
- Form the OR of all the terms generated by each
loop
64Step 2 For POS Equation
- Examine map for adjacent 0s. Create loops as
large as possible (size must be a power of 2 1,
2, 4, 8, 16). - Create fewest possible number of loops.
- Form the AND of all the terms generated by each
loop
65Example 2
- Find the non-reduced Boolean expression
- Find the reduced equation
AB
CD
00
01
11
10
X ABCD ABCD ABCD ABCD
00
01
X ABC ABC
11
10
66Loop Size
- Here is a group of 8
- 3 variable disappear ( 23 8)
AB
CD
00
01
11
10
00
X A
01
11
10
67Edges are Adjacent
- The two outside columns are adjacent
- The top and bottom rows are also adjacent
AB
CD
00
01
11
10
00
X BD
01
11
10
68Incompletely Specified Functions
- Here is a 2 stage digital system
- We want F 1 for ABC
- ABC, and ABC, what does
- the TT look like?
Note N1 does not generate outputs A B C with
values of 101 or 111
69Incompletely Specified Functions
- Multiple ways to choose those Xs when
minimizing. Cost of minimal solution will depend
on which one chosen.
F1 ABC AC
F2 ABC AC AB
F3 BC AC
F4 A ABC A BC Let the K-Map decide!
70K-Maps with Dont Cares
AB
C
00
01
11
10
0
1
Minimum Boolean Equation
F A BC
71Summary
- Boolean Operations
- Truth tables
- Logic gates
- Alternate gate shapes
- Functionally complete gates
- Boolean expressions
- Boolean theorems
- Canonical forms (SOP POS)
- Boolean minimization
- The design process
- Karnaugh maps
72Homework
- HW 3 Chapt 3 Probs 1, 3, 12
73Next Time
- MSI Circuits
- Multiplexers
- Demultiplexers
- Encoders
- Decoders
- Comparators
- Adders
74(No Transcript)