I'm designing a very simple CPU to be built on a custom PCB. I designed the CPU in LogicCircuit, and it seems to work. But I'm wondering it a specific part of the CPU will also work in real life.
I implemented the JMP instruction as follows (cycle counter increases on falling edge):
- Cycle 1: PC Output Enable onto address bus is active, PC Output Enable into the ALU is active, PC Write Enable is active (to latch the increased PC from the ALU). On rising edge, latch the instruction from ROM and latch the increased PC from the ALU into the PC register at the same time.
- Cycle 2: PC Output Enable onto address bus is active, PC Write Enable is active. On rising edge, latch the new PC value from ROM)
My question is now, is it problematic that in Cycle 1 im latching the new PC value and the instruction at the same time. My thinking is that the instruction from ROM will be latched first before the increased PC value is latched. In the simulation this seems to work, but im not sure if im getting into any race condition in real life.