--generic parity detector:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity genericparitydetector is
generic(n:integer:=8);
port(a:in std_logic_vector(n downto 0);
y:out std_logic_vector(n+1 downto 0));
end genericparitydetector;
architecture Behavioral of genericparitydetector is
begin
process(a)
variable x:std_logic;
begin
x:='0';
for i in 0 to n loop
x:=x xor a(i);
end loop;
y<=x&a;
end process;
end Behavioral;
The above code has been executed and has been found to have no errors..!
plz do comment..!
thank u..!! :) :)
plz do comment..!
thank u..!! :) :)