EECS 31L | EX-901 | Debugging and Synthesis

Document version: v0.6a
Last modified: 2026-05-28 21:58
Canvas: [ EECS 31L Workspace ]
Select all answers that correctly characterize or apply to the corresponding code.
Q1: Snippet 1
Characterize the block.
always @(*) begin
    if (sel)
        y = a;
    else
        y = b;
end
💡 HintTrace every branch and ask: is y assigned in all cases?Then check the assignment operator: = is blocking, <= is nonblocking.
Q2: y: type
💡 HintAsk: where is y assigned, and is it assigned on every path?
Q3: Snippet 2
Characterize the block.
always @(*) begin
    if (en)
        y = d;
end
💡 HintTrace every possible value of en and ask: is y assigned in all cases?
Q4: y: type
💡 HintTrace every possible value of en and ask: is y assigned on every path?
Q5: Snippet 3
Characterize the block.
always @(posedge clk) begin
    if (rst)
        q <= 0;
    else
        q <= d;
end
💡 HintLook at the sensitivity list, then trace every branch.Then check the assignment operator: = is blocking, <= is nonblocking.
Q6: q: type
💡 HintAsk: is q assigned on every triggering event, and what happens between events?
Q7: Snippet 4
Characterize the block.
always @(posedge clk or posedge rst) begin
    if (rst)
        q <= 0;
    else
        q <= d;
end
💡 HintCompare the sensitivity list to Snippet 3 and trace every branch.
Q8: q: type
💡 HintAsk: is q assigned on every triggering event, and what happens between events?
Q9: Snippet 5
Characterize the block.
always @(*) begin
    case (op)
        2'b00: y = a + b;
        2'b01: y = a - b;
        2'b10: y = a & b;
    endcase
end
💡 Hintop is 2 bits wide — list all possible values and check whether each has a matching case arm.
Q10: y: type
💡 HintCheck whether y is assigned for every possible value of op.
Q11: Snippet 6
Characterize the block.
always @(*) begin
    #10;
    y = a | b;
end
💡 HintIdentify every construct in the block and ask whether it has a hardware equivalent.Then check whether y is assigned on every path.
Q12: y: type
💡 HintTrace every execution path and ask: is y assigned on all of them?
Q13: Snippet 7
Characterize the block.
initial begin
    y = 0;
end
💡 HintAsk: does this block react to input changes, or does it run exactly once at the start of simulation?Then check the assignment operator.
Q14: y: type
💡 HintAny signal assigned inside a procedural block must be declared reg.
Do not apply fully assigned or may hold state — those characterize reactive logic. This block runs once at time 0; the signal is a simulation variable, not synthesized storage.
Q15: Snippet 8
Characterize the block.
assign y = a & b;
💡 Hintassign is a continuous assignment — it is not a procedural block.
Q16: y: type
💡 HintThe target of a continuous assign statement must be declared wire, not reg.
y is always driven because the continuous assignment is always active.
Q17: Snippet 9
Characterize the block.
assign y = a & b;
assign y = a | b;
💡 HintCount how many sources drive y.
Q18: y: type
💡 HintThe target of a continuous assign must be declared wire.
Do not apply fully assigned or may hold state — the design is invalid due to multiple drivers.
Q19: Snippet 10
Characterize the block.
and_gate u0 (
    .a(x),
    .b(y),
    .out(z)
);
💡 HintModule instantiation is structural RTL — it wires submodule ports to signals in the parent module.
Q20: z: type
💡 HintSignals connected to submodule output ports must be declared wire in the parent module.
z is driven by the submodule output, so it is fully assigned as long as the submodule is active.
Q21: Snippet 11
Characterize the block.
initial begin
    clk = 0;
    forever #5 clk = ~clk;
end
💡 HintIdentify every construct and ask whether each has a hardware equivalent.
Q22: clk: type
💡 HintAny signal assigned inside a procedural block must be declared reg.
Do not apply fully assigned or may hold state — clk is a simulation-only variable driven by a forever loop with no synthesizable meaning.