pumpdac.v
来自「FPGA verilog」· Verilog 代码 · 共 44 行
V
44 行
module PumpDAC
(
DAC_CLK,
OpMode,
CURR_SET_Set,
Pump_DacData,
Pump_DacOut,
);
`include "parameter.v"
input DAC_CLK;
input [2:0] OpMode;
input [11:0] CURR_SET_Set;
input [11:0] Pump_DacData;
output [11:0] Pump_DacOut;
reg [11:0] Pump_DacOut;
reg [11:0] Q0;
wire ACCCtrl;
wire PumpDown;
assign ACCCtrl = OpMode==ACC_MODE;
assign PumpDown = OpMode==PD_MODE;
always @(negedge DAC_CLK)
begin
Q0 <= Pump_DacData;
end
always @(negedge DAC_CLK)
begin
if (ACCCtrl)
Pump_DacOut <= CURR_SET_Set;
else if (PumpDown)
Pump_DacOut <= 12'd0;
else if (OpMode!=IDLE_MODE)
Pump_DacOut <= Q0;
end
endmodule
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?