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.

component in process

Status
Not open for further replies.

h.m

Junior Member level 2
Joined
Jul 26, 2013
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
shiraz_iran
Activity points
151
if we can't use component statements in process,so we can't have them(component statements) in a for loop,am i right?
if yes,what should i do?i have some component statements that must be repeated many times :?: :!:
 

if we can't use component statements in process,so we can't have them(component statements) in a for loop,am i right?
if yes,what should i do?i have some component statements that must be repeated many times :?: :!:

you will need to use them in a "generate" clause

something like :

xi :for i in x'range generate

x : entity work. foo (x => y);

end generate xi;
 
  • Like
Reactions: h.m

    h.m

    Points: 2
    Helpful Answer Positive Rating
sorry,my question was not complete,i want to have component statements and some other things with each other in a loop but it can't be possible, generate is just for components... :(
k(4)<=k(4+6*j);
k(5)<=k(5+6*j);
k(6)<=k(6+6*j);
--component statements
fa1:multiply port map (x(1),k(1),f(1));
fa2:faadd port map (x(2),k(2),f(2));
fa3: faadd port map (x(3),k(3),f(3));
fa4:multiply port map (x(4),k(4),f(4));
f(5)<=f(1) xor f(3);
i want to have these lines in a loop
tnx alot fo your help
 

sorry,my question was not complete,i want to have component statements and some other things with each other in a loop but it can't be possible, generate is just for components... :(
k(4)<=k(4+6*j);
k(5)<=k(5+6*j);
k(6)<=k(6+6*j);
--component statements
fa1:multiply port map (x(1),k(1),f(1));
fa2:faadd port map (x(2),k(2),f(2));
fa3: faadd port map (x(3),k(3),f(3));
fa4:multiply port map (x(4),k(4),f(4));
f(5)<=f(1) xor f(3);
i want to have these lines in a loop
tnx alot fo your help

no problem to assign segnals with generate.
however, it is not clear what you want to achieve in puting those assigment in a loop.
 

thank u thank u,my mistake was another thing,in a for loop,it wasn't error to write 0 downto 6 or to 6; but in a generate one,we should write( 0 downto 7 ) or (7 to 0),and other cases are wrong!am i right?
it is my first project,tnx alot

- - - Updated - - -

if u can have a value as a signal and also variable,which of them should be chosen? ofcourse signal will cause more warnings!
 

thank u thank u,my mistake was another thing,in a for loop,it wasn't error to write 0 downto 6 or to 6; but in a generate one,we should write( 0 downto 7 ) or (7 to 0),and other cases are wrong!am i right?
it is my first project,tnx alot

- - - Updated - - -

if u can have a value as a signal and also variable,which of them should be chosen? ofcourse signal will cause more warnings!

you should write 7 downto 0 -- 7 is greater then 0 or
0 to 7 -- again 7 is greater then 0
 

0 downto 7 produces a null range, as does 7 to 0.
You should always pick signals until you learn how VHDL works. Variables can be confusing when you dont understand them, and what logic they will produces. So the easy advice is always stick with signals.
 

i should do this project to pass this course,and i should program it on a real fpga,so if it's possible to u,please tell me more about signals and variables.
 
Last edited:

The most important things to remember about variables are:

They can only appear inside of a process
The assignment operator is := , not <=
The value gets updated immediatly upon a new assignment whereas a signal only gets updated when the process suspends.

The big difference is that last one. If you don't understand the differences in how variables and signals change you are looking at potential errors in your design. As Tricky said, avoid variables unless you really understand them and have a need for them. In most cases you probably do not have a need.
 

tnx for you,re complete answer:i knew them,and i,m in a situation that both of them will work correctly,and signal one has more warning so which of them is better?again thank you:)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top