Skip to content

Arrays & Slicing

Bit 0 is always the LSB (least significant bit).
For u8, bits are [7, 6, 5, 4, 3, 2, 1, 0] where 7 is MSB.
For arrays, index 0 is the first element.

Index: counter[0] (Access specific bit or element)
Slice: data[7..0] (Extract a range of bits)

When slicing, you must use [MSB..LSB] order.

data[high..low] (Requires high >= low) data[3..0] (Gets bits 3, 2, 1, 0) data[15..8] (Gets the upper byte) data[0..7] ERROR: Ranges must be descending.

You can combine signals using the built-in concat function:

concat(high_byte, low_byte)