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.

how to initialize a 1D*1D VECTOR?

Status
Not open for further replies.

fahim1

Member level 4
Joined
Jun 4, 2015
Messages
75
Helped
2
Reputation
4
Reaction score
2
Trophy points
8
Activity points
517
hi
how can i initialize a 1d 1d vector that the length and columns of vector are generic?
like this :

Code:
generic  (n :integer :=4;   --number of coefficients 
          m :integer :=4);   --number of bits represent coefficients
.
.
.
.
type registers is array (n-2 downto 0) of std_logic_vector(m-1 downto 0);
.
.
.
signal reg : registers;     ????(how to initialize all the values zero)
 
Last edited by a moderator:

Code:
signal reg : registers := (others => (others => '0'));
 
  • Like
Reactions: fahim1

    fahim1

    Points: 2
    Helpful Answer Positive Rating
hi
how can i initialize a 1d 1d vector that the length and columns of vector are generic?
like this :

Code:
generic  (n :integer :=4;   --number of coefficients 
          m :integer :=4);   --number of bits represent coefficients
.
.
.
.
type registers is array (n-2 downto 0) of std_logic_vector(m-1 downto 0);
.
.
.
signal reg : registers;     ????(how to initialize all the values zero)

you can also have a 2D matrix in a similar way by checking on the link.

https://vhdlguru.blogspot.de/2010/02/arrays-and-records-in-vhdl.html
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top