S
sebas
Guest
Hi,
A newbie's question, in the following code:
module reg_file
(
input wire clk,
input wire wr_en,
input wire [1:0] w_addr, r_addr,
input wire [7:O] w_data,
output wire [7:Ol r_data
)
reg [7:Ol array_reg [2**1:0] ;
always @(posedge clk)
if (wr_en)
array_reg [w_addrl <= w_data;
assign r_data = array_reg [r_addr];
why is the writing done sequentially and the reading purely combinational
That is writing inside an always activated on the front edge of clk an
reading in a continuous assignment.
Thanks
---------------------------------------
Posted through http://www.FPGARelated.com
A newbie's question, in the following code:
module reg_file
(
input wire clk,
input wire wr_en,
input wire [1:0] w_addr, r_addr,
input wire [7:O] w_data,
output wire [7:Ol r_data
)
reg [7:Ol array_reg [2**1:0] ;
always @(posedge clk)
if (wr_en)
array_reg [w_addrl <= w_data;
assign r_data = array_reg [r_addr];
why is the writing done sequentially and the reading purely combinational
That is writing inside an always activated on the front edge of clk an
reading in a continuous assignment.
Thanks
---------------------------------------
Posted through http://www.FPGARelated.com