I read that UInt(1) refers to a 1-bit decimal literal. I'm confused about what UInt(0) could mean. It is used in a Counter code that goes as follows :-
package TutorialSolutions
import Chisel._
object Counter {`
`def wrapAround(n: UInt, max: UInt) = `
Mux(n > max, **UInt(0)**, n)
// ---------------------------------------- \\
// Modify this function to increment by the
// amt only when en is asserted
// ---------------------------------------- \\
def counter(max: UInt, en: Bool, amt: UInt) = {
val x = Reg(init=**UInt(0, max.getWidth)**)
when (en) { x := wrapAround(x + amt, max) }
x
}
Can someone explain the working of the two highlighted (bounded by asterisks) statements?