最初のページ 戻る 次へ 最後のページ

module dff(clk, clr, pr, d, q);

input clk, clr, pr, d;

output q;

reg q;

always @(negedge clr or negedge pr

      or posedge clk ) begin

 case ({clr,pr})

  2'b01 : q<=1'b0;

  2'b10 : q<=1'b1;

  2'b11 : q<=d;

  default : q<=1'bX;

 endcase

end

endmodule