Search code examples
veriloghdl

What does [-1:0] mean in Verilog?


In my code i wrote:

output [numSize-1:0] index;

numSize is a parameter that can be zero. What is the meaning of this? What is this gonna be synthesized to?


Solution

  • The assignment of output [-1:0] index would allow you to access index[-1] and index[0].

    There is no preclusion to using negative values in the range of a vector in Verilog.