Professional Documents
Culture Documents
Experiment (6)
Theoretical background
Shift Registers
A register capable of shifting its binary information in one or both directions is
called a shift register. The logical configuration of a shift register consists of a chain
of flip-flops in cascade, with the output of one flip-flop connected to the input of the
next flip-flop. All flip-flops receive common clock pulses, which activate the shift
from one stage to the next.
The simplest possible shift register is one that uses only flip-flops, as shown in
Figure 1. The output of a given flip-flop is connected to the D input of the flip-flop at
its right. Each clock pulse shifts the contents of the register one bit position to the
right. The serial input determines what goes into the leftmost flip-flop during the shift.
The serial output is taken from the output of the rightmost flip-flop. Sometimes it is
necessary to control the shift so that it occurs only with certain pulses, but not with
others. This can be done by inhibiting the clock from the input of the register to
prevent it from shifting. The shift operation can he controlled through the D inputs of
the flip-flops rather than through the clock input. If however the shift register of
Lab Experiments 2nd Year Electric
Figure 1 is used, the shift can be controlled by connecting the clock through an AND
gate with an input that controls the shift.
Suppose the shift registers have four bits each. The control unit that supervises
the transfer must be designed in such a way that it enables the shift registers,
through the shift control signal, for a fixed time of four clock pulses. This is
Lab Experiments 2nd Year Electric
shown in the timing diagram of figure 3. The shift control signal is
synchronized with the clock and changes value just after the negative edge of
the clock. The next four clock pulses find. the shift control signal in the active
state so that the output of the AND gate connected to the CLK inputs produces
four pulses, T1, T2, T3, and T4. Each rising edge of the pulse causes a shift in
both registers. The fourth pulse changes the shift control to 0 and the shift
registers are disabled. Assume that the binary content of A before the shift is
1011 and that of B is 0010. The serial transfer from A to B occurs in four steps,
as shown in Table 1. With the first pulse T1, the right most bit of A is shifted
into the leftmost bit of B and is also circulated into the leftmost position of A.
At the same time, all bits of A and B are shifted one position to the right. The
previous serial output from B in the rightmost position is lost and its value
changes from 0 to 1. The three pulses perform identical operations, shifting the
bits of A into B, one at a time. After the fourth shift, the shift control goes to 0
and both registers A and B have the value 1011. Thus the content of A is
transferred into B, while the content of A remains unchanged. The difference
between serial and parallel modes of operation should he apparent from this
example. In the parallel mode, information is available from all bits of a
register and all bits can be transferred simultaneously during one clock pulse.
In the serial mode, the registers have a single serial input and a single serial
output. The information is transferred one bit at a time while the registers are
shifted in the same direction
Counters:
Using the map method to calculate the TA2, TA1 and TA0 we have:
TA2 = A0A1
TA1 = A0
TA0 = 1
Including these functions with three flip-flops, we obtain the logic diagram of
the counter, as shown in Figure 5.
Ripple counter
MSI counters come in two categories: ripple counters and synchronous
counters. In a ripple counter, the flip-flop output transition serves as a source
for triggering other flip-flops. In other words, the cp inputs of all flip-flops
(expect the first) are triggered not by the incoming pulses, but rather by the
transition that occurs in other flip-flops, as shown in Figure 6.
A decimal counter follows a sequence of ten state and return to 0 after the
count of 9. Such a counter must have at least four flip-flops to represented each
decimal digit, since a decimal digit is represented by a binary code with at least
four bits. The sequence of states in a decimal counter is dictated by the binary
code used to represent a decimal digit. If this is similar to a binary counter,
except that the state after 1001 (code for decimal digit 9) is 0000 (code for
decimal digit 0). See Figure and Figure 8.
The following are the conditions for each flip-flop state transition:
1. Q1 is complemented on the negative edge of every pulse.
2. Q2 is complemented if Q8 = 0 and Q1 goes from 1 to 0. Q2 is
cleared if Q8 = 1 and Q1 goes from 1 to 0.
3. Q4 is complemented when Q2 goes from 1 to 0.
4. Q8 is complemented when Q2Q4 = 11 and Q1 goes from 1 to 0. Q8
is cleared if either Q4 or Q2 is 0 and Q1 goes from 1 to 0.
Equipments (photos):
1. 74195 IC register.
2. JK flip-flop 7476 ICs,
3. AND gate 7408 IC,
4. NAND gate 7400 IC,
5. 4-bit synchronous binary counter with parallel load asynchronous clear
74161 IC,
6. LEDs
7. Multimeter
8. Breadboard
9. Connecting wires
10. DC voltage supplies (5-Volts, 0-Volts).
Exercise 6-1
Ex 6-1-1
IC Shift Register
IC type 74195 is a 4-bit shift register with parallel load and asynchronous clear.
The pin assignment to the inputs and outputs is shown in Figure 11.The single
control line labeled SH/LD (shift/load determines the synchronous operation of
the register. When SH/LD = 0, the control input is in the load mode and the
four data inputs are transferred into the four internal flip-flops, QA through
QD. When SH/LD = 1, the control input is in the shift mode and the
information in the register is shifted right from QA toward QD. The serial input
into QA during the shift is determined from the J and K inputs. The two inputs
behave like the J and the complement of K of a JK flip-flop. When both J and
K are equal to 0, flip-flop QA is cleared to 0 after the shift. If both inputs are
equal to 1, QA is set to 1 after the shift. The other two conditions for the J and
K inputs provide a complement or no change in the output of flip-flop QA
after the shift. The function table in table 8 for the 74195 shows the mode of
operation of the register. When the clear input goes to 0, the four flip-flops
clear to 0 asynchronously, that is, without the need of a clock. Synchronous
operations are affected by a positive transition of the clock. To load the input
data, the SH/LD must be equal to 0 and a positive clock-pulse transition must
occur. To shift right, the SH/LD must he equal to 1. The J and K inputs must
be connected together to form the serial input.
Perform an experiment that will verify the operation of the 74195 IC. Show
that it performs all the operations listed in the function table. Include in your
function table the two conditions for J K = 01 and 10.
Ex 6-1-2
Bidirectional Shift Register without parallel load
The 74195 IC can shift only right from QA toward QD. It is possible to
convert the register to a bidirectional shift register by using the load mode to
obtain a shift left operation (from QD toward QA). This is accomplished by
connecting the output of each flip-flop to the input of the flip-flop on its left
and using the load mode of the SH/LD input as a shift-left control. Input D
becomes the serial input for the shift-left operation.
Connect the 74195 as a bidirectional shift register (without parallel load).
By connecting the serial input for shift right to a toggle switch. Construct the
shift left by connecting the serial input D to a toggle switch. Clear the register
and then check its operation by shifting right a single 1 from the serial input
switch and record each state in table 3. Shift left three more times and insert 0’s
from the serial input switch and record each state in table 4.
c. Show how the 74161 IC together with a 2-input NAND gate can be made
to operate as a synchronous BCD counter that counts from 0000 to 1001.
By using two ways, first by using NAND gate to detect the count of
1010, which then clears the counter asynchronous through the clear
input. Second use the NAND gate to detect the count of 1001, which then
causes all 0's to be loaded into the counter.
Table 5
Function Table
Clear Clock Load Count Function
0 X X X Clear outputs to 0
1 0 X Load input data
1 1 1 Count to next binary value
1 1 0 No change in output
Report
1- Construct a bidirectional shift register with parallel load using the 74195
register and the 74157 multiplexer. The circuit should be able to perform
the following operations: ( indicate your answer with a characteristic table
such as the following table.
a) Asynchronous clear,
b) Shift right,
c) Shift left,
d) Parallel load,
2- Design a digital clock (24 mode) by using six binary counters: 2 for seconds,
2 for minutes and 2 for hours