?? counter2.v
字號:
// Eight bit counter example 2
module counter2(out, cout, data, load, cin, clk);
output [7:0] out;
output cout;
input [7:0] data;
input load, cin, clk;
reg [7:0] out;
reg cout;
reg [7:0] preout;
// create the 8-bit register
always @(posedge clk)
begin
out = preout;
end
// calculate the next state of the counter and the carry out
// note that we don't want load to affect cout, for performance
// reasons
always @(out or data or load or cin)
begin
{cout, preout} = out + cin;
if (load) preout = data;
end
endmodule
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -