# Beginner’s Guide to the Shift Register in Digital Electronics

A shift register is a common building block in digital electronics that is used to store and move bits, for example, to convert from serial to parallel data and vice versa.

It is basically a group of flip-flops that can store bits, and shift its stored bits sideways by one bit-position every time it is triggered. It is made using a series of D flip-flops with the output of one connected to the input of the next. Each clock pulse triggers a shift.

In this tutorial, you will learn the different types of shift registers, how they work, and how to build them using flip-flops.

## What is a shift register?

A flip-flop can store just one bit of digital data, a 1 or 0. What if you want to store more than one bit? In order to store multiple bits of data, you need multiple flip-flops.

In digital electronics, a register is a group of flip-flops connected together to store multiple bits of data. For example, if you use eight flip-flops at once, then you are creating a register that can hold eight bits – or one byte.

The binary data in a shift register can be moved sideways within the register from one flip-flop to another. Registers that allow you to move bits sideways are called shift registers. There are four types of shift registers:

1. Serial in – serial out
2. Serial in – parallel out
3. Parallel in – serial out
4. Parallel in – parallel out

## What is a shift register used for?

A shift register is commonly used in data storage, data movement, and data manipulation. The number of bits you can store in a shift register is equal to the number of flip-flops used.

You can find prebuilt shift registers ready to be used in a circuit for example in these chips:

• CD4015 – contains two 4-bit shift registers
• CD4014 – contains an 8-bit shift register with parallel outputs
• CD4017 – contains a ring counter (see below)

Among plenty more.

## Circuit example for a shift register: Ring counters

Shift registers can be used in a wide variety of circuits. For instance, If you modify a serial in – parallel out shift register a little bit, you can create a ring counter circuit, like this:

To create a ring counter, you have to take the output from the last flip-flop in the register and connect it to the input of the first flip-flop. You also have to preset the first flip-flop to start with a 1.

You can do this by connecting its set input to the reset signal that all the D flip-flops share. This means that when you reset the circuit, it will start with 1 in the first flip-flop and 0 in the rest.

As a result, the 1 you set in the first flip-flop will shift around and around – in a “ring” – throughout the Q outputs.

The IC 4017 is a chip with this type of functionality, but with 10 outputs instead of just 4, like above. This makes for a fun chip you can use for example to create the Knight Rider LED bar, for example.

Now that you know a practical application of a shift register, here are more details about the different types you may come across.

## What are the different types of shift registers?

### Serial in – serial out (SISO) shift registers

The following circuit shows the structure of a serial in – serial out shift register made with D flip-flops:

This shift register accepts just one bit of data at the serial data input. It will move sideways to the next D flip-flop every time the Clk input receives a valid trigger signal. A valid trigger signal in flip-flops could be a rising edge – which is the change from a digital state of 0 to 1 ↑ – or a falling edge – a change from 1 to 0 ↓. In this tutorial, we are using flip-flops that trigger with rising edge signals.

As you can see, the above circuit has four D flip-flops. Let’s suppose you place a digital 1 into the serial data input. It will take four rising edge signals for the input bit to reach the serial data output. You can see the movement of bits in the SISO shift register timing diagram below:

### Serial in – parallel out (SIPO) shift registers

This type of shift register is very similar to the SISO one we looked at above, but the difference is that a SIPO shift register has more than one output. This shift register has an output pin from each flip-flop so that you can access the bits in parallel. Let’s see its circuit:

This circuit receives one bit at a time in the serial data input. This bit will move from one flip-flop to the other – left to right – every time the Clk input in the D flip-flops receives a rising edge signal.

As the SIPO version has parallel outputs Q0, Q1, Q2, and Q3, you don’t have to wait for the input bit to arrive at the last flip-flop to be available; it will be at the Q3 output in the first trigger signal, in Q2 at the second one, with the third one it will be in Q1, and finally with a fourth rising edge in Q0. You have this behavior below:

A common practical example for the SIPO register is to add more output pins to an Arduino or other microcontroller. For example, check out this example using the 74HC595 with an Arduino.

## Parallel in – serial out (PISO) shift registers

This shift register has a parallel input, which means that bits are loaded separately onto each flip-flop at the same time. In contrast to the input, the output has a serial format, meaning just one bit is output every time the flip-flops are triggered.

The circuit above consists of four D flip-flops, where the clock signal is shared among all the Clk inputs. Every D input is connected to a multiplexer, which receives the bit input (IN0, IN1, IN2, IN3) and the output of the previous flip-flop (left to right). Since the first flip-flop lacks a prior flip-flop, one input of the multiplexer is placed in a digital 1.

With this type of register a rising edge signal is not required to parallel load the register because the bits are already present in the inputs. Nevertheless, if you consider the above circuit with four flip-flops, then four rising edges will be required to unload the data. This will start with the bit in IN0, followed by the bit in IN1, then IN2, and finally IN3. Here you have an example with a timing diagram:

### Parallel in – parallel out (PIPO) shift registers

This type of shift register acts as a multi-bit temporary storage device. Take a look at its circuit and try to guess why.

As you might have observed, in the PIPO shift register, the D flip-flops are not connected together through the D inputs and the Q outputs. Instead, they only share the clock signal.

The parallel input corresponds to every D input of each flip-flop (D0, D1, D2, D3). Because every flip-flop has the same clock signal in the Clk input, each will be triggered at the same time. When this happens, all the bits in the parallel input will move simultaneously to the parallel output (Q0, Q1, Q2, Q3). In other words, to transfer the entire data set, you only need one trigger signal.

This circuit wouldn’t qualify as a shift register since it doesn’t actually shift any bits. But with some additional logic gates between the output of one and the input of the next one, you can load data in parallel, shift the data, then get the shifted version of the data in parallel format.

## Questions?

Do you have any questions about shift registers and their applications? Let me know in the comments below.

## More Digital Electronics Tutorials

### 3 thoughts on “Beginner’s Guide to the Shift Register in Digital Electronics”

1. Hi,

In the PISO shift register how is the mux working without the selection lines?