D触发器

module D_Flip_Flop(
	clk,rst_n,d,q);

input		 	clk;
input		  	rst_n;
input			d;
output reg  q;

always @(posedge clk or negedge rst_n)
if(!rst_n)
	q <= 1'b0;
else
	q <= d;

endmodule

  

posted @ 2016-12-20 13:38  peng_blog  阅读(199)  评论(0编辑  收藏  举报