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出不来 展开
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出不来 展开
展开全部
你设计了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;
你应当将上述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;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询