eli5 How do people code with binary?

1.28K viewsOtherTechnology

Like I get that it can be a 1 or a 0, and that stores information, but how do you get information out of that? And how do people code with it? Seems like all it could store is numbers

Edit: Thank you all, this is very helpful

In: Technology

26 Answers

Anonymous 0 Comments

People don’t normally code things directly in binary anymore. A few do, usually hackers, modders, and software pirates, but it’s very uncommon.

You say that all binary can store is numbers, and you’re pretty much right: as far as a computer sees, all the data stored on it is (with apologies to the BBC) a big ball of wibbly-wobbly, numbery-wumbery… *stuff*. The trick is that if you can come up with standard notations for writing down numbers in place of other things, then you can store those things as numbers. And since binary can store numbers, you can use this trick to make it store other things.

Let’s say I make up a code for letters: A = 1, B = 2, C = 3, and so on. Now I can store letters, and if I add some more numbers for spaces and punctuation, I can store nicer text.

Let’s do pictures. Let’s say I break a picture into a number of small squares, like a tile mosaic. Then I use numbers to deacribe the color of each of those tiles: say, maybe one number each to control how much red, green, or blue is in the tile. Now I can store pictures.

How about sound? Consider that sound is really just vibrations in air or some other medium. I can make sound by telling a speaker to vibrate. If I use a number to conteol how fast it vibrates, I can vary the sound. Now let’s use a bunch of numbers, so that the vibration can vary quickly: now I can reproduce sounds.

Video? We’ve got pictures, we’ve got sound, so we just need to store sound alongside a string of pictures.

And that’s the basics. You’re right that binary is just numbers. The trick is that anything that can be turned into numbers -in other words, *digitized*- can be turned into binary, and then we can store it. All you need to do is agree upon the ways in which you *do* that.

You are viewing 1 out of 26 answers, click here to view all answers.