Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2006-11-21 02:47:25

user1234
Member
Registered: 2006-11-21
Posts: 8

this is mysterious! binary subtraction

hi. i have a problem with binary subtarction. i am trying to subtract 11010110 - 01000111 showing the difference and borrow as well but i get the wrong answer. can u help me?

                     1101 0110
                   -
                     0100 0111
-----------------------------------
Difference:        10010001
Borrow:         00000001(0)
-------------------------------------
Answer:           010010111

i get this as the answer but its not correct, because if you check this in Calculator (View > Scientific) you get the answer 10001111.
I cant see where i am going wrong. all help is greately appreciated!

Offline

#2 2006-11-21 03:12:23

pi man
Member
Registered: 2006-07-06
Posts: 251

Re: this is mysterious! binary subtraction

1101 0110
         - 0100 0111
          ========
           1000 1111

You need to borrow for the first 5 (rightmost) columns.   Hopefully you can understand my notations.


             1                 
1101 0100              You must borrow for the first subtraction which makes the 1 in the 2's
0100 0111              column a 0
=======
              1


            1
1101 0000             You must borrow for the second subtraction also, making the 1 in the 4's
0100 0111             column a 0
=======
            11

          1
1100 1000             You must borrow again, this time from the 16's column.
0100 0111
=======
          111


1100 1000             Now it's easy with no more borrowing.
0100 0111
=======
1000 1111

Offline

#3 2006-11-21 03:46:51

Devantè
Real Member
Registered: 2006-07-14
Posts: 6,400

Re: this is mysterious! binary subtraction

I got 1000 1111, too, so this problem has been solved.

Offline

#4 2006-11-21 05:15:15

user1234
Member
Registered: 2006-11-21
Posts: 8

Re: this is mysterious! binary subtraction

thanks alot. that definately explained my problem! smile

Offline

#5 2006-11-21 06:15:32

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

Re: this is mysterious! binary subtraction

Adding the inverse is typically much easier than subtraction.  However, if you've never heard of 2's complement, then you might as well stick to subtraction.


"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

Board footer

Powered by FluxBB