
entity DD_FF is 
  port (D, R, CLK : in bit;
        Q, QBAR : out bit);
end DD_FF;

architecture BEHAV of DD_FF is
begin
  process(R, CLK)
  begin
    if (R = '0') then
      Q <= '0';
    elsif (CLK'event) then
      Q <= D;
    end if;
  end process;
  QBAR <= not Q;
end BEHAV;
