K
K. Sudheer Kumar
Guest
To declare and initialise a one-bit register in verilog we use the
following statement
reg one_bit_reg=1'b0;
Similarly, to declare and initialise a one dimension reg (e.g. 8-bit)
we can write
reg [7:0] reg_len_8=8'd0;
We can declare a two dimensional array (e.g. 16x8-bit) as
reg [7:0] reg_dim_2 [15:0];
But how can we initialise this array in the same statement?
or How do we declare the initial state (known non-zero values) of an
array without using extra logic (especially when implementing on
hardware (FPGAs))?
following statement
reg one_bit_reg=1'b0;
Similarly, to declare and initialise a one dimension reg (e.g. 8-bit)
we can write
reg [7:0] reg_len_8=8'd0;
We can declare a two dimensional array (e.g. 16x8-bit) as
reg [7:0] reg_dim_2 [15:0];
But how can we initialise this array in the same statement?
or How do we declare the initial state (known non-zero values) of an
array without using extra logic (especially when implementing on
hardware (FPGAs))?