Complete the code to declare a 4-element array of 8-bit registers.
reg [7:0] my_array [0:[1]];
The array indices start at 0, so for 4 elements, the last index is 3.
Complete the code to declare a 16-element array of 1-bit registers.
reg [1] my_bits [0:15];
For 1-bit registers, no range is needed or use [0]. Here, '0' means a single bit.
Fix the error in the array declaration for a 10-element array of 4-bit registers.
reg [[1]:0] data_array [0:9];
The bit range should be from 3 down to 0 for 4 bits.
Fill both blanks to declare a 2D array with 8 elements each of 16-bit registers.
reg [[1]:0] matrix [0:[2]];
The bit width is 16 bits, so indices go from 15 down to 0. The array has 8 elements, so indices go from 0 to 7.
Fill all three blanks to declare a 3D array of 4-bit registers with dimensions 4x4x4.
reg [[1]:0] cube [0:[2]][0:[3]];
The bit width is 4 bits, so indices go from 3 down to 0. Each dimension has 4 elements, so indices go from 0 to 3.
