Visual
Lab intro
A shift register moves stored bits one position to the left or right with each clock pulse. This tutorial covers the 4-bit serial-in parallel-out (SIPO) shift register. You will load a bit pattern through the serial input, apply clock pulses one at a time, and watch the stored value shift through the four flip flop stages until it appears at the parallel output.
What you will learn
- How data enters a shift register through the serial input one bit per clock cycle
- How each clock pulse moves existing bits one stage to the right
- How to read the parallel output Q0 through Q3 after each pulse
- How to predict the register contents after any number of clock pulses given a known input sequence
Prerequisites
- Understanding of D flip flop operation and clock-edge triggering
- Ability to read a 4-bit binary number from individual output lines
- Completion of the D flip flop lab or equivalent experience
Step-by-step
- Step 1: Inspect the initial stateOpen the shift register simulator. You will see a Serial In toggle on the left, a CLK button in the center panel, and four LED output indicators labeled Q0, Q1, Q2, and Q3 on the right. All four LEDs should be dark, indicating the register holds 0000.Tip: If any LED is lit on load, use the Reset button to clear the register before beginning.
- Step 2: Set Serial In to 1Click the Serial In toggle to set it to 1. No LEDs will change yet because data only enters the register on a clock edge. The toggle sets the value waiting at the input.Tip: Think of Serial In as the value that will be pushed into Q0 on the next rising clock edge.
- Step 3: Apply the first clock pulseClick the CLK button once. Q0 should light up, and Q1, Q2, Q3 remain dark. The register now holds 1000 (Q0=1, Q1=0, Q2=0, Q3=0). The bit has entered the first stage.Tip: Each CLK click represents one rising edge. The register does not respond to you holding the button down.
- Step 4: Set Serial In to 0 and pulse againClick Serial In back to 0. Then click CLK once. Q0 should go dark, and Q1 should light up. The register now holds 0100. The original 1 has shifted one position to the right.Tip: Keep a written record of what you set Serial In to before each pulse. This is the only way to predict the output sequence.
- Step 5: Continue shiftingSet Serial In to 1, then click CLK. The register should now show 1010 (Q0=1, Q1=0, Q2=1, Q3=0). Then set Serial In to 1 and click CLK again. The register should show 1101.Tip: If an unexpected LED is lit, count the number of clock pulses you have applied. One extra pulse shifts everything one stage further than intended.
- Step 6: Verify the full parallel outputAfter four clock pulses with inputs 1, 0, 1, 1 in that order, read Q3 down to Q0. Q3 holds the first bit entered and Q0 holds the most recent. Confirm the display matches your expected 4-bit word.Tip: Q3 is the oldest bit and Q0 is the newest. This ordering is opposite to how you entered the bits serially.
- Step 7: Reset and try a different patternClick the Reset button to return the register to 0000. Enter a new 4-bit pattern of your choice, one bit per clock pulse, and verify the parallel output after all four pulses.Tip: Try the pattern 1111 first. After four pulses all four LEDs should be lit, which makes it easy to confirm the register is working.
Expected output
After loading the sequence 1, 0, 1, 1 over four clock pulses, the parallel output should read Q3=1, Q2=0, Q1=1, Q0=1. Each intermediate state after pulses 1 through 3 should also match the expected shifted positions. The register advances exactly one stage per clock pulse with no skipped or doubled steps.
Troubleshooting tips
- If all four LEDs light up after the first clock pulse, the simulator may be treating a button hold as multiple pulses. Click and release the CLK button quickly.
- If Q0 stays dark even when Serial In is 1 and CLK is pressed, check that the Reset line is not held active. A Reset button that appears pressed will keep all outputs at 0.
- If the bits appear to shift left instead of right, confirm which end of the register is labeled Q0. Some simulators place Q0 on the right and Q3 on the left.
- If the final output does not match your expected pattern, recount the number of clock pulses applied. An off-by-one error in clock count is the most common mistake in this lab.
- If the Serial In toggle has no visible effect before clocking, this is normal behaviour. The toggle sets the input value but the register only captures it on the clock edge.