📄 fifo_16_8.v
字号:
//////////////////////////////////////////////////////////////////////////File Name: FIFO.v//SetUp Data: 2006/03/09//modify Data: 2006/03/09 Setup the file// 2006/03/14 Rewrite the file.Put the control department// outside to module "fifo_control" //Author: Shen Zhi//Function: First input first output,make the two streams between the // input and ouput synchronal//////////////////////////////////////////////////////////////////////////module fifo_16_8(//input wclk,rclk, we_n,rd, wptr,rptr, din, //output dout);parameter address_size = 4;parameter word_size = 8;parameter mem_size = 16;input wclk; //write clkinput rclk; //read clkinput we_n;input rd;input[address_size-1:0] wptr; //write pointerinput[address_size-1:0] rptr; //read pointerinput[word_size-1:0] din;output[word_size-1:0] dout;reg[word_size-1:0] mem [0:mem_size-1];reg[word_size-1:0] dout;always@(posedge wclk) if(~we_n) begin mem[wptr] <= din; end always@(posedge rclk) if(rd) begin dout <= mem[rptr]; end else dout <= {word_size{1'bz}}; endmodule
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -