i2c_test.v.bak
来自「FPGA EP2C5Q288C8 I2C 原码,测试OK 打开即用.」· BAK 代码 · 共 27 行
BAK
27 行
module i2c_test(clk,rst,data_out,wr_input,rd_input,wr_output,rd_output);
input clk,rst,wr_input,rd_input;
output[3:0] data_out; //输入写入EEPROM的数据
output wr_output; //要求写的输入
output rd_output; //要求读的输入
reg [3:0]counter;
assign data_out=counter;
assign wr_output=wr_input;
assign rd_output=rd_input;
always @(negedge wr_input or negedge rst )
begin
if(!rst)
counter<=0;
else if(counter<=8'hff)
counter<=counter+1'b1;
else
counter<=0;
end
endmodule
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?