Section 6.4: Converting 2's complement numbers (Frame 2)                     [prev][home][next]

To illustrate, let's work through converting -19 to 2's complement, using a fixed size of 8 bits.

Step 1:
    Get the value in binary.                19 is 10011.

Step 2:
    Pad out to 8 bits.                      00010011

Step 3:
    Flip all the bits.                      11101100

Step 4:
    Add 1.                                  11101100
                                                  +1
                                            --------
    This is it!                             11101101