Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Coding timinig relationship

Reply
Thread Tools

Coding timinig relationship

 
 
vb_thecapt vb_thecapt is offline
Junior Member
Join Date: Mar 2012
Posts: 3
 
      05-07-2012
Hi everybody! I have a question about coding&timing/delay relationship.
Considering a code like this
Quote:
for index 0 to MAX_N loop
varMatrix:= CONV_INTEGER(matrix(index));
diff := a-varMatrix;
if(diff < VAL) then
c:= coeff(diff);
else
c := 1;
end if;
prod := ker(index)*c;
...
end loop;
where i create a variable for every accessed array element , and considering this code
Quote:
for index 0 to MAX_N loop
if( abs(a-CONV_INTEGER(matrix(index))) < VAL) then
prod := ker(index)*coeff( a-CONV_INTEGER(matrix(index)) );
else
prod := ker(index);
end if;
...
end loop;
where i use every time that i need the "whole" indexed-array element.
If these two codes have different hardware mapping, which of these two codes are faster?
Code 1 implies a register (thus a delay) for every created variable?
Code 2 implies only that a "wire" is taken from a source?
Sorry if it sounds a bit messy
 
Reply With Quote
 
 
 
 
joris joris is offline
Senior Member
Join Date: Jan 2009
Posts: 152
 
      05-07-2012
Intermediate variables don't imply registers, so both codes should be exactly equivalent.

Variables only imply registers when their values are being read while they haven't previously been set in the same clock tick.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
general coding issues - coding style... calmar Python 11 02-21-2006 10:36 AM
SQL Server 2000 question: What's the relationship between users and logins Leonard Martin MCSD 0 12-05-2005 09:15 PM
DataGridTableStyle and relationship dbuchanan ASP .Net 1 11-29-2005 06:39 PM
Bind optional one-to-one relationship to textbox Dan Davenport via .NET 247 ASP .Net 0 08-04-2004 01:55 PM
Relationship between Mozilla, Firefox and Thunderbird Lionel B. Dyck Firefox 6 07-19-2004 09:14 AM



Advertisments