huytergan
Member level 3
Tryna see 00-99 counter in Xilinx Vivado's simulation.
couldn't understand what was wrong. In simulation, digit1 and digit2 stuck with 0.
For any help, thanks in advance.
Regards
Code:
entity twodigitcounter is
Port (
clk : in std_logic;
digit1,digit2 : out integer range 0 to 9
);
end twodigitcounter;
architecture Behavioral of twodigitcounter is
shared variable temp1,temp2 : integer range 0 to 9;
begin
proc1:process(clk)
begin
if rising_edge(clk) then
if temp1 = 9 then
temp1:=0;
else
temp1:=temp1+1;
end if;
end if;
end process proc1;
proc2:process(clk)
begin
if rising_edge(clk) then
if temp1=9 then
if temp2=9 then
temp2:=0;
else
temp2:=temp2+1;
end if;
end if;
end if;
end process proc2;
digit1 <= temp1;
digit2 <= temp2;
end Behavioral;
couldn't understand what was wrong. In simulation, digit1 and digit2 stuck with 0.
For any help, thanks in advance.
Regards