FacebookTwitter
Hatrack River Forum   
my profile login | search | faq | forum home

  next oldest topic   next newest topic
» Hatrack River Forum » Active Forums » Books, Films, Food and Culture » Cousin Hobbes’s Explanation of Binary (Page 1)

  This topic comprises 2 pages: 1  2   
Author Topic: Cousin Hobbes’s Explanation of Binary
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
I’m doing this because at one point I plan on doing a Cousin Hobbes explains how computers work series, and you have to at least be familiar with these concepts to understand how computers work. So when ever I do write that topic, I can just link back here to explain it. [Smile]

We all know (or hopefully know [Wink] ) base 10 numbers. 0-9 makes up all of the digits we have, when we want to write bigger numbers than 9, we just put a 1 in the “tens” column and start over with 0 in the “ones column”. And of course once we reach 19 and want to go up, we put a 2 in the tens column and start over at 0. I think we also all understand this concept, certainly we all use it. But sometimes it’s difficult to understand the meaning of the tens column when it is no longer the tens column (as in binary).

So let’s look at what the “tens column” really means. It’s pretty simple, it means you multiply whatever digit is in that column by ten to get the number it represents. 10*1 = 10. 10*2 = 20. So whatever number is in that column really just means multiply it by ten. The “ones column” means multiply by one. Hundreds column multiply by 100 and so on. Pretty simple, right?

But this is just for base 10, if we want to work in, say, base 5 then you don’t have a tens column. So we have to figure out why there’s a tens column and hundreds column and so forth in base 10. Which is, again, pretty simple; we can rename the columns so that they are the same for any base. Let’s just call them column zero, column one, column two, column 3, and so forth all the way out to infinity. So then 548 has an 8 in column zero, a 4 in column one, and a 5 in column 2. To figure our what this number is in base 10 we multiply 5 by 100, 4 by 10, and 8 by 1. But if we don’t know what base it is in, we can just check column numbers.

Let’s say it’s in base b; then to find out what 548 represents we multiply 5 by b to the 2nd (because it’s in column 2), 4 by b to the 1st (column 1) and 8 by b to the 0th (column 0). This simple formula will tell you what any number is in given base b.

As an example, we can figure out 3412 in base 5. 3*5^3 + 4*5^2 + 1*5^1 + 2*5^0. 5^3 is 125, 5^2 is 25, 5^1 is 5, and any number ^0 is 1 so it’s 3*125 + 4*25 + 1*5 + 2*1. Which (only one more step left) is 375 + 100 + 5 + 2(all now in base 10). So 3412 (in base 5) is 482 in base 10.

This is how bases work in general, so figuring out binary (base 2) should be pretty simple. To do so, lets look at converting a base 10 number into binary. Say, 189 into binary. Well, what are the various columns of binary? 2^0 is 1, 2^1 is 2, 2^2 4, and so on. 2^7 is 128, 2^8 256, which is larger than our number so let’s stop there.

Binary makes for simpler conversions because either you put a ‘1’ in a specific column or a zero, no need to figure out how many 128s you need to obtain this number, all you need to know is that you have to have one. So lets put a 128 in our number. 1000000 has a ‘1’ in the 128th column and ‘0’s in the rest, so of course it represents the base 10 number 128. This is the first step in converting 189, we have 128 already so let’s subtract that from 189 to get 61.

Now we go to the next largest column after 128. 2^6 is 64, so let’s see if we need a ‘1’ there. What we have left from 189 is just 61 since we’ve already taken care of 128. 61 is smaller than 64, so we’ll leave the zero in that column and we still have 10000000. Now go down to the next column, 2^5 which is 32. 61 is larger than 32 so put a ‘1’ in that column and subtract 32 from 61 since it has been taken care of. So now we have our number as being 10100000 with 29 left to take care of.

Next column is 2^4 or 16. Once again, 29 is larger than 16, so a ‘1’ in that column. 10110000 with 13 left to deal with. Next column 2^3 or 8. 13 is larger than 8 so 10111000 with 5 to deal with. 2^2 is 4, which 5 is larger than so we now have 10111100 and 1 to deal with. 2^1 is 2, which 1 is smaller than so we’ll put a ‘0’ in that column. Finally we have 10111100 with 1 to deal with. 2^0 is 1, which is what we have left, so we’ll put a 1 in the 1s column and we have 10111101 and none of the number left, meaning that we have reached our final answer.

This is binary, just another way of counting, one that only uses two digits to do so (or 10 digits in binary [Wink] ). Hopefully now you understand it and how bases in general work (the alphabet for instance, is just base 26 with different representations for the digits). If not we’ll just chalk it up to be further proof of my inability to communicate. [Smile]

[EDIT: just so you know, before I do launch into computers I'm going to explain boolean algebra too, since that's even more basic for computers but it seemed like too much for one post]

Hobbes [Smile]

[ November 20, 2003, 01:59 PM: Message edited by: Hobbes ]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
slacker
Member
Member # 2559

 - posted      Profile for slacker   Email slacker         Edit/Delete Post 
Times like that make me glad that I was just given a sheet that you could plug the numbers into to teach you how to read/write in binary.

I almost fell asleep from your explanation. [Razz]

Posts: 851 | Registered: Oct 2001  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
Sorry. [Embarrassed] Perhpas more people would like me if I just wrote a little console application to do it for them instead of trying to explain it. [Wink]

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Farmgirl
Member
Member # 5567

 - posted      Profile for Farmgirl   Email Farmgirl         Edit/Delete Post 
I liked your explanation. I just wish you had put a little more white space (paragraph breaks) in that next to the last big section -- it got kind of hard to track line to line...... made it hard to follow

Farmgirl
(I know, I know -- old geezer with glasses)

Posts: 9538 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
beatnix19
Member
Member # 5836

 - posted      Profile for beatnix19   Email beatnix19         Edit/Delete Post 
um... the big button turns the computer on. [Confused]
Posts: 1294 | Registered: Oct 2003  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
Sorry Farmgirl, I typed it in Word and forgot to double space those last few paragraphs.

Beatnix, that's right, it then has value '1'. [Razz] [Wink]

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
You know, there are 10 kinds of people...
Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
beatnix19
Member
Member # 5836

 - posted      Profile for beatnix19   Email beatnix19         Edit/Delete Post 
Hobbes - I'm glad people like you exsist so people like me have someone to call for help.

If the cousin Hobbes computer series continues in this manner I'll be sure to stay away and avoid the headaches that will most definately follow any attempt I make at understanding. [Smile]

Posts: 1294 | Registered: Oct 2003  |  IP: Logged | Report this post to a Moderator
T_Smith
Member
Member # 3734

 - posted      Profile for T_Smith   Email T_Smith         Edit/Delete Post 
You complicate things.

189, eh?

189/2 = 94 R 1
94/2 = 47 R 0
47/2 = 23 R 1
23/2 = 11 R 1
11/2 = 5 R 1
5/2 = 2 R 1
2/2 = 1 R 0
1

10111101

Gee hobbes, way to complicate things.

Posts: 9754 | Registered: Jul 2002  |  IP: Logged | Report this post to a Moderator
Rappin' Ronnie Reagan
Member
Member # 5626

 - posted      Profile for Rappin' Ronnie Reagan   Email Rappin' Ronnie Reagan         Edit/Delete Post 
::sigh:: i miss math. i can't wait to take computer science I next semester! yay!
Posts: 1658 | Registered: Sep 2003  |  IP: Logged | Report this post to a Moderator
T_Smith
Member
Member # 3734

 - posted      Profile for T_Smith   Email T_Smith         Edit/Delete Post 
Whats really fun is hexidecimal. ::quivers with delight:: Letter and numbers.... gotta love it.
Posts: 9754 | Registered: Jul 2002  |  IP: Logged | Report this post to a Moderator
beatnix19
Member
Member # 5836

 - posted      Profile for beatnix19   Email beatnix19         Edit/Delete Post 
oh, no... eyes burning... ears smoking... the pain, oh the pain.

<-- *runs screaming from thread before head explodes*

Posts: 1294 | Registered: Oct 2003  |  IP: Logged | Report this post to a Moderator
Julie
Member
Member # 5580

 - posted      Profile for Julie   Email Julie         Edit/Delete Post 
I always wondered about binary. Now I don't necessarily understand it but at least I know what it means!
Posts: 981 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
Julie
Member
Member # 5580

 - posted      Profile for Julie   Email Julie         Edit/Delete Post 
quote:
189/2 = 94 R 1
94/2 = 47 R 0
47/2 = 23 R 1
23/2 = 11 R 1
11/2 = 5 R 1
5/2 = 2 R 1
2/2 = 1 R 0
1

10111101

When you do it this way are you still using the exponents as a guide? [Confused]
Posts: 981 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
He's taking advantage of a property of modulo addition.
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Eruve Nandiriel
Member
Member # 5677

 - posted      Profile for Eruve Nandiriel   Email Eruve Nandiriel         Edit/Delete Post 
I just finished my math for the year, and I'm not about to try and understand this.
*mutters* hyperbolas, parabolas, quadratic formula...uhg...

Posts: 4174 | Registered: Sep 2003  |  IP: Logged | Report this post to a Moderator
skrika03
Member
Member # 5930

 - posted      Profile for skrika03   Email skrika03         Edit/Delete Post 
(possessed by the hovering wraith of pooka)

I think what you are getting is that your explanation starts at too high of a level. I understood it, but I already understand binary. Hmmm, specifics:

"We all know base 10 numbers" A lot of folks don't realize "normal" numbers are base ten. If they don't, you've lost them right here because they now are thinking "I don't know what this guy is talking about, I'm going to give up now." A better way to put it might be "Binary, or base 2 numbering, is how people communicate with computers. We have ten fingers. Computers only have 2. So it was necessary to find a way to describe all numbers based on 10 digits (most people will not ever see this as a pun) into 2."

"Because we have 10 digits (0-9) our method of counting is called base 10."

I know this is a lot longer, but hopefully it will pay off in allowing you to delete other stuff later.

Of course, as I'm writing this I realize computers only have one finger, and it's either down or up. Which brings to mind the question why we don't communicate with our fingers in ASCII instead of using words. That way we could have invented civilization instead of the greeks or chinese, because their character sets aren't viewable in ASCII. Stupid temporal causality parameters. [Smile]

Posts: 383 | Registered: Nov 2003  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
computers have 2 fingers? cool!
Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
Julie
Member
Member # 5580

 - posted      Profile for Julie   Email Julie         Edit/Delete Post 
I didn't know my computer had any fingers at all. [Smile]
Posts: 981 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
Morbo
Member
Member # 5309

 - posted      Profile for Morbo   Email Morbo         Edit/Delete Post 
Pretty good, Hobbes. You covered it well. Base numbering systems are dull, my explanation would have been eye-glazing.

You could throw in the importance of zero as a place holder, how a lack of zero held back Greek and Roman math, and how the Muslims transmitted the zero concept from India to Europe. That would expand the subject from binary, but sometimes historical tidbits help hold the reader's attention.[edit: or other math history trivia dealing more directly with binary (uhh, can't think of any, but there must be some. . . ) I know your goal was a short, simple explanation, but to make it readable math history or anecdotes help]

*Waits breathlessly for Cousin Fugu’s Explanation of Modulo Arithmetic*

[ November 20, 2003, 04:40 PM: Message edited by: Morbo ]

Posts: 6316 | Registered: Jun 2003  |  IP: Logged | Report this post to a Moderator
Dragon
Member
Member # 3670

 - posted      Profile for Dragon   Email Dragon         Edit/Delete Post 
Okay, I'm trying to get this. Hobbes: your explanation of bases was good until you went into the actual binary part, then you lost me a bit. [Razz]

So Nathan, in:

189/2 = 94 R 1
94/2 = 47 R 0
47/2 = 23 R 1
23/2 = 11 R 1
11/2 = 5 R 1
5/2 = 2 R 1
2/2 = 1 R 0
1

What do the Rs stand for? And how do you know whether a number is a 1 or a 0? And what about decimals? Do you jsut round them? Because 11/2 isn't really 5...

[Confused] [Cry]

[ November 20, 2003, 05:01 PM: Message edited by: Dragon ]

Posts: 3420 | Registered: Jun 2002  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
I'm afraid I don't really know my math history as well as I should. [Embarrassed] You'd have to do that part for me.

Skrika, you're right, I probably should've done that, I'm afraid I'm not much of a writer, which is partly why I write these. Thanks for the suggestion. [Smile]

T, as Fugu pointed out your way, while being perfectly valid, has more to do with the modulous function than actual base conversions. It's probably faster but way explains better what the heck is going on. Or at least comes closer. [Wink] [Smile]

For those of you bored by this, boolean's cooler, I promise! [Big Grin]

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
rivka
Member
Member # 4859

 - posted      Profile for rivka   Email rivka         Edit/Delete Post 

Hooray for new math,
New-hoo-hoo-math,
It won't do you a bit of good to review math.
It's so simple,
So very simple,
That only a child can do it!


quote:
Now that actually is not the answer that I had in mind, because the book that I got this problem out of wants you to do it in base eight. But don't panic. Base eight is just like base ten really - if you're missing two fingers. Shall we have a go at it? Hang on.

You can't take three from two,
Two is less than three,
So you look at the four in the eights place.
Now that's really four eights,
So you make it three eights,
Regroup, and you change an eight to eight ones,
And you add them to the two,
and you get one-two base eight,
Which is ten base ten,
And you take away three, that's seven.

Now instead of four in the eights place
You've got three,
'Cause you added one,
That is to say, eight, to the two,
But you can't take seven from three,
So you look at the sixty-fours.

"Sixty-four? How did sixty-four get into it?" I hear you cry.
Well, sixty-four is eight squared, don't you see?
(Well, you ask a silly question, and you get a silly answer.)

From the three you then use one
To make eight ones,
And you add those ones to the three,
And you get one-three base eight,
Or, in other words,
In base ten you have eleven,
And you take away seven,
And seven from eleven is four.
Now go back to the sixty-fours,
And you're left with two,
And you take away one from two,
And that leaves...?

Gotta love Tom Lehrer!
Posts: 32919 | Registered: Mar 2003  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
Dragon, do you have any specific questions? I'd be happy to answer them. [Smile]

The 'R's stand for remainder.

189/2 = 94 R 1

Means 189 divided by the current base (base 2 for binare) equals 94 with a remainder of 1. The remainder goes into the binary number and then the process is repeated until the division is 0. Like Fugu said, it's about the mod function, not bases.

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
fugu13
Member
Member # 2859

 - posted      Profile for fugu13   Email fugu13         Edit/Delete Post 
I think you'll have to wait on cousin fugu's explanation of modulo arithmetic. Cousin fugu isn't thinking about math right now [Smile] .
Posts: 15770 | Registered: Dec 2001  |  IP: Logged | Report this post to a Moderator
Hazen
Member
Member # 161

 - posted      Profile for Hazen   Email Hazen         Edit/Delete Post 
That was very informative, Hobbes. (Did you get the "Cousin Hobbes" from "Uncle Orson," or are you from Tennessee?)

I have one question about the alternate method of switching between bases: How do you know how many places it will take up? In some cases, you will need a 0 at the end, and you will need to know the number of digits in order to know if it should be there. How can you tell how many digits it will be?

Posts: 285 | Registered: Jun 1999  |  IP: Logged | Report this post to a Moderator
Dragon
Member
Member # 3670

 - posted      Profile for Dragon   Email Dragon         Edit/Delete Post 
[Big Grin] We listened to Who's Next and Wernher von Braun in social studies the other day...

Hobbes: That helps a lot! I get it now!

*Happy dance* [Party]

Posts: 3420 | Registered: Jun 2002  |  IP: Logged | Report this post to a Moderator
imogen
Member
Member # 5485

 - posted      Profile for imogen   Email imogen         Edit/Delete Post 
I understand binary and bases. (You'd hope so, I did a physics/maths degree).

What I don't understand is:

Actually, I'll give you the background.
I saw a newspaper article about crop circles. (yes, i know... just bear with me) These people wrote, in binary, on a huge piece of plastic "What do you want with us"

The next morning, crop circles in the shapes of swallows had appeared in the next field.

My question is not concerning the swallow-crop-circles, but rather how does one "write" in binary? Would it just be numbers corresponding to each letter's position in the alphabet?

Or is there an accepted binary - alphabet translation that I don't know about?

Posts: 4393 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
Rappin' Ronnie Reagan
Member
Member # 5626

 - posted      Profile for Rappin' Ronnie Reagan   Email Rappin' Ronnie Reagan         Edit/Delete Post 
quote:
Did you get the "Cousin Hobbes" from "Uncle Orson," or are you from Tennessee?

now what does that mean? ::is from tennessee::
Posts: 1658 | Registered: Sep 2003  |  IP: Logged | Report this post to a Moderator
Dragon
Member
Member # 3670

 - posted      Profile for Dragon   Email Dragon         Edit/Delete Post 
quote:
Or is there an accepted binary - alphabet translation that I don't know about?
I don't know how it works but this does the trick.
Posts: 3420 | Registered: Jun 2002  |  IP: Logged | Report this post to a Moderator
Morbo
Member
Member # 5309

 - posted      Profile for Morbo   Email Morbo         Edit/Delete Post 
quote:
Or is there an accepted binary - alphabet translation that I don't know about?
imogen.
ASCII is a default binary-English alphabet mapping that almost all computers and programs have, no idea if that's what the crop circle folks used. I think it evolved from early teletype code and wound up with a 128 charactor set--or ist 256? Ask any hacker.

Assuming aliens did draw giant swallows, what the hell do they mean by that?

Posts: 6316 | Registered: Jun 2003  |  IP: Logged | Report this post to a Moderator
imogen
Member
Member # 5485

 - posted      Profile for imogen   Email imogen         Edit/Delete Post 
quote:
Assuming aliens did draw giant swallows, what the hell do they mean by that?
Guess you'd have to ask the aliens
[Smile]

I have no idea. Though I was thinking more along the lines of 'assuming people drew giant swallows as a hoax, why swallows? And how they get them so big? And neat?'

Posts: 4393 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
imogen
Member
Member # 5485

 - posted      Profile for imogen   Email imogen         Edit/Delete Post 
Actually, I'm not sure what is more weird:

The idea aliens communicate by drawing giant swallows..
or
the idea a lot of people can think of nothing better to do with their time then spend all night in a freezing cold field pretending to be aliens drawing giant swallows.

Posts: 4393 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
Morbo
Member
Member # 5309

 - posted      Profile for Morbo   Email Morbo         Edit/Delete Post 
Hobbes, I don't know math history half as well as I'd like either. I picked up most from only a handful of books. I was always more interested in theory and application of math than its history.

One more tidbit: sexagesimal or base-60 notation was used by Mesopotamian civilizations, I think because 60 is "divisor rich", ie has many divisors that leave no remainder, in contrast with primes which always have only 2 divisors, the prime and 1. And for mystical/religious reasons.

This is why we are saddled with 60 seconds in an minutes, 60 minutes in an hour, and 360 degrees in a circle, 4000+ years after the Babylonians used sexagesmal bases. I also just read that Mesopotamians had a place holder that resembled zero functionally (invented around the time of Alexander the Great), giving them the most accurate fractional notation of any civilization before the European Renaissance. I would hate to work with sexagesimal fractions, though. [Angst]
Source: A History of Mathematics by Carl Boyer, revised by Uta Merzbach, a very good and comprehensive book. [edit: except he left out those pesky Mayans! Probably because they had little direct effect on European mathematical development, though the Mayans had very advanced math for any ancient civilisation.]

[ November 21, 2003, 12:46 AM: Message edited by: Morbo ]

Posts: 6316 | Registered: Jun 2003  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
The biggest question in the crop circle affair is -

Were they African swallows?

Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
Annie
Member
Member # 295

 - posted      Profile for Annie   Email Annie         Edit/Delete Post 
didn't the Maya use base 60 too?
Posts: 8504 | Registered: Aug 1999  |  IP: Logged | Report this post to a Moderator
imogen
Member
Member # 5485

 - posted      Profile for imogen   Email imogen         Edit/Delete Post 
swallows .... about 3/4 of the way down the page.
Posts: 4393 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
Morbo
Member
Member # 5309

 - posted      Profile for Morbo   Email Morbo         Edit/Delete Post 
[Laugh] African swallows, good one Annie.
Beats me, Boyer blows off the Mayans.

According to Ask Dr. Math, "Would Aliens Use Base 10?" link, Mayans used base 20.

I do know that Mayans used a more accurate solar calendar than the Gregorian calender in common usage today.

Posts: 6316 | Registered: Jun 2003  |  IP: Logged | Report this post to a Moderator
Nick
Member
Member # 4311

 - posted      Profile for Nick           Edit/Delete Post 
<===Highest math level: Algebra II

You lost with the exponents bits. I just gave up. It would take a while to figure it all out. [Smile]

I know how to do binary though.
Say x is base 2, and y is base 10 with x on the left and y on the right:

0=1
1=2
10=3
11=4
100=5
101=6
111=7
1000=8

Right?
[Confused]

I'm probably hoplessly wrong. I only took basic binary my freshman year in high school. That was about 4 years ago.

*thinks about enrolling in a computer science course next semester*
[Smile]

Posts: 4229 | Registered: Dec 2002  |  IP: Logged | Report this post to a Moderator
Nick
Member
Member # 4311

 - posted      Profile for Nick           Edit/Delete Post 
quote:
According to Ask Dr. Math, "Would Aliens Use Base 10?" link, Mayans used base 20.

I do know that Mayans used a more accurate solar calendar than the Gregorian calender in common usage today.

That's a similar situation as to why we use a base 6 system for time-telling. The sumerians had a somewhat advanced base 6 mathematical system, and that system still influences the way we tell time today. [Smile]
Posts: 4229 | Registered: Dec 2002  |  IP: Logged | Report this post to a Moderator
rivka
Member
Member # 4859

 - posted      Profile for rivka   Email rivka         Edit/Delete Post 
quote:
0=1
1=2
10=3
11=4
100=5
101=6
111=7
1000=8

Right?

Close.

1=1
10=2
11=3
100=4
101=5
110=6
111=7
1000=8

Posts: 32919 | Registered: Mar 2003  |  IP: Logged | Report this post to a Moderator
Nick
Member
Member # 4311

 - posted      Profile for Nick           Edit/Delete Post 
[Wall Bash]

It's been a while. [Dont Know]

Posts: 4229 | Registered: Dec 2002  |  IP: Logged | Report this post to a Moderator
rivka
Member
Member # 4859

 - posted      Profile for rivka   Email rivka         Edit/Delete Post 
Yeah, and you were on the right track. [Smile]
Posts: 32919 | Registered: Mar 2003  |  IP: Logged | Report this post to a Moderator
Hobbes
Member
Member # 433

 - posted      Profile for Hobbes   Email Hobbes         Edit/Delete Post 
quote:
(Did you get the "Cousin Hobbes" from "Uncle Orson," or are you from Tennessee?)
First one. [Smile]

quote:
I have one question about the alternate method of switching between bases: How do you know how many places it will take up? In some cases, you will need a 0 at the end, and you will need to know the number of digits in order to know if it should be there. How can you tell how many digits it will be?
You techincally don't, if you want to look at it in a systematic way, just start with the '1's place and keep working up until you find a column that is larger than the number (i.e. with 189 get to 2^8 which is 256, larger than 189 and thus you know you don't have to deal with that column. [Smile] ).

quote:
Or is there an accepted binary - alphabet translation that I don't know about?
As Morbo said, ASCII. Things to know about ASCII: the first 128 charecters are well defined (first seven columns). The next 128 vary over systems, even though all ASCII charecters are coded in 8 digit long sequences. ASCII is specifically english charecters. UNICODE is the answer to that (stored in 16 digit numbers), though its first 128 numbers are exactly the same as ASCII, its following ones contain other charecter codes (i.e. Chinese). Also, the first few charecters are not alphabet charecters, they are command charecters. Things like tabs and new lines and carriage returns (and the null terminator but you have to know more about programming to get that one).

Hobbes [Smile]

Posts: 10602 | Registered: Oct 1999  |  IP: Logged | Report this post to a Moderator
imogen
Member
Member # 5485

 - posted      Profile for imogen   Email imogen         Edit/Delete Post 
So basically these people were presuming that aliens know binary (ok...) and ASCII.

Alien hunters! [Roll Eyes]

Posts: 4393 | Registered: Aug 2003  |  IP: Logged | Report this post to a Moderator
T_Smith
Member
Member # 3734

 - posted      Profile for T_Smith   Email T_Smith         Edit/Delete Post 
code:
 1001
+0011
_____
1100

Also something to point out, when adding in binary, it works the same way, except whenever you get a '2', the answer to 0 and carry the one to the next columb.

A little skip into boolean algebra (all of this is in Binary):

And:
A && B = A*B

If A = 1 and B = 1 then you get an output of 1

Or:
A || B

Simple enough: if A OR B equals 1, the output is 1

So you get something like this (numbers under coorespond with what they equal):

Boolean And:

A B Output
1 1 1
0 1 0
1 0 0
0 0 0

Boolean Or:

A B Output
1 1 1
1 0 1
0 1 1
0 0 0

Then you get into the "opposite ofs" otherwise known as the nots. ! = 'not'. If outside the parentheses, the value of the equation is flipped. If inside the parentheses, just the variable (A or B) is flipped.

Not Ands
!(A&&B) = the opposite of A*B

Not Ors
!(A||B) = the opposite of A or B

!And:
A B Output
1 1 0
0 1 1
1 0 1
0 0 1

!Or:
A B Output
1 1 0
1 0 0
0 1 0
0 0 1

Or if you want just the opposite of one variable

!A

A Output
1 0
0 1

With this, we have a little bit of fun now. This is boolean algebra to prove that:

1+1 = 10 (2)

(A&&!B) = C

(!B&&B) = D

(A&&B) = E

(C||D) = F

Output = E F

Pretend A = 1 and B = 1 (again, think in terms of binary)

1. C = 0

2. D = 0

3. E = 1

4. F = 0

Output = 10 (or 2 in binary)

E is going to represent what you are carrying over to the next columb, while F represents what stays in the original columb you started with.

Its late. Hobbes with explain it better.

Posts: 9754 | Registered: Jul 2002  |  IP: Logged | Report this post to a Moderator
luthe
Member
Member # 1601

 - posted      Profile for luthe   Email luthe         Edit/Delete Post 
In the begining ASCII represented characters with 7bits (a binary string 7 places long) which is large enough for 128 different characters (2^7 = 128). In this set the first 32 characters were control characters (nonprinting) for things like line feed, carrige return, and escape.

Later on someone decided that they needed accented characters and switched to using 8bits per character this gave 256 differnt characters the upper 128 were for a time defined by the operating system that you had. Eventually it was all standardized into the ANSI codes page which was identical to the ASCII code for the first 128 and depended on you country for the second, this allowed people to have the special characters that some languages use. This solved many of the problems, although not all of them. you could still only display 256 different characters at a time, and documents transfered between computers in different countries might not display the same text on both computers.

Unicode eventually came along to fix most of these problems. Unicode does not specify a number of bits for each character, Allowing the implemantation to specify how many they are using, althought the common ones are 8,16,32 bits per character. With all of them able to display any of the 95,221 differnt characters currently defined by the spec. Windows 2000 or better uses 16bit unicode characters by default. see http://unicode.org/ for more info.

This is alot of stuff I left out (IOS standarizations, byte order marks, etc.) and I may have gotten something incorrect so please feel free to correct me if so.

[ November 21, 2003, 08:49 AM: Message edited by: luthe ]

Posts: 1458 | Registered: Feb 2001  |  IP: Logged | Report this post to a Moderator
saxon75
Member
Member # 4589

 - posted      Profile for saxon75           Edit/Delete Post 
T,

That was a good explanation. Just a few nitpicks:

The standard Boolean Algebraic notation for the AND operation is * or ·. i.e. A AND B is written as either A*B, A·B, or just AB. Using the double ampersand (&&) notation is confusing, because in C/C++, && is not strictly the Boolean AND operation.

The standard Boolean Algebraic notation for the OR operation is +. i.e. A OR B is written as A+B. Similar nitpick about the double pipe (||) notation.

The reasons for using the familiar multiplication and addition signs for AND and OR in Boolean Algebra becomes clear when you examine the algebraic properties of those operations.

The standard notation for inversion (NOT operation) is to put a line over the variable or expression being inverted. i.e. NOT A is written as Ā. But this one is harder to type, so it's also common to use !A or ~A.

Truth tables are generally written with the operands in ascending binary order. i.e.:
A B = C
0 0 = 0
0 1 = 1
1 0 = 1
1 1 = 0

(Incidentally, that's the exclusive OR operation.)

But otherwise nice work.

Posts: 4534 | Registered: Jan 2003  |  IP: Logged | Report this post to a Moderator
T_Smith
Member
Member # 3734

 - posted      Profile for T_Smith   Email T_Smith         Edit/Delete Post 
Bah, I live on c++. Everyone can conform around me.

Or else.

Edit: Bah, I should have caught that OR gate bit. I can still use the excuse it was late, right?

[ November 21, 2003, 12:38 PM: Message edited by: T_Smith ]

Posts: 9754 | Registered: Jul 2002  |  IP: Logged | Report this post to a Moderator
saxon75
Member
Member # 4589

 - posted      Profile for saxon75           Edit/Delete Post 
Dude, in C++, && is not the same as a bitwise AND. Breaks down like so:

&: The bitwise AND operator. You should use this for actual bit manipulation.
e.g. C = A & B

&&: The logical AND operator. You should use this for evaluating logical conditions.
e.g. if ((oaxaca == 1) && (nahdudenah == 0)) cout << "Right on!\n";

[ November 21, 2003, 12:49 PM: Message edited by: saxon75 ]

Posts: 4534 | Registered: Jan 2003  |  IP: Logged | Report this post to a Moderator
  This topic comprises 2 pages: 1  2   

   Close Topic   Feature Topic   Move Topic   Delete Topic next oldest topic   next newest topic
 - Printer-friendly view of this topic
Hop To:


Contact Us | Hatrack River Home Page

Copyright © 2008 Hatrack River Enterprises Inc. All rights reserved.
Reproduction in whole or in part without permission is prohibited.


Powered by Infopop Corporation
UBB.classic™ 6.7.2