Jump to content

Home

Can Anyone Add Binary? ;_;


guildenstern

Recommended Posts

Does anyone know binary arithmatic? n_n If you do, you would be an amazing help! I've got this final exam in my computers class, see, and I have to know how to add *big* binary numbers - heck, I can't even count to 2. ¬_¬

 

I need to add these numbers: 01010101 + 00010111 + 000111011=?

 

Who wants to be a hero?? ;_;

Link to comment
Share on other sites

binary addition is easy this is how to do it

 

 

01010101

00010111 +

_________

01101100

_________

1 111

 

ok heres how it works

 

 

one 1 just right the 1 in the answer

two 1's carry the 1 but put a 0 in the answer

three 1's carry the 1 and put a 1 in the answer

 

now just let me check that on a calculator... yep im right. (use bin mode in windows calculator)

Link to comment
Share on other sites

Originally posted by Jabba The Hunt

binary addition is easy this is how to do it

 

 

01010101

00010111 +

_________

01101100

_________

1 111

 

ok heres how it works

 

 

one 1 just right the 1 in the answer

two 1's carry the 1 but put a 0 in the answer

three 1's carry the 1 and put a 1 in the answer

 

now just let me check that on a calculator... yep im right. (use bin mode in windows calculator)

 

WRONG!

 

Now go sit in the corner! And put the dunce cap on!

Link to comment
Share on other sites

Oh my goodness, kill me.

I just realised I posted the wrong number to be added. -_- I put an extra 0 at the start of the 3rd number.

Does that make a difference?

It should be this:

01010101
+00010111
+00111011   *NOT* 000111011 -_- Let's see if I can do it.
__________
    0111  

- uh... what do you do when you have to add 4 zeros? O_o Cuz that would = 100, ne? But you can't carry 2 numbers... oh, poop.

Link to comment
Share on other sites

You are correct on those two. And leading zeros make no difference.

 

Now, if it doesn't matter how you get the answers, why not just convert them to decimal, add, and then convert back, if you find it difficult to add in binary?

 

But, here we go:

 

01010101

00010111

00111011

________

________

 

OK, add 1, 1, and 1. You get 11. Put down 1 and carry the 1:

 

______1

01010101

00010111

00111011

________

_______1

 

Now add 1, 0, 1, and 1. You get 11. Put down 1 and carry the 1:

 

_____11

01010101

00010111

00111011

________

______11

 

Same deal again:

 

____111

01010101

00010111

00111011

________

_____111

 

Now add 1 and 1 and get 10. Put down 0 and carry the 1:

 

___1111

01010101

00010111

00111011

________

____0111

 

Now add those four 1s. What do you get? 100. So, put down the zero, and carry the 1 and 0 in their respective columns:

 

_101111

01010101

00010111

00111011

________

___00111

 

The next step is obvious:

 

_101111

01010101

00010111

00111011

________

__100111

 

As is the next:

 

1101111

01010101

00010111

00111011

________

_0100111

 

And the final step:

 

1101111

01010101

00010111

00111011

________

10100111

 

So, if you have a multiple digit carry, carry them into two different columns. If you have another carry that needs to be added to one of those, just add them. Just like in decimal addition.

Link to comment
Share on other sites

Turn each hex digit into four binary digits and go to town :)

 

Seriously - what's with the questions about adding numbers in different bases? Addition is addition. Adding in binary is exactly the same as adding in decimal. Why should the meaning or procedure of addition change depending on what base you express the numbers in?

Link to comment
Share on other sites

Why? It's still multiplication. It's exactly the same.

 

As for the hex thing, that's just a shortcut - you can do it the normal way.

 

Didn't you ever wonder why computers are so confortable with hex? Because it's just binary, basically. Same with any base that's a power of two. An octal (base eight) digit can be viewed as three binary digits, for example.

 

A hex example:

 

In hex: 45D6

In binary: 0100010111010110

 

See, just break up the binary into chunks of four to see each group of four can be viewed as a hex digit:

 

0100 = 4

0101 = 5

1101 = D

0110 = 6

Link to comment
Share on other sites

Thanks! I confess I had to do a small search to find why 1101 = D, but it's actually pretty logical for a base 16. :doh::rolleyes:

 

Never thought much about mathematics with other bases than a decimal base, or why computers like hex. It was never a subject in one of my math classes. I think it's a bit of a shame, even though it has little to do with aerospace engineering.

Link to comment
Share on other sites

Commander 598 I know im right, I think your interpreting the binary number differently to me.

 

Hex is also easy as its just base 16, times each digit by 16 and then add that on remeber than if its greater than 9 to add it in the other column.

 

Then simply do the dec maths and if convert it back (doing the opposite of before).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...