I'm using pcspim. I have two N bits length binary numbers.(2's complements) say one of them is in $8(register 8) another one of them is in $9 (register 9) This numbers are "2's complements" of corresponding given numbers. (one 2's complement is in register 8, another 2's complement is in register 9)
I want to do the following: add these 2 numbers setup any register (say $10) to all 0s if there is no overflow with the positive numbers adding and setup all ones if there is overflow. setup any register (say $11) to all 0s if there is no overflow with the negative numbers adding and setup all ones if there is overflow.
(In one case i have 2's complements of 2 positive numbers(in $8 and $9), in 2-n case i have 2's complements of 2 negative numbers(in $8 and $9))
How can i do this? (without using if)
For the case when these numbers are not two's complements, i just could shift the addition result for corresponding number of bits, to detect overflow.
I don't imagine what to do in this case.