This is my VHDL code in Modelsim. The problem is that output is uninitialized, as you can see in the image. Please tell me what's the problem with my code.
library ieee;
use ieee.std_logic_1164.All;
use IEEE.NUMERIC_STD.ALL;
entity circu_it is
port (A : in std_logic;
B : in std_logic;
C : in std_logic;
D : in std_logic;
Z : out std_logic );
end circu_it;
architecture Behavioral of circu_it
is
Signal E ,F ,M ,N , L: std_logic;
begin
M <= (A and B and C) after 5ns;
E <= (M or D) after 5ns;
N <= (B nor C) after 5ns;
F <= (N nand A) after 5ns;
L <= not F after 2ns;
Z <= L xor E after 5ns;
end Behavioral;
The testbench of code is the following ......
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
USE ieee.numeric_std.ALL;
entity delay_test is
end delay_test;
architecture stimulus of delay_test is
component delay
port (
A : in std_logic;
B : in std_logic;
C : in std_logic;
D : in std_logic;
Z : out std_logic);
end component;
signal A: std_logic ;
signal B: std_logic ;
signal C: std_logic ;
signal D: std_logic ;
signal Z: std_logic ;
begin
DUT: delay port map ( A => A, B => B, C => C, D => D, Z => Z);
STIMULUS1: process
constant PERIOD: time := 100 ns;
begin
A <= '0';
B <= '0';
C <= '0';
D <= '0';
wait for period;
A <= '0';
B <= '0';
C <= '0';
D <= '1';
wait for period;
A <= '0';
B <= '0';
C <= '1';
D <= '0';
wait for period;
A <= '0';
B <= '0';
C <= '1';
D <= '1';
wait for period;
A <= '0';
B <= '1';
C <= '0';
D <= '0';
wait for period;
A <= '0';
B <= '1';
C <= '0';
D <= '1';
wait for period;
A <= '0';
B <= '1';
C <= '1';
D <= '0';
wait for period;
A <= '0';
B <= '1';
C <= '1';
D <= '1';
wait for period;
A <= '1';
B <= '0';
C <= '0';
D <= '0';
wait for period;
A <= '1';
B <= '0';
C <= '0';
D <= '1';
wait for period;
A <= '1';
B <= '0';
C <= '1';
D <= '0';
wait for period;
A <= '1';
B <= '0';
C <= '1';
D <= '1';
wait for period;
A <= '1';
B <= '1';
C <= '0';
D <= '0';
wait for period;
A <= '1';
B <= '1';
C <= '0';
D <= '1';
wait for period;
A <= '1';
B <= '1';
C <= '1';
D <= '0';
wait for period;
A <= '1';
B <= '1';
C <= '1';
D <= '1';
wait;
end process;
end stimulus;