← ProblemsCircuits / Sequential Logic / Shift Registers

3-bit LFSR

15%shift-registersflip-flops

Implement the 3-bit LFSR from the midterm schematic, targeting a DE1-SoC-style board interface:

  • KEY[0] is the clock
  • KEY[1] is L, a synchronous parallel-load control
  • SW[2:0] is the parallel load value
  • LEDR[2:0] shows the register contents

On each rising edge of KEY[0]: when L is 1, the register loads SW; otherwise it steps the LFSR:

r[0] <= r[2]
r[1] <= r[0]
r[2] <= r[1] ^ r[2]

Note: because the clock here is one bit of a bus (KEY[0]), this problem is graded externally — solve it in an external simulator, then mark it complete.

This problem can't be auto-graded here yet — it needs a full behavioral Verilog simulator. Solve it in an external simulator, then record your result so your learning path stays accurate.