A shift register is a sequential logic device made up of a cascade of flip-flops, through which a sequence of bits is shifted. These devices are commonly used to convert between serial and parallel interfaces.
In a shift register, the output of each flip-flop is connected to the input of the next flip-flop in the cascade. With each cycle of the connected clock, the bits are shifted down the cascade by one flip-flop.
A simple analogy to understand the basic theory of operation would be to consider a glass tube with an opening both ends and placing a ball marked 0 or 1 into one end of the tube at regular intervals.
As each ball is placed into the tube, all the balls are shifted along by one position. The sequence in which the balls marked 0 and 1 were fed in is preserved. Also, each time one ball is fed in, the ball that has been in the cascade the longest drops out. So if the tube can contain 4 balls at any one time, this could be described as a 4-bit shift register.
In this type of shift register, the data input and output is serial. With each clock cycle, a new bit is fed into the cascade, with the bit furthest along the cascade exiting as an output. So in a 4-bit register, the output trails the input by 4 clock cycles. This matches the simple example above, with the ball that exits the tube being the output.
In this configuration data is converted from serial into a parallel format. As described for the SISO variant above, data is fed in serially and shifted down the cascade, the difference is that each flip-flop has an output, allowing the entire bit array to be output simultaneously as a parallel output. This may be done using a latched of buffered output.
This variant takes a parallel input and converts into a serial output. To do this the shift register must implement a write/shift sequence. The parallel data input is (written) into each flip-flop of the array simultaneously in one clock cycle, then for the next cycles, the register goes into shift mode as the bits are shifted down the flip-flop cascade, being output as serial data. The process then repeats.
This type of register differs slightly from the others in that inputs and outputs of each flip-flop in the array are not interconnected. Each flip-flop takes one bit of the parallel input, stores it for a cycle, and then outputs the data simultaneously with the other flip-flops in the register, creating a parallel output that matches the input. Like the SISO type above, PIPO variants can be used to temporarily store data, or act a time delay device.
A configurable Shift Register that can be programmed to act as a SISO, SIPO, PISO or PIPO device, often on the fly.
8b universal shift register,SN74ALS299N