In Verilog, suppose I use the $size
function on a 1-D vector. Would it give me the size of the value it holds or the size of the maximum value it can hold?
For example:
reg[10:0] a;
a=11'd3;
$display("Size of a is ",$size(a));
In this scenario, would it display "Size of a is 11", since this is the bit length of the max value that the vector can hold? Or would it say "Size of a is 2" since the actual bit length of the value in a
, i.e, 3 is 2-bits?
P.S. I am new to verilog. So please excuse any syntax errors. Thank you