What is the bit-width of count in the instantiated module? module counter…
What is the bit-width of count in the instantiated module? module counter #(parameter WIDTH = 8) (); reg [WIDTH-1:0] count; endmodule module top; counter c1(); defparam c1.WIDTH = 16; endmodule
- 8
- 16
- 32
- Compilation error
Correct answer
B. 16
Explanation
defparam hierarchically overrides module parameters during elaboration, changing WIDTH from its default value of 8 to 16.