Skip to content

Commit c06edb4

Browse files
committed
Add additional clarification about UInt vs SInt
1 parent e5548d0 commit c06edb4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,9 @@ The bit-index `x[i]` selects the single bit `i`.
18121812

18131813
The type of the bit-index expression `x[hi:lo]`.{firrtl} is `UInt<hi - lo +
18141814
1>`.{firrtl} (even if `x` is an `SInt`) and the type of `x[i]`.{firrtl} is
1815-
`UInt<1>`.{firrtl}.
1815+
`UInt<1>`.{firrtl}. This means that when connecting to a bit-indexed value, the
1816+
right-hand-side of the connection must be a `UInt`.{firrtl}, even if the value
1817+
being indexed is an `SInt`.{firrtl}.
18161818

18171819
The bit-index can be used as a sink or source. When used as a source,
18181820
`x[hi:lo]` is equivalent to `bits(x, hi, lo)` and `x[i]` is equivalent to

0 commit comments

Comments
 (0)