Académique Documents
Professionnel Documents
Culture Documents
UNIVERSITY
Objectives
After completing this lecture, you will be able to: Describe how to model counters (ripple/synchronous counters and modulo r counters) Describe how to model sequence generators Describe how to model timing generators
FALL 2011
S.Sivanantham
Counters
Counter is a device that counts the input events such as input pulses l or clock l k pulses. l Types of counters: Asynchronous Synchronous Asynchronous y (ripple) ( pp ) counters: Binary counter (up/down counters) Synchronous counters: Binary counter (up/down counters) BCD counter (up/down counters) Gray counters (up/down counters)
ECE301 VLSI System Design FALL 2011 S.Sivanantham
CK K Q' 1
CK K Q' 2
CK K Q' 3
FALL 2011
S.Sivanantham
FALL 2011
S.Sivanantham
FALL 2011
S.Sivanantham
Q: What is the difference between using {cout, qout} <= qout + 1 and qout <= qout + 1 and assign cout = &qout?
ECE301 VLSI System Design FALL 2011 S.Sivanantham
FALL 2011
S.Sivanantham
FALL 2011
S.Sivanantham
Sequence Generators
In this lecture, we focus on the following three circuits: PR (pseudo random)-sequence generator Ring counter Johnson J h counter t
f Qn-1 D Q D Q CK Q' n-1 clk CK Q' n-2 Combinational Circuit Qn-2
Dn-1
Q1 D Q D Q CK Q' 1 CK Q' 0
Q0 z
Primitive Polynomials
n 1, 2, 3, 4, 6, 7, 15, 22, 60 5, 11, 21, 29 10 17 10, 17, 20 20, 25 25, 28, 31, 41, 52 9 23, 47 18 8 12 13 14, 16 19, 27 f( x ) 1+x+xn 1+x2+xn 1+x3+xn 1+x4+xn 1+x5+xn 1+x7+xn 1+x2+x3+x4+xn 1+x+x4+x6+xn 1+x+x3+x4+xn 1 1+x3+x4+x5+xn 1+x+x2+x5+xn
n
n 24 26 30 32 33 34 35 36 37 38 39 40 42
f( x ) 1+x+x2+x7+xn 1+x+x2+x6+xn 1+x+x2+x23+xn 1+x+x2+x22+xn 1+x13+xn 1+x+x14+x15+xn 1+x2+xn 1+x11+xn 1+x2+x10+x12+xn 1+x+x5+x6+xn 1+x4+xn 1 1+x2+x19+x21+xn 1+x+x22+x23+xn
f( x ) 1+x+x5+x6+xn 1+x+x26+x27+xn 1+x+x3+x4+xn 1+x+x20+x21+xn 1+x+x27+x28+xn 1+x9+xn 1+x+x15+x16+xn 1+x+x36+x37+xn 1+x24+xn 1+x+x21+x22+xn 1+x7+xn 1 1+x19+xn
f ( x) = ai x i = a0 + a1 x + a2 x 2 + K + an x n
i =0 ECE301 VLSI System Design FALL 2011 S.Sivanantham
CK n-1 Q'
CK n-2 Q'
CK 1 Q'
CK 0 Q'
D a0 clk
Q a1
Q a2
Q an-1
Q an
CK n-1 Q'
CK n-2 Q'
CK 1 Q'
CK 0 Q'
FALL 2011
S.Sivanantham
d[3]
clk start
Using start to set the initial to 1000, the circuit will start from state 4b1000 after reset signal is applied.
FALL 2011
S.Sivanantham
Using start to set the initial value to 4b1000, hence simulators can calculate qout and hence we could observe the qout q q values. Of course, the circuit will start from state 4b1000 after reset signal is applied.
ECE301 VLSI System Design FALL 2011 S.Sivanantham
Ring Counters
qout[0] qout[1] qout[2] qout[3] d[0] D Q CK Q' preset clk start d[1] D Q CK Q' clear d[2] D Q CK Q' clear d[3] D Q CK Q' clear
// a ring counter with initial value module ring_counter(clk, ring counter(clk start, start qout); parameter N = 4; input clk, start; output reg [0:N-1] qout; // the body of ring counter always @(posedge clk or posedge start) if (start) qout <= {1'b1,{N-1{1'b0}}}; else qout <= {qout[N {qout[N-1], 1], qout[0:N-2]}; qout[0:N 2]}; endmodule
ECE301 VLSI System Design FALL 2011 S.Sivanantham
Johnson Counters
qout[0] qout[1] qout[2] qout[3] d[0] d[1] d[2] D Q CK Q' clear d[3]
D Q CK Q' clear
D Q CK Q' clear
D Q CK Q' clear
clk start
// Johnson counter with initial value module ring_counter(clk, ring counter(clk start, start qout); parameter N = 4; // define the default size input clk, start; output reg [0:N-1] qout; // the body of Johnson counter always @(posedge clk or posedge start) if (start) qout <= {N{1'b0}}; else qout <= { {~qout[N-1], qout[N 1], qout[0:N-2]}; qout[0:N 2]}; endmodule
ECE301 VLSI System Design FALL 2011 S.Sivanantham
Timing Generators
A timing generator is a device that generates timings required i d for f specific ifi application. li i Multiphase clock signals: Ring counter Binary counter with decoder Digital g monostable circuits: Retriggerable Nonretriggerable
FALL 2011
S.Sivanantham
// a ring counter with initial value serve as a timing generator module ring_counter_timing_generator(clk, ring counter timing generator(clk, reset, qout); parameter n = 4; // define the counter size input clk, reset; output reg [0:n-1] qout; // the th body b d of f ring i counter t always @(posedge clk or posedge reset) if (reset) qout <= {1'b1,{n-1{1'b0}}}; qout <= {q q {qout[n-1], [ ], q qout[0:n-2]}; [ ]}; else endmodule
ECE301 VLSI System Design FALL 2011 S.Sivanantham
3-to-8 decoder A2 A1 A0
Synthesized output from SynplifyPro with n = 4 and m =2. (Program is listed on the next page.)
clk
[1:0]
CP
CK
Q2
Q1
Q0
Binary counter
enable reset
[1:0]
[1:0]
D[1:0] R
Q[1:0]
[1:0] [1:0]
decode
D[1:0] EQ[3:0]
[3:0] [3:0]
qout[3:0]
b t bcnt_out_5[1:0] t 5[1 0]
qout[3:0] bcnt_out[1:0]
FALL 2011
S.Sivanantham
FALL 2011
S.Sivanantham