Beruflich Dokumente
Kultur Dokumente
Digital Systems
Lecture 10
Sequential circuit design and analysis with T flip flops
1. Introduction
We can use any flip flop to design counter circuits. In the last lecture we saw how to do this with D flip
flops. In this lecture we will repeat the same examples using T flip flops. The design process for T flip
flops is conceptually a little more complicated than for D flip flops, but the circuits that result are
usually simpler.
T Q Clock Q+
0 0 0 T Q
0 1 1
1 0 1 Clock Q
1 1 0
As before, any signal without the + superscript refers to the value just before the clock edge. The +
superscript is used to denote values just after the clock edge. The T input can be regarded as a control
input whose function is:
• T=0 Hold the memorised bit constant
• T=1 Toggle the memorised bit
T Clock Q+ Name
0 Q Hold
1 �
Q Toggle
• When T=0, Q+=Q. In other words, the value of Q that will happen just after the clock edge is the
same as the value that Q had just before the clock edge.
• When T=1, Q+ =Q � , in other words, the value of Q that will happen just after the clock edge is the
complement of the value that Q had just before the clock edge
Clock
1
2.1 The T Flip Flop Characteristic Equation
We can derive the characteristic equation of the T flip flop from its truth table:
Q
T 0 1
0 0 1
1 1 0
This equation tells us how the value of the memory bit after the clock edge (Q+) is derived from the
value of the memory bit before the clock edge before the clock edge (Q) and the T input before the
clock edge.
1 Q0
T0 Q0 T1 Q1
Ck Q Ck Q
0 1
We can work this out by forming table a table of values on successive clock cycles. The values of
����,Q , and ��
Q0 ,Q Q��1 (before the clock edge) give rise to values of T0, T1 (before the clock edge). These
0 1
values of T0, T1 will cause the values after the clock edge Q0+, Q1+ to be a flip (Q+ =Q � ) or a hold
+
(Q =Q) of the value before the clock edge. We can use this information to work out the sequence that
Q0, Q1 will go through.
Cycle Q1 Q0 ����
𝑸𝑸𝟏𝟏 ����
𝑸𝑸𝟎𝟎 T1 T0 Q+1 Q+0
Start 0 0 1 1 0 1 0 1
1 0 1 1 0 1 1 1 0
2 1 0 0 1 0 1 1 1
3 1 1 0 0 1 1 0 0
4 0 0
And repeats forever
T 0 Q0 T 1 Q1 D0 Q 0 D1 Q 1
Ck Q Ck Q1 Ck Q0 Ck Q
1
0
2-bit binary up-counter using T-types 2-bit binary up-counter using D-types
The circuit built from T types requires fewer logic gates. This is usually the case for most common
types of counter, hence the popularity of T-type flip-flops.
T0 Q0 T1 Q1
Ck Q Ck Q
0 1
We have to design the logic that goes into the boxes. The inputs to this logic can be the values of Q1,
Q0 (and their complements) before the clock edge. This requires a little more thought than was
necessary when we were using D flip flops. With a D flip flop, the value at the D input was simply
equal to Q+. With the T type we need to think what value T needs to have to give the required
transition. We can do this by drawing up a table that shows the value of Q before the clock edge, the
value of Q+ that we desire after the clock edge, and the value of T that is necessary in order to achieve
this:
Value before clock Desired value after What operation What value of T
edge Q clock edge Q+ will give this? will give this?
0 0 Hold 0
0 1 Toggle 1
1 0 Toggle 1
1 1 Hold 0
This is called the excitation table of the flip flop. It shows what value of input T is needed to cause
(“excite”) the required transition in the memory bit.
3
Output=0→3→2→1→0→3→2→1→ and so on forever
Interpreting these denary numbers in binary means that this is what we need to design:
This means that we are designing two pieces of logic, one for T0 and one for T1. This can be done by
drawing up two tables (one for T1, one for T0) that show:
• the values of the inputs (Q0, Q1) to the box before the clock edge
• the value that we want after the clock edge Q+
• the value that we must force T to before the clock edge in order to get the required next value
Our task is then to design the logic that takes the values of Q0, Q1 as inputs and produces the required
value of T at the output. This can be done with two K-maps:
Q1 Q1
Q0 0 1 Q0 0 1
0 1 1 0 1 1
1 0 0 1 1 1
𝑇𝑇1 = ���
𝑄𝑄0 𝑇𝑇0 = 1
We see that the desired T is not dependent on Q1 or Q0: it is simply 1 all of the time. Our circuit
solution is:
4
1 Q0
T0 Q0 T1 Q1
Ck Q Ck Q
0 1
This will require 2 flip flops as we require 2-bits to represent the numbers 0,1,2,3. The transition tables
and Karnaugh maps for this device are shown below.
5
Q1Q0 Q1Q0
00 01 11 10 00 01 11 10
DOWN
DOWN
0 0 1 1 0 0 1 1 1 1
1 1 0 0 1 1 1 1 1 1
T1=DOWN.Q0+DOWN.Q0 T0=1
The equation for T1 is equivalent to an XOR gate:
����0 +DOWN
T1 =DOWN.Q ���������.Q0 =DOWN⊕Q0
DOWN
1 T0 Q0 T1 Q1
Ck Q Ck Q
0 1
4 Summary
In this lecture we have introduced counters as an example of the design approaches used to build
counters from T-type flip-flops Design proceeds by forming a table of the transitions of the state of the
flip flop outputs that must occur on each clock cycle, then deciding what value the T input should take
at the clock edge in order to give the required output after the clock edge.
Examples
1. The circuit starts with Q0=0, Q1=0. What will be the values of Q0 and Q1 on subsequent clock
cycles?
Q0+Q1 Q0+Q1
T0 Q0 T1 Q1
Ck Q Ck Q
0 1
Cycle Q0 Q1 ����
𝑸𝑸𝟎𝟎 ����
𝑸𝑸𝟏𝟏 T0 T1 Q+0 Q+1
Start 0 0 1 1
1
2
3
6
2. Use T flip flops to design a counter follows the count sequence Q1Q0=00→01→11→10→00,
etc…. (This is a 2-bit Gray-code counter)
Q1 Q1
Q0 0 1 Q0 0 1
0 0
1 1
T0 Q0 T1 Q1
Ck Q Ck Q
0 1