📄 i2c_test.v
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -