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.

Error as: "Wrong index type for x","Wrong index type for temp".

Status
Not open for further replies.

ashwini012

Newbie level 3
Joined
Mar 27, 2015
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
38
hello,

I want to write the equation ,

Code:
x(i)=a*temp(i)
for i ranges from 0 to 5

I tried to write in vhdl but i got the error:[B] "Wrong index type for x","Wrong index type for temp".

PROCESS(CLK)
VARIABLE i : INTEGER RANGE 0 TO 5;
BEGIN

x(i) <= a * temp(i);

END PROCESS;

Is this write way to writw equation?
Help me....

Thank you!
 
Last edited by a moderator:

ads-ee

Super Moderator
Staff member
Joined
Sep 10, 2013
Messages
7,805
Helped
1,809
Reputation
3,628
Reaction score
1,768
Trophy points
1,393
Location
USA
Activity points
58,916
Re: Error as: "Wrong index type for x","Wrong index type for temp".

Are you trying to implement the parallel code:

Code:
x(0) = a * temp(0);
x(1) = a * temp(1);
...
x(5) = a * temp(5);

or are your trying to iterate over a sequence of i = 0, i = 1, ... , i = 4, i = 5?

If you are trying to iterate then you must use a counter not any kind of looping structure (e.g. for). And you likely don't need to index, just run a pipeline.

You also don't tell us how x is defined, but it should be an array of some type, given the multiplication either a signed or unsigned array. Both a and temp should also be defined as signed or unsigned arrays.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top