默认位宽
module test (); initial begin $display("ans is %b", 5'd17); $display("ans is %b", 7'hfa); $display("ans is %b", 12); $display("ans is %b", 'h56); $display("ans is %b", 5'b1); end endmodule
结果:
默认位宽32,过短则被截取,这里的位宽指的是二进制的位宽长度,与bodh无关。
ans is 10001 ans is 1111010 ans is 00000000000000000000000000001100 ans is 00000000000000000000000001010110 ans is 00001