Error while coding a 2 bit comparator code

Status
Not open for further replies.

Sujith_Raj

Newbie level 1
Joined
May 4, 2020
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
14
Hi all;

I write a VHDL code below. There are no error when I compile it, but then fatal error occur when I try to simulate.



Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
library ieee;                                   
use ieee.std_logic_1164.all;            
                                                    
entity comparator2 is port (                    
    A, B: in std_logic_vector(1 downto 0); 
    Equals: out std_logic);                 
end comparator2;                                
 
architecture behavioral of comparator2 is
begin
    process(A,B)
    begin
        if (A(0)=B(0))and (A(1)=B(1))then
        Equals <= '1';
        else
        Equals <= '0';
        end if;
    end process;
end behavioral;

 
Last edited by a moderator:

You dont say what tool or error. There is nothing wrong with the code.
 

is there a testbench? does the tool count the lack of a testbench as a fatal error?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…