我读到 UInt(1) 指的是 1 位十进制文字。我对 UInt(0) 的含义感到困惑。它用于计数器代码,如下所示:-
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
}
有人可以解释两个突出显示(以星号为界)语句的工作原理吗?