Title: Yawgeng Chau
1Logic Circuit Design
2Contents
- Binary Systems
- Boolean Algebra and Logic Gates
- Gate-Level Minimization
- Combinational Logic
- Synchronous Sequential Logic
- Registers and Counters
- Memory and Programmable Logic
35.1 Sequential Circuits
- Sequential circuits consist of
- Input, logic gates, output, storage elements
- State of storage elements is a function of past
input - Output depends on current and past inputs.
- State binary information stored in memory
- Sequential circuit is specified by
- A time sequence of inputs, outputs, and internal
states.
45.2 Synchronous vs. Asynchronous
- Synchronous Sequential Circuit
- Function according to its inputs and states at
discrete instants of time. - Asynchronous Sequential Circuit (Ch. 9)
- Function according to its inputs and states at
discrete instants of time and the input changing
order. - May become unstable due to feedback.
5Synchronous Clocked Sequential Circuit
- Use clock generator to generate a periodic train
of clock pulses. - Storage elements are activated when a clock pulse
arrives. - States can change during pulse transition.
6Flip-Flops as storage elements
- Flip-flop binary storage device to store 1bit.
75.3 SR Latch with NOR Gates
- S or R must go back to 0 before further changes
to avoid undefined states. - 1 should not on S and R at the same time.
R1 Reset State
Forbidden
8SR Latch with NAND Gates
- S or R must go back to 1 before further changes
to avoid undefined states. - 0 shouldn't go on S and R at the same time.
S0 Set State
Forbidden
9SR Latch with Control Input
- Enable signal is used to determines when the
state of the latch can be changed.
En1 enable En0 disable
10D Latch
- To ensure that S and R never equal to 1 at the
same time. - Transparent latch temporary bit storage
11Graphic Symbols
SR Latch with NAND gates
NOR gates
12Latch Problem from Feedback (1/2)
Unpredictable results if En1 with changing D
13Latch Problem from Feedback (2/2)
- Latch state changes once the clock pulse changes
to 1. - New latch state appears at the output while the
pulse is active. - The output works on the latch input through
combinational feedback. - If inputs change while the clock pulse is in 1,
the latch will respond and result in new outputs.
145.4 Flip-Flops (1/2)
- Flip-Flop (FF) a memory element changes at the
edge of clock only - If level-triggered flip-flops are used
- The feedback path may cause instability problem
- Edge-triggered flip-flops
- The state transition happens only at the edge
- Eliminate the multiple-transition problem
15Flip-Flops (2/2)
- Trigger Change in control input.
- Triggered only during a signal transition.
Level trigger
Positive trigger or rising-edge trigger
Negative trigger or falling-edge trigger
16D Flip-Flops
Q(t1)D
- Work as D-latch, but edge-trigger
Characteristic Table
Fig. 5.11 Graphic symbols for edge-triggered D
flip-flop
17Master-Slave D Flip-Flop (1/2)
Slave Q doesnt change
Master D?Y
Y doesnt change
Y?Q
18Master-Slave D Flip-Flop (2/2)
- How to make it be a positive-edge triggered
flip-flop?
19D-Type Positive-Edge Triggered Flip-Flop
- Initially, CLK0, S1,R1 Q(t1)Q(t)
- When CLK?1 as D0, R?0, Q0
- If D changes to 1
- when CLK1, R0
because Q0 - When CLK?1
- as D1, S?0, Q1
- If D changes to 0
- when CLK1, S0.
20Time Parameters
- Setup Time minimum time such that D must be
maintained at a constant value before clock
transition. - Hold Time minimum time such that D does not
change after the positive clock transition. - Propagation Delay Time time from trigger edge to
the time of a stable output.
21JK Flip-Flop
Q(t1) D JQ(t)' K'Q(t)
22T Flip-Flop
T0, DQ(t) , Q(t1)Q(t) T1, DQ'(t) ,
Q(t1)Q'(t)
T0, JK0, Q(t1)Q(t) T1, JK1, Q(t1)Q'(t)
Q(t1)T?Q(t)
23Characteristic Tables
24Characteristic Equations
K 0 1
J 0 1
Q(t) 0
1 Q'(t)
Q(t1)J'K'QJK'JKQ'J'K'QJK'QJK'Q'JKQ'
K'QJQ'
25Preset Clear (Reset)
R0 clear R1 undo
1 1
265.5 Analysis
- Given a sequential circuit, we try to guess what
it is. - Step 1 write the excitation equations or the
state equations - Step 2 draw the state table
- Step 3 draw the state diagram
- Step 4 guess
- All red keywords have the same meaning.
27Flip-Flop Input/Output Equations
flip-flop input
DA
flip-flop name
Step 1 (way 1) Compute input equation (or
called excitation equation) output equation
28Next-State Derivation
- Step 1 (Way1) determine input equations (or
excitation equations) using present states and
input variables. - Step 2 list all binary combination of
inputs/state. Use characteristic table to
determine next state values and create the state
table.
29State Equations
A
DAAxBx
x
Step 1 (way 2)
x
excitation or input equation
B
DA A x B x DB A' x
output equation
y (AB)x'
A'
DBA'x
characteristic equation
x
Q(t1)D
state equation
A(t1) DA A x B x B(t1) DB A' x
B
yx'(AB)
A
x'
x
30State Table (1/2)
Step 2 Draw the state table
(form 1)
(1) excitation equ.
- DA Ax Box
- DB A'x
- y (AB)x'
DADB A B
00 01 00 11 00 10 00 10
00 01 00 11 00 10 00 10
(2) state equ.
A(t1) Ax Bx B(t1) A'x y(t) (AB)x'
31State Table (2/2)
Step 2 Draw the state table
(form 2)
32State Diagram
Step 3 Draw the state diagram
AB
State
Mealy Machine
33Example of D Flip-Flop
Step 1 excitation equation or state equation
DAA?x?y
x?y
Step 2 state table
Step3 state diagram
34Example of JK Flip-Flop (1/3)
Step 1 excitation equation
JA B KABx' JB x' KBA?x
JAB
x'
KABx'
B
JBx'
A
KBA?x
x
35Example of JK Flip-Flop (2/3)
Step 2 state table
JA B KABx' JB x' KBA?x
36State Equations Derived with Characteristic
Equations and Input Equations
characteristic equation
Q(t1) D JQ(t)' K'Q(t)
?
State equations
JAB
A (t1) JAA' KA'A BA' (Bx')'A A'B
AB' Ax
KABx'
JBx'
B (t1) JBB' KB'B x'B' (A?x)'B B'x'
ABx A'Bx'
KBA?x
37Example of JK Flip-Flop (3/3)
Step3 state diagram
38Example of T Flip-Flop (1/3)
x
TABx
yAB
B
Step 1 characteristic equation
input/output equation
TBx
state equation
39Example of T Flip-Flop (2/3)
Step 2 state table
TA Bx TB x y AB
TATB A B
00 01 01 10 10 11 11 00
40Example of T Flip-Flop (3/3)
Step 3 state diagram
Input
AB / y
State/output
Moore Machine
41Mealy FSM (Finite State Machine)
- Output is a function of input and present state.
- For synchronized output, inputs are synchronized
with the clock. - Outputs must be sampled during the clock edge.
yx'(AB)
42Moore FSM
x
TABx
yAB
B
- Output is a function of present state only.
- Outputs are synchronized with the clock.
TBx
435.7 State Reduction
- To reduce the flip-flop number.
- May require more combinational gates.
Design a ciruit Step 1 Draw the state diagram
but find the graph is complex
44Example (1/5)
- state a a b c d e f f g f g a
- input 0 1 0 1 0 1 1 0 1 0 0
- output 0 0 0 0 0 1 1 0 1 0 0
45Example (2/5)
Step 2 Draw the state table
46Example (3/5)
- States g and e are equivalent.
g is replaced by e.
Step 2 Find two equivalent states,
replace one with another,
redraw the
state table
47Example (4/5)
- States f and d are equivalent.
f is replaced by d.
Step 3 Repeat Step 2 until you can not find any
more
48Example (5/5)
Step 4 Redraw the state diagram
49State Assignment
Step 5 State assignment Redraw the state table
?
505.8 Simplified Design Procedure
- Step 1 Derive a state diagram from operation
specifications. - Step 2 Obtain the state table by finding the
input values of flip-flops. - Step 3 Derive input equations and output
equations. - Step 4 Draw the sequential circuit
51Example 111 sequence detector
- Detect the occurrence of three or more
consecutive 1s. - S0 more than one 0 appear.
- S1 one 1 appears.
- S2 two 1s appear.
- S3 three 1s appears.
S0?00 S1?01 S2?10 S3?11
Step 1 Draw the state diagram
52Synthesis with D Flip-Flop (1/3)
Step 2 Draw the state table by finding the input
values of D-FFs
- Use two D flip-flops to represent 4 states.
- State (A,B)
- input x, output y
Step 3 Derive input equation output equation
DA(A,B,x)A(t1) ?(3,5,7) DB(A,B,x)B(t1)
?(1,5,7)
y(A,B,x) ?(5,7)
53Synthesis with D Flip-Flop (2/3)
Step 3 Simplify input equation output equation
54Synthesis with D Flip-Flop (3/3)
Step4 Draw sequential cricuit
55Synthesis with JK Flip-Flop (1/3)
Given the half state table
Step 1 skips
Step 2 to find the input values of JK-FFs
56Excitation Table for JK Flip-Flops
- The table lists required inputs for a state
change. Obtained from the characteristic table.
Dont Care
57Synthesis with JK Flip-Flop (2/3)
Step 3 Derive input equation output equation
58Synthesis with JK Flip-Flop (3/3)
Step 4 Draw sequential circuit
59Synthesis with T Flip-Flop (1/4)
- Example 3-Bit Binary Counter
- Input clock
- Output next state
Step 1 Draw the state diagram
60Synthesis with T Flip-Flop (2/4)
- A2, A1, A0 Three flip-flop outputs.
Step 2 Draw the state table
61Excitation Table for T Flip-Flops
- The table lists required inputs for a state
change. Obtained from the characteristic table.
62Synthesis with T Flip-Flop (3/4)
Step 3 Derive input equation output equation
63Synthesis with T Flip-Flop (4/4)
Step 4 Draw sequential circuit
64Design Procedure
- Derive a state diagram from operation
specifications. - Reduce state numbers.
- Assign binary codes to states.
- Obtain the state table.
- Choose the flip-flop type.
- Derive input equations and output equations.
- Draw the sequential circuit.
65Synthesis Procedure
- Step 1 is completed by designers.
- Steps 2 and 3 are seldom used.
- Step 4 to step 7 can be implemented using HDL and
automatic synthesis tools (Electronic Design
Automation (EDA) tools). - To obtain synthesis netlist.
66Home Works
- Read Section 5-5
- Problems 5-2, 5-4, 5-6, 5-7, 5-8, 5-10, 5-12,
5-16, 5-19