关于用VHDL语言编写好程序后用modelsim进行仿真,所有的值都是U,波形都是红线的问题
RT刚学的VHDL语言,用quartus10.1写好一个3-8译码器后,经过startcompilation=>starttestbenchtempltewriter,生...
RT
刚学的VHDL语言,用quartus10.1写好一个3-8译码器后,经过start compilation =>start test bench templte writer,生成了.vho和.vht2个文件,然后调用modelsim仿真,可是出现的只有红线,是不是少了什么激励信号啊?如果是的话应该怎样用VHDL写这个激励信号,然后加入工程进行仿真呢?是不是所有的激励信号都差不多呢?小弟初学quartus,还有好多不明白的地方啊,一个仿真搞得头都大了,哪位达人具体介绍一下吧····
3-8译码器程序:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_ARITH.ALL;
use ieee.std_logic_UNSIGNED.ALL;
entity decoder is
port(a,b,c,e1,e2,e3:in std_logic; --in design
y:out std_logic_vector(7 downto 0) --out design
);
end decoder;
architecture rt1 of decoder is
signal indata: std_logic_vector(2 downto 0); --signal design
begin
indata<= c&b&a;
process(indata,e1,e2,e3)
begin
if(e1='0'and e2='0'and e3='1') then
case indata is
when "000"=>y<="11111110";
when "001"=>y<="11111101";
when "010"=>y<="11111011";
when "011"=>y<="11110111";
when "100"=>y<="11101111";
when "101"=>y<="11011111";
when "110"=>y<="10111111";
when "111"=>y<="01111111";
when others=>y<="11111111";
end case;
else
y<="00000000";
end if;
end process;
end rt1; 展开
刚学的VHDL语言,用quartus10.1写好一个3-8译码器后,经过start compilation =>start test bench templte writer,生成了.vho和.vht2个文件,然后调用modelsim仿真,可是出现的只有红线,是不是少了什么激励信号啊?如果是的话应该怎样用VHDL写这个激励信号,然后加入工程进行仿真呢?是不是所有的激励信号都差不多呢?小弟初学quartus,还有好多不明白的地方啊,一个仿真搞得头都大了,哪位达人具体介绍一下吧····
3-8译码器程序:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_ARITH.ALL;
use ieee.std_logic_UNSIGNED.ALL;
entity decoder is
port(a,b,c,e1,e2,e3:in std_logic; --in design
y:out std_logic_vector(7 downto 0) --out design
);
end decoder;
architecture rt1 of decoder is
signal indata: std_logic_vector(2 downto 0); --signal design
begin
indata<= c&b&a;
process(indata,e1,e2,e3)
begin
if(e1='0'and e2='0'and e3='1') then
case indata is
when "000"=>y<="11111110";
when "001"=>y<="11111101";
when "010"=>y<="11111011";
when "011"=>y<="11110111";
when "100"=>y<="11101111";
when "101"=>y<="11011111";
when "110"=>y<="10111111";
when "111"=>y<="01111111";
when others=>y<="11111111";
end case;
else
y<="00000000";
end if;
end process;
end rt1; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询