negative values

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

negative values

yoniman
Hey,
I didn't find where to use the 2's complement that we learned in this chapter.

I saw that in the ALU documentation is written about x+y - "integer 2's complement addition".
What is the meaning of that? is the Add16 required?

thanks, Yoni.
Reply | Threaded
Open this post in threaded view
|

Re: negative values

cadet1620
Administrator
Yes, the ALU uses Add16. (Add16 works for unsigned and 2's complement numbers.)

You also need to know about 2's complement representation of numbers to implement the 'ng' status output.

--Mark