Start Signal with Zero Value

A

a_Conan

Hi,
Suppose I write:

package MyVariables is
constant M : integer := 4;
constant N : integer := 9;
constant MN : integer := M*N ;
constant TRUE : integer := 1;
constant FALSE : integer := 0;
type Location is record
row : integer;
col : integer;
val : real;
end record;
type MyArrayM is array (0 to M) of Location;
type KM is array (0 to M) of integer;
type KF is array(0 to M, 0 to M) of integer;
end MyVariables;
..
..
..
Signal W1 : MyArrayM;
Signal W2 : KM;
Signal KF : KF;

My question: how can I assign all signals with Zeros ( Default value
before any calculations)
Thank You
 
A

Ajeetha

If it is for pure synthesis mode - you need reset signal and logic
associated, for pure simulation, simple inline initialization should
suffice. Like:

Signal W2_0 : KM := (others => 0);

HTH
Ajeetha
www.noveldv.com
 
A

a_Conan

Thank you Ajeetha , but what about this:

type UM is array(0 to 5, 0 to 4) of unsigned(0 to 7);

signal W : UM;

how can I initialize the W signal with 0 ? ca I use

Signal W : UM := (others => 0);

Thanks
 
A

a_Conan

Thank you I found it as :

signal cy : MN := ( others =>( others => "00000000" ));

Thanks again
 
R

Rob Dekker

Or, range independent :

signal cy : MN := ( others =>( others => (others => '0' ));
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top