WHY is this bad? An add needs no memory access but is still charged for one. The clock is "one size fits all — the slowest size."
WHAT is the fix? Break execution into balanced sub-steps (each ≈ one functional-unit delay). Now the clock only has to be long enough for one step, not the whole instruction:
Tmulti=max(delay of a single step)≪Tsingle
HOW do we reuse hardware? Because steps happen in different cycles, one ALU / one memory can serve many roles. So we:
Use a single memory for both instructions and data (accessed in different cycles).
Use a single ALU for PC increment, branch target, and arithmetic.
Add internal registers (IR, A, B, ALUOut, MDR) to hold values between cycles, since combinational signals vanish at the clock edge.
We need the instruction bits, so read memory at address PC.
We also want PC+4 ready (default next instruction).
IR←Memory[PC],PC←PC+4Why latch into IR? Because in the next cycle Memory may be used for data — the instruction bits would be lost otherwise.
Why compute PC+4 now? The ALU is free this cycle, so we reuse it to increment PC.
We don't yet know the instruction type, so do work that's useful for all possibilities:
A←Reg[IR[25:21]],B←Reg[IR[20:16]]ALUOut←PC+(sign-ext(IR[15:0])≪2)Why compute the branch target speculatively? The ALU is idle; if the instruction turns out to be beq we already have the target — no extra cycle wasted. This is optimistic pre-computation.
In which step and register does lw place data before write-back?
In MEM, into MDR (Memory Data Register).
Recall Feynman: explain to a 12-year-old
Imagine building a LEGO model. Single-cycle = you must build the whole model in one giant timed block, and the timer is set for the hardest model, so easy models waste time. Multi-cycle = you build in small steps (find pieces, snap base, add top...). Each step is quick, and an easy model just does fewer steps and stops early. You also reuse the same table (memory) and same hands (ALU) at different steps, so you need less equipment. You do more little steps, but each is fast — and you don't waste effort on the parts you don't need.
Dekho, single-cycle datapath ki problem ye hai ki har instruction ko ek hi clock cycle me poora hona padta hai. Isliye clock ko itna slow rakhna padta hai ki sabse slow instruction (lw) bhi fit ho jaye. Matlab add jaisa fast instruction bhi utna hi time leta hai jitna lw. Ye waste hai. Multi-cycle isko fix karta hai — ek instruction ko chhote chhote steps me tod deta hai (IF, ID, EX, MEM, WB), aur har step ek chhota clock cycle leta hai. Fast instructions kam steps use karte hain, slow zyada.
Ab magic point: kyunki steps alag alag cycles me hote hain, hum same hardware reuse kar sakte hain. Ek hi memory instruction aur data dono ke liye (kyunki fetch aur data-access alag cycle me hote hain), aur ek hi ALU jo IF me PC+4 karta hai, ID me branch target nikalta hai, aur EX me actual arithmetic karta hai. Beech me values ko sambhalne ke liye internal registers rakhte hain — IR, A, B, ALUOut, MDR — ye "sticky notes" ki tarah value ko agle cycle tak hold karte hain, warna clock edge par value gayab ho jati.
Ek important detail: clock period sabse lambe stage se decide hota hai. Is example me ID stage me register read (100 ps) ke baad ALU ka branch-target calc (200 ps) hota hai — same cycle me — to ID = 300 ps ban jata hai, aur wahi clock period set karta hai. Performance nikalne ka formula: execution time = (cycles) × (clock period), aur average CPI = har instruction ki frequency × uske cycles ka sum. Yaad rakho — multi-cycle hamesha fast nahi hota; agar stages unbalanced hain to raw time me slow bhi ho sakta hai. Asli guaranteed faayda hai kam hardware (shared ALU/memory).
Ek aur baat: sab instructions 5 cycle nahi lete. beq aur j sirf 3 lete hain, add (R-type) 4 — aur R-type MEM step ko skip karta hai, uska write-back WB (step 5) me hota hai. Jump ko EX step chahiye kyunki PC step 3 me update hota hai. Jaise hi instruction ka kaam khatam, wo ruk jata hai — koi dummy cycle nahi. Ye concept aage pipelining me kaam aayega.