yosys/tests/asicworld/code_hdl_models_tff_async_r...

28 lines
733 B
Verilog
Raw Normal View History

2013-01-05 04:13:26 -06:00
//-----------------------------------------------------
// Design Name : tff_async_reset
// File Name : tff_async_reset.v
// Function : T flip-flop async reset
// Coder : Deepak Kumar Tala
//-----------------------------------------------------
module tff_async_reset (
data , // Data Input
clk , // Clock Input
reset , // Reset input
q // Q output
);
//-----------Input Ports---------------
input data, clk, reset ;
//-----------Output Ports---------------
output q;
//------------Internal Variables--------
reg q;
//-------------Code Starts Here---------
always @ ( posedge clk or negedge reset)
if (~reset) begin
q <= 1'b0;
end else if (data) begin
q <= !q;
end
endmodule //End Of Module tff_async_reset