1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Subtraction using 8-bit binary 1's complement

  1. Apr 12, 2015 #1
    1. The problem statement, all variables and given/known data
    Perform the indicated subtraction using 8-bit binary in 1's complement:

    (22-59)10

    (-11-64)10

    2. Relevant equations
    i. Convert the numbers from decimal to binary
    ii. Take the ones complement of binary representation of any negative numbers
    iii. Add the two numbers together add 1 if there is a carryout. Leave as is if no carry out.
    3. The attempt at a solution
    (+22)10 →→ (0001 0110)2 →→ (0001 0110)2
    +(-59)10 → +1'sC(0011 1011)2 → +(1100 0100)2
    Answer: (1101 1010)2

    (-11) →→1'sC(0000 1011)→1111 0100
    +(-64) →+1'sC(0100 0000) →+1011 1111
    Answer: 1011 0100

    Is this correct? Thanks. I just get the positive value by taking the 1's Comp of my answer right? I kind of figured it out as I wrote this. But if someone can confirm that would be nice thanks.
     
    Last edited: Apr 12, 2015
  2. jcsd
  3. Apr 12, 2015 #2

    phinds

    User Avatar
    Gold Member
    2016 Award

    I only checked the first one and it looks fine.
     
  4. Apr 12, 2015 #3
    Thanks
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Subtraction using 8-bit binary 1's complement
Loading...