0

In normal scenario we process the BEQ inst in 3 cycles like IF,ID,and EX but how can we process BEQ in just 2 cycles

I have already made the DataPath for 3 cycles

Awais
  • 1
  • 1
    The naïve answer is to do more work in fewer cycles; the trade off is that these cycles get longer. For example, we know that the single cycle processor can do all the instruction types in one cycle that is typically fairly long compared with multicycle or pipelined. For a better answer, you'd have to dictate constraints and perhaps share current design, especially if the constraints are relative to current design. To complete the simple thought though: move any work being done for `beq` in EX into ID, lengthen the clock cycle as needed — and of course, skip the EX cycle for `beq`. – Erik Eidt Jan 14 '23 at 19:19
  • In real pipelined MIPS CPUs like R2000 (MIPS I), EX has the branch condition ready in the first half cycle, and IF didn't start until the 2nd half-cycle, so EX could forward to IF with only 1 cycle of branch latency, hidden by the branch delay slot ([see this Q&A](https://stackoverflow.com/questions/56586551/how-does-mips-i-handle-branching-on-the-previous-alu-instruction-without-stallin)). If you're not pipelining, presumably that doesn't help. Instead you could put compare logic inside ID after register-fetch, so you don't need to do an EX cycle at all for branches. – Peter Cordes Jan 14 '23 at 20:13

0 Answers0