VHDL语言 写一个0-59计数 个位十位分别输出 带清零和暂停
几乎没学过VHDL程序是靠看别的程序写出来的错误可能多了点请帮着改改用quartusII运行过了17和30行报错libraryieee;useieee.std_logic...
几乎没学过VHDL
程序是靠看别的程序写出来的
错误可能多了点
请帮着改改
用quartus II运行过了 17 和 30行报错
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity time is
port(clk,reset,pause:in std_logic;
m1,m0:out std_logic_vector(2 downto 0));
end time;
architecture rtl of time is
signal g:integer range 0 to 9;
signal s:integer range 0 to 5;
begin
process(clk,reset,pause)
begin
if(reset='1')then
s<=0;
g<=0;
elseif(pause='1')then --这行报错
s<=s+1;
g<=g+1;
else if (clk'event and clk='1' )then
if(g=9) then
s<=s+1;
g<='0';
else
g:=g+1;
end if;
end if;
m0<=g;
m1<=s;
end process; --这个也报错
end rtl; 展开
程序是靠看别的程序写出来的
错误可能多了点
请帮着改改
用quartus II运行过了 17 和 30行报错
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity time is
port(clk,reset,pause:in std_logic;
m1,m0:out std_logic_vector(2 downto 0));
end time;
architecture rtl of time is
signal g:integer range 0 to 9;
signal s:integer range 0 to 5;
begin
process(clk,reset,pause)
begin
if(reset='1')then
s<=0;
g<=0;
elseif(pause='1')then --这行报错
s<=s+1;
g<=g+1;
else if (clk'event and clk='1' )then
if(g=9) then
s<=s+1;
g<='0';
else
g:=g+1;
end if;
end if;
m0<=g;
m1<=s;
end process; --这个也报错
end rtl; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询