# Matrix composed by two matrix

Discussion in 'VHDL' started by lvcargnini, Jul 4, 2006.

1. ### lvcargniniGuest

Hi,
I have a matrix of (0 to 53, 0 to 67) and i create other two matrix
one of x(0 to 53, 0 to 53) and another y(0 to 53, 0 to 5) how could i
map this two matrix on bigger matrix ?
the easy way, correct way, the combinatorial way.
To do this outside an process statement or even inside a process.

lvcargnini, Jul 4, 2006

2. ### Jonathan BromleyGuest

On 4 Jul 2006 09:41:07 -0700, "lvcargnini"
<> wrote:

>I have a matrix of (0 to 53, 0 to 67) and i create other two matrix
>one of x(0 to 53, 0 to 53) and another y(0 to 53, 0 to 5) how could i
>map this two matrix on bigger matrix ?
>the easy way, correct way, the combinatorial way.
>To do this outside an process statement or even inside a process.

Write a conversion function that takes the two smaller matrices
and returns a value of the large matrix type. Use FOR loops
inside this function to do the copying.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK

http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.

Jonathan Bromley, Jul 4, 2006

3. ### lvcargniniGuest

Hi,
all matrix are of type std_logic. So the manner that you are saying me
to do is using forr loops inisde a process or a function, correct ?
but if a create a function, I don't need to call the function inside a
process block ?
Jonathan Bromley wrote:
> On 4 Jul 2006 09:41:07 -0700, "lvcargnini"
> <> wrote:
>
> >I have a matrix of (0 to 53, 0 to 67) and i create other two matrix
> >one of x(0 to 53, 0 to 53) and another y(0 to 53, 0 to 5) how could i
> >map this two matrix on bigger matrix ?
> >the easy way, correct way, the combinatorial way.
> >To do this outside an process statement or even inside a process.

>
> Write a conversion function that takes the two smaller matrices
> and returns a value of the large matrix type. Use FOR loops
> inside this function to do the copying.
> --
> Jonathan Bromley, Consultant
>
> DOULOS - Developing Design Know-how
> VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services
>
> Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK
>
> http://www.MYCOMPANY.com
>
> The contents of this message may contain personal views which
> are not the views of Doulos Ltd., unless specifically stated.

lvcargnini, Jul 4, 2006
4. ### Jonathan BromleyGuest

>all matrix are of type std_logic. So the manner that you are saying me
>to do is using forr loops inisde a process or a function, correct ?
>but if a create a function, I don't need to call the function inside a
>process block ?

Yes; but why is that an issue? EVERY piece of procedural code in
VHDL runs inside a process, although sometimes the process is
disguised (for example, a concurrent signal assignment is in
fact a process). So you could easily write a concurrent
signal assignment that calls your function:

big_matrix <= combine_function (small_matrix, tiny_matrix);

That's why functions are such a neat solution for this sort of
thing - you can use them all over the place.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL * Verilog * SystemC * e * Perl * Tcl/Tk * Project Services

Doulos Ltd., 22 Market Place, Ringwood, BH24 1AW, UK

http://www.MYCOMPANY.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.

Jonathan Bromley, Jul 5, 2006