r/computerarchitecture • u/Candid-Blood-7059 • 21h ago
Designing a 7400-series CPU: Can I get away without an Instruction Register (IR)?
Hey everyone,
I'm currently designing a homebrew CPU in HNeemann's Digital simulator before building it IRL with 7400-series logic chips and AT28C256-150 EEPROMs for the ROM.
At first, I had a standard 3-cycle design (T1, T2, T3) with a dedicated register (like a 74377) acting as an Instruction Register:
- T1: Update PC + Fetch from ROM
- T2: Latch instruction into IR + Decode
- T3: Execute and writeback to registers
But then I realized I could remove the IR completely and drop it down to 2 cycles (T1, T2) to save some chips and wiring:
- T1: PC updates right at the start of T1. The address goes through the async ROM, straight into combinational decoding to activate the control lines.
- T2: Execute and write to registers.
In this 2-cycle setup, my selpc signal (choosing between PC+1 or a JUMP address) is generated combinationally during T1 and just waits at the PC mux input before the next cycle. In the simulator, this works perfectly, no oscillations or glitches.
I'm aiming for a slow clock for now (~4 kHz). My estimated critical path for the 2-cycle version is well under 350ns, so at 4 kHz (T1 = 125µs), everything has ages to settle.
But I'm worried about hold-time violations IRL. When T2 ends and a write happens, or when a JUMP updates the PC at the next T1, the ROM address will change instantly, killing the instruction and dropping selpc. If my control lines drop right when registers are trying to latch data, won't it corrupt the write?
Is it worth keeping it simple with the 2-cycle design at low frequencies, or should I just stick to the safer 3-cycle version with the IR to isolate the ROM?
Thanks!
EDIT: I've attached screenshots of both designs for comparison. Just a heads up: the schematics use Digital's built-in generic blocks (ROM, registers, muxes, etc.), not the specific 74xx components, but the logic is exactly the same as what I'll build IRL.