Matrix to vector conversion

M

Moises

Hello,
My name is Moises Paniagua and I am designing a communication interface
in VHDL. I would be grateful if any of you could help me.

My problem is that I have a matrix and I would like to pick up its rows
and register them in a vector of vectors. Find attached the types used
and the part of code, which I am designing.

Many thanks for advance,
Moises Paniagua

type data_out is array(0 to MAT_LENGTH-1,0 to MAT_WIDTH-1) of
std_logic_vector(MAX_BIT-1 downto 0);

type sum_c is array(0 to MAT_LENGTH-1) of
std_logic_vector(MAX_BIT-1 downto 0);

type conv is array(0 to MAT_WIDTH-1) of sum_c;
library IEEE;


use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;

use work.librairie.all;

entity convert is
Generic(
length : natural := MAT_LENGTH;
width : natural := MAT_WIDTH);

Port ( input : in data_out;
output : out conv);
end convert;

architecture behaviour of convert is
signal aux : conva;
begin

L1: for i in 0 to width-1 generate
L2: for j in 0 to length-1 generate
aux(i) of sum_c(j) <= input(j, i);
end generate;
end generate;

output <= aux;

end behaviour;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top