always @(*) begin
if (sel)
y = a;
else
y = b;
end
y assigned in all cases?y is assigned on every path → infers combinational logicy unassigned → incomplete assignment → infers latch= is blocking, <= is nonblocking.y: type
y assigned, and is it assigned on every path?regalways @(*) begin
if (en)
y = d;
end
en and ask: is y assigned in all cases?y is assigned on every path → infers combinational logicy unassigned → incomplete assignment → infers latchy: type
en and ask: is y assigned on every path?regalways @(posedge clk) begin
if (rst)
q <= 0;
else
q <= d;
end
posedge/negedge → clocked block → infers flip-flop, not latchq is assigned on every path → no incomplete assignment= is blocking, <= is nonblocking.q: type
q assigned on every triggering event, and what happens between events?regalways @(posedge clk or posedge rst) begin
if (rst)
q <= 0;
else
q <= d;
end
posedge/negedge → clocked block → infers flip-flopq is assigned on every path → no incomplete assignmentq: type
q assigned on every triggering event, and what happens between events?regalways @(*) begin
case (op)
2'b00: y = a + b;
2'b01: y = a - b;
2'b10: y = a & b;
endcase
end
op is 2 bits wide — list all possible values and check whether each has a matching case arm.default exists → infers combinational logicy: type
y is assigned for every possible value of op.regy unassigned → may hold statealways @(*) begin
#10;
y = a | b;
end
y is assigned on every path.y: type
y assigned on all of them?reginitial begin
y = 0;
end
initial block, not a combinational or sequential blockinitial blocks have no hardware equivalent → unsynthesizable constructy: type
reg.assign y = a & b;
assign is a continuous assignment — it is not a procedural block.y: type
assign statement must be declared wire, not reg.y is always driven because the continuous assignment is always active.assign y = a & b;
assign y = a | b;
y.assign drives the same signal → multiple driversy: type
assign must be declared wire.and_gate u0 (
.a(x),
.b(y),
.out(z)
);
always block, no assign → none of the block characterizations applyz: type
wire in the parent module.z is driven by the submodule output, so it is fully assigned as long as the submodule is active.initial begin
clk = 0;
forever #5 clk = ~clk;
end
initial blocks run once at simulation start → unsynthesizableforever loops have no hardware equivalent → unsynthesizable#5 timing delays have no hardware equivalent → unsynthesizableclk: type
reg.clk is a simulation-only variable driven by a forever loop with no synthesizable meaning.