Robotics & Embedded
LC-3 Processor in Verilog
- Status
- Completed
- When
- Dec 2025
- Context
- Course project
I built a complete multi-cycle LC-3 processor in Verilog: ALU, register file, memory interface, and the finite-state-machine controller that sequences them, covering the entire LC-3 instruction set across arithmetic, memory, and control flow.
The debugging is the part worth reading. Simulation hung with no error message, which is the least informative failure a processor can give you. Waveform analysis in Vivado traced it to unassigned control-mux selects: certain controller states left mux inputs undriven, so the datapath stalled on undefined values rather than faulting. Fixing it meant making every control signal explicitly assigned in every state instead of relying on defaults. The final design passed all 19 tests with zero errors.
Key decisions
ChoseTreat ret as redundant with jump
R7 is encoded in ir[8:6].
Debugging
SymptomInferred latches.
CauseMissing default assignments.
FixAdd defaults.
SymptomDecode stalled on undefined opcodes (1000 RTI, 1101 reserved).
CauseNo default case.
FixDecode self-loop.
Symptomjsr_reg did nothing useful.
CauseState missing both pc_ld and rf_w_en.
FixAssert both.
Outcome
- 19 tests, 0 errorsCourse test suite for the processor.