mam do zrobienia cos ala zegar do gotowania jajek, z niezaleznym ustawianiem min i sek, po przycisku start ma odliczac do zera. czas ma byc wyswietlany na 4x7segmentowych wyswietlaczach. problem polega na przekazywaniu wartosci sygnałow miedzy procesami, zarówno w procesie w ktorym wprowadzam dane, jak tez w tym w ktorym jest odliczanie mam syganly min i sec, jak zrobic, zeby to wszystko sie kompilowalo i poprawnie dzialalo? co ciekawe procesy oddzielnie dzialaja dokladnei tak jakbym chcial, a razem jest cos nie tak:) wykombinowaem cos takiego, przypisanie
sec<=secu;
min<=minu; tylko w tym miejscu mie wywala bledy, ale podczas symulacji widac, ze cos jest nie tak. bylbym wdzyeczny za pomoc
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity proby is
port( minuty, sekundy: out std_logic_vector (6 downto 0);
stop: out std_logic;
s_min, s_sec, start, clk: in std_logic);
end proby;
architecture a1 of proby is
signal min, minu: std_logic_vector (6 downto 0):="0000000";
signal sec, secu: std_logic_vector (6 downto 0):="0000000";
signal secc, minn: std_logic_vector (6 downto 0):="0000000";
signal sec_d: integer range 0 to 59;
signal min_d: integer range 0 to 59;
signal stp: std_logic;
begin
p1: process(s_sec, s_min)
begin
if start/='1' then
if s_min = '1' and s_min'event then min_d <= min_d + 1;
if min_d = 59 then minu <= "0000000"; min_d<=0; else
minu <= minu + 1; end if; end if;
if s_sec = '1' and s_sec'event then sec_d <= sec_d + 1;
if sec_d = 59 then secu <= "0000000"; sec_d<=0; else
secu <= secu + 1; end if; end if;
end if;
end process p1;
process(start)
begin
if clk='1' and clk'event then
sec<=secu;
min<=minu;
if start='1' then
for i in 0 to 500 loop
if sec/="0000000" then sec<=sec-1; end if;
if sec="0000000" and min/="0000000" then min<=min-1; end if;
if sec="0000000" and min="0000000" then stp <= '1'; exit; end if;
--if sec="0000000" then --sec<=sec-1;
--if min/="0000000" then min<= min-1; sec<="0111011"; elsif
-- min="0000000" then stp <= '1'; exit; end if;
--elsif sec/="0000000" then sec<=sec-1; end if;
end loop;
end if;
end if;
end process;
minuty<=min;
sekundy<=sec;
stop<=stp;
end a1;
sec<=secu;
min<=minu; tylko w tym miejscu mie wywala bledy, ale podczas symulacji widac, ze cos jest nie tak. bylbym wdzyeczny za pomoc
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity proby is
port( minuty, sekundy: out std_logic_vector (6 downto 0);
stop: out std_logic;
s_min, s_sec, start, clk: in std_logic);
end proby;
architecture a1 of proby is
signal min, minu: std_logic_vector (6 downto 0):="0000000";
signal sec, secu: std_logic_vector (6 downto 0):="0000000";
signal secc, minn: std_logic_vector (6 downto 0):="0000000";
signal sec_d: integer range 0 to 59;
signal min_d: integer range 0 to 59;
signal stp: std_logic;
begin
p1: process(s_sec, s_min)
begin
if start/='1' then
if s_min = '1' and s_min'event then min_d <= min_d + 1;
if min_d = 59 then minu <= "0000000"; min_d<=0; else
minu <= minu + 1; end if; end if;
if s_sec = '1' and s_sec'event then sec_d <= sec_d + 1;
if sec_d = 59 then secu <= "0000000"; sec_d<=0; else
secu <= secu + 1; end if; end if;
end if;
end process p1;
process(start)
begin
if clk='1' and clk'event then
sec<=secu;
min<=minu;
if start='1' then
for i in 0 to 500 loop
if sec/="0000000" then sec<=sec-1; end if;
if sec="0000000" and min/="0000000" then min<=min-1; end if;
if sec="0000000" and min="0000000" then stp <= '1'; exit; end if;
--if sec="0000000" then --sec<=sec-1;
--if min/="0000000" then min<= min-1; sec<="0111011"; elsif
-- min="0000000" then stp <= '1'; exit; end if;
--elsif sec/="0000000" then sec<=sec-1; end if;
end loop;
end if;
end if;
end process;
minuty<=min;
sekundy<=sec;
stop<=stp;
end a1;