UInt
defines an unsigned integer. UInt(value)
defines a 1-bit decimal literal, so UInt(0)
and UInt(1)
are the literals for 1-bit wide integers holding 0 and 1 respectively. UInt(value, width)
allows you to define literals with values greater than 1-bit, so from your example UInt(0, max.getWidth)
creates an unsigned integer with max.getWidth
bits holding the value 0.
Reference: https://chisel.eecs.berkeley.edu/2.0.0/manual.html