Altera_Forum
Honored Contributor
14 years agoVHDL Code Of 2 input XOR -gate
Hi,
I am new to VHDL programing and i had written a VHDL code on 2 input XOR gate using process and it compiles successfully but in test bench waveform i am unable to get the output that is for all possible inputs i am getting 0 output , I am using Xilinx 9.1 and the following is code entity XOR2 is Port ( A : in STD_LOGIC; B : in STD_LOGIC; C : out STD_LOGIC); end XOR2; architecture Behavioral of XOR2 is begin process(A,B) begin if((A='0') and (B='1')) then C<='1'; elsif((A='1') and (B='0')) then C<='1'; else C<='0'; end if; end process; end Behavioral;