Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

costnat value for whole matrix in VHDL

Status
Not open for further replies.

Adnan86

Full Member level 2
Full Member level 2
Joined
Apr 4, 2013
Messages
121
Helped
26
Reputation
52
Reaction score
26
Trophy points
1,308
Visit site
Activity points
2,153
Hi
In Vhdl if i have matrix 2x2 , and want all matrix zero we use this :
(others => (others=>0));
if i have MxN matrix, how i can give all arrow and column zero value ?
thanks.
 

if use the same way for 20x20 matrix , it means use 20 (others=>) or just (others => (others=>0));
 
  • Like
Reactions: siasia

    siasia

    Points: 2
    Helpful Answer Positive Rating
You really need to be more clear.
You havent shown the type declaration for this matrix.
You havent shown the base type for each array element.

So, please, post some code, and we can comment more.
 
yes you right
this is my declaration for matrix :
Code:
type matrix_08 is array (integer range <>, integer range <>) of signed( 7 downto 0);
type matrix_16 is array (integer range <>, integer range <>) of signed( 15 downto 0);
and this my input matrix :
Code:
PORT (
      a: IN matrix_08(1 to M, 1 to N); -- MxN matrix ;
      b: IN matrix_08(1 to N, 1 to K); -- NxK matrix ;
      clk: IN STD_LOGIC;
      aclr: IN STD_LOGIC;
      c: OUT  matrix_16(1 to N, 1 to K)
   ) ;
and M,N,K are Generic :
Code:
GENERIC (M : integer:=20;
            K : integer:=20;
            N : integer:=20);

.
.
.
and this my problem :
Code:
x_a <= (others=>(others => x"0000"));
          x_b <= (others=>(others => x"0000"));
above declaration for value zero it's right for 20x20 matrrix or i should 20 of
(Others=>(....((others=>(others=>0))));
i hope you get my point :D
 
  • Like
Reactions: siasia

    siasia

    Points: 2
    Helpful Answer Positive Rating
Andan - you dont show the whole code, just a little bit, and you're missing the declarations of x_a and x_b.
 
yes Thanks for help .
you right ,but my code it's too long and not finished for now ,x_a and x_b it's signal , i'm forget to said that .
anyway , thank you for help

- - - Updated - - -

if its a 2D array then this is enough
(others => (others=>'0'));

Thanks for help .

- - - Updated - - -

Andan - you dont show the whole code, just a little bit, and you're missing the declarations of x_a and x_b.
yes Thanks for help .
you right ,but my code it's too long and not finished for now ,x_a and x_b it's signal , i'm forget to said that .
anyway , thank you for help
 

Then what help are you looking for?
imbichie Answerd my question, my friends.
Matrix 20x20 it's 2D matrix, right so just (others => (others=>'0')); it's enough , i think .
for now my whole code not finished , i want to wright testbench for whole my code but , i my code didn't work for now, so asked that . but apparently i have some problem else ...
so Thanks my friend <3
 

But Imbichie is wrong, what you posted origionally correct IF x_a and x_b are matrix_16. This is why asked to see the declarations of x_a and x_b, to see their type.

you need an "others" for EACH dimension, you have a 2D array of a 1D array type, hence you need 3 "others", not 2. But this would work fine:

signal x_a : matrix_16;

x_a <= (others => (others => x"0000"));
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top