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
+21
View File
@@ -0,0 +1,21 @@
module read_pointer(
output [4:0] rptr,
output fifo_rd,
input rd,
input fifo_empty,
input clk,
input rst_n);
reg [4:0] rptr;
assign fifo_rd = (~fifo_empty)& rd;
always @(posedge clk or negedge rst_n)
begin
if(~rst_n) rptr <= 'b0;
else if(fifo_rd)
rptr <= rptr + 'b1;
else
rptr <= rptr;
end
endmodule