Altera_Forum
Honored Contributor
14 years agoCreating Flip-flop by using logic gates
Hi,
I am a student who new to VHDL and currently doing VHDL assignment. In this assignment, students are required to create the D, JK flip-flop. I need help to solve my error for my code as shown as below: ------------------------ library ieee; use ieee.std_logic_1164.all; entity Dflip_flop is port ( D :in std_logic; clk :in std_logic; Q :out std_logic; Qbar :out std_logic ); end Dflip_flop; architecture hc of Dflip_flop is signal W1 : std_logic; signal W2 : std_logic; signal W3 : std_logic; signal W4 : std_logic; signal W5 : std_logic; begin Q <= W4; Qbar <= W5; W1 <= not D; W2 <= D nand clk; W3 <= clk nand W1; W4 <= W2 nand W5; W5 <= W3 nand W4; process(clk) begin if rising_edge(clk)then Q <= D; end if; end process end hc; ------------- Error (10500): VHDL syntax error at Dflip_flop.vhd(41) near text "end"; expecting ";", or an identifier ("end" is a reserved keyword) Can anyone point out what is the syntax error here?? Thanks and appreciated for the helps.