Title: CPE/EE 422/522 Advanced Logic Design
1CPE/EE 422/522Advanced Logic Design
- Electrical and Computer EngineeringUniversity of
Alabama in Huntsville
2Motivation
- Benefits of HDL-based design
- Portability
- Technology independence
- Design cycle reduction
- Automatic synthesis and Logic optimization
- But, the gap between available chip complexity
and design productivity continues to increase
3Educators Mission
- Educate future generations of designers
- Emphasis on hierarchical IP core design
- Design systems, not components!
- Understand hardware/software co-design
- Understand and explore design tradeoffs between
complexity, performance, and power consumption
? Design a soft processor/micro-controller core
4UAH Library of Soft Cores
- Microchips PIC18 micro-controller
- Microchips PIC16 micro-controller
- Intels 8051
- ARM Integer CPU core
- FP10 Floating-point Unit
5Design Flow
Reference Manual
ASM Test Programs
VHDL Model
MPLAB IDE
Verification
?
SynthesisImplementation
6Benefits
- Proposed project-based approach encompasses the
whole engineering cycle
- Put together knowledge in digital design, HDLs,
computer architecture, programming languages - State-of-the-art devices
- Work in teams
7PIC18 Greetings
8Outline
- Review of Logic Design Fundamentals
- Combinational Logic
- Boolean Algebra and Algebraic Simplifications
- Karnaugh Maps
- Combinational-Circuit Building Blocks
9Combinational Logic
- Has no memory gtpresent state depends only on
the present input
X x1 x2... xn
Z z1 z2... zm
x1
z1
x2
z2
xn
zm
Note Positive Logic low voltage corresponds
to a logic 0, high voltage to a logic 1Negative
Logic low voltage corresponds to a logic 1,
high voltage to a logic 0
10Basic Logic Gates
11Full Adder
Module
Truth table
Algebraic expressionsF(inputs for which the
function is 1)
Minterms
m-notation
12Full Adder (contd)
Module
Truth table
Algebraic expressionsF(inputs for which the
function is 0)
Maxterms
M-notation
13Boolean Algebra
- Basic mathematics used for logic design
- Laws and theorems can be used to simplify logic
functions - Why do we want to simplify logic functions?
14Laws and Theorems of Boolean Algebra
15Laws and Theorems of Boolean Algebra
16Simplifying Logic Expressions
- Combining terms
- Use XYXYX, XXX
- Eliminating terms
- Use XXYX
- Eliminating literals
- Use XXYXY
- Adding redundant terms
- Add 0 XX
- Multiply with 1 (XX)
17Theorems to Apply to Exclusive-OR
(Commutative law)
(Associative law)
(Distributive law)
18Karnaugh Maps
- Convenient way to simplify logic functions of 3,
4, 5, (6) variables - Four-variable K-map
- each square corresponds to one of the 16
possible minterms - 1 - minterm is present 0 (or blank) minterm
is absent - X dont care
- the input can never occur, or
- the input occurs but the output is not specified
- adjacent cells differ in only one value gtcan be
combined
Location of minterms
19Sum-of-products Representation
- Function consists of a sum of prime implicants
- Prime implicant
- a group of one, two, four, eight 1s on a
maprepresents a prime implicant if it cannot be
combined with another group of 1s to eliminate a
variable - Prime implicant is essential if it contains a 1
that is not contained in any other prime
implicant
20Selection of Prime Implicants
Two minimum forms
21Procedure for min Sum of products
- 1. Choose a minterm (a 1) that has not been
covered yet - 2. Find all 1s and Xs adjacent to that minterm
- 3. If a single term covers the minterm and all
adjacent 1s and Xs, then that term is an
essential prime implicant, so select that term - 4. Repeat steps 1, 2, 3 until all essential prime
implicants have been chosen - 5. Find a minimum set of prime implicants that
cover the remaining 1s on the map. If there is
more than one such set, choose a set with a
minimum number of literals
22Products of Sums
- F(1) 0, 2, 3, 5, 6, 7, 8, 10, 11F(X) 14,
15
23Karnaugh Maps
Sum of products
Product of sums
24Five variable Karnaugh Map
- f(1) 2,3,6,7,9,13,18,19,22,23,24,25,29
BC
BC
00
01
10
11
00
01
11
10
DE
DE
1
00
00
01
01
11
11
10
10
A1
A0
25Six Variable Karnaugh Map
AB00
AB01
AB10
AB11
26Designing with NAND and NOR Gates (1)
- Implementation of NAND and NOR gates is easier
than that of AND and OR gates (e.g., CMOS)
27Designing with NAND and NOR Gates (2)
- Any logic function can be realized using only
NAND or NOR gates gt NAND/NOR is complete - NAND function is complete can be used to
generate any logical function - 1 a I (a a) a a 1
- 0 a I (a a) a I (a a) 1 1 0
- a a a a
- ab (a b) (a b) (a b) ab
- ab (a a) (b b) a b a b
28Conversion to NOR Gates
- Start with POS (Product Of Sums)
- circle 0s in K-maps
- Find network of OR and AND gates
29Conversion to NAND Gates
- Start with SOP (Sum of Products)
- circle 1s in K-maps
- Find network of OR and AND gates
30Tristate Logic and Busses
- Four kinds of tristate buffers
- B is a control input used to enable and disable
the output
31Data Transfer Using Tristate Bus
32Combinational-Circuit Building Blocks
- Multiplexers
- Decoders
- Encoders
- Code Converters
- Comparators
- Adders/Subtractors
- Multipliers
- Shifters
33Multiplexers 2-to-1 Multiplexer
- Have number of data inputs, one or more select
inputs, and one output - It passes the signal value on one of data inputs
to the output
w
s
0
w
0
0
f
s
f
w
1
1
w
1
(a) Graphical symbol
(c) Sum-of-products circuit
f
s
w
0
0
w
1
1
(b) Truth table
34Multiplexers 4-to-1 Multiplexer
s
0
s
0
s
f
s
s
1
1
0
w
0
w
00
w
0
0
0
s
0
1
w
01
w
1
0
1
f
1
w
10
w
2
1
0
2
w
w
11
3
w
1
1
1
3
f
(b) Truth table
(a) Graphic symbol
w
2
w
3
(c) Circuit
35Multiplexers Building Larger Mulitplexers
s
0
s
1
s
1
w
s
0
0
w
3
w
0
0
w
1
1
w
s
2
4
s
0
3
f
w
1
7
w
f
0
2
w
w
1
3
8
w
11
(a) 4-to-1 using 2-to-1
(b) 16-to-1 using 4-to-1
w
12
w
15
36Synthesis of Logic Functions Using Muxes
w
f
w
w
2
1
2
w
1
0
0
0
0
1
0
1
1
f
1
1
0
1
0
0
1
1
(a) Implementation using a 4-to-1 multiplexer
f
w
w
1
2
f
w
1
w
1
0
0
0
w
0
2
1
0
1
w
w
1
2
2
1
1
0
f
0
1
1
(c) Circuit
(b) Modified truth table
37Synthesis of Logic Functions Using Muxes
w
w
w
f
1
2
3
f
w
w
1
2
0
0
0
0
0
0
0
0
1
0
0
w
0
1
3
1
0
0
0
w
1
0
3
w
1
1
1
0
2
1
1
1
w
1
0
0
0
1
0
0
1
1
1
w
1
0
1
1
3
f
1
1
1
1
1
(a) Modified truth table
(b) Circuit
38Decoders n-to-2n Decoder
- Decode encoded information n inputs, 2n outputs
- If En 1, only one output is asserted at a time
- One-hot encoded output
- m-bit binary code where exactly one bit is set to
1
w
y
0
0
n
n
2
inputs
w
outputs
n
1
y
n
Enable
2
1
En
39Decoders 2-to-4 Decoder
y
w
w
y
y
y
En
0
1
0
1
2
3
w
0
0
0
1
1
0
0
0
y
0
0
1
1
0
1
0
0
w
1
1
0
1
0
0
1
0
1
1
1
0
0
0
1
y
x
x
0
0
0
0
0
1
(a) Truth table
y
2
w
y
0
0
w
y
y
1
1
3
y
2
En
y
En
3
(c) Logic circuit
(b) Graphic symbol
40Decoders 3-to-8 Using 2-to-4
w
y
w
y
0
0
0
0
y
w
w
y
1
1
1
1
y
y
2
2
w
2
y
y
En
3
3
y
w
y
En
4
0
0
y
w
y
5
1
1
y
y
2
6
y
y
En
7
3
41Decoders 4-to-16 Using 2-to-4
w
y
w
y
0
0
0
0
y
w
w
y
1
1
1
1
y
y
2
2
y
y
En
3
3
w
y
y
0
0
4
w
y
y
1
1
5
y
y
2
6
w
y
w
y
y
2
En
0
0
3
7
w
y
w
1
1
3
y
2
w
y
y
y
En
En
8
0
0
3
w
y
y
1
1
9
y
y
2
10
y
y
En
3
11
w
y
y
0
0
12
y
w
y
1
1
13
y
y
2
14
y
y
En
3
15
42Encoders
- Opposite of decoders
- Encode given information into a more compact form
- Binary encoders
- 2n inputs into n-bit code
- Exactly one of the input signals should have a
value of 1,and outputs present the binary number
that identifies which input is equal to 1 - Use reduce the number of bits (transmitting and
storing information)
w
0
y
0
n
n
2
outputs
inputs
y
n
1
w
n
2
1
43Encoders 4-to-2 Encoder
w
y
y
w
w
w
3
1
0
2
1
0
w
0
0
0
0
0
0
1
w
1
y
0
1
0
0
1
0
0
1
0
0
1
0
0
w
2
1
1
1
0
0
0
y
1
w
3
(a) Truth table
(b) Circuit
44Encoders Priority Encoders
- Each input has a priority level associated with
it - The encoder outputs indicate the active
inputthat has the highest priority
(a) Truth table for a 4-to-2 priority encoder
w
w
y
y
w
w
z
0
1
0
1
2
3
d
d
0
0
0
0
0
0
0
1
1
0
0
0
x
0
1
1
1
0
0
x
x
1
0
1
1
0
x
x
x
1
1
1
1
45Code Converters
- Convert from one type of input encoding to a
different output encoding - E. g., BCD-to-7-segment decoder
w
a
b
w
w
w
c
d
e
f
g
0
1
2
3
a
a
1
1
1
0
0
0
0
1
1
1
0
b
w
0
1
1
1
0
0
0
0
0
0
0
0
b
f
c
w
1
1
0
0
1
0
0
1
1
0
1
1
d
w
1
1
1
1
1
0
0
1
0
0
1
g
2
e
c
e
w
0
1
1
0
0
1
0
0
0
1
1
3
f
1
0
1
0
1
0
1
1
0
1
1
g
d
0
1
1
0
1
0
1
1
1
1
1
(b) 7-segment display
1
1
1
0
1
1
1
0
0
0
0
(a) Code converter
0
0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
0
1
1
(c) Truth table
46To Do
- Textbook
- Chapter 1.3, 1.4, 1.13
- Read
- Alteras MAXplus II and the UP1 Educational
boardA Users Guide, B. E. Wells, S. M. Loo - Altera University Program Design Laboratory
Package