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.

VHDL data types question

Status
Not open for further replies.

alexz

Full Member level 5
Joined
Nov 19, 2004
Messages
283
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Location
UK
Activity points
2,246
How can I initialize constants by incrementing method?

Similar to something like this:

constant a : std_logic_vector(22 downto 0) := (others=>'0');
constant b : std_logic_vector(22 downto 0) := a+1;
constant c : std_logic_vector(22 downto 0) := a+2;
constant d : std_logic_vector(22 downto 0) := a+3;
 

Code:
constant a : std_logic_vector(22 downto 0) := (others=>'0'); 
constant b : std_logic_vector(22 downto 0) := a+1; 
constant c : std_logic_vector(22 downto 0) := a+2; 
constant d : std_logic_vector(22 downto 0) := a+3;

Works!! whats problem with this??
 

also you can use arrays
 

you should add "signed" or "unsigned" ieee libraray to your vhdl files; ie:

USE IEEE.std_logic_signed.all;
or
USE IEEE.std_logic_unsigned.all;

depending to your need and definition of function "add" in your project.
 

Your syntax works fine .........
 

What synthetiser are U using?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top