prep6.v

来自「多个Verilog和vhdl程序例子」· Verilog 代码 · 共 22 行

V
22
字号
// PREP Benchmark 6, Sixteen Bit Accumulator

/* PREP6 contains a sixteen bit accumulator

Copyright (c) 1994 Synplicity, Inc.
You may distribute freely, as long as this header remains attached. */


module prep6(Q, CLK, RST, D);
output [15:0] Q;
input CLK, RST;
input [15:0] D;
reg [15:0] Q;

always  @(posedge CLK or posedge RST)
begin
	if (RST)	Q = 0;	 // reset logic
	else Q = Q + D; // accumulate
end

endmodule

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?