library IEEE;
use IEEE.std_logic_1164.all;
entity grey2
norm is
generic (width: integer := 8);
port (
grey: in std_logic_vector(width - 1 downto 0);
norm: out std_logic_vector(width - 1 downto 0)
);
end grey2norm;
architecture behav of grey2norm is
begin
process(grey)
variable
temp : std_logic;
begin
for i in width-1 downto 0 loop
temp := '0';
for j in width-1 downto i loop
temp := temp xor grey(j);
end loop;
norm(i) <= temp ;
end loop;
end process;
end behav;