-- LED TEST for HDL Bread Board (XC95108 PC84 -7 / 10MHz) library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_unsigned.all; entity LED is port ( RESET: in std_logic; START: in std_logic; -- not used now...(use RESET instead) ENABLE: in std_logic; -- :=STOP LEDS: out std_logic_vector (7 downto 0) ; CLK: in std_logic ) ; -- !! CAUTION !! You need assignment signals to pins into " Edit Constraints " in EXPRESS -- RESET : signal is "P2"; (Push = 0) -- START : signal is "P4"; (Push = 0) -- "P3" Other side of START button (usualy = 0, Push = 1) -- STOP : signal is "P7"; (= ENABLE, Push = 0) -- "P6" Other side of STOP button (usualy = 0, Push = 1) -- LEDS : Output signal is "P43,P44,P45,P46,P47,P48,P50,P51"; -- CLK : Input signal is "P9";) end LED; architecture LED_ARCH of LED is signal OSCOUT, C2CLK, CLOCK : std_logic; -- OSCOUT,C2CLK are not used now. signal COUNT : std_logic_vector (23 downto 0); -- signal COUNT : std_logic_vector (3 downto 0); signal FIBOUT, PREV_FIB, FIBADD : std_logic_vector (7 downto 0); begin -- Syetm Clock = 10MHZ, divide by (2**24) = > Clock Frequency 1 Hz process ( CLK ) begin if CLK = '1' and CLK'event then if COUNT > "111111111111111111111111" then -- if COUNT > "1111" then COUNT <= "000000000000000000000000"; -- COUNT <= "0000"; else COUNT <= COUNT + '1'; end if; CLOCK <= COUNT(23); -- CLOCK <= COUNT(3); end if; end process; process begin -- Write your own Code ! if RESET = '0' then FIBOUT <= "00000001"; PREV_FIB <= "00000000"; end if ; wait until CLOCK'event and CLOCK = '0' and ENABLE = '1' ; PREV_FIB <= FIBOUT; case (FIBOUT="00000000") and (PREV_FIB="00000000") is when true => FIBOUT <= "00000001"; when others => FIBOUT <= FIBADD; end case; end process ; -- incliment FIBOUT FIBADD <= FIBOUT + PREV_FIB; -- Assign to output port and Display to LEDs LEDS <= FIBOUT xor "00000001" ; end LED_ARCH ;