-1

I'm currently doing twos complement in my course, using 8 bits I'm trying to complete this operation, its -85 + -44. I missed a lecture so I have tried to catch up on my own and this is what I have come up with, tell me if I'm right or wrong.

  -85    
      85 =  01010101
            10101010
          +        1      
           ---------  
       -85= 10101011

So that's the first one.

 -44    
    44 = 00101100
         11010011
        +       1
        ---------    
     -44= 11010100

Then Adding them together.

 -85  10101011
 -44  11010100
    + --------
     101111111

So is that the answer? Do I remove the carry bit or keep it because it's 8bit?

Rapidz
  • 19
  • 5
  • Double check your twos complement calculation for -85. I see an arithemetic error. – jwygralak67 Oct 16 '13 at 18:59
  • Thanks, I made a mistake when I did it in my browser, however I had already copied the correct one in the last part of the sum from my document. However is it correct? – Rapidz Oct 17 '13 at 17:56

2 Answers2

1

If you're restricted to 8 bits, then yes, you discard the carry bit.

If this were being done in a an 8-bit register in a processor, the carry bit would cause a carry flag to be set in a status register. The state of the Carry flag lets you know that the 8 bit result held in the register isn't the whole answer.

jwygralak67
  • 924
  • 7
  • 13
0

Since nobody answered about the answer I went ahead and submitted it for my assignment and bit the bullet, got full marks. Looks like researching twos complement for 4 hours on multiple sites adds up.

Rapidz
  • 19
  • 5