Skip to content

Instantly share code, notes, and snippets.

@mgronhol
Created May 23, 2017 19:29
Show Gist options
  • Select an option

  • Save mgronhol/74bb835fb40d5cd6d49c28587c62a0b1 to your computer and use it in GitHub Desktop.

Select an option

Save mgronhol/74bb835fb40d5cd6d49c28587c62a0b1 to your computer and use it in GitHub Desktop.
Flip-flop in verilog
module flapflap(d,clk,q,qn);
input d,clk;
output q,qn;
reg q,qn;
initial
begin
q=0;
qn=1;
end
always @(posedge clk)
begin
q <= d;
qn <= !d;
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment