-----------------------------------
package array2D is
type array2D0 is array (15 DOWNTO 0,9 DOWNTO 0) of STD_LOGIC;
end array2D;
-----------------------------------
--
--
function conv_2d21d ( array2d : array2D0; ch_num : integer range 0 to 15)
return std_logic_vector is
variable ch_out : std_logic_vector (9 downto 0);
begin
for i in 0 to 9 loop
ch_out(i) := array2d(ch_num , i);
end loop;
return ch_out;
end conv_2d21d;
----
----
signal Ch_in :array2D0;
signal Ch_out :std_logic_vector (9 downto 0);
variable Ch_num :integer range 0 to 15;
-- test values
Ch_num := 1;
Ch_in <= (X"01","0000001111");
Ch_out(9 downto 0) <= conv_2d21d( Ch_in,Ch_num);