[HDL] Add single-output DFF HDL

This commit is contained in:
tangxifan 2020-11-06 10:18:37 -07:00
parent 55b14fa6b4
commit 7d46b35296
1 changed files with 25 additions and 0 deletions

View File

@ -4,6 +4,31 @@
// Coder : Xifan TANG
//-----------------------------------------------------
//-----------------------------------------------------
// Function : A native D-type flip-flop with single output
//-----------------------------------------------------
module DFFQ (
input CK, // Clock Input
input D, // Data Input
output Q // Q output
);
//------------Internal Variables--------
reg q_reg;
//-------------Code Starts Here---------
always @ (posedge CK) begin
q_reg <= D;
end
// Wire q_reg to Q
`ifndef ENABLE_FORMAL_VERIFICATION
assign Q = q_reg;
`else
assign Q = 1'bZ;
`endif
endmodule //End Of Module
//-----------------------------------------------------
// Function : A native D-type flip-flop
//-----------------------------------------------------