Quartus2V13.0SP1 DE1board VHDL
I am a student of university.
Professor said "do not use CLOCK and 'event".
Yesterday I have done reverse onoff on 7segmentLED.
I edited this question many things today.
Below Code1 is right behavior.
And I want to do it on Code2 without "'event".
--Code1
library IEEE;
use ieee.std_logic_1164.all ;
use IEEE.std_logic_unsigned.all;
entity increase is
port(
key0 : in std_logic;
hex3 : out std_logic_vector(6 downto 0));
end increase;
architecture RTL of increase is
signal hex3c : integer range 0 to 9;
begin
process(key0, hex3c)begin
if(key0' event and key0 = '0') then
if(hex3c = 9) then
hex3c <= 0;
else
hex3c <= hex3c + 1;
end if;
end if;
end process;
process(hex3c)
begin
case hex3c is
when 0 => hex3 <= "1000000";
when 1 => hex3 <= "1111001";
when 2 => hex3 <= "0100100";
when 3 => hex3 <= "0110000";
when 4 => hex3 <= "0011001";
when 5 => hex3 <= "0010010";
when 6 => hex3 <= "0000010";
when 7 => hex3 <= "1111000";
when 8 => hex3 <= "0000000";
when others => hex3 <= "0010000";
end case;
end process;
end RTL;
and
--Code2
library IEEE;
use ieee.std_logic_1164.all ;
use IEEE.std_logic_unsigned.all;
entity increase is
port(
key0 : in std_logic;
hex3 : out std_logic_vector(6 downto 0));
end increase;
architecture RTL of increase is
signal hex3c : integer range 0 to 9;
signal prev : std_logic;
begin
process(key0, hex3c, prev)begin
if(key0 = '0' and prev = '0')then
if(hex3c = 9) then
hex3c <= 0;
prev <= '1';
else
hex3c <= hex3c + 1;
prev <= '1';
end if;
elsif(key0 = '1' and prev = '1')then
prev <= '0';
end if;
end process;
process(hex3c)
begin
case hex3c is
when 0 => hex3 <= "1000000";
when 1 => hex3 <= "1111001";
when 2 => hex3 <= "0100100";
when 3 => hex3 <= "0110000";
when 4 => hex3 <= "0011001";
when 5 => hex3 <= "0010010";
when 6 => hex3 <= "0000010";
when 7 => hex3 <= "1111000";
when 8 => hex3 <= "0000000";
when others => hex3 <= "0010000";
end case;
end process;
end RTL;
Please give me how to solve this problem.
Really we can realize this?
'event" mean no don't use a clock or does he mean userising_edge()which is better than'event. - Paebbels