Question.5
Why does this module fail to compile or synthesize correctly?
module toggle_ff(input clk, output q); always @(posedge clk) begin q <= ~q; end endmodule
Select Answer
~ is an invalid operator inside procedural blocks.
~
Module outputs cannot be inverted in an assignment.
q defaults to a wire data type, which cannot be assigned in an always procedural block.
q
wire
always
A continuous assign keyword is missing before q <= ~q.
assign
q <= ~q