Do a subtraction with a 4-bit ALU with negative inputs at the edges of the rendering range

0

Having as inputs an ALU -6 (1010) and -8 (1000), both encoded using the Complement to 2, if I want to do the subtraction 1010 - 1000 we usually use the "trick" of doing the Complement to 2 of the second operand so that the expression a - (-b) remains as a + b, but when it comes to representing 8 in Complement a 2 we would need an extra bit, then how would we do this operation by hand knowing that the ALU does it without problems ? We would base on the fact that for positive numbers the representation in Complement a 2 as well as in natural binary is the same?

Pd: Starting from the base that 8 in Complement a 2 is 01000 whereas in natural binary it is 1000 that at the end of the day they are the same number since to the representation in natural binary of 8 we can add as many 0 as we want to the left of the most significant bit.

    
asked by Angelixus 22.02.2018 в 22:51
source

0 answers