Course 2 Acquisition and Treatment of Experimental Data 1. Sequential Logic Circuits
Course 2 Acquisition and Treatment of Experimental Data 1. Sequential Logic Circuits
Course 2 Acquisition and Treatment of Experimental Data 1. Sequential Logic Circuits
a) b) c)
Figure 4. The DFF: (a) Symbol; (b) equivalent circuit; (c) working diagram
The DFF transfers the digital level from the input D to the output Q, bur this does not
happen immediately and only happens on an rising clock pulse (i.e. as CLK goes from 0 to 1). The
input is thus delayed by up to a clock pulse before appearing at the output. This is illustrated in the
Figure 1.c. The DFF is an edge-triggered device which means that the change of state occurs only
on a clock transition (in this case the rising clock pulse as it goes from 0 to 1). The data
transferred from the D input to the Q output is memorized until the next rising clock pulse.
Additional to the function of elemental memory cell, the DFF may be also used as
frequency divider by connecting, as indicated in Figure 2, the D input to the Q output.
a) b)
Figure 2. Use of the DFF as frequency divider: (a) electronic schematic; (b) signals diagram
It can be seen that for every two input clock pulses only one output clock pulse appears, the
circuit is therefore performing division by 2. It should be noted that this behaviour only takes
places when the clock pulses are reasonably short (but at least long enough for the output to change
state). If the clock pulse is long then oscillation may occur.
1
Course 2 Acquisition and treatment of experimental data
a b
Figure 3. a) Symbol of a JKFF. b) JKFF with asynchronous Preset and Clear inputs, designed
based on NAND gates.
As illustrated in Figure 3.b, the implementation of the JKFF can be done using the NAND
gates, including the two asynchronous inputs for PRESET and CLEAR.
A truth table can be developed for the output Q at time t (before a clock pulse) and at time
t+1 (after a clock pulse), this is given below (clearly, the Q output is just the complement of Q).
J K Qt Qt+1
0 0 0 0
0 0 1 1
1 0 0 1
1 0 1 1
0 1 0 0
0 1 1 0
1 1 0 1
1 1 1 0
The final two lines in the truth table represent oscillation between the two states on each
rising CLK pulse. As was the case with the Delay flip-flop, this results in division by two of the
incoming CLK pulse as long as the clock pulse is short, otherwise oscillation may occur. This
behaviour can be summarised as follows:
J not equal to K → On the CLK pulse, Q takes the value of J and Q takes the
value of K;
J=K=0 → All transitions are inhibited ("no change")
J=K=1 → The circuit works as binary divider if the clock pulses are reasonably
short (but at least long enough for the output to change state). If the clock pulse is
long, then oscillation may occur.
Finally, it should be noted that the DFF and JKFF are the basic elements in achieving data
registers and complex counter circuits, being possible to carry out programmable division rates,
incrementing or decrementing of counters, etc.
2
Course 2 Acquisition and treatment of experimental data
U7
DCD_HEX
XLA1
1
Count_Enable
1
Key = S
Note here that, for a natural evolution of the outputs (increasing counted number), the clock
inputs are connected to the ~Q (inverted outputs) because the flip-flops trigger on the rissing edge
of each clock pulse.
For all of the 4 JKFFs, the J and K inputs are connected together, generating the
Count_Enabled control input, that must be held at 1 in order to allow the counting process. A 0
logic level on this input will disable the counting process. (see the Multisim application "01
4JK_FF_UP.ms11" from the sub-folder Course02_ATED\Resources\Multisim App)
Assuming an initial state where all outputs are 0, state that can be obtained by clearing
(RESET) all JKFFs, it is possible to develop a truth table for the four outputs Qa,Qb,Qc and Qd on
successive clock pulses, given below.
Imp. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Qa 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Qb 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
Qc 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
Qd 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
So, on successive clock pulses, the output from the four JKFFs is exactly the same as the
pure binary code representation of the decimal numbers from 0 to 15. Here, Qa is weighted by 1,
Qb is weighted by 2 and so on. Such a device is known as a ripple counter or a modulo-16 (mod-
16) counter.
If the Qn output of the previous flip-flop is connected to the CLK n + 1 input of the later flip-
flop, the counter evolves in decreasing order (see "02 4JK_FF_DOWN.ms11" in the sub-
folder ....\Multisim App). Changing the counting direction can be accomplished by controlling
clockwise signals with X-OR gates (see "03 4JK_FF_UP_DOWN.ms11" in the sub-folder
....\Multisim App).
The same 3 types of counters (ascending, descending, or switching) can be implemented
with D-type flip-flops (see "04 4D_FF_UP.ms11", "05 4D_FF_DOWN.ms11" and "06
4D_FF_UP_DOWN.ms11" in sub-folder...\Multisim App).
Qc = 0
Qd = 1
In principle, this would require the logical AND of the outputs Qb and Qd and the
complements of Qa and Qc. In practise however, from the mod-16 counter truth table it can be
seen that decimal 10 value corresponds to the first time that Qb and Qd are 1 and so the logic is
simplified.
The subsequent circuit for a decade counter is illustrated in Figure 5, where some of the
labelling has been omitted for clarity.
U7
DCD_HEX
XLA1
1
U6
50 Hz K ~Q K ~Q K ~Q K ~Q
F
RESET RESET RESET RESET C Q T
JK_FF JK_FF JK_FF JK_FF
U9 AND2
Figure 5. Decade
counter based on
JKFFs
When the count reaches 1010bin then Qb = Qd = 1 and so the output from the AND gate
changes from 0 to 1. In this case RESET goes from 0 to 1 and causes all of the Q outputs to be
reset to 0. At the same time, Qb = Qd = 0 then the output of the AND gate returns to 0 and the
count can restart (see "07 4JK_FF_BCD.ms11" application from the sub-folder ....\Multisim App).
By increasing the number "n" of flip-flops included in the counter structure and using a
corresponding network of AND gates, the dividing factor of the circuit can be set to any integer
value between 1 and 2n.
Unlike the previous examples, the changing of the dividing ratio can be set without
modifying physically the electronic circuits, by using:
Presettable reversible counters, such as, for example, the 74LS191 integrated circuit. This
type of circuit allows, besides the direct and reversible counting, the parallel asynchronous
loading of the counter (preset) with a logical code fixed by user. As indicated in Figure 7,
the circuit is operated reversibly (Down) and the RCO (Ripple Clock Output) circuit output
is coupled to the parallel asynchronous loading input of the counter (see "09
DIV_PROG_PRES.ms11" application from the sub-folder ....\Multisim App).
4
Course 2 Acquisition and treatment of experimental data
U4
VCC
5V
DCD_HEX_BLUE
Count/STOP
GND XLA1
1
U1 U2 U3 U6
SET SET SET SET
U5 J Q J Q J Q J Q
F
CLK CLK CLK CLK C Q T
K ~Q K ~Q K ~Q K ~Q
V1 NOT
10 Hz U12 RESET RESET RESET RESET
5V
JK_FF JK_FF JK_FF JK_FF
GND U11
DCD_HEX_DIG_RED
XOR2 U7
XOR2 U8
XOR2 U9 NOR4
XOR2U10
VCC
VCC VCC
VCC 5V
5V 5V
5V
2^3
2^1 2^2
2^0
GND
GND GND
GND
U12 U4
DCD_HEX_BLUE
VCC
U1
5V
15 A QA 3
1 B QB 2
10 C QC 6
9 D QD 7
4 ~CTEN
11 ~LOAD
5 ~U/D ~RCO 13
V1 MAX/MIN 12
14 CLK
10 Hz
5V GND 74LS191D
GND
Figure 7. Schematic of a
2^0 2^1 2^2 2^3
programmable divider
GND GND GND GND
based on presettable
reversible counter
In this configuration, the circuit counts down from the parallel loaded number to 0, at which
the output RCO passes to logical "0" and the counter is re-loaded with the division factor
programmed by user via the switches 2^0, 2^1, 2^2 and 2^3. Subsequently, the process is
repeated, resulting in a division of the input frequency according to the programmed division
factor.
- data bus;
- address bus
- control bus
The introduction and the reading of data in/from a bus is made using specialised circuits
like multiplexers, demultiplexers, decoders, data registers, transfer gates etc.
The most common circuit that can retrieve and memorize the information existing on a bus
can be designed using data registers based on D type flip-flops, such as the 74LS175 circuit. In this
context, the example presented in Figure 8, shows the ability to control 4 7-segment digital
displays using only 7 digital lines, grouped in 3 buses: 4 lines for the data bus (D0 ÷ D3), 2 lines
for the address bus (A0, A1) and 1 line the for bus control (CLK).
1 1 1 1
Key = Space Key = M S1 S2 S3 S4
GND UP/DOWN OSC/MAN X1 X2 X3 X4
U11
SET
D Q
CLK ~Q
RESET
U32
D_FF
U12
SET
D Q
CLK ~Q
RESET
D_FF
U56
X8
X5 X6 X7
D2
D0
D2
D3
D1
D2
D0
D3
D1
D3
D1
D0
D2
D0
D3
D1
CLK
CLK
CLK
CLK
U44 U46 U48 U50
74LS175 74LS175 74LS175 74LS175
Q2
Q0
Q2
Q3
Q1
Q2
Q0
Q3
Q1
Q3
Q1
Q0
Q2
Q0
Q3
Q1
U45 U47 U49 U51
Figure 8. Circuit for the multiplexed transfer of data using dedicated buses
6
Course 2 Acquisition and treatment of experimental data
U21
U22 U23
Key = S
VCC
5V U33 200 Hz
Ser/Par
In order to simplify the scheme of devices for serial data transmission, digital specialized
circuits of shift register type were designed for the parallel/serial data conversion (i.e. 74LS165)
and serial/parallel data conversion (i.e. 74LS164).
7
Course 2 Acquisition and treatment of experimental data
Unfortunately, the “von Neumann” model requires multiple connections between the
included units.
Figure 11. The architecture of the computing system based on system’s buses
The communication and the data transfer between the three main components of the
computing system is done using dedicated buses:
(1) Data Bus;
(2) Address Bus
(3) Control Bus
8
Course 2 Acquisition and treatment of experimental data
It is worth to note that the CPU makes logical and arithmetical operations, but only one at a
time. As a consequence, the instructions, the primary and intermediate data and, also, the final
results must be stored in the memory units. Depending on the type of stored data, as described in
Figure 12, the memory units have different speeds and capacities.
Figure 12. Comparison between different types of memory units used in the computing systems
Moreover, the faster memory units are more expensive and, as a consequence, their
capacity is limited, usually, at small values.
9
Course 2 Acquisition and treatment of experimental data
From a technological point of view, the secondary memory use different principles to store
the data:
(a) Magnetic (tapes, hard discs);
(b) Optic (CD, CD-R, CD-RW, DVD, etc.)
(c) Magneto-optic (magneto-optical disc)
The selection of the secondary memory device is made depending on the desired storage
capacity, the access speed, the price and the reliability of the device and data security.
10
Course 2 Acquisition and treatment of experimental data
► Application:
Identify the main components of a computing system and of some motherboards using the
equipments offered as didactical material.
A comparison between the speeds of data transfer in old and new PC configuration is
presented in Figures 14 and 15.
11
Course 2 Acquisition and treatment of experimental data
Figure 14. Comparison between the speed of data transfer inside of a PC depending on the used
bus
12
Course 2 Acquisition and treatment of experimental data
Figure 15. Comparison between the speeds of data transfer inside of a more recent PC (Chipset
Intel® 975X Express) depending on the used buses.
13
Course 2 Acquisition and treatment of experimental data
peripheral boards, more of them of “Plug&Play” type. Currently, the PCI interface starts to be
replaced by the PCI-Express one and, moreover, by the PCIe 16X interfaces.
AGP (accelerated graphic port) is dedicated exclusively to connect graphical adapters.
14