Frequency Divider Circuits Overview
Frequency Divider Circuits Overview
15-1
Section 15.1 A Divide by 2 Frequency Divider
D D Q Q
CLK Q Qb
CLK
We shall use the D-Flip Flop introduced in Chapter 14. The divide by 2
frequency divider circuit diagram is now shown in Fig. 15.1-2
R1
VDD 10n
M2_p1
tsp1 M2_p2 Qb Q
M2_n2
15-2
Experiment 15.1-1 A Divide by 2 Frequency Divider: Experiment
In this experiment, we used the circuit shown in Fig. 15.1-2. The program is in
Table 15.1-1 and the result is in Fig. 15.1-3. As indicated in Table 15.1-1, we set
Q to be high initially.
R1 Qb D 10n
15-3
CLK
N2
N3
Qb
From Fig. 15.1-3, we can see that the output signal is not correct. We first
analyze the initial conditions of the circuit which is shown in Fig. 15.1-4
R1
VDD 10n
M2_p1
tsp1 M2_p2 Qb Q
1 0
CLK M1_p2 CLK M3_n1
D 0 CLK N3 M4_n1
0 1 0
1 N2
0 M2_n1 tsp4
M1_n1
M3_n2
tsp3
M2_n2
15-4
CLK
N2
N3
Qb
Consider Inverter 3. As the clock rises slightly, the following events happen:
From the above discussion, we can see that Q oscillates. This is called the
racing phenomenon. We can see that this is caused by the slow rising of the clock.
If the clock rises sharply, Q will fall sharply and this is ideal because for a
frequency divider, we like the output to change state when and only when the clock
rises.
To solve the racing problem, we may connect two inverters to the output of the
clock so that the rise and fall times are both rather short as shown in Fig. 15.1-6.
The circuit diagram is shown in Fig. 15.1-7.
15-5
R1
10n
Qb Q
D Q
CLK_in 2 1 2 1 CLK
CLK Q
NOT NOT
DFF
Fig. 15.1-6 The divide by 2 frequency divider with
two inverters added after the clock
R1
VDD 10n
M2_p1
tsp1 M2_p2 Qb Q
M2_n2
VDD VDD
Mc_p1 Mc_p2
Mc_n1 Mc_n2
Fig. [Link] divide by 2 frequency divider with two inverters added after the clock
In this experiment, the circuit is as show in Fig. 15.1-7. The program in Table
15.1-2 and the result is in Fig. 15.1-8 which is correct.
15-6
.options nomod post
R1 Qb D 10n
15-7
CLK
N2
N3
Q_bar
Although the circuit works as a divide by 2 frequency divider, we still should pay
attention to the time around t 11s when the clock rises for the second time.
Note that in Fig. 15.1-5, at this moment, the clock is high while N2 is low.
Theoretically, N3 should be floating and thus should remain to be high. Yet, it
becomes low. To investigate this we enlarge the figure around t 11s as shown
in Fig. 15.1-9.
15-8
Fig. 15.1-9 Fig. 15.1-5 enlarged around t 11s
From Fig. 15.1-9, we can see that the clock rises rather quickly to 1.2V which is
high enough for the PMOS M2-p1. N2 is high at this moment. Thus both clock
and N2 are high. Stage 2 acts like an inverter and N3 therefore starts to drop. This
in turn causes Q to drop sharply which is ideal.
The reader is hereby encouraged to compare Fig. 15.1-9 and Fig. 15.1-5. In Fig.
15.1-5, we can see that the clock signal rises, but too slowly. Q does drop, but
rather slowly. This causes the racing which must be avoided.
15-9
Section 15.2 Divide by 3 by Counting, Synchronous
Divide-by-3 Up Counter
In this sction, we shall introduce a divide by 3 frequency divider. This is a
synchronous divider as a clock signal is sent to two D-flip flops In addition to two
flip flops, there is a NOR gate. The circuit diagram is shown in Fig. 15.2-1 and an
illustration of its performance is in Fig. 15.2-2. It can be shown that this circuit is a
divide by3 frequency divider.
2
1 Q_A Q_B
3 NOR D Q D Q
CLK Q CLK Q
DFF_A DFF_B
CLK
Fig. 15.2--1 Synchronous Divide-by-3 Up Counter
CLK
DA
QA 0 1 0 0 1 0 0 1
QbA
QB 0 0 1 0 0 1 0 0
QbB
Count
0 1 2 0 1 2 0 1
Fig. 15.2-2 The performance of the circuit in Fig. 15.2-1
(1) Initially, CLK, QA and QB are all assumed to be 0 to start with. Therefore DA is
1..
(2) At [Link] first time CLK goes up. QA changes state to become 1 because DA
was 1 before. QB remains to be 0 because QA was 0 before. DA remains to be 0
15-10
because QA, one of the input signal to the NOR gate, is 1.
(3) At t2, the second time the clock goes up, QA becomes 0 because DA was 0 before
and QB becomes 1 because QA was 1 before. Therefore DA remains to be 0 because
QB ,one of the input signal to the NOR gate, is 1.
(4) At t3, the third time the clock goes up, QA remains to be 0 and QB changes to
become 0. Since both QA and QB are 0, DA becomes 1.
(5) At t4, the fourth time the clock goes up, QA changes to 1 because DA was1before
and QB remains to be 0 because . QA was 0 before. DA becomes 0 because . QA one
of the input signal to the NOR gate, is 1
(6) At t5, the fifth time the clock goes up, both QA and QB change states. QB rises to
become 1.
As one can see, the output of the circuit, namely QB remains to be in the same
state from t3 to t5. From t2 to t5, the input clock has four periods. But the output QB
has only three periods. Thus the circuit is a divide by 3 frequency divider.. We
admit that for the entire cycle consisting three periods, the high period time duration
is not equal to the low period duration. This is admissible for most applications.
Let us now try to explain why this is a divide by 3 frequency divider. The key
point is that QB is 0 from t3 to t4 and continues to be 0 from t4 to t5. If it is not so,
this circuit will not be a divide by 3 divider.. In the following, we shall explain why
QB continues to be 0 from t4 to t5.
(3) DA is 0 from t2 to t3 because QB, an input to the NOR gate, is 1 from t2 to t3.
From the above discussion, we can see that the NOR gate plays a critical role in
the divide by 3 frequency divider.
15-11
VDD
M2_p1
tsp1 M2_p2 Qb Q
M2_n2
VDD
no_A Mo_p1
no_1
no_B Mo_p2
no_out
15-12
NOR Gate
Da Qa Db Qb
CLK CLK
VDD
VDD
VDD VDD VDD
M2_p1
Q_A
Mo_p1
M1_p1 tsp2 M3_p1 M4_p1
no_1
Q_B tsp1 M2_p2 Qb_A Q_A
Mo_p2
CLK M1_p2 CLK N3 CLK M3_n1 M4_n1
D_A
N2 M2_n1 tsp4
Mo_n1 Mo_n2
M1_n1 tsp3 M3_n2
M2_n2
VDD
M2_n2
Mc_p1 Mc_p2
Mc_n1 Mc_n2
15-13
.PROTECT
.lib "C:\mm0355v.l" TT
.UNPROTECT
.options nomod post
.global vdd vss
.param clk_freq = 1e6
*NOR
.subckt NOR no_a no_b no_out
Mo_p1 no_1 no_a vdd vdd pch W=3u L=0.35u
Mo_p2 no_out no_b no_1 vdd pch W=3u L=0.35u
Mo_n1 no_out no_a vss vss nch W=1u L=0.35u
Mo_n2 no_out no_b vss vss nch W=1u L=0.35u
.ends NOR
'0.4875/clk_freq' '1/clk_freq')
15-14
.tran '1/(10000*clk_freq)' '(9/clk_freq)'
.END
CLK
D_A
Q_A 0 1 0 0 1 0 0 1 0
Q_B 0 0 1 0 0 1 0 0 1
15-15
Section 15.3 Synchronous Divide by 4 Johnson Counter
Frequency Divider
In this section, we shall introduce a synchronous divide 4 frequency divider It is
said to be synchronous because the clock signal is fed to both D Flip-Flops as shown
in Fig. 15.3-1. This is based upon the Johnson Counter.
F_out
D Q D Q
CLK Q CLK Q
DFF_A DFF_B
CLK
Fig. 15.3-1 Synchronous Divide by 4 Johnson Counter
This means that the output of D Flip-Flop A follows the inverse of the D
Flip-Flop B. We now explain why the circuit is a divide by 4 frequency divider.
(1) Assume that initially, Clock, QA and QB are all 0 to start with. This means that
DA QB 1 initially.
(2) When the Clock goes up for the first time, QA will become 1 because QA follows
DA and DA QB 1 previously.
(4) When the Clock goes up for the second time, QA will remain to be 1 because it
follows DA QB and DA QB is not changed.. Since QB follows DB QA , QB
becomes 1 and QB becomes 0.
(5) When the Clock goes up for the third time, QA will drop to be 0 because it
follows DA QB and QB 0 previously.. QB will remain to 1 as it follows
DB QA and QA was 1 previously.
15-16
CLK
D_A
Q_A
Q_B
The circuit of the experiment is shown in Fig. 15.3-3. The program is in Table
15.3-1 and the result is in Fig. 15.3-3.
15-17
VDD
M2_n2
VDD
M2_n2
Mc_p1 Mc_p2
Mc_n1 Mc_n2
15-18
M1_n1 N2 D VSS VSS NCH W=1u L=0.35u
'0.4875/clk_freq' '1/clk_freq')
CLK
Q_A
Q_B
15-19
Section 15.4 Asynchronous Divide-by-4 Frequency Divider
F_out
D Q D Q
CLK
CLK Q CLK Q
DFF_A DFF_B
Fig. 15.4-1 Asynchronous divide-by-4 frequency divider
Experiment 15.4-1
VDD
M2_n2
Mc_p1 Mc_p2
M2_n2
15-20
.OPTION POST
.PROTECT
.lib "C:\mm0355v.l" TT
.UNPROTECT
.options nomod post
.global vdd vss
.param clk_freq = 1e6
'0.4875/clk_freq' '1/clk_freq')
15-21
CLK
Q_A
Q_B
15-22
Section 15.5 A New Single Clock D-Flip Flop
The new single clock D Flip-Flop is now shown in Fig. 15.5-1. As can be seen, the
new circuit employs only three. instead of four, transistors in the second stage. The
top and bottom transistors are all controlled by the clock signal and the middle
transistor is controlled by the N2 signal coming out of Stage 1.
tsp1 N3 Qb
tsp2 tsp3
Since the new and old single clock D Flip-Flops are different only on the second
stage, we now display the second stages of the two circuits in Fig. 15.5-2
VDD
VDD
M2 _ p 1
M2 _ p 2
N3
CLK N3
N2 M2_n1 N2
M2 _ n 1
tsp2
tsp3
CLK M2_n2
M2 _ n 2
New Old
Fig. 15.5-2 The second stages of the new and old D Flip-Flops
Case 1: Clock is high. In this case, the top transistor is cut off and the bottom
15-23
transistor can be conducting..
Case 1a: N2 is high. In this case, the inputs of the two NMOS transistors are
both high and therefore the output N3 is low.
Case 1b: N2 is low. In this case, the middle transistor is cutoff. Since both the
top and bottom transistors are cutoff, the output N3 is floating.
Case 2: Clock is low. In this case, the top transistor is on and the output N3 is
therefore high.
Table 15.5-1 The performances of the second stages of the new and old circuits
N2 CLK N3 N2 CLK N3
1 1 0 1 1 0
0 1 floating 0 1 floating
1 0 1 1 0 floating
0 0 1 0 0 1
If we compare the performances of these two stages, we notice that there is only
difference. It occurs when N2 is high and the clock is low. For this case, N3 will
be high for the new circuit while it is floating for the old circuit.
If N3 is high, M3-p1 will be cutoff. If the clock has not fallen to zero, both
M3-n1 and M3-n2 are open. Thus Qb will not be floating as shown in Fig. 15.5-3
It will become low which is not desirable.
tsp1 N3 Qb
tsp2 tsp3
This problem can be avoided by having a sharp clock rise and fall. Suppose the
clock falls sharply, M3-n1 will be open. Qb will therefore be floating which makes
our circuit work. To have a sharp colck, we simply add two inveters after the clock.
15-24
Experiment 15.5-1 The Testing of the New Single Clock D Flip-Flop
In this experiment, we used the circuit shown in Fig. 15.5-1 The program is in
Table 15.5-2 and the result is in Fig. 15.5-5. As indicated in Table 15.5-2, we set
Q to be high initially. From Fig. 15.5-5, we can see that this circuit is indeed a D
Flip-Flop as the output changes state only when the clock signal rises. Besides, the
output retains the state of the D signal before the clock rises.
tsp1 N3 Qb Q
tsp2 tsp3
VDD VDD
Mc_p1 Mc_p2
Mc_n1 Mc_n2
15-25
Mc_n1 clk_b clk_in gnd gnd nch L=l_nch W='w_nch*1'
Mc_p2 clk clk_b vdd vdd pch L=l_pch W='w_pch*15'
Mc_n2 clk clk_b gnd gnd nch L=l_nch W='w_nch*5'
*First stage
M1_p1 tsp1 D vdd vdd pch L=l_pch W='w_pch*3'
M1_p2 N2 clk tsp1 vdd pch L=l_pch W='w_pch*3'
M1_n1 N2 D gnd gnd nch L=l_nch W='w_nch*1'
*Second stage
M2_p1 N3 clk vdd vdd pch L=l_pch W='w_pch*3'
M2_n1 N3 N2 tsp2 gnd nch L=l_nch W='w_nch*1'
M2_n2 tsp2 clk gnd gnd nch L=l_nch W='w_nch*1'
*Third stage
M3_p1 Qb N3 vdd vdd pch L=l_pch W='w_pch*3'
M3_n1 Qb clk tsp3 gnd nch L=l_nch W='w_nch*1'
M3_n2 tsp3 N3 gnd gnd nch L=l_nch W='w_nch*1'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*3'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*1'
.ic v(Qb)=3.3v
15-26
CLK
N2
N3
Qb
We now take a look at Fig. 15.5-6 which shows the moment when N3 rises.
Since the clock falls sharply, M3-p1 is open because of the rising of N3 and M3-n1 is
also open because of the sharp falling of the clock. Therefore Qb is floating and this
is what we want.
CLK
N2
N3
Qb
15-27
Fig. 15.5-6 A look at the time when N3 rises
Suppose we did not add the two inverters, the circuit works as shown in Fig.
15.5-7. This is not a D Flip-Flop circuit.
CLK
N2
N3
Qb
As shown in Fig. 15.5-8, if M3-n1 is not open because the clock rises too slowly,
This causes Qb to fall immediately which is not desirable.
15-28
CLK
N2
N3
Qb
Fig. 15.5-8 A look at the moment of the circuit without two inverters added
when N3 rises
15-29
Section 15.6 A Divide by 8 Frequency Divider
Fig. 15.6-1 shows a schematic diagram of a divide by 8 frequency divider.
There are three D-Flip Flops. For each D-Flip Flop, the Qb terminal is connected to
D so that the D-Flip Flop is actually a divide by 2 frequency divider. Besides, each
Qb is sent to the next D-Flip Flop as an input.
Q0 Q1 Q2
D Q D Q D Q
CLK Qb Qb Qb
Fig. 15.6-2 shows the circuit of the D-Flip Flop which was introduced before.
Note that the clock is connected to two inverters.
15-30
VDD VDD VDD VDD
CLK
M1_p1 M2_p1 M3_p1 M4_p1
tsp1 N3 Qb Q
Qb
CLK N2 M2_n1 CLK M3_n1 M4_n1
M1_p2
tsp2 tsp3
VDD VDD
Mc_p1 Mc_p2
Mc_n1 Mc_n2
The D-Flip Flop circuit is shown in Fig. 15.6-1. The program is in Table 15.6-1.
The result of the experiment is in Fig. 15.6-3. As can be seen, this is indeed a divide
by 8 frequency divider.
15-31
Mc_p2 clk clk_b vdd vdd pch L=l_pch W='w_pch*3'
Mc_n2 clk clk_b gnd gnd nch L=l_nch W='w_nch*1'
*Second stage
M2_p1 N2 clk vdd vdd pch L=l_pch W='w_pch*1.5'
M2_n1 N2 N1 tsp2 gnd nch L=l_nch W='w_nch*0.5'
M2_n2 tsp2 clk gnd gnd nch L=l_nch W='w_nch*0.5'
*Third stage
M3_p1 Qb N2 vdd vdd pch L=l_pch W='w_pch*1.5'
M3_n1 Qb clk tsp3 gnd nch L=l_nch W='w_nch*0.5'
M3_n2 tsp3 N2 gnd gnd nch L=l_nch W='w_nch*0.5'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*1.5'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*0.5'
.ic Qb 0v
.ends TSPC
15-32
CLK
Qb_0
Q_0
Qb_1
Q_1
Qb_2
Q_2
Let us take a detailed look at Fig. 15.6-3 and see how Q0 ,Q1 and Q 2 behave
as shown in Fig. 15.6-4
CLK
Q_0 0 1 0 1 0 1 0 1 0 1
Q_1 0 0 1 1 0 0 1 1 0 0
Q_2 0 0 0 0 1 1 1 1 0 0
15-33
Table 15.6-2 The behavior of Q0 ,Q1 and Q 2
Q2 Q1 Q0 Count
0 0 0 0
0 0 1 1
0 1 0 2
0 1 1 3
1 0 0 4
1 0 1 5
1 1 0 6
1 1 1 7
From Table 15.6-2, we can see that Q0 ,Q1 and Q 2 behaves as a binary counter.
This observation is quite important because it will lead us to a programmable
frequency divider. For instance, suppose we want to have a divide by 5 counter, we
simply wait the Q0 ,Q1 and Q 2 to count to 4. We then try to reset the circuit. All
of these techniques will be discussed in the following sections.
15-34
Section 15.7 A New TSPC D-Flip Flop with Set and Reset
In the later sections, we will introduce programmable frequency divider . In this
kind of frequency dividers, we need D-Flip Flop’s with set and reset. Fig. 15.7-1
shows a D-Flip Flop circuit which we introduced before.
tsp1 N3 Qb Q
tsp2 tsp3
Let us focus on the period during which the clock is high. As expected, if the
clock is high, Stage 3 is an inverter. In other words, Qb will be always opposite to
N3 when the clock is high. This is illustrated in Fig. 15.7-2 We should also note
that when the clock is high, Stage 2 is an inverter and N2 and N3 are opposite to each
other.
For most applications, outside changes always occur when the clock is high.
We therefore may have a D-Flip Flop with set and reset based upon the assumption
that the outside changes occur when the clock is high. Under certain conditions, the
set and reset will also work.
15-35
CLK
1
N2
0
1
N3 0
1
Qb 0
1
Q 0
Fig. 15.7-2 Fig. 15.6-1 focusing the periods when the clock is high
From the above discussion, we obtain the conditions for set and reset as shown in
Table 15.7-1. Note that we assume clock signal is high for the following table.
Fig. 15.7-3 shows a new TSPC D-Flip Flop with set and reset
15-36
VDD
VDD
M0p_set
VDD
w=3u
VDD set set_b M2p_set
set M1p_set w=1u
w=0.5u CLK M0n_set
tsp1 M2_p1 VDD VDD
w=1u
w=0.4u
M1_p1 tsp3
w=0.4u rst M3_p1 M4_p1
M2p_rst
tsp2 w=0.5u w=2u
w=0.4u
CLK M1_p2 N3 Qb Q
D
w=2u N2 CLK
M2_n1 M3_n1
M4_n1
w=2u w=0.4u
w=3u
M1_n3 tsp4 tsp5
w=2u CLK M2_n2 M3_n2
set w=8u w=0.4u
M1n_set
w=1u set M3n_set
w=1u
VDD VDD rst M2n_rst
w=1u
Mc_p1 Mc_p2
CLK_IN CLK_INV CLK
Mc_n1 Mc_n2
Let us first note that in the last stage which is an inverter reversing Qb to Q, there
is a new NMOS transistor labeled as M3-set. A set signal is applied to the gate of
this transistor. If this set signal is high, it will force terminal Qb to be low and
terminal Q to be high.
Yet, this is not enough. When the set signal applied to M3-set, we know that
Qb will be low. Suppose N3 is also low, it will cause trouble. In other words, N3
must be high when the set signal is applied. Let us take a look at the inverter
consisting of transistors MOp-set and Mon-set. When the high set signal is applied
to this inverter, set-b will be low. This will cause N3 to be high which is required as
indicated in Table 15.7-1.
The same argument applies to transistors M1p-set and M1n-set. When a high
set signal is applied to these two transistors, it will cause N2 to be low which is again
required as shown in Table 15.7-1.
Experiment 15.7-1 Experiments of the D-Flip Flop with Set and Reset Circuit
in Fig. 15.7-3.
15-37
.lib "C:\mm0355v.l" TT
.UNPROTECT
.options nomod post
.global VDD GND
*Set Signal
M0p_set set_b set vdd vdd pch L=l_pch W='w_pch*3'
M0n_set set_b set gnd gnd nch L=l_nch W='w_nch*1'
M1n_set N2 set gnd gnd nch L=l_nch W='w_nch'
M2p_set N3 set_b vdd vdd pch L=l_pch W='w_pch'
M3n_set Qb set gnd gnd nch L=l_nch W='w_nch'
*Reset Signal
M2n_rst N3 rst gnd gnd nch L=l_nch W='w_nch'
*First stage
M1p_set tsp1 set vdd vdd pch L=l_pch W='w_pch*0.5'
M1_p1 tsp2 D tsp1 vdd pch L=l_pch W='w_pch*0.4'
M1_p2 N2 clk tsp2 vdd pch L=l_pch W='w_pch*2'
M1_n1 N2 D gnd gnd nch L=l_nch W='w_nch*2'
*Second stage
M2_p1 tsp3 clk vdd vdd pch L=l_pch W='w_pch*0.4'
M2p_rst N3 rst tsp3 vdd pch L=l_pch W='w_pch*0.4'
M2_n1 N3 N2 tsp4 gnd nch L=l_nch W='w_nch*2'
M2_n2 tsp4 clk gnd gnd nch L=l_nch W='w_nch*8'
*Third stage
M3_p1 Qb N3 vdd vdd pch L=l_pch W='w_pch*0.5'
M3_n1 Qb clk tsp5 gnd nch L=l_nch W='w_nch*0.4'
M3_n2 tsp5 N3 gnd gnd nch L=l_nch W='w_nch*0.4'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*2'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*3'
15-38
.ic v(Qb)=3.3v
CLK
D
Set
Reset
N2
N3
Qb
Q
15-39
CLK
D
Set
Reset
N2
N3
Qb
Q
15-40
Section 15.8 A 3 Bit Programmable K-Fout System Based
upon a Frequency Divider
Fig. 15.8-1 shows the schematic diagram of a 3 bit programmable k-fout system.
We can see that we have added three constant voltage signals to the circuit. They are
n0, n1 and n2. Since we are designing a 5-Fout frequency divider, we set (n2,n1,n0) to
be (1,0,1). Suppose (Q2,Q1,Q0) reaches (101), we can see that all of the three XOR
gates will output 0. Thus the NOR gate will output 1. That is, a reset signal will be
sent out. We will see later why this reset signal is a short pulse.
15-41
Q0 Q1 Q2
D Q D Q D Q
DFF_0 DFF_1 DFF_2
CLK Qb Qb Qb
R R R
n0
XOR
Q0
n1 Fout F_out
XOR NOR NOT NOT
Q1
n2
XOR
Q2
15-42
VDD VDD VDD VDD
CLK
M1_p1 M2_p1 M3_p1 M4_p1
tsp1 Qb Q
rst
Qb M2p_rst
CLK CLK M3_n1 M4_n1
M1_p2 N3
N2 M2_n1
tsp3
tsp2
M1_n1 M3_n2
CLK M2_n2
rst M2n_rst
VDD VDD
Mc_p1 Mc_p2
Mc_n1 Mc_n2
Fig. 15.8-3 The D-Flip Flop with rest used in Experiment 15.8-1
It can be seen that n0 , n1 , n2 (1,0,1) . Since the binary number 101 represents
5, we expect this experiment will produce a 5-fout system. The program is in
Table 15.8-1. The D-Flip Flop we use in this experiment is shown in Fig. 15.8-3.
Fig. 15.8-4 shows the values of n0,n1 and n2 and the result of this experiment is
shown in Fig. 15.8-5 As can be seen, this is indeed a 5-fout system.
15-43
.param l_nch = 0.35u
.param l_pch = 0.35u
.param w_nch = 1u
.param w_pch = 1u
.param clk_freq = 1e6
*First stage
M1_p1 tsp1 D vdd vdd pch L=l_pch W='w_pch*0.4'
M1_p2 N2 clk tsp1 vdd pch L=l_pch W='w_pch*2'
M1_n1 N2 D gnd gnd nch L=l_nch W='w_nch*2'
*Second stage
M2_p1 tsp2 clk vdd vdd pch L=l_pch W='w_pch*0.4'
M2p_rst N3 rst tsp2 vdd pch L=l_pch W='w_pch*0.4'
M2_n1 N3 N2 tsp3 gnd nch L=l_nch W='w_nch*2'
M2_n2 tsp3 clk gnd gnd nch L=l_nch W='w_nch*2'
*Third stage
M3_p1 Qb N3 vdd vdd pch L=l_pch W='w_pch*0.5'
M3_n1 Qb clk tsp4 gnd nch L=l_nch W='w_nch*0.4'
M3_n2 tsp4 N3 gnd gnd nch L=l_nch W='w_nch*0.4'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*1.5'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*0.5'
.ic v(Qb)=0v
.ends TSPC_rst
*NOR_3in
.subckt NOR nor_a nor_b nor_c NOR_out
Mn_a_p1 nor_1 nor_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mn_b_p1 nor_2 nor_b nor_1 vdd pch L=l_pch W='w_pch*0.5'
Mn_c_p1 NOR_out nor_c nor_2 vdd pch L=l_pch W='w_pch*0.5'
Mn_a_n1 NOR_out nor_a gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_b_n1 NOR_out nor_b gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_c_n1 NOR_out nor_c gnd gnd nch L=l_nch W='w_nch*0.5'
15-44
.ends NOR
*XOR_2in
.subckt XOR xor_a xor_b XOR_out
Mx_ain_p1 xor_ab xor_a vdd vdd pch L=l_pch W='w_pch*1.5'
Mx_ain_n1 xor_ab xor_a gnd gnd nch L=l_nch W='w_nch*0.5'
Mx_bin_p1 xor_bb xor_b vdd vdd pch L=l_pch W='w_pch*1.5'
Mx_bin_n1 xor_bb xor_b gnd gnd nch L=l_nch W='w_nch*0.5'
Mx1_p1 xor_1 xor_ab vdd vdd pch L=l_pch W='w_pch*0.5'
Mx1_p2 XOR_out xor_b xor_1 vdd pch L=l_pch W='w_pch*0.5'
Mx2_p1 xor_2 xor_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mx2_p2 XOR_out xor_bb xor_2 vdd pch L=l_pch W='w_pch*0.5'
Mx1_n1 XOR_out xor_a xor_3 xor_3 nch L=l_nch W='w_nch*0.5'
Mx2_n1 XOR_out xor_bb xor_3 xor_3 nch L=l_nch W='w_nch*0.5'
Mx1_n2 xor_3 xor_ab gnd gnd nch L=l_nch W='w_nch*0.5'
Mx2_n2 xor_3 xor_b gnd gnd nch L=l_nch W='w_nch*0.5'
.ends XOR
*Inverter
.subckt INV inv_in inv_out
Minv_p1 inv_out inv_in vdd vdd pch L=l_pch W='w_pch*1.5'
Minv_n1 inv_out inv_in gnd gnd nch L=l_nch W='w_nch*0.5'
.ends INV
*Subckt Circuit
xTSPC1 Qb_0 CLK Q_0 Qb_0 Fout TSPC_rst
xTSPC2 Qb_1 Qb_0 Q_1 Qb_1 Fout TSPC_rst
xTSPC3 Qb_2 Qb_1 Q_2 Qb_2 Fout TSPC_rst
xXOR1 n0 Q_0 ch1 XOR
xXOR2 n1 Q_1 ch2 XOR
xXOR3 n2 Q_2 ch3 XOR
xNOR ch1 ch2 ch3 Fout NOR
xINV1 Fout Fout_b INV
xINV2 Fout_b F_out INV
Vn0 n0 0 'n0_volt'
Vn1 n1 0 'n1_volt'
Vn2 n2 0 'n2_volt'
15-45
n0
n1
n2
CLK
F_out
Q0 0 1 0 1 0
Q1 0 0 1 1 0
Q2 0 0 0 0 1
From Fig. 15.8-5, we can see that the last (Q2,Q1,Q0) is (100). Therefore the
next (Q2,Q1,Q0) will be (101)which is not shown in Fig. 15.8-5.. As discussed
before, this will cause all of the XOR gates to send out 0 and NOR gate to send out 1.
We now explain why the fout reset signal is so short. Note that it is sent out
whenever a certain condition of the values of Q0,Q1 and Q2 are satisfied. But the
fout signal is also the reset signal. After the reset signal is sent to the three D-Flip
15-46
Flops, all of the values of Q0,Q1 and Q2 are rest to 0. Thus the logic gates will not
send out a high signal. Instead, it will send out a low signal. This is why the fout
signal, which is also the reset signal, is so short. The situation is shown in Fig.
15.8-6.
CLK
F_out
Q0
Q1
Q2
Fig. 15.8-6
Qb3 D Q Q1 D Q Q2 D Q Q3
Qb
This divider is a synchronous one because the clock signal is fed into the three
D-flip flops simultaneously. Besides, the output of DFF3 is fed back to DFF1. A
15-47
very important property of these D-flip flops is that the output of a D-flip flop cannot
react immediately with the input. If so, it will cause the racing effect which may
cause serious trouble. Imagine that the clock rises and D1 senses this. If there is no
delay, Q1 immediately changes and finally, D1 Q3 immediately changes. This
will, as one can easily imagine, cause trouble. Therefore, we conclude that there
must be a delay within the D-flip flop.
The circuit diagram is as shown in Fig. 15.9-1. The D-flip flop circuit is shown in
Fig. 15.9-2. The program is Table 15.9-1 and the result of the experiment is in Fig.
15.9-3
CLK
M1_p1 M2_p1 M3_p1 M4_p1
t s p1
N3 Qb Q
Qb
CLK N2 M2_n1 CLK M3_n1 M4_n1
M1_p2
t s p2 t s p3
VDD VDD
Mc_p1 Mc_p2
Mc_n1 Mc_n2
15-48
.param l_nch = 0.35u
.param l_pch = 0.35u
.param w_nch = 1u
.param w_pch = 1u
.param clk_freq = 1e6
.param Mode_volt = 0
*DFF
.subckt TSPC_DFF D CLK Qb Q
*First stage
M1_p1 tsp1 D vdd vdd pch L=l_pch W='w_pch*1.5'
M1_p2 N2 clk tsp1 vdd pch L=l_pch W='w_pch*1.5'
M1_n1 N2 D gnd gnd nch L=l_nch W='w_nch*0.5'
*Second stage
M2_p1 N3 clk vdd vdd pch L=l_pch W='w_pch*1.5'
M2_n1 N3 N2 tsp2 gnd nch L=l_nch W='w_nch*0.5'
M2_n2 tsp2 clk gnd gnd nch L=l_nch W='w_nch*1.5'
*Third stage
M3_p1 Qb N3 vdd vdd pch L=l_pch W='w_pch*1.5'
M3_n1 Qb clk tsp3 gnd nch L=l_nch W='w_nch*0.5'
M3_n2 tsp3 N3 gnd gnd nch L=l_nch W='w_nch*0.5'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*1.5'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*0.5'
.ic Qb 3.3
.ends TSPC_DFF
*NAND_2in
.subckt NANDN_a N_b N_out
Ma_p1 N_out N_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mb_p2 N_out N_b vdd vdd pch L=l_pch W='w_pch*0.5'
Ma_n1 N_out N_a nd_1 nd_1 nch L=l_nch W='w_nch*0.5'
Mb_n2 nd_1 N_b gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NAND
*Subckt Circuit
xDFF1 Qb_3 CLK Qb_1 Q_1 TSPC_DFF
xDFF2 Q_1 CLK Qb_2 Q_2 TSPC_DFF
xDFF3 Q_2 CLK Qb_3 Q_3 TSPC_DFF
15-49
.tran '1/(10000*clk_freq)' '(10/clk_freq)'
.END
CLK
Q1
Q2
Q3
Qb3
From Fig. 15.9-3, we can see that the circuit is indeed a divide by 6 frequency
divider because the cycle of Q3 is 6 clock cycles long.
We should first observe the property that there is a delay mechanism in every
D-flip flop. Consider the first instance when the clock rises. From Fig. 15.9-3, we
can see that Q1 rises at this instance. Actually, it rises slightly after the clock rises.
This is why Q2 does not rise at this moment because so fat as D2 Q1 is concerned,
it rises after the clock is risen because in this circuit, the clock is fed into all of the
D-flip flops.
The function of the frequency divider can be explained by seeing how the
terminals of the D-flip flops behave. This behavior is summarized in table 15.9-2.
15-50
1 0 0 0 1 0
1 1 0 0 1 1
Q1 Q2 Q3
000
001 100
011 110
111
15-51
Q3
Q2
D1 D Q Q1 D Q D3 D Q
NAND NAND
=Q2
Qb Qb2
MC (High)
Qb Qb2
The major difference between the divide by 4 frequency divider in Fig. 15.9-1
and the divide by 5 frequency divider in Fig. 15.9-6 is as follows:
This difference makes the circuit in Fig. 15.9-6 a divide by 5, instead of divide by
6, frequency divider. We will use the following experiment to explain how the
circuit works.
In this experiment, the circuit is in Fig. 15.9-6. We did not use the inverter. We
15-52
connected the output of DFF2 to the input of DFF3 directly. The program is in Table
15.9-3 and the result is in Fig. 15.9-7.
.param Mode_volt = 0
*DFF
.subckt TSPC_DFF D CLK Qb Q
*First stage
M1_p1 tsp1 D vdd vdd pch L=l_pch W='w_pch*1.5'
M1_p2 N2 clk tsp1 vdd pch L=l_pch W='w_pch*1.5'
M1_n1 N2 D gnd gnd nch L=l_nch W='w_nch*0.5'
*Second stage
M2_p1 N3 clk vdd vdd pch L=l_pch W='w_pch*1.5'
M2_n1 N3 N2 tsp2 gnd nch L=l_nch W='w_nch*0.5'
M2_n2 tsp2 clk gnd gnd nch L=l_nch W='w_nch*1.5'
*Third stage
M3_p1 Qb N3 vdd vdd pch L=l_pch W='w_pch*1.5'
M3_n1 Qb clk tsp3 gnd nch L=l_nch W='w_nch*0.5'
M3_n2 tsp3 N3 gnd gnd nch L=l_nch W='w_nch*0.5'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*1.5'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*0.5'
.ic Qb 3.3
.ends TSPC_DFF
*NAND_2in
.subckt NANDN_a N_b N_out
Ma_p1 N_out N_a vdd vdd pch L=l_pch W='w_pch*0.5'
15-53
Mb_p2 N_out N_b vdd vdd pch L=l_pch W='w_pch*0.5'
Ma_n1 N_out N_a nd_1 nd_1 nch L=l_nch W='w_nch*0.5'
Mb_n2 nd_1 N_b gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NAND
*Subckt Circuit
xDFF1 D_1 CLK Qb_1 Q_1 TSPC_DFF
xDFF2 Q_1 CLK Qb_2 Q_2 TSPC_DFF
xDFF3 Q_2 CLK Qb_3 Q_3 TSPC_DFF
xNAND Q_3 Q_2 D_1 NAND
CLK
Q1
Q2
Q3
D1
15-54
0 1 1 1 0 3
0 0 1 1 0 4
1 0 0 1 1 5
1 1 0 0 1 1
Fig. 15.9-8 illustrates the above discussion. From this diagram, we can see that
there are only 5 clock cycles for this circuit. (0,0,0) appears only once at the very
beginning and never appears again. Thus this circuit is a divide by 5 frequency
divider.
Q1 Q2 Q3
000
100
001 110
011 111
15-55
Section 15.10 A dual-modulus prescaler by 4/5 Frequency
Divider
In this section, we shall introduce a special frequency divider, called dual-modulus
prescaler by 4/5.. This circuit will be used in the phase lock loop which will be
introduced in the next chapter. There is a control signal, named MC. When the
MC signal is of low voltage, the circuit is a divide by 4 frequency divider and it is a
divide by 5 frequency divider if the MC signal is of high voltage. The schematic
diagram of the circuit is shown in Fig. 15.10-1, the circuit of the D-Flip Flop is in Fig.
15.10-2 and the NAND gate circuit is in Fig. 15.10-3
Q3
Q2
D1 D Q Q1 D Q D3 D Q
NAND NAND
Qb
MC
Fig. 15.10-1 A dual modulus prescaler-by 4/5 frequency divider
15-56
VDD VDD VDD VDD
CLK
M1_p1 M2_p1 M3_p1 M4_p1
t s p1
N3 Qb Q
Qb
CLK N2 M2_n1 CLK M3_n1 M4_n1
M1_p2
t s p2 t s p3
VDD VDD
Mc_p1 Mc_p2
Mc_n1 Mc_n2
Fig. 15.10-2 The TSPC D-Flip Flop circuit used in the dual modulus prescaler by
4/5 frequency divider
VDD
A Ma_p1 B Mb_p2
N_out
A Ma_n1
B Mb_n2
Fig. 15.10-3 The NAND gate used in the dual modulus prescaler
by 4/5 frequency divider
If the MC signal is low, D3 will be always high and Q3 will always be high.
Since Q3 is always high, D1 will be simply the inversion of Q2. We may therefore
ignore DFF3 and the circuit becomes a synchronous divide by 4 Johnson counter
frequency divider
Experiment 15.10-1 The Testing of the Dual Modulus Prescaler by 4/5 with MC
Signal Low
15-57
We set MC to be of 0Volt as indicated in Fig. 15.10-4
.param MC_volt = 0
Q3
High
Q2
D1 D Q Q1 D Q D3 D Q
NAND NAND
High
Qb Qb2
MC (Low)
.param MC_volt = 0
*DFF
.subckt TSPC_DFF D CLK Qb Q
*First stage
M1_p1 tsp1 D vdd vdd pch L=l_pch W='w_pch*1.5'
15-58
M1_p2 N2 clk tsp1 vdd pch L=l_pch W='w_pch*1.5'
M1_n1 N2 D gnd gnd nch L=l_nch W='w_nch*0.5'
*Second stage
M2_p1 N3 clk vdd vdd pch L=l_pch W='w_pch*1.5'
M2_n1 N3 N2 tsp2 gnd nch L=l_nch W='w_nch*0.5'
M2_n2 tsp2 clk gnd gnd nch L=l_nch W='w_nch*0.5'
*Third stage
M3_p1 Qb N3 vdd vdd pch L=l_pch W='w_pch*1.5'
M3_n1 Qb clk tsp3 gnd nch L=l_nch W='w_nch*0.5'
M3_n2 tsp3 N3 gnd gnd nch L=l_nch W='w_nch*0.5'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*1.5'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*0.5'
.ic Qb 3.3
.ends TSPC_DFF
*NAND_2in
.subckt NANDN_a N_b N_out
Ma_p1 N_out N_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mb_p2 N_out N_b vdd vdd pch L=l_pch W='w_pch*0.5'
Ma_n1 N_out N_a nd_1 nd_1 nch L=l_nch W='w_nch*0.5'
Mb_n2 nd_1 N_b gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NAND
*Subckt Circuit
xDFF1 D_1 CLK Qb_1 Q_1 TSPC_DFF
xDFF2 Q_1 CLK Qb_2 Q_2 TSPC_DFF
xDFF3 D_3 CLK Qb_3 Q_3 TSPC_DFF
xNAND1 Q_2 Q_3 D_1 NAND
xNAND2 Qb_2 MC D_3 NAND
Vmc MC 0 'MC_volt'
15-59
CLK
Q_1
Q_2
Q_3
MC
D_1
Qb_2
D_3
From Fig. 15.9-5, we can see that the circuit is a divide by 4 frequency divider.
Experiment 15.10-2 The Testing of the Dual Modulus Prescaler by 4/5 with MC
Signal High
Qb Qb2
MC (High)
15-60
CLK
Q_1
Q_2
Q_3
MC
D_1
Qb_2
D_3
As one can see, this circuit is a divide by 5 frequency divider. Thus we have
obtained a dual modulus prescaler by 4/5 frequency divider by controlling the
volatage of the MC signal
15-61
Section 15.11 A Dual-modulus Divide by 32/33 Prescaler Frequency
Divider
Divide by 4/5
Q2 Q3
D1 D Q Q1 D Q D3 D Q
NAND NAND
Qb Qb2
Divide by 8
D Qb D Qb D Qb Qb6
Fout
Q Q4 Q Q5 Q
(1) When the Mode signal is low, M1 will be high and MC will be low. If MC is
low, as discussed in Section 15.10, DFF3 can be ignored.
(2) If Mode 1 and Q6 1 , M1 will be low. If, when M 1 Q4 Q 5 0 , MC will
15-62
be high.
(3) DFF1 and DFF2 constitute a synchronous divide by 4 frequency divider.
(4) If MC is high, DFF3 will not be ignored. In this case, DFF1 to DFF3 constitute a
divide by 5 frequency divider as pointed out in Section 15.9.
(5) DFF4 to DFF6 constitute an asynchronous divide by 8 frequency divider.
(6) If MC is low, DFF3 is ignored. The Q4 signal is divided by 8,the Q5 signal is
divided by 16 and the Q6 signal is divided by 32. Therefore the Fout signal is
divided by 32.
(7) If Mode is low, MC will be low as pointed out in Statement (1). Therefore, if
MC is low, the circuit is a divide 32 frequency divider.
(8) If MC is high, when Q4 Q5 Q6 0 , MC 1 and DFF3 begins to work. As
explained before, DFF1, DFF2 and DFF3 function as a divide by 5 frequency
divider.
Q4
Q5
Q6
28 32
Fig. 15.11-2 The behavior of Q4, Q5 and Q6 when Mode is low.
In this experiment, the circuit used is the circuit in Fig. 15.11-1. The NOR gate is in
Fig. 15.11-3. The frequency of the clock was set to be 1MHz. That is, each clock
cycle is 1s . The program is in Table 15.11-1.
15-63
VDD
A Mn_a_p1
B Mn_b_p1
C Mn_c_p1
NOR_out
.param Mode_volt = 0
*DFF
.subckt TSPC_DFF D CLK Qb Q
*First stage
M1_p1 tsp1 D vdd vdd pch L=l_pch W='w_pch*1.5'
M1_p2 N2 clk tsp1 vdd pch L=l_pch W='w_pch*1.5'
M1_n1 N2 D gnd gnd nch L=l_nch W='w_nch*0.5'
*Second stage
15-64
M2_p1 N3 clk vdd vdd pch L=l_pch W='w_pch*1.5'
M2_n1 N3 N2 tsp2 gnd nch L=l_nch W='w_nch*0.5'
M2_n2 tsp2 clk gnd gnd nch L=l_nch W='w_nch*0.5'
*Third stage
M3_p1 Qb N3 vdd vdd pch L=l_pch W='w_pch*1.5'
M3_n1 Qb clk tsp3 gnd nch L=l_nch W='w_nch*0.5'
M3_n2 tsp3 N3 gnd gnd nch L=l_nch W='w_nch*0.5'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*1.5'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*0.5'
.ic Qb 3.3
.ends TSPC_DFF
*NAND_2in
.subckt NANDN_a N_b N_out
Ma_p1 N_out N_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mb_p2 N_out N_b vdd vdd pch L=l_pch W='w_pch*0.5'
Ma_n1 N_out N_a nd_1 nd_1 nch L=l_nch W='w_nch*0.5'
Mb_n2 nd_1 N_b gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NAND
*NOR_3in
.subckt NOR nor_a nor_b nor_c NOR_out
Mn_a_p1 nor_1 nor_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mn_b_p1 nor_2 nor_b nor_1 vdd pch L=l_pch W='w_pch*0.5'
Mn_c_p1 NOR_out nor_c nor_2 vdd pch L=l_pch W='w_pch*0.5'
Mn_a_n1 NOR_out nor_a gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_b_n1 NOR_out nor_b gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_c_n1 NOR_out nor_c gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NOR
*Inverter
.subckt INV inv_in inv_out
Minv_p1 inv_out inv_in vdd vdd pch L=l_pch W='w_pch*1.5'
Minv_n1 inv_out inv_in gnd gnd nch L=l_nch W='w_nch*0.5'
.ends INV
*Subckt Circuit
xDFF1 D_1 CLK Qb_1 Q_1 TSPC_DFF
xDFF2 Q_1 CLK Qb_2 Q_2 TSPC_DFF
xDFF3 D_3 CLK Qb_3 Q_3 TSPC_DFF
xNAND1 Q_2 Q_3 D_1 NAND
xNAND2 Qb_2 MC D_3 NAND
15-65
Vmc Mode 0 'Mode_volt'
Fig. 15.11-5 shows that the signals all start from 0.5 s .
15-66
CLK
Q1
Q2
Q3
D1
D3
MC
Q4
Q5
Fout
Qb6
M1
Mode
The ending state is shown in Fig. 15.11-6 We can see that fout ends at 32.5us
which verifies that the circuit is a divide by 32 frequency divider
15-67
CLK
Q1
Q2
Q3
D1
D3
MC
Q4
Q5
Fout
Qb6
M1
Mode
15-68
CLK
Q1
Q2
Q3
D1
D3
MC
Q4
Q5
Fout
Qb6
M1
Mode
We can see that the circuit does function as a divide by 33 frequency divider
because fout ends at t=33.5us. Besides, this figure shows a very important point,
from t=28us to 33us, Q4 Q5 Q6 0 as we pointed out before. In fact, we can also
see that Q4 Q5 Q6 0 only in this period.
15-69
Section 15.12 The PS-Counter Which Counts to Any
Number
In the above sections, we introduced many frequency dividers with fixed number.
For instance, divide by 2, divide by 3 and divide by 4 frequency dividers have been
introduced. For practical purpose, actually we are interested in counters. For
instance, we need a counter which counts 2, 3 or 4. For a 2-counter, a short pulse will
occur after every 2 clock cycles. For a 3-counter, a short pulse will occur after every
3 clock cycles.
M NP S (15.12-1)
M ( N 1)S N ( P S ) (15.12-2)
The above equation means that we may do the dividing twice. For the first time,
we divide the frequency by N 1 S times and then for the second time, we divide
it by N P S times.
M 5 1 4 (4 1) 5 1 4 3 .
(1) An (N+1)/N program counter which counts N+1 or N. This kind of program
counter is called a dual modulus-prescaler counter. Its input is the clock signal.
There is a control signal MC which determines whether this counter counts N+1
or N. If the counter counts N+1(N), after N+1(N) clock pulses, this counter will
output a pulse, called nf. This pulse signal is the output of the (N+1)/N program
counter. Note the pulse is a square wave,
(2) An S program counter. The input of this counter is nf. That is, after counting
the nf signal S times, it will send out a control signal MC to change the behavior
of the (N+1)/N counter. The MC signal is a short pulse. If it is counting N+1,
it will start count N and vice versa. Since the S program counter can change the
behavior of the (N+1)/N counter counter, it is called a swallow counter.
(3) A P progam counter whose input signal is the nf pulse from the (N+1)/N program
counter. That is, after counting the nf signal S times, it will send out a
[Link] denoted as pf.
15-70
A top level diagram of the PS counter is now shown in Fig. 15.12-1.
nf P Program
fin(clock) (N+1)/N Program pf
Counter fout
Counter
(divide by P)
MC=1/0
S Program
Counter
(divide by S)
Reset
2. In the mean time, both P counter and S counter start counting the bf signals. The
P(S)-counter sends out a pulse signal after every P (S) input nf signals.
5. From now on, after ( P S ) upward edge signals have been sent to the P-counter,
the P-counter will send out a pulse. The total time for this set of ( P S )
signals to be sent corresponds to ( P S ) N clock cycles.
15-71
S= 1 P-S
M 4+1 4 4 4
P= 4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
CLK
5 4 4 4
4/5 1 2 3 4
1
S
MC
4
P
Fig. 15.12-2
The circuit of this PS-counter for this example is shown in Fig. 15.12-3.
D Qb
(1) Initially, QB is et to be 1. Thus the MC signal is 1 and the 4/5 counter starts to
5..
(2) After 5 clock cycles, an nf signal is sent to the S counter.
(3) Since S=1, the S Counter will send out a signal to the OR gate, indicating that
the divide by 5 operations are finished. The OR gate sends out a 1 signal to the DFF
which makes the Q terminal to be 1 and Qb to be 0. Since MC is from Qb, MC
becomes 0 which is what we desire.
(4) The 4/5 counter begins to count by 4. After counting 4 clock cycles, it will
send out an nf signal to the P counter. The P counter counts the number of nf signals.
After P=4 nf signals are received, a pf signal will be sent out
15-72
(5) When the pF-out becomes 1, it will cause the DFF to flip again. That is, Qb
will become 1 again. Since MC is from Qb, MC becomes 1 which is what we desire.
(6) When pF-out becomes 1 and MC becomes 1, we need to delay the MC slightly.
If there is no such a delay, the S Counter will send out a 1 signal immediately which is
not desirable. Note that after the S counter counts to S, it should stop functioning.
Therefore, there is a delay and latch circuit which will delay the MC signal and make
sure that the S counter will not function.
Q3
Q2
D1 D Q Q1 D Q D3 D Q
NAND NAND
Qb
nF_out MC
Fig. 15.12-4 Divide by 4/5 prescaler
15-73
Q0 Q1 Q2 Q3 Q4
n0
XOR
Q0
n1
XOR
Q1 R
n2
XOR NOR
Fout
Q2
n3
XOR
Q3
n4
XOR
Q4
nF_out
Delay
DFF_sclk_clk DFF
Delay
MC
15-74
Fig. 15.12-6 The delay and latch circuit
In the following, we shall describe how the delay and latch circuit illustrated in
Fig. 15.12-6 works. We shall present three cases:
Fig. 15.12-7 illustrates the signals of the delay and latch circuit.
A=nf-out
B=nf-out delayed
DFF-C=XOR(A,B)
DFF-C=XOR(A,B)-delayed
again
MC
MC-delayed
DFF-D=AND(A,MC delayed)
sF-in
Fig. 15.12-7 The signals in the delay and latch circuit for Case 1
Case 2: MC goes down. This happens when the Swallow Counter has already
counted to S . The signals in the delay and latch circuit for this case are now shown
in Fig. 15.12-8. We can see that sF-in will be high after MC is low. This means
that the S-Counter will stop counting which is what we expect.
15-75
A=nf-out
B=nf-out delayed
DFF-C=XOR(A,B)
DFF-C=XOR(A,B)-delayed
again
MC
MC-delayed
DFF-D=AND(A,MC-delayed)
sF-in
Fig. 15.12-8 The signals in the delay and latch circuit for Case 2
Case 3: MC goes up. This happens immediately after the P-counter counts to P .
Note that this should not cause the sf-in to send out a high signal to the S-counter. If
it does, it will cause the S-counter to count to 1 immediately. As we shall see from
Fig. 15.12-9, sF-in will remain to be low after MC immediately goes down. It will
become high after nF-out sends out its first upward edge signal.
It is important to note that the MC is delayed. This causes the DFF-D arrives at
the DFF after DFF-C. In other words, the DFF-C does not have any effect on the
DFF.
15-76
A=nf-out
B=nf-out delayed
DFF-C=XOR(A,B)
DFF-C=XOR(A,B)-delayed
again
MC
MC-delayed
DFF-D=AND(A,MC-delayed)
sF-in
Fig. 15.12-9 The signals in the delay and latch circuit for Case 3
The following figures show the details of the circuits of the PS-Counter.
15-77
VDD VDD VDD VDD
CLK
M1_p1 M2_p1 M3_p1 M4_p1
t s p1
N3 Qb Q
Qb
CLK N2 M2_n1 CLK M3_n1 M4_n1
M1_p2
t s p2 t s p3
VDD VDD
Mc_p1 Mc_p2
Mc_n1 Mc_n2
CLK
M1_p1 M2_p1 M3_p1 M4_p1
t s p1
Qb Q
rst
D M2p_rst
CLK CLK M3_n1 M4_n1
M1_p2 N3
N2 M2_n1 t s p3
t s p2
M1_n1 M3_n2
CLK M2_n2
rst M2n_rst
15-78
VDD
A Ma_p1 B Mb_p2
N_out
A Ma_n1
B Mb_n2
VDD
A Mn_a_p1
B Mn_b_p1
C Mn_c_p1
NOR_out
Mx_A_inv _p1
Mx_A_inv _n1
XOR_out
VDD
B B_b
A_b Mx1 n2 Mx2 n2 B
Mx_B_inv _n1
15-79
program is in Table 15.12-2.
Prescaler
fin ÷4 / 5 nF_out 5 bit pF_out
P Counter
D Qb
Delay 5 bit
OR
& Latch S Counter
DFF
sF_out
MC MC
Fig. 15.12-15
*/-----MOS Size-----/*
.param l_nch = 0.35u
.param l_pch = 0.35u
.param w_nch = 1u
.param w_pch = 1u
*/-----CLK Frequency-----/*
.param clk_freq = 17e6
15-80
.param s2_volt = 0
.param s3_volt = 0
.param s4_volt = 0
15-81
.ic Qb 0v
.ends TSPC_rst
*--------NAND_2_input--------*
.subckt NANDN_a N_b N_out
Ma_p1 N_out N_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mb_p2 N_out N_b vdd vdd pch L=l_pch W='w_pch*0.5'
Ma_n1 N_out N_a nand_1 nand_1 nch L=l_nch W='w_nch*0.5'
Mb_n2 nand_1 N_b gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NAND
*--------NOR_2_input--------*
.subckt NOR2 nor_A nor_B NOR_out
Mn_a_p1 nor_1 nor_A vdd vdd pch L=l_pch W='w_pch*0.5'
Mn_b_p1 NOR_out nor_B nor_1 vdd pch L=l_pch W='w_pch*0.5'
Mn_a_n1 NOR_out nor_A gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_b_n1 NOR_out nor_B gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NOR2
*--------NOR_5_input--------*
.subckt NOR5 nor_A nor_B nor_C nor_D nor_E NOR_out
Mn_a_p1 nor_1 nor_A vdd vdd pch L=l_pch W='w_pch*0.5'
Mn_b_p1 nor_2 nor_B nor_1 vdd pch L=l_pch W='w_pch*0.5'
Mn_c_p1 nor_3 nor_C nor_2 vdd pch L=l_pch W='w_pch*0.5'
Mn_d_p1 nor_4 nor_D nor_3 vdd pch L=l_pch W='w_pch*0.5'
Mn_e_p1 NOR_out nor_E nor_4 vdd pch L=l_pch W='w_pch*0.5'
Mn_a_n1 NOR_out nor_A gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_b_n1 NOR_out nor_B gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_c_n1 NOR_out nor_C gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_d_n1 NOR_out nor_D gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_e_n1 NOR_out nor_E gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NOR5
*--------XOR_2_input--------*
.subckt XOR xor_a xor_b XOR_out
Mx_A_inv_p1 xor_a_b xor_a vdd vdd pch L=l_pch W='w_pch*1.2'
Mx_A_inv_n1 xor_a_b xor_a gnd gnd nch L=l_nch W='w_nch*0.4'
Mx_B_inv_p1 xor_b_b xor_b vdd vdd pch L=l_pch W='w_pch*1.2'
Mx_B_inv_n1 xor_b_b xor_b gnd gnd nch L=l_nch W='w_nch*0.4'
Mx1_p1 xor_1 xor_a_b vdd vdd pch L=l_pch W='w_pch*0.4'
Mx1_p2 XOR_out xor_b xor_1 vdd pch L=l_pch W='w_pch*0.4'
Mx2_p1 xor_2 xor_a vdd vdd pch L=l_pch W='w_pch*0.4'
Mx2_p2 XOR_out xor_b_b xor_2 vdd pch L=l_pch W='w_pch*0.4'
Mx1_n1 XOR_out xor_a xor_3 xor_3 nch L=l_nch W='w_nch*0.4'
Mx1_n2 xor_3 xor_a_b gnd gnd nch L=l_nch W='w_nch*0.4'
Mx2_n1 XOR_out xor_b_b xor_3 xor_3 nch L=l_nch W='w_nch*0.4'
Mx2_n2 xor_3 xor_b gnd gnd nch L=l_nch W='w_nch*0.4'
.ends XOR
*--------Inverter--------*
15-82
.subckt INV inv_in inv_out
Minv_p1 inv_out inv_in vdd vdd pch L=l_pch W='w_pch*0.5'
Minv_n1 inv_out inv_in gnd gnd nch L=l_nch W='w_nch*0.5'
.ends INV
*-------Delay--------*
.subckt Delay delay_in delay_out
Mdelay_p1 delay_out_1 delay_in vdd vdd pch L='l_pch*10' W='w_pch*1.5'
Mdelay_n1 delay_out_1 delay_in gnd gnd nch L='l_nch*10' W='w_nch*0.5'
Mdelay_p2 delay_out delay_out_1 vdd vdd pch L='l_pch*10' W='w_pch*1.5'
Mdelay_n2 delay_out delay_out_1 gnd gnd nch L='l_nch*10' W='w_nch*0.5'
.ends Delay
15-83
xDFF_s5 sQb_4 sQb_3 sQb_4 sQ_4 sF_out TSPC_rst
xXOR_s1 s_n0 sQ_0 s_ch1 XOR
xXOR_s2 s_n1 sQ_1 s_ch2 XOR
xXOR_s3 s_n2 sQ_2 s_ch3 XOR
xXOR_s4 s_n3 sQ_3 s_ch4 XOR
xXOR_s5 s_n4 sQ_4 s_ch5 XOR
xNOR_s1 s_ch1 s_ch2 s_ch3 s_ch4 s_ch5 sFout NOR5
xINV_s2 sFout sFout_b INV
xINV_s3 sFout_b sF_out INV
xNOR_s2 pF_out sF_out Mode_1b NOR2
xINV_s4 Mode_1b Mode_1 INV
xDFF_s6 sQb_6 Mode_1 sQb_6 sQ_6 TSPC_DFF
xINV_MC sQ_6 MC INV
The result is shown in Fig. 15.12-16. The signal used was 17MHz. This
means that within one second, there will be 17106 clock cycles. Each clock
1
is 106 second. Since we set M 17 , after each 17 clock cycles, there will be
17
a short pulse, which means that after 17us. There will be a pulse. From Fig.
15.12-16, we can see that our circuit works correctly.
15-84
CLK
nF_out
sF_in
pF_out
sF_out
Mode_1
MC
Fig. 15.12-17 shows the case when MC goes down. It is what we expected.
15-85
CLK
nF_out
sF_out_Delay
DFF_sclk_clk
MC
MC_Delay
DFF_sclk_D
sF_in
sF_out
pF_out
Fig. 15.12-18 shows the case when MC goes up. In this case, DFF-sclk-clk
arrives earlier than DFF-sclk-D. Therefore, sF-in has no response as expected.
CLK
nF_out
sF_out_Dela
y
DFF_sclk_clk
MC
MC_Delay
DFF_sclk_D
sF_in
sF_out
pF_out
15-86
Experiment 15.12-2 An Experiment of Generating a 3464 counter.
Prescaler
÷4 ÷32/33 nF_out 5 bit pF_out
P Counter
nmode_1
fin Digital Input
D Qb
Delay 5 bit
OR
& Latch S Counter
Modulus
sF_in DFF
Control sF_out
MC Digital Input MC
Fig. 15.12-19 The circuit diagram for Experiment 15.12-2
D Q D
Qb
DFF1 DFF2
CLK
F_pre_by4
Fig. 15.12-20 Synchronous Divide by 4 Johnson Counter
15-87
Divide by 4/5
Q2 Q3
D1 D Q Q1 D Q D3 D Q
NAND NAND
Qb Qb2
Divide by 8
D Qb D Qb D Qb Qb6
nF_out
Q Q4 Q Q5 Q
The P and S counters are the same as those used in Experiment 15.12-1. The
program is in Table 15.12-3.
*/-----MOS Size-----/*
.param l_nch = 0.35u
15-88
.param l_pch = 0.35u
.param w_nch = 1u
.param w_pch = 1u
*/-----CLK Frequency-----/*
.param clk_freq = 433e6
15-89
M2n_rst N3 rst gnd gnd nch L=l_nch W='w_nch'
*First stage
M1_p1 tsp1 D vdd vdd pch L=l_pch W='w_pch*0.4'
M1_p2 N2 clk tsp1 vdd pch L=l_pch W='w_pch*2'
M1_n1 N2 D gnd gnd nch L=l_nch W='w_nch*2'
*Second stage
M2_p1 tsp2 clk vdd vdd pch L=l_pch W='w_pch*0.4'
M2p_rst N3 rst tsp2 vdd pch L=l_pch W='w_pch*0.4'
M2_n1 N3 N2 tsp3 gnd nch L=l_nch W='w_nch*2'
M2_n2 tsp3 clk gnd gnd nch L=l_nch W='w_nch*2'
*Third stage
M3_p1 Qb N3 vdd vdd pch L=l_pch W='w_pch*0.5'
M3_n1 Qb clk tsp4 gnd nch L=l_nch W='w_nch*0.4'
M3_n2 tsp4 N3 gnd gnd nch L=l_nch W='w_nch*0.4'
*Forth stage:Inverter
M4_p1 Q Qb vdd vdd pch L=l_pch W='w_pch*0.4'
M4_n1 Q Qb gnd gnd nch L=l_nch W='w_nch*0.4'
.ic Qb 0v
.ends TSPC_rst
*--------NAND_2_input--------*
.subckt NANDN_a N_b N_out
Ma_p1 N_out N_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mb_p2 N_out N_b vdd vdd pch L=l_pch W='w_pch*0.5'
Ma_n1 N_out N_a nd_1 nd_1 nch L=l_nch W='w_nch*0.5'
Mb_n2 nd_1 N_b gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NAND
*--------NOR_2_input--------*
.subckt NOR2 nor_a nor_b NOR_out
Mn_a_p1 nor_1 nor_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mn_b_p1 NOR_out nor_b nor_1 vdd pch L=l_pch W='w_pch*0.5'
Mn_a_n1 NOR_out nor_a gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_b_n1 NOR_out nor_b gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NOR2
*--------NOR_3_input--------*
.subckt NOR3 nor_a nor_b nor_c NOR_out
Mn_a_p1 nor_1 nor_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mn_b_p1 nor_2 nor_b nor_1 vdd pch L=l_pch W='w_pch*0.5'
Mn_c_p1 NOR_out nor_c nor_2 vdd pch L=l_pch W='w_pch*0.5'
Mn_a_n1 NOR_out nor_a gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_b_n1 NOR_out nor_b gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_c_n1 NOR_out nor_c gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NOR3
*--------NOR_5_input--------*
.subckt NOR5 nor_a nor_b nor_c nor_d nor_e NOR_out
Mn_a_p1 nor_1 nor_a vdd vdd pch L=l_pch W='w_pch*0.5'
Mn_b_p1 nor_2 nor_b nor_1 vdd pch L=l_pch W='w_pch*0.5'
15-90
Mn_c_p1 nor_3 nor_c nor_2 vdd pch L=l_pch W='w_pch*0.5'
Mn_d_p1 nor_4 nor_d nor_3 vdd pch L=l_pch W='w_pch*0.5'
Mn_e_p1 NOR_out nor_e nor_4 vdd pch L=l_pch W='w_pch*0.5'
Mn_a_n1 NOR_out nor_a gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_b_n1 NOR_out nor_b gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_c_n1 NOR_out nor_c gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_d_n1 NOR_out nor_d gnd gnd nch L=l_nch W='w_nch*0.5'
Mn_e_n1 NOR_out nor_e gnd gnd nch L=l_nch W='w_nch*0.5'
.ends NOR5
*--------XOR_2_input--------*
.subckt XOR xor_a xor_b XOR_out
Mx_ain_p1 xor_ab xor_a vdd vdd pch L=l_pch W='w_pch*1.2'
Mx_ain_n1 xor_ab xor_a gnd gnd nch L=l_nch W='w_nch*0.4'
Mx_bin_p1 xor_bb xor_b vdd vdd pch L=l_pch W='w_pch*1.2'
Mx_bin_n1 xor_bb xor_b gnd gnd nch L=l_nch W='w_nch*0.4'
Mx1_p1 xor_1 xor_ab vdd vdd pch L=l_pch W='w_pch*0.4'
Mx1_p2 XOR_out xor_b xor_1 vdd pch L=l_pch W='w_pch*0.4'
Mx2_p1 xor_2 xor_a vdd vdd pch L=l_pch W='w_pch*0.4'
Mx2_p2 XOR_out xor_bb xor_2 vdd pch L=l_pch W='w_pch*0.4'
Mx1_n1 XOR_out xor_a xor_3 xor_3 nch L=l_nch W='w_nch*0.4'
Mx2_n1 XOR_out xor_bb xor_3 xor_3 nch L=l_nch W='w_nch*0.4'
Mx1_n2 xor_3 xor_ab gnd gnd nch L=l_nch W='w_nch*0.4'
Mx2_n2 xor_3 xor_b gnd gnd nch L=l_nch W='w_nch*0.4'
.ends XOR
*--------Inverter--------*
.subckt INV inv_in inv_out
Minv_p1 inv_out inv_in vdd vdd pch L=l_pch W='w_pch*0.5'
Minv_n1 inv_out inv_in gnd gnd nch L=l_nch W='w_nch*0.5'
.ends INV
*-------Delay--------*
.subckt Delay delay_in delay_out
Mdelay_p1 delay_out_1 delay_in vdd vdd pch L='l_pch*10' W='w_pch*1.5'
Mdelay_n1 delay_out_1 delay_in gnd gnd nch L='l_nch*10' W='w_nch*0.5'
Mdelay_p2 delay_out delay_out_1 vdd vdd pch L='l_pch*10' W='w_pch*1.5'
Mdelay_n2 delay_out delay_out_1 gnd gnd nch L='l_nch*10' W='w_nch*0.5'
.ends Delay
*/----------Prescaler by 32/33----------/*
xDFF_n1 nD_1 F_pre_by4 nQb_1 nF_by4 TSPC_DFF
xDFF_n2 nF_by4 F_pre_by4 nQb_2 nQ_2 TSPC_DFF
15-91
xDFF_n3 nD_3 F_pre_by4 nQb_3 nQ_3 TSPC_DFF
xNAND_n1 nQ_2 nQ_3 nD_1 NAND
xNAND_n2 nQb_2 MC_nand nD_3 NAND
xDFF_n4 nQb_4 nF_by4 nQb_4 nQ_4 TSPC_DFF
xDFF_n5 nQb_5 nQ_4 nQb_5 nQ_5 TSPC_DFF
xDFF_n6 nQb_6 nQ_5 nQb_6 nF_out TSPC_DFF
xOR_n1 nQ_4 nQ_5 MC_1 MC_nand NOR3
xNAND_n3 nQb_6 MC MC_1 NAND
15-92
xDFF_s6 sQb_6 Mode_1 sQb_6 sQ_6 TSPC_DFF
xINV_MC sQ_6 MC INV
/*-----f=433.5 MHz-----/*
.alter
.param clk_freq = 433.5e6
.param p0_volt = 3.3
.param p1_volt = 3.3
.param p2_volt = 0
.param p3_volt = 3.3
.param p4_volt = 3.3
/*-----f=434 MHz-----/*
.alter
.param clk_freq = 434e6
.param p0_volt = 3.3
.param p1_volt = 3.3
.param p2_volt = 0
.param p3_volt = 3.3
.param p4_volt = 3.3
.param s0_volt = 0
.param s1_volt = 0
.param s2_volt = 3.3
15-93
.param s3_volt = 0
.param s4_volt = 0
/*-----f=434.5 MHz-----/*
.alter
.param clk_freq = 434.5e6
.param p0_volt = 3.3
.param p1_volt = 3.3
.param p2_volt = 0
.param p3_volt = 3.3
.param p4_volt = 3.3
/*-----f=435 MHz-----/*
.alter
.param clk_freq = 435e6
.param p0_volt = 3.3
.param p1_volt = 3.3
.param p2_volt = 0
.param p3_volt = 3.3
.param p4_volt = 3.3
.param s0_volt = 0
.param s1_volt = 3.3
.param s2_volt = 3.3
.param s3_volt = 0
.param s4_volt = 0
.END
1
The frequency of our input signal was 433MHz. Each clock cycle is us
433
3464
long. Thus, 3464 clock cycles is 80 us. The result of this experiment is
433
shown in Fig. 15.12-22. As can be seen, PF-out occurs exactly a the expected time.
Thus, our 3464 counter works correctly.
15-94
CLK
F_pre_by4
nF_out
sF_out
pF_out
MC
15-95