Transcribed Image Text Q6) Design a serial 2's complementer with a shift register and a flip-flop. The binary number is shifted out from one side and it's 2's complement shifted into the other side of the shift register Get more help from Chegg. What is the maximum frequency at which the counter can operate reliably? 7.Design a serial 2’s complementer with a shift register and a flip - flop. The binary number is shifted out from one side and it’s 2’s complement shifted into the other side of the shift register You've reached the end of your free preview. Want to read the whole page?
We know that one flip-flop can store one-bit of information. In order to store multiple bits of information, we require multiple flip-flops. The group of flip-flops, which are used to hold (store) the binary data is known as register.
If the register is capable of shifting bits either towards right hand side or towards left hand side is known as shift register. An ‘N’ bit shift register contains ‘N’ flip-flops. Following are the four types of shift registers based on applying inputs and accessing of outputs.
The shift register, which allows serial input and produces serial output is known as Serial In – Serial Out (SISO) shift register. The block diagram of 3-bit SISO shift register is shown in the following figure.
This block diagram consists of three D flip-flops, which are cascaded. That means, output of one D flip-flop is connected as the input of next D flip-flop. All these flip-flops are synchronous with each other since, the same clock signal is applied to each one.
In this shift register, we can send the bits serially from the input of left most D flip-flop. Hence, this input is also called as serial input. For every positive edge triggering of clock signal, the data shifts from one stage to the next. So, we can receive the bits serially from the output of right most D flip-flop. Hence, this output is also called as serial output.
Let us see the working of 3-bit SISO shift register by sending the binary information “011” from LSB to MSB serially at the input.
Assume, initial status of the D flip-flops from leftmost to rightmost is $Q_{2}Q_{1}Q_{0}=000$. We can understand the working of 3-bit SISO shift register from the following table.
No of positive edge of Clock | Serial Input | Q2 | Q1 | Q0 |
---|---|---|---|---|
0 | - | 0 | 0 | 0 |
1 | 1(LSB) | 1 | 0 | 0 |
2 | 1 | 1 | 1 | 0 |
3 | 0(MSB) | 0 | 1 | 1(LSB) |
4 | - | - | 0 | 1 |
5 | - | - | - | 0(MSB) |
The initial status of the D flip-flops in the absence of clock signal is $Q_{2}Q_{1}Q_{0}=000$. Here, the serial output is coming from $Q_{0}$. So, the LSB (1) is received at 3rd positive edge of clock and the MSB (0) is received at 5th positive edge of clock.
Therefore, the 3-bit SISO shift register requires five clock pulses in order to produce the valid output. Similarly, the N-bit SISO shift register requires 2N-1 clock pulses in order to shift ‘N’ bit information.
The shift register, which allows serial input and produces parallel output is known as Serial In – Parallel Out (SIPO) shift register. The block diagram of 3-bit SIPO shift register is shown in the following figure.
This circuit consists of three D flip-flops, which are cascaded. That means, output of one D flip-flop is connected as the input of next D flip-flop. All these flip-flops are synchronous with each other since, the same clock signal is applied to each one.
In this shift register, we can send the bits serially from the input of left most D flip-flop. Hence, this input is also called as serial input. For every positive edge triggering of clock signal, the data shifts from one stage to the next. In this case, we can access the outputs of each D flip-flop in parallel. So, we will get parallel outputs from this shift register.
Let us see the working of 3-bit SIPO shift register by sending the binary information “011” from LSB to MSB serially at the input.
Assume, initial status of the D flip-flops from leftmost to rightmost is $Q_{2}Q_{1}Q_{0}=000$. Here, $Q_{2}$ & $Q_{0}$ are MSB & LSB respectively. We can understand the working of 3-bit SIPO shift register from the following table.
No of positive edge of Clock | Serial Input | Q2(MSB) | Q1 | Q0(LSB) |
---|---|---|---|---|
0 | - | 0 | 0 | 0 |
1 | 1(LSB) | 1 | 0 | 0 |
2 | 1 | 1 | 1 | 0 |
3 | 0(MSB) | 0 | 1 | 1 |
The initial status of the D flip-flops in the absence of clock signal is $Q_{2}Q_{1}Q_{0}=000$. The binary information “011” is obtained in parallel at the outputs of D flip-flops for third positive edge of clock.
So, the 3-bit SIPO shift register requires three clock pulses in order to produce the valid output. Similarly, the N-bit SIPO shift register requires N clock pulses in order to shift ‘N’ bit information.
The shift register, which allows parallel input and produces serial output is known as Parallel In − Serial Out (PISO) shift register. The block diagram of 3-bit PISO shift register is shown in the following figure.
This circuit consists of three D flip-flops, which are cascaded. That means, output of one D flip-flop is connected as the input of next D flip-flop. All these flip-flops are synchronous with each other since, the same clock signal is applied to each one.
In this shift register, we can apply the parallel inputs to each D flip-flop by making Preset Enable to 1. For every positive edge triggering of clock signal, the data shifts from one stage to the next. So, we will get the serial output from the right most D flip-flop.
Let us see the working of 3-bit PISO shift register by applying the binary information “011” in parallel through preset inputs.
Since the preset inputs are applied before positive edge of Clock, the initial status of the D flip-flops from leftmost to rightmost will be $Q_{2}Q_{1}Q_{0}=011$. We can understand the working of 3-bit PISO shift register from the following table.
No of positive edge of Clock | Q2 | Q1 | Q0 |
---|---|---|---|
0 | 0 | 1 | 1(LSB) |
1 | - | 0 | 1 |
2 | - | - | 0(LSB) |
Here, the serial output is coming from $Q_{0}$. So, the LSB (1) is received before applying positive edge of clock and the MSB (0) is received at 2nd positive edge of clock.
Therefore, the 3-bit PISO shift register requires two clock pulses in order to produce the valid output. Similarly, the N-bit PISO shift register requires N-1 clock pulses in order to shift ‘N’ bit information.
The shift register, which allows parallel input and produces parallel output is known as Parallel In − Parallel Out (PIPO) shift register. The block diagram of 3-bit PIPO shift register is shown in the following figure.
This circuit consists of three D flip-flops, which are cascaded. That means, output of one D flip-flop is connected as the input of next D flip-flop. All these flip-flops are synchronous with each other since, the same clock signal is applied to each one.
In this shift register, we can apply the parallel inputs to each D flip-flop by making Preset Enable to 1. We can apply the parallel inputs through preset or clear. These two are asynchronous inputs. That means, the flip-flops produce the corresponding outputs, based on the values of asynchronous inputs. In this case, the effect of outputs is independent of clock transition. So, we will get the parallel outputs from each D flip-flop.
Let us see the working of 3-bit PIPO shift register by applying the binary information “011” in parallel through preset inputs.
Since the preset inputs are applied before positive edge of Clock, the initial status of the D flip-flops from leftmost to rightmost will be $Q_{2}Q_{1}Q_{0}=011$. So, the binary information “011” is obtained in parallel at the outputs of D flip-flops before applying positive edge of clock.
Therefore, the 3-bit PIPO shift register requires zero clock pulses in order to produce the valid output. Similarly, the N-bit PIPO shift register doesn’t require any clock pulse in order to shift ‘N’ bit information.
A shift register is an n-bit register with provision for shifting its stored data by one position at each clock pulse. The logical configuration of a shift register consists of a chain of flip-flops connected in cascade, with the output of one flip-flop connected to the input of the next flip-flop. All flip-flops receive a common clock pulse which causes the shift from one stage to the next. Fig. 1 shows a simple shift register configuration. The new bit to be shifted into one end must be specified, and the bit shifted off the other end is lost unless it is saved externally. Although Fig. 1 shows a right-shift register, the same register can obviously be used for left shifts simply by reversing the sense of the bits. Most shift registers have provision for shifting only in one direction, but some have a control input that allows either left or right shifting to be specified at each clock.
One way to load n bits of data into the flip-flop chain is to load the data one bit each clock cycle using the serial input. Some shift registers also have parallel inputs that can be used to load all n bits in one clock cycle. The output of a shift register can be observed one bit at a time at the serial output, but some shift registers also have parallel outputs for observing all n bits at once.
Shift registers are classified according to three basic considerations: their method of data handling (serial-in serial-out, serial-in parallel-out, and parallel-in serial-out), their direction of data movement (shift right, shift left, and bidirectional), and their bit length. One of the important applications of shift register circuits is in serial computation. Compared to parallel computation, where all bits in a word are processed at the same cycle, serial computation process words in one bit per cycle. Therefore, serial computation is slower, but it has the advantage of requiring less hardware and wiring. A serial adder will be built in this experiment as an example.
Students are expected to understand various data handling methods in shift registers and their usage.
Use two 7474 dual flip-flops to connect a serial-in, parallel-out shift register as shown in Fig. 1. Connect L1–L4 to four LEDs (with current-limiting resistors), SW1 and SW2 to switches, and CLK to a pulser. Initially, set SW2 to logic 1. Switch SW2 being at logic 1 clears all flip-flops. Now set SW1 to logic 1 and SW2 to logic 0. Push the pulser button several times to allow more logic 1 to be shifted into the shift register. Change SW1 to logic 0 and repeat the experiment again.
Now use the above circuit to build a pseudo-random binary sequence generator as shown in Fig. 2. This binary sequence generator will display a random output (repeats every 2n–1 bits, where n is the number of flip-flops used in the shift register). The IC 7486 provides the exclusive-OR needed in the circuit. To start the sequence generator, set the initial state of the shift register to 0001 by setting the switch SW1 to logic 1. Then change SW1 to logic 0 as this will release the control input. Now apply the clock and record the output in a table. Does the output show randomness? Does the output repeat after 15 pulses?
A serial adder adds bits adds a pair of binary numbers serially with a simple full adder. The carry out of the full adder is transferred into a D flip-flop and the output of this carry flip-flop is then used as the input carry for the next pair of significant bits. Fig. 3 illustrates an example of serial addition.
Fig. 4. shows the block diagram design of a serial adder. The two binary numbers to be added serially are stored in two shift registers (using two 74164, 8-bit serial-in, parallel-out shift registers). Bits are added one pair at a time through a single full adder (such as the one in Experiment 2) The carry out of the full adder is transferred into a D flip-flop. The output of this carry flip-flop is then used as the input carry for the next pair of significant bits. The sum output from the full adder is transferred into register A as the contents of the register are shifted out.
Gunsc0unter $trike 1.6. To perform the addition, the following steps are used.
1. Shift the first 8-bit augend into A (remember to shift in LSB first) and addend into B. This is done by performing the following steps:
2. Clear the D flip-flop and run the adder for eight cycles to obtain the sum.
Table 1 shows the values in registers A and B when the data values 01011101 and 10011110 are added together.
Table 1: Trace of the serial adder | ||||
---|---|---|---|---|
Serial Input | Register A | Register B | D FF | Comments |
X | 00000000 | 00000000 | 0 | Clear A, B, D |
1 | 00000000 | 10000000 | 0 | |
0 | 00000000 | 01000000 | 0 | |
1 | 00000000 | 10100000 | 0 | |
1 | 00000000 | 11010000 | 0 | |
1 | 00000000 | 11101000 | 0 | |
0 | 00000000 | 01110100 | 0 | |
1 | 00000000 | 10111010 | 0 | |
0 | 00000000 | 01011101 | 0 | Augend in B; 0 in A |
0 | 10000000 | 00101110 | 0 | 0+1=1 |
1 | 01000000 | 10010111 | 0 | |
1 | 10100000 | 11001011 | 0 | |
1 | 11010000 | 11100101 | 0 | |
1 | 11101000 | 11110010 | 0 | |
0 | 01110100 | 01111001 | 0 | |
0 | 10111010 | 00111100 | 0 | |
1 | 01011101 | 10011110 | 0 | Augend in A; Addend in B |
X | 10101110 | X1001111 | 0 | C=0, S=1 |
X | 11010111 | XX100111 | 0 | C=0, S=1 |
X | 01101011 | XXX10011 | 1 | C=1, S=0 |
X | 10110101 | XXXX1001 | 1 | C=1, S=1 |
X | 11011010 | XXXXX100 | 1 | C=1, S=1 |
X | 11101101 | XXXXXX10 | 0 | C=0, S=1 |
X | 11110110 | XXXXXXX1 | 0 | C=0, S=1 |
X | 11111011 | XXXXXXXX | 0 | Sum in A |