我有问题。这是我的主要代码:
--Comparer
library ieee;
use ieee.std_logic_1164.all;
entity comp is
generic(N : natural := 1);
port (bitVec1, bitVec2: in bit_Vector(N-1 downto 0);
outVec: out bit_Vector(N-1 downto 0);
same: out bit);
end comp;
architecture struktur of comp is
begin
p1: process(bitVec1, bitVec2)
begin
if bitVec1 = bitVec2 then
same <= '1';
else
same <= '0';
end if;
if bitVec1 >= bitVec2 then
outVec <= bitVec1;
else
outVec <= bitVec2;
end if;
end process;
end architecture struktur;
这是我的最佳测试:
--Comparer Test
entity test is
end test;
architecture bench of test is
component comparer
generic(N : natural := 1);
port (bitVec1, bitVec2: in bit_vector(N-1 downto 0);
outVec: out bit_Vector(N-1 downto 0);
same: out bit);
end component;
constant MAX : natural := 3;
signal bitVec1, bitVec2, outVec: bit_vector(MAX downto 0);
signal same : bit;
begin
UUT:comparer generic map(MAX)
port map(bitVec1, bitVec2, outVec, same);
bitVec1 <= "1000", "1001" after 100 ns;
bitVec2 <= "1000";
end bench;
我的问题是,我的程序没有输出。我的输出&#34;相同&#34;当我测试时,每次都是0,并且&#34; outVec&#34;每次0000.为什么会这样,我不知道?