VHDL手动点亮LED程序:在maps出现的
warninglibraryIEEE;useIEEE.STD_LOGIC_1164.ALL;ENTITYLEDISPORT(a:INSTD_LOGIC;b:OUTSTD_...
warninglibrary IEEE;
use IEEE.STD_LOGIC_1164.ALL;
ENTITY LED IS
PORT(a:IN STD_LOGIC;
b:OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
END ENTITY LED;
ARCHITECTURE BHV OF LED IS
SIGNAL S:STD_LOGIC_VECTOR(7 DOWNTO 0);
BEGIN
PROCESS(a,S) BEGIN
IF a='1' THEN S<="10000111";
ELSE S<="00000000";
END IF;
END PROCESS;
b<=S;
END ARCHITECTURE BHV;
WARNING:LIT:701 - PAD symbol "a" has an undefined IOSTANDARD.
WARNING:LIT:702 - PAD symbol "a" is not constrained (LOC) to a specific
求助,刚学老是出错要落泪了. 展开
use IEEE.STD_LOGIC_1164.ALL;
ENTITY LED IS
PORT(a:IN STD_LOGIC;
b:OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
END ENTITY LED;
ARCHITECTURE BHV OF LED IS
SIGNAL S:STD_LOGIC_VECTOR(7 DOWNTO 0);
BEGIN
PROCESS(a,S) BEGIN
IF a='1' THEN S<="10000111";
ELSE S<="00000000";
END IF;
END PROCESS;
b<=S;
END ARCHITECTURE BHV;
WARNING:LIT:701 - PAD symbol "a" has an undefined IOSTANDARD.
WARNING:LIT:702 - PAD symbol "a" is not constrained (LOC) to a specific
求助,刚学老是出错要落泪了. 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
若以下回答无法解决问题,邀请你更新回答
1个回答
展开全部
a被定义成STD_LOGIC型,它的值就不止0和1, std_logic有以下九种状态:U'——初始值,'X'——不定,'0'——0,'1'——1,'Z'——高阻,'W'——弱信号不定,'L'——弱信号0,'H'——弱信号1,'-'——不可能的情况,所以,你应该用elsif(a='0')而不是直接else;
还有你的process进程的敏感条件怎么还有信号S?
下面是用条件信号赋值语句来做的,不需要process进程,因为条件信号赋值语句本身就是并行语句;
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY LED IS
PORT(a:IN STD_LOGIC;
b:OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
END ENTITY LED;
ARCHITECTURE BHV OF LED IS
BEGIN
b<="10000111" WHEN a='1' ELSE
"00000000" WHEN a='0';
END ARCHITECTURE BHV;
还有你的process进程的敏感条件怎么还有信号S?
下面是用条件信号赋值语句来做的,不需要process进程,因为条件信号赋值语句本身就是并行语句;
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY LED IS
PORT(a:IN STD_LOGIC;
b:OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
END ENTITY LED;
ARCHITECTURE BHV OF LED IS
BEGIN
b<="10000111" WHEN a='1' ELSE
"00000000" WHEN a='0';
END ARCHITECTURE BHV;
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询