2 use ieee.std_logic_1164.all;
5 generic (w: natural := 4);
7 dat : std_logic_vector (7 downto 0);
8 mask : std_logic_vector (1 downto 0);
9 res : out std_logic_vector (7 downto 0));
12 architecture behav of slice02 is
15 variable hi, lo : natural;
17 if rising_edge (clk) then
18 res <= (others => '0');
19 for i in mask'range loop
20 if mask (i) = '1' then
23 res (hi downto lo) <= dat (hi downto lo);