Lecture 35
Lecture 35
1. Serial-to-Parallel Converter
Earlier, Multiplexer and Demultiplexer based Parallel to Serial and Serial to
Parallel converters were discussed. The Multiplexer and Demultiplexer require registers
to store the parallel data that is converted into serial data and parallel data which is
obtained after converting the incoming serial data. A Parallel In/Serial Out shift register
offers a better solution instead of using a Multiplexer-Register combination to convert
parallel data into serial data. Similarly, a Serial In/Parallel Out shift register replaces a
Demultiplexer-Register combination.
LOAD
2. Keyboard Encoder
Earlier a simple keypad encoder circuit was discussed where, the 0 to 9 digit
keypad was connected through a decade to BCD encoder. Pressing any keypad key
enables the corresponding input of the encoder circuit which encodes the input as a 4-bit
BCD output. Computer keyboards which have more keys employ a keyboard encoder
circuit that regularly scans the keyboard to check for any key press. Figure 35.3. The
scanning is done by organizing the keys in the form of rows and columns. With the help
of a shift register based ring counter one row is selected at a time. The two counters are
connected as an 8-bit Ring counter which sequences through a bit pattern having all 1’s
and a single 0. The 8 state sequence selects one row at a time by setting it to logic 0. If a
key is pressed, the corresponding column also becomes logic 0 as it connected to the
selected row. The row and column which are selected are encoded by the row and column
encoders. When a key is pressed, the selected column which is set to logic 0 sets the
output of the NAND gate to logic 1 which triggers two One Shots. The first One Shot
inhibits the clock signal to the ring counters for a short interval until the Key Code is
stored. The One Shot also triggers the second One-Shot that sends a pulse to the clock
input of the Key Code register. The Key Code Register stores the key ID represented as
3-bit column and 3-bit row code.
SH / LD +V
of the D flip-flop instead of the Q output. The feedback to the AND gate array however
remains the same, which is connected to the Q output of the D flip-flop.
The ISTYPE statement is used in the declaration part with the statements assigning PIN
numbers to output variables.
The declaration statements describe variable X and Y available at output pins 22 and 23
respectively. The X variable is a ‘Registered’ output available from the D-flip-flop. The
Y variable is a ‘Combinational’ output available directly from the AND-OR gate array
output. The active-low or active-high output of the Registered Mode can also be specified
in the declaration statement
The assignment operators ‘:=’ and ‘:>’ are used in logic descriptions to indicate a
Registered output.
X := D;
Y = D;
The first logical declaration statement indicates that X will be assigned the value of D on
the clock transition and will hold the value until the next clock transition. The second
logical declaration indicates that output Y is equal to input D.
The dot extension ‘.CLK’ is used to indicate that the register device is a clocked flip-flop.
A statement using the dot extension must accompany a logical declaration statement.
X := D;
X.CLK = Clock;
Figure 35.6a ABEL Statements for implementing an 8-bit register with inverted outputs
Q0
Q1
Q2
Q3
Q4
Q5
Q6
Q7
PLD. The D flip-flop implemented in the OLMC is triggered on the positive clock edge.
It also has active-high, asynchronous set and clear inputs.
Module Right_bit_shift_register
“Device Declaration
“Pin Declaration
Equations
Test_Vectors
([Clock, Clear, Data, Enable] -> [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7])
[ .x. , 0 , .x. , .x. ] -> [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 1 , 0 ] -> [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 0 , 1 ] -> [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 1 , 1 ] -> [1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 0 , 1 ] -> [0 , 1 , 0 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 1 , 1 ] -> [1 , 0 , 1 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 0 , 1 ] -> [0 ,1 ,0 ,1 ,0 ,0 ,0 ,0 ];
[ .c. , 1 , 1 , 1 ] -> [1 ,0 ,1 ,0 ,1 ,0 ,0 ,0 ];
[ .c. , 1 , 0 , 1 ] -> [0 ,1 ,0 ,1 ,0 ,1 ,0 ,0 ];
[ .c. , 1 , 1 , 1 ] -> [1 ,0 ,1 ,0 ,1 ,0 ,1 ,0 ];
[ .c. , 1 , 0 , 1 ] -> [0 ,1 ,0 ,1 ,0 ,1 ,0 ,1 ];
[ .c. , 1 , 1 , 1 ] -> [1 ,0 ,1 ,0 ,1 ,0 ,1 ,0 ];
[ .c. , 0 , 1 , 1 ] -> [0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ];
END
Figure 35.8 ABEL Input file for Serial In/Parallel Out Shift register
The ABEL Input file format for the shift register is shown in figure 35.4. The
Equations and the Test_Vectors declarations are,
The Q0 output is active high and depends upon the product of Data input and the
Enable input and Q0 will be assigned the product value at the positive transition of
the clock.
• [Q1, Q2, Q3, Q4, Q5, Q6, Q7] := [Q0, Q1, Q2, Q3, Q4, Q5, Q6];
[Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7].CLK = Clock;
The Q0, Q1, Q2, Q3, Q4, Q5, Q6 outputs are assigned to Q1, Q2, Q3, Q4, Q5, Q6,
Q7 respectively on a clock transition.
The Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7 outputs are reset on a Clear signal applied at
the Asynchronous Reset (AR) Input.
• ([Clock, Clear, Data, Enable] -> [Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7])
[ .x. , 0 , .x. , .x. ] -> [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 1 , 0 ] -> [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 0 , 1 ] -> [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ];
[ .c. , 1 , 1 , 1 ] -> [1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ];
The Test_Vector specifies ‘x’ as don’t care, ‘c’ as clock signal, thus the first vector
specifies logic 0 outputs when Clear input is logic 0. Clock, Data and Enable inputs
are don’t care. The second vector specifies a clock transition with, Clear, Data and
Enable inputs set to logic 1, 1 and 0 respectively. The Enable input is set to logic 0
therefore the shift operation is inhibited. The third vector enables the shift operation
with logic 0 shifted in. The fourth vector shifts in logic 1.
D0 D1 D2 D3
SHIFT / LOAD
1 2 1 2 1 2
CLK
Clear
Figure 35.9 4-bit Parallel In/Serial Out Shift Register
Module Four_bit_shift_register
“Device Declaration
“Pin Declaration
Equations
Q0 := D0;
Q1 := Q0 & SHLD # D1 & !SHLD;
Q2 := Q1 & SHLD # D2 & !SHLD;
Test_Vectors
END
Figure 35.10 ABEL Input file for a 4-bit Parallel In/Serial Out Shift register
The Q0 output is active high and is assigned the value Do at the positive transition of
the clock.
The Q1, Q2 and Q3 output is assigned the value based on the Boolean expression
Q0.SHLD + D1.SHLD , Q1.SHLD + D2.SHLD and Q2.SHLD + D3.SHLD on a
positive clock transition.
The Q0, Q1, Q2, Q3 outputs are reset on a Clear signal applied at the Asynchronous
Reset (AR) Input.
The Test_Vector specifies ‘x’ as don’t care, ‘c’ as clock signal, thus the first vector
specifies logic 0 output at Q3 when Clear input is logic 0. Clock, SHLD, D0, D1, D2
and D3 inputs are don’t care. The second vector specifies a clock transition with,
Clear, SHLD, D0, D1, D2 and D3 inputs set to logic 1, 0, 0, 1, 0 and 1 respectively.
The data 0101 is loaded into the register with the Q3 output set to 1.