vhdl语言错误
libraryieee;useieee.std_logic_1164.all;useieee.std_logic_arith.all;useieee.std_logic_...
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity counter10 is
port(
clk,enable,clr:in std_logic;
cy:out std_logic;
q:out std_logic_vector(3 downto 0)
);
end counter10;
architecture counter_arch of counter10 is
begin
process(clk,clr,enable)
variable tmp:integer;
begin
if clr='1' then
tmp:=0;
elsif enable= '1' then
if clk'event and clk='1' then
if(tmp=9) then
tmp:=0;
cy<='1';
else
tmp:=tmp+1;
cy<='1';
end if;
end if;
end if;
end process;
q<=conv_std_logic_vector (tmp,4);
end counter_arch;
10进制计数器 编译没通过 q<=conv_std_logic_vector (tmp,4); 错误tmp未声明 有没有高手帮解答下 怎么修改啊 展开
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity counter10 is
port(
clk,enable,clr:in std_logic;
cy:out std_logic;
q:out std_logic_vector(3 downto 0)
);
end counter10;
architecture counter_arch of counter10 is
begin
process(clk,clr,enable)
variable tmp:integer;
begin
if clr='1' then
tmp:=0;
elsif enable= '1' then
if clk'event and clk='1' then
if(tmp=9) then
tmp:=0;
cy<='1';
else
tmp:=tmp+1;
cy<='1';
end if;
end if;
end if;
end process;
q<=conv_std_logic_vector (tmp,4);
end counter_arch;
10进制计数器 编译没通过 q<=conv_std_logic_vector (tmp,4); 错误tmp未声明 有没有高手帮解答下 怎么修改啊 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询