[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [oc] Adder issues ?



Aloha!

NansonHuang@ITRI.ORG.TW wrote:
>   I had a question about the adder implementation in RTL. Provided that we
> use 2's
> complement system as the number representation, 2 variable adder is
> normally written
> as c=a+b which c is 12 bits, a and b are 11 bits. We denote the area
> occupation of the  2 variable adder is X gates. Now if we would like to
> implement the function such as c=a+ 11'h001(a constant) or the negation of
> a, -a(i.e ~a+1'b1), do we code that as the above coding style c=a+11'h001
> in the RTL ? Will the synthesizer optimize it instead of area occupation X
> (it should be smaller that that)? I think synthesizer like Dc will do that
> job. Do you prefer any implementation methodology to achieve that instead
> of synthesizer in RTL ?

If you have corrently defined your operands (A and B) as being two's 
complement, your synthesis tool should be able to automatically instantiate a 
correct and optimized adder for the negated case.

For the constant addition case (a fixed combinational counter) the synthesis 
tool should have no problems whatsoever optimizing the adder structure to 
minimal combinational area/complexity. This is what the optimizer is really 
good at!

Unless, of course you want to do the logical reduction for the constant adder 
yourself. A simlpe increment by one-counter can be implemented in many ways, 
and and adder is not neccesarily the optimal solution. With a good "hand job" 
you should be able to meet and exceed the results from the synthesis tool.

-- 
Med vänlig hälsning, Yours

Joachim Strömbergson - Alltid i harmonisk svängning.
VP, Research & Development
----------------------------------------------------------------------
InformAsic AB / Hugo Grauers gata 5B / SE-411 33 GÖTEBORG / Sweden
Tel: +46 31 68 54 90  Fax: +46 31 68 54 91  Mobile: +46 733 75 97 02
E-mail: joachim.strombergson@informasic.com  Home: www.informasic.com
----------------------------------------------------------------------


--
To unsubscribe from cores mailing list please visit http://www.opencores.org/mailinglists.shtml