dff.v

来自「发一个基于ModelSim仿真的Verilog源代码包」· Verilog 代码 · 共 27 行

V
27
字号

  /******************************************************/
/*       module dff                                   */
/******************************************************/
/* A D flip-flop module. */
module dff(D,Q,Clock,Reset); // N.B. reset is active-high.

parameter CARDINALITY = 1;

output [CARDINALITY-1:0] Q; 
input  [CARDINALITY-1:0] D;
input Clock,Reset;

//parameter CARDINALITY = 1; 
reg [CARDINALITY-1:0] Q;
wire [CARDINALITY-1:0] D;

//!!!Asyn ->Reset, Below is the only synthetizable code; 


always @(posedge Reset or posedge Clock) 
    begin
      if (Reset)  Q <= 0;
	  else	 Q<=D; 
	end 
endmodule

⌨️ 快捷键说明

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