【发布时间】:2016-02-10 14:38:22
【问题描述】:
我的 3 位 BCD 到二进制解码器的测试台有问题。
输入很好,但输出是 UUUUUU .....
不知道如何解决它。我应该以某种方式分配输出吗?
我正在使用 ISE 来模拟代码。
我一直在尝试应用我在行为模型中使用的方法,但它不接受它。
-- TestBench Template
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY testbench IS
END testbench;
ARCHITECTURE behavior OF testbench IS
COMPONENT bcd_2_bin
PORT(
bcd_in_0 : IN std_logic_vector(3 downto 0);
bcd_in_10 : IN std_logic_vector(3 downto 0);
bcd_in_100 : IN std_logic_vector(3 downto 0);
bin_out : OUT std_logic_vector(9 downto 0)
);
END COMPONENT;
signal bcd_in_0 : std_logic_vector(3 downto 0) := (others => '0');
signal bcd_in_10 : std_logic_vector(3 downto 0) := (others => '0');
signal bcd_in_100 : std_logic_vector(3 downto 0) := (others => '0');
signal bin_out : std_logic_vector(9 downto 0);
BEGIN
-- Instantiate the Unit Under Test (UUT)
uut: bcd_2_bin PORT MAP (
bcd_in_0 => bcd_in_0,
bcd_in_10 => bcd_in_10,
bcd_in_100 => bcd_in_100,
bin_out => bin_out
);
-- Stimulus process
stim_proc: process
begin
bcd_in_0 <= x"0"; bcd_in_10 <= x"1"; bcd_in_100 <= x"2";
wait for 100 ns;
bcd_in_0 <= x"9"; bcd_in_10 <= x"9"; bcd_in_100 <= x"9";
wait for 100 ns;
bcd_in_0 <= x"8"; bcd_in_10 <= x"2"; bcd_in_100 <= x"4";
wait;
end process;
END;
【问题讨论】:
-
查看 bcd2bin 组件内部的信号。 electronics.stackexchange.com/questions/213174/…
-
检查你的模拟器输出。可能没有找到
bin_2_bcd,并且已发出有关黑盒实例的警告。 -
您的问题不包含Minimal, Complete, and Verifiable example,当设计的核心位于无法看到内容的盒子内时,您是在请求他人帮助您。
标签: vhdl