I need to do a circuit in which I subtract 2 numbers. I believe I need to use the SUM and a sign bit, and some masks, but I cannot figure out how to put it together.
[LATER EDIT]
i tried to do "15-3".
15 in binary is 1111 3 in binary is 0011
I have added a bit for the sign 0 for + and 1 for -
So now i have: 0 1111 + 1 0011 = 100010 and to this I make a XOR with the sign mask 1 0000. This is where I get stuck.
[Even later edit]
I think I found another way to look at the problem. I'll be using 2 shift registers to load the 2 numbers. The output of each shift register will be the input of a NOR gate performing a NOR with 0. (This is to transform 0101 into 1010) Then the 2 outputs of these gates will be connected to the input of the SUM. My question is how can I transform back from 1 bit to a 8 bit data before entering the SUM ?