Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

matrix transpose code in vhdl

Dear all,

I want to transpose a set of matrix from row to column.I has write the code in VHDL but has error occured.Below is my code:

----------------------------------------------------------------------

library ieee;

use ieee.std_logic_1164.all;

entity transpose is

port (

-- Inputs

in1 : IN integer RANGE -127 TO 127;

in2 : IN integer RANGE -127 TO 127;

in3 : IN integer RANGE -127 TO 127;

in4 : IN integer RANGE -127 TO 127;

in5 : IN integer RANGE -127 TO 127;

in6 : IN integer RANGE -127 TO 127;

in7 : IN integer RANGE -127 TO 127;

in8 : IN integer RANGE -127 TO 127;

--Outputs

out1 : OUT integer RANGE -127 TO 127;

out2 : OUT integer RANGE -127 TO 127;

out3 : OUT integer RANGE -127 TO 127;

out4 : OUT integer RANGE -127 TO 127;

out5 : OUT integer RANGE -127 TO 127;

out6 : OUT integer RANGE -127 TO 127;

out7 : OUT integer RANGE -127 TO 127;

out8 : OUT integer RANGE -127 TO 127);

end transpose;

architecture transpose of transpose is

begin

for i in 1 to m loop;

for j in 1 to n loop;

Gazouta (i,j)<= Gazinta (j,i);

end loop;

end loop;

end transpose;

--------------------------------------------------------------------

Can anyone help me correct this code?Many thanks

8 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Dear Tricky,

    I not familiar using loop operation.Can u give simple loop coding?

    Many thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    
    process
    begin
      for i in 1 to m loop
        for j in 1 to n loop
          Gazouta (i,j)<= Gazinta (j,i);
        end loop;
      end loop;
    end process;
    

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Dear Tricky,

    Thanks a lot for give response. I will write the code back.

    Many Thanks.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Dear Daixiwen,

    Yes, i just notice that Gazota and Gazinta after i run the code and error occur because i not declare them.Actually i found the loop process (code) in this forum.Then i try to write the whole vhdl code.So, know i get a new error.Did you has any idea?

    Many thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I think you should define an array of integers type to represent a matrix and use that one as type for your inputs and outputs.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Given your lack of knowledge of VHDL, and your random copy/pasting of other bits of code, I suggest you find a beginners guide to VHDL and get reading. Copy/pasting code from posts on forums is not going to help you learn.