shall I reuse a variable/signal or not?

W

walala

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)(count2)+49*ZZ(6)(count2);

t2:=126*ZZ(1)(count2)+106*ZZ(3)(count2)+71*ZZ(5)(count2)+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);
 
J

Jon

Hi Walala,
There really is no hardware impact of reusing the variables but for
clarity and ease of debug keep them seperate.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top