What is the difference between 2'b0 and 2'd0?

3.3k Views Asked by At

I was tying a port to zero in my design. What is the difference between 2'b0 and 2'd0 in Verilog?

What does b and d actually mean?

1

There are 1 best solutions below

0
dave_59 On

b and d are the base radix of the numeric literal; binary and decimial respectively. They are equivalent values in your case. In both literals, you are specifying 2-bit width values, with both bits having a '0' value. 2'b11 and 2'd3 would also be equivalent, with both bits having a '1' value.

Note that you can also write '0 which is a fill literal that expands to the width of the port.