UInt(1) は 1 ビットの 10 進リテラルを参照することを読みました。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
}
強調表示された (アスタリスクで囲まれた) 2 つのステートメントの動作を説明できる人はいますか?