add FIFO files

This commit is contained in:
Imants Pulkstenis
2019-11-20 21:09:14 +02:00
parent 9257364a38
commit 681d20fbf4
6 changed files with 187 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
module memory_array(
output [7:0] data_out,
input [7:0] data_in,
input clk,
input fifo_we,
input [4:0] wptr,
input [4:0] rptr
);
reg [7:0] data_out2 [15:0];
wire [7:0] data_out;
always @(posedge clk)
begin
if(fifo_we)
data_out2[wptr[3:0]] <=data_in ;
end
assign data_out = data_out2[rptr[3:0]];
endmodule