Altera_Forum
Honored Contributor
12 years agoXOR operator doesnt work?
Im trying to code a 1bit CRA adder. here is my code.
LIBRARY ieee;USE ieee.std_logic_1164.ALL;
ENTITY CRA1BIT IS
PORT(c0, x0, y0: IN std_logic;
s0, c1: OUT std_logic);
END CRA1BIT;
ARCHITECTURE s0func OF CRA1BIT IS
BEGIN
s0 <= (c0 XOR x0 XOR y0);
END s0func;
ARCHITECTURE c1func OF CRA1BIT IS
BEGIN
c1 <= ((x0 AND y0) OR (c0 AND (x0 OR y0)));
END c1func; I have used modelsim and the waveform editor in Quartus 2 to check this and in both c1 works as it should but s0 gives me 0 all across the board. iv tried playing with parenthesis and even tried just doing x0 XOR y0 and that doesnt even work. Whats the problem here? Thanks in advanced.