8051 alu

Thread Starter

Dritech

Joined Sep 21, 2011
901
Hi all,

Does anyone know what operations are found in the ALU of the atlem8051? and how can these operations be used to do an uusigned multiplication?

Thanks in advance.
 

Thread Starter

Dritech

Joined Sep 21, 2011
901
Thanks for the replies.

Another question: In the ALU, why is two's complement better to represent signed numbers?
 

thatoneguy

Joined Feb 19, 2009
6,359
Thanks for the replies.

Another question: In the ALU, why is two's complement better to represent signed numbers?
2's compliment makes an 8 bit unsigned number (0-255 range) into a 7 bit signed number (-127 to 127 range). The sign bit states if the number is positive or negative.

With 2's compliment, all math is performed the exact same way as it would be using unsigned numbers, no special hardware for subtraction, for example. Simply add the 2's compliment of the number to be subtracted.
 

MrChips

Joined Oct 2, 2009
30,824
No one system is better than another. They might serve different purposes.
The neat thing about two's complement is when you add 1 to -1 the answer is 0.

Wow!
 
Top