Upload
lauren-weaver
View
213
Download
0
Embed Size (px)
Citation preview
EEE2243Digital System Design
Chapter 1: Combinational Logic Recap
by Muhazam Mustapha, January 2011
Learning Outcome
• By the end of this chapter, students are expected to refresh their knowledge on combinatorial logic related to HDL
Chapter Content
• Boolean Logic
• Representation of Boolean Function
Boolean Logic
Definition• Boolean algebra has 2 similar but different
definitions for mathematician and engineers• Mathematician: Boolean algebra is part of the
so called abstract mathematics that involves structures and lattice– Wikipedia: http://en.wikipedia.org/wiki/Boolean_algebra_(structure)
• Engineers: Boolean algebra is calculus of truth values that is used as a means to facilitate the design of logic and digital systems– Wikipedia: http://en.wikipedia.org/wiki/Boolean_algebra_(logic)
• We’ll refresh our boolean algebra / logic enough for use with HDL (Verilog)
Boolean Values• Pairs of 2 distinct values
1 0
HIGH LOW
True False
ON OFF
Boolean Operations• OR (binary operation)
– symbol: ‘+’ (plus)– gives true (1) if any of the parameters is true
• AND (binary operation)– symbol: ‘·’ (dot) – optional– gives true (1) if both parameters are true
• NOT (unary operation)– symbol: ‘‾’ (bar / overline)– gives true (1) if the parameter is false– gives false (0) if the parameter is true– also called ‘inverter’
Boolean Operations• NOR
– OR followed by NOT– A NOR B = A+B
• NAND– AND followed by NOT– A NAND B = AB
• XOR– true if either one, but not
both, is true– symbol: ‘⊕’
• XNOR– true if both parameters
are the same– XOR followed by NOT– symbol: ‘ ’⊙
Boolean Gates
AND
NAND
NOT
OR
NOR
XOR
XNOR
Basic Truth Table
A B AB
0 0 0
0 1 0
1 0 0
1 1 1
A B A+B
0 0 0
0 1 1
1 0 1
1 1 1
A B AB
0 0 1
0 1 1
1 0 1
1 1 0
A B A+B
0 0 1
0 1 0
1 0 0
1 1 0
A B
0 0 0
0 1 1
1 0 1
1 1 0
A B
0 0 1
0 1 0
1 0 0
1 1 1
A A
0 1
1 0
AND
NAND
NOT
OR
NOR
XOR
XNOR
BA
BA
General Truth Table
A B C AC B F
0 0 0 0 1 1
0 0 1 0 1 1
0 1 0 0 0 0
0 1 1 0 0 0
1 0 0 0 1 1
1 0 1 1 1 1
1 1 0 0 0 0
1 1 1 1 0 1
• Example of step by step construction of truth table of function:
BACCBAf ),,(
DeMorgan’s Theorem• Used to split groups of large inversion
BABA BAAB
A B A B AB A+B A+B
0 0 1 1 1 0 1
0 1 1 0 0 1 0
1 0 0 1 0 1 0
1 1 0 0 0 1 0
A B A B A+B AB AB
0 0 1 1 1 0 1
0 1 1 0 1 0 1
1 0 0 1 1 0 1
1 1 0 0 0 1 0
DeMorgan’s Theorem• Reflections of DeMorgan’s Theorem on logic
gates
NAND
NOR
BA
BAAB
BA
AB
AB
Negative OR
AB
Negative AND
AB
Representation of Boolean Function
Boolean Function Representation• There are 3 ways of representing boolean
functions that are convenient for HDL:– Truth Table– Minterm (Maxterm is less useful for HDL)– AOI (AND-OR-INVERTER) Gate Tree
(OAI (OR-AND-INVERTER) Gate Tree is less popular)
Boolean Function Representation
A B C F
0 0 0 1
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
Truth Table
ABCCBACBACBACBAF
Sum of Product (SOP)
7)m(0,1,4,5,F
Boolean Function Representation
ABCCBACBACBACBAF
A B C F
Sum of Product Gate Tree in FPGA
× × × ×
× × ×
× × ×
× × ×
×××
×
×
×
×
Boolean Function Representation
A B C F
0 0 0 1
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
Truth Table
C)BA)(CBC)(AB(AF
Product of Sum (POS)
M(2,3,6)F
POS is not so useful for HDL as most of FPGA (programmable logic) hardware are build with SOP structure
Simplification• In introductory courses of digital electronics we
spent so much on boolean function simplification
• Thank God! In intermediate digital electronics we don’t have to do that for FPGA programming
• This is due to the fact that FPGA structure is made of minterms
• This means we are not going to cover function simplification