← RTL Design Interviews · SoC Architecture Interviews

Interview Question · Explain the SoC

Follow a Store Through Five Stages

L0 FresherL3 Seniorexplain the soc

The Question

The interviewer asks

Follow the store at address 18 through a five-stage pipeline. Where do its address, data and write enable meet?

Reveal the Model Answer

IF fetches the instruction, and ID reads the base register and store data. EX adds the offset. In MEM the address and data arrive with the write enable. The store has no register result in WB. Other instructions occupy the remaining stages. In S2.7 seven independent instructions take seven clocks plus four to fill and drain.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Want to Hear (Fresher)

Follow one instruction across a row of the pipeline diagram.

Choose Your Follow-up

I’ve answered the opening question

Choose the route closest to your reasoning. Answer the follow-up aloud, then open the closing question.

I followed the store address.

S2.24 decodes the store in cycle 8. In cycle 10 EX/MEM has mem_write=1 while ID/EX has mem_read=1. Which action reaches memory?

Reveal the Model Answer

The older store writes. Its address, data and write enable reach MEM together through EX/MEM. The younger load in EX still carries its own read enable. Trace operands with the same care: S2.25 forwards the newest matching write.

Self-Check

Tick each key point you covered in your answer.

Decide Where to Cut

S2.24 counts 65 levels in the ALU and 80 on the longest pipelined path. Would splitting EX reduce program time?

Reveal the Model Answer

Locate the endpoints of the 80-level path before choosing the cut. For seven independent instructions the single-cycle design costs 854 level delays against 880 pipelined. For 100 the costs are 12,200 and 8,320, about a 1.5× speedup. Resolving a branch one stage later raises the two-cycle redirect penalty to three. Compare cycles times period again on the intended instruction mix.

Self-Check

Tick each key point you covered in your answer.

I forwarded the latest result.

With the S2.9 stall disabled, the dependent add leaves x7=80000007. What did the bypass deliver, and which stages should wait?

Reveal the Model Answer

The bypass delivered the address calculated in EX. Load data arrives after MEM, too late for the adjacent add in EX. Hold the PC and IF/ID, send a bubble into ID/EX and let the load advance. Forward its data to the delayed add.

Self-Check

Tick each key point you covered in your answer.

Decide Where to Cut

S2.24 counts 65 levels in the ALU and 80 on the longest pipelined path. Would splitting EX reduce program time?

Reveal the Model Answer

Locate the endpoints of the 80-level path before choosing the cut. For seven independent instructions the single-cycle design costs 854 level delays against 880 pipelined. For 100 the costs are 12,200 and 8,320, about a 1.5× speedup. Resolving a branch one stage later raises the two-cycle redirect penalty to three. Compare cycles times period again on the intended instruction mix.

Self-Check

Tick each key point you covered in your answer.

I charged a cycle for the dependence.

S2.9 takes 12 clocks for seven instructions and 12 for eight with a gap. How can more work take the same time?

Reveal the Model Answer

An independent instruction occupies the slot that the adjacent reader had to leave empty. Verify that moving it preserves dependencies and observable behavior. Then check that the reader receives the load value without a stall.

Self-Check

Tick each key point you covered in your answer.

Decide Where to Cut

S2.24 counts 65 levels in the ALU and 80 on the longest pipelined path. Would splitting EX reduce program time?

Reveal the Model Answer

Locate the endpoints of the 80-level path before choosing the cut. For seven independent instructions the single-cycle design costs 854 level delays against 880 pipelined. For 100 the costs are 12,200 and 8,320, about a 1.5× speedup. Resolving a branch one stage later raises the two-cycle redirect penalty to three. Compare cycles times period again on the intended instruction mix.

Self-Check

Tick each key point you covered in your answer.

I split EX into two stages.

In cycle 6 the branch at 0c redirects to 18. Which work is discarded? Suppose splitting EX delays that decision one clock.

Reveal the Model Answer

Discard the younger instructions at 10 and 14. The recorded loop redirects twice, losing four cycles to branches. If fetch continues each cycle, one more younger instruction enters before each new decision. Two redirects would then cost six cycles, before accounting for the extra stage needed to fill the pipeline.

Self-Check

Tick each key point you covered in your answer.

Decide Where to Cut

S2.24 counts 65 levels in the ALU and 80 on the longest pipelined path. Would splitting EX reduce program time?

Reveal the Model Answer

Locate the endpoints of the 80-level path before choosing the cut. For seven independent instructions the single-cycle design costs 854 level delays against 880 pipelined. For 100 the costs are 12,200 and 8,320, about a 1.5× speedup. Resolving a branch one stage later raises the two-cycle redirect penalty to three. Compare cycles times period again on the intended instruction mix.

Self-Check

Tick each key point you covered in your answer.

What People Get Wrong

Common wrong answers and why they fail.

Misconception

Use the current decoder output to enable the store.

The decoder is already working on a younger instruction.

Source S2.24, older store and younger load.

Misconception

Five stages give five times the clock frequency.

The clock has to accommodate the longest stage and its register timing.

Source S2.24, longest stage and clock period.

Misconception

If MEM and WB both write x5, forward WB.

Both match, but MEM holds the younger write. Forward that value to the reader.

Source S2.25, forwarding from MEM in cycle 6.

Learn It, Then Prove It