Complete the code to declare a memory array of 8-bit words with 256 entries.
reg [7:0] memory [0:[1]];
The memory array indices go from 0 to 255 for 256 entries.
Complete the code to initialize the memory from a hex file named 'data.hex' inside an initial block.
initial begin
$readmemh([1], memory);
endThe filename must be a string literal enclosed in double quotes.
Fix the error in the code to correctly initialize the memory using $readmemh.
initial begin $readmemh("data.hex", [1]); end
The memory array variable name must match the declared memory name.
Fill both blanks to create a memory initialization that reads from 'init.hex' and has 128 entries.
reg [7:0] mem [0:[1]]; initial begin $readmemh([2], mem); end
The memory size is 128 entries indexed 0 to 127, and the filename must be a double-quoted string.
Fill all three blanks to declare a 16-bit wide memory with 64 entries and initialize it from 'memdata.hex'.
reg [[1]:0] mem_array [0:[2]]; initial begin $readmemh([3], mem_array); end
For 16-bit width, bits go from 15 down to 0. For 64 entries, highest index is 63. Filename must be double-quoted.