Here is the simple D flipflop code in Verilog :
// D flip-flop Code 2 module d_ff ( d, clk, q, q_bar); input d ,clk; output q, q_bar; wire d ,clk; reg q, q_bar; always @ (posedge clk) begin q <= d; q_bar <= ! d; end endmodule |
||
Note: Sorry, It is a very old post which was stuck in the draft, I will post more simple code to understand the basics of electronics and language