Forum Discussion
Altera_Forum
Honored Contributor
15 years agoNeed help with 3 bit parity generator!
Hello, I'm tasked to design a 3 bit parity generator by using VHDL code but i can't seem to get it right. Can anyone help me with this? Thanks in advance! This is what i have done: lib...
Altera_Forum
Honored Contributor
15 years agoThis will work:
library ieee;
use ieee.std_logic_1164.all;
entity paritygen is
port (a, b, c : in std_logic;
odd_out, even_out : out std_logic);
end paritygen;
architecture work of paritygen is
begin
process (a, b, c)
begin
if (a = '1') or (b='1') or (c='1') then
odd_out <= ((a xor b) xor c);
even_out <= not ((a xor b) xor c);
else
odd_out <= '0';
even_out <= '0';
end if;
end process;
end;