Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > shall I reuse a variable/signal or not?

Reply
Thread Tools

shall I reuse a variable/signal or not?

 
 
walala
Guest
Posts: n/a
 
      09-12-2003
Dear all,

Here is a fragment of my code... t1, t2, t3, t4, temp1, temp2, temp3,
temp4 are my temporary variables... Y0, Y7, Y1, Y6 are the actual
result I want to output...

I want to know if I can re-use t1, t2 and temp1 and temp2, that's to
say, don't use t3, t4, temp3 and temp4? What will be the impact of
that change to my circuit?

Less storage memory? Less adders?

Can anybody tell me?

Thanks a lot,

-Walala
----------------------------------------------------------------------------


t1:=91*ZZ(0)(count2)+118*ZZ(2)(count2)+91*ZZ(4)(co unt2)+49*ZZ(6)(count2);

t2:=126*ZZ(1)(count2)+106*ZZ(3)(count2)+71*ZZ(5)(c ount2)+25*ZZ(7)(count2);
temp1:=t1+t2;
temp2:=t1-t2;
Y0<=temp1(23 downto 16);
Y7<=temp2(23 downto 16);


t3:=91*ZZ(0)(count2)+49*ZZ(2)(count2)-91*ZZ(4)(count2)-118*ZZ(6)(count2);

t4:=106*ZZ(1)(count2)-25*ZZ(3)(count2)-126*ZZ(5)(count2)-71*ZZ(7)(count2);
temp3:=t3+t4;
temp4:=t3-t4;
Y1<=temp1(23 downto 16);
Y6<=temp2(23 downto 16);
 
Reply With Quote
 
 
 
 
Jon
Guest
Posts: n/a
 
      09-14-2003
Hi Walala,
There really is no hardware impact of reusing the variables but for
clarity and ease of debug keep them seperate.

Jon

http://www.velocityreviews.com/forums/(E-Mail Removed) (walala) wrote in message news:<(E-Mail Removed). com>...
> Dear all,
>
> Here is a fragment of my code... t1, t2, t3, t4, temp1, temp2, temp3,
> temp4 are my temporary variables... Y0, Y7, Y1, Y6 are the actual
> result I want to output...
>
> I want to know if I can re-use t1, t2 and temp1 and temp2, that's to
> say, don't use t3, t4, temp3 and temp4? What will be the impact of
> that change to my circuit?
>
> Less storage memory? Less adders?
>
> Can anybody tell me?
>
> Thanks a lot,
>
> -Walala
> ----------------------------------------------------------------------------
>
>
> t1:=91*ZZ(0)(count2)+118*ZZ(2)(count2)+91*ZZ(4)(co unt2)+49*ZZ(6)(count2);
>
> t2:=126*ZZ(1)(count2)+106*ZZ(3)(count2)+71*ZZ(5)(c ount2)+25*ZZ(7)(count2);
> temp1:=t1+t2;
> temp2:=t1-t2;
> Y0<=temp1(23 downto 16);
> Y7<=temp2(23 downto 16);
>
>
> t3:=91*ZZ(0)(count2)+49*ZZ(2)(count2)-91*ZZ(4)(count2)-118*ZZ(6)(count2);
>
> t4:=106*ZZ(1)(count2)-25*ZZ(3)(count2)-126*ZZ(5)(count2)-71*ZZ(7)(count2);
> temp3:=t3+t4;
> temp4:=t3-t4;
> Y1<=temp1(23 downto 16);
> Y6<=temp2(23 downto 16);

 
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
To reuse or not to reuse jacob navia C Programming 19 12-18-2006 07:22 AM
code reuse and design reuse sailor.gu@gmail.com C Programming 16 02-12-2006 09:09 PM
Reuse paramter list and reuse connection tshad ASP .Net 5 05-17-2005 12:33 AM
DataGrid: Carriage Return in HtmlInputText shall save row Wolfgang Schmidt ASP .Net 2 03-02-2004 12:54 PM
To reuse or not to reuse.... Hylander Java 0 02-26-2004 12:00 AM



Advertisments