Jump to content

Home

Can Anyone Add Binary? ;_;


guildenstern

Recommended Posts

Posted

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?? ;_;

Posted

I'll help. Now, are these just unsigned binary numbers, or are they in some signed form, like 1's complement or 2's complement? And does it matter how you get the answer, just so long as you get it right, or do you have to show work?

Posted

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)

Posted
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!

Posted
Originally posted by Nitro

I think the question we really need to be asking ourselves, is why the heck is --g learning binary?

 

Ever seen Reboot: Daemon Rising? Remember the Binary Suicide CodeTM?

 

. . . oh-one-one-one-oh-oh-one-one-oh-one-oh-oh-one-one-one. --Oh!

*head explodes*

Posted
Originally posted by Nitro

I think the question we really need to be asking ourselves, is why the heck is --g learning binary?

... ¬_¬

And why shouldn't I be?

 

To Beastie: daemon4_av2.JPG

 

Oh yeah! And thanks for all the answers! n_n

Posted

K, I'm just gonna do some silmpe ones to make sure I understand; can someone tell me if these are right? O_o

 

1000                  1111
+1111                +1111
______               ______
10111                11110

 

:? Oui?

Posted

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.

Posted

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.

Posted

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?

Posted

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

Posted

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.

Posted

No, I imagine not. But it has everything to do with computer engineering. I am actually more comfortable with hex and binary than decimal now! Sometimes when I'm in some math class or something now, and 1 + 1 comes up in an equation, I replace it by 10. And get the problem wrong, obviously :mad:

Posted

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).

Archived

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

×
×
  • Create New...