Professional Documents
Culture Documents
DIGITAL IC DESIGN
USING HDL
CHAPTER 8:
SEQUENTIAL CIRCUIT
DESIGN: PRINCIPLE
d q d q clk q*
c q*
c clk 0 q
0 q
1 q
1 d
d
(a) D latch (b) Possitive edge trigger D FF
reset clk q*
d q clk q* d q 1 - 0
clk 0 q clk 0 0 q
1 q
0 1 q
d reset
0 d
(b) Negative edge trigger D FF (d) D FF with asynchronous reset
NGUYEN THANH NGHIA 8
Chapter 8: Sequential circuit design: principle
1. Overview of sequential circuits
3. SYNCHRONOUS VERSUS ASYNCHRONOUS CIRCUITS
Positiwe-edge-triggered D FF.
The function table of a positive-edgetriggered
D FF was shown in Figure 8.1(b).
The corresponding VHDL code is shown in
Listing 8.3.
This is a standard description and should be
recognized by all synthesis software.
A predesigned D FF should be inferred
accordingly.
NGUYEN THANH NGHIA 39
Chapter 8: Sequential circuit design: principle
4. Inference of basic memory elements
2. D FF
library IEEE; use IEEE.STD_LOGIC_1164.ALL;
entity DFF is
Port ( c: in STD_LOGIC;
d: in STD_LOGIC;
q: out STD_LOGIC);
end DFF;
architecture dff_arch of DFF is
begin
process(clk)
begin
if clk'event AND clk = '1' then q <= d;
end if;
end process;
end dff_arch;
r_next(2)
r_next(3)
r_next(1)
r_next(0)
r_reg(2)
r_reg(3)
r_reg(0)
r_reg(1)
d d q d q d q d q q
clk clk clk clk
A sequential
input pattern next pattern
counter circulates a
predefined sequence 000 011
of states. 011 110
110 101
The next-state
101 111
logic determines the
111 000
patterns in the
sequence.
NGUYEN THANH NGHIA 55
Chapter 8: Sequential circuit design: principle
5. Simple design examples
3. ARBITARY-SEQUENCE COUNTER
entity arbi_seq_counter is
Port ( clk, reset : in STD_LOGIC;
q : out STD_LOGIC_VECTOR (2 downto 0));
end arbi_seq_counter;
clk
Max_pulse
entity binary_counter4_pulse is
Port ( clk, reset : in STD_LOGIC;
max_pulse: out STD_LOGIC;
q : out STD_LOGIC_VECTOR (2 downto 0));
end binary_counter4_pulse;
q_reg
+1 r_next d q q
clk
1 T Max_pulse
clk reset
reset 0 F
=1111
4
reset q
clk
load
en
entity binary_counter4_feature is
Port ( clk, reset: in STD_LOGIC;
syn_clr, en, load: in STD_LOGIC;
d: in STD_LOGIC_VECTOR (3 downto 0);
q : out STD_LOGIC_VECTOR (3 downto 0));
end binary_counter4_feature;
entity mod10_counter is
Port ( clk, reset: in STD_LOGIC;
q : out STD_LOGIC_VECTOR (3 downto 0));
end mod10_counter;
architecture two_seg_arch of mod10_counter is
constant TEN: integer := 10;
signal r_reg, r_next: unsigned(3 downto 0);
0 T q_reg
r_next d q q
+1 F clk
reset
=9
clk
reset
Conceptual diagram
0 T q_reg
r_next d q q
+1 F clk
reset
m =
-1
clk
reset
+1 0 T q_reg
r_next d q q
r_inc F clk
reset
m =
clk
reset
At time t0,
the clock
changes from
‘0’ to ‘1’.
In the timing
diagram, the
state_next signal
changes at t2, which
is t1 + Tnext(min),
and becomes
stabilized at t3,
which is t1 +
Tnext(max).
NGUYEN THANH NGHIA 89
Chapter 8: Sequential circuit design: principle
6. Timing analysis of a synchronous sequential circuit
2. SETUP TIME VIOLATION AND MAXIMAL CLOCK RATE
At time t5, a
new rising clock
edge arrives and
the current
clock cycle ends.
Now let us
examine the
impact of the
setup time
constraint.
t3<t4
NGUYEN THANH NGHIA 92
Chapter 8: Sequential circuit design: principle
6. Timing analysis of a synchronous sequential circuit
2. SETUP TIME VIOLATION AND MAXIMAL CLOCK RATE
t3 = t0+Tcq+Tnext(max)
Tc = Tcq+Tnext(max) + Tsetup
NGUYEN THANH NGHIA 96
Chapter 8: Sequential circuit design: principle
6. Timing analysis of a synchronous sequential circuit
2. SETUP TIME VIOLATION AND MAXIMAL CLOCK RATE
q_reg
+1 r_next d q q
clk
1 T Max_pulse
clk reset
reset 0 F
=1111
The end!