vhdl的编译和仿真出现这种问题怎么办

程序libraryieee;useieee.std_logic_1164.all;entitydocisport(A:instd_logic_vector(2downto... 程序
library ieee;
use ieee.std_logic_1164.all;

entity doc is
port
(
A:in std_logic_vector(2 downto 0);
led1:out std_logic_vector(6 downto 0);
led2:out std_logic_vector(6 downto 0);
led3:out std_logic_vector(6 downto 0);
led4:out std_logic_vector(6 downto 0)
);
end doc;

architecture hu1 of doc is
begin
led1<="11111110" when A="000"else
"1001110" when A="001"else
"1000111" when A="010"else
"1000111" when A="011"else
"0110111" when A="100"else
"0110111" when A="101"else
"0110111" when A="110"else
"0110111";
end hu1;
architecture hu2 of doc is
begin
led2<="1111110" when A="000"else
"0011101" when A="001"else
"0011101" when A="010"else
"0011101" when A="011"else
"1001111" when A="100"else
"1001111" when A="101"else
"1001111" when A="110"else
"1001111";
end hu2;
architecture hu3 of doc is
begin
led3<="1111110" when A="000"else
"0110000" when A="001"else
"0011101" when A="010"else
"0011101" when A="011"else
"0001110" when A="100"else
"0001110" when A="101"else
"0001110" when A="110"else
"0001110";
end hu3;
architecture hu4 of doc is
begin
led4<="1111110" when A="000"else
"0111101" when A="001"else
"0111101" when A="010"else
"0111101" when A="011"else
"1100111" when A="100"else
"1100111" when A="101"else
"1100111" when A="110"else
"1100111";
end hu4;

编译没错误有警告,但是仿真的时候led1-led3出不来
展开
 我来答
nereus78e904
2015-09-21 · TA获得超过1.5万个赞
知道大有可为答主
回答量:5463
采纳率:90%
帮助的人:1932万
展开全部
你设计了4个结构体,但每个结构体却只对一个输出端口赋值。这在编译时不会出现问题,却在综合的时候,综合器只默认综合最后一个结构体,前三个结构体没有被综合。
你应当将上述4个结构体整合成为一个结构体:
architecture hu of doc is
begin
led1<="11111110" when A="000"else
"1001110" when A="001"else
"1000111" when A="010"else
"1000111" when A="011"else
"0110111" when A="100"else
"0110111" when A="101"else
"0110111" when A="110"else
"0110111";
led2<="1111110" when A="000"else

"0011101" when A="001"else
"0011101" when A="010"else
"0011101" when A="011"else
"1001111" when A="100"else
"1001111" when A="101"else
"1001111" when A="110"else
"1001111";
led3<="1111110" when A="000"else

"0110000" when A="001"else
"0011101" when A="010"else
"0011101" when A="011"else
"0001110" when A="100"else
"0001110" when A="101"else
"0001110" when A="110"else
"0001110";
led4<="1111110" when A="000"else

"0111101" when A="001"else
"0111101" when A="010"else
"0111101" when A="011"else
"1100111" when A="100"else
"1100111" when A="101"else
"1100111" when A="110"else
"1100111";
end hu;
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式