Binary - Quia



Binary

Most of us use digital machines like calculators and computers almost every day. But very few of us understand the basics about how they work. The binary system is what computing devices use at the most basic level to represent and store data.

The base 10 number system is what most people use. Using the numbers 0 through 9 we can write down any number imaginable. Our numbering system is probably base 10 because we have 10 fingers to count on.

The binary system is base 2 using only two symbols, a zero (0) and a one (1). Why do you think that is? One of the simplest electrical circuits is a switch, representing on and off, yes and no, empty and full, and of course 1 and 0.

Computers use switches like fingers to count on, passing around electrical signals in binary code.

How does this strange binary system work? Binary works with powers of two, marking them either one meaning on or zero meaning off. Here is the number one. Notice that the light representing 1 is on. That means there is one 1.

Let’s try the decimal number 25. Using the decimal number system 25 would be described as two 10’s and five 1’s.

25 in binary would look like this; A 16, an 8, no 4’s, no 2’s, and a 1. 16+8+1=25.

This binary system sounds pretty complicated compared to the one we are all used to but computers are so fast they can handle it with no sweat.

All the data your computer uses is stored in binary at the most basic level. Sure, it may look like all files and folders and desktop patterns, but way down deep it is just a bunch of on’s and off’s. The keys you type, the movements of your mouse, even the sound of a voice in a computer video are all represented by binary code.

DO THE ONLINE QUIZ

[pic]

[pic]

Logic Gates

If you've ever opened up an electronic device, you probably saw one of these.

This is a circuit board. It holds the main parts of a circuit, and controls the flow of electricity to them. Close up, you'll see something like little pathways. In fact, that's just what they are, paths for electricity to flow from one piece to another.

Right, as electricity streams through the circuit, it's also passing along tiny pieces of information. The current is actually pulsing in a kind of code called binary. Yup, binary is usually represented as 1s and 0s. These values are known as bits, but they don't have to be numbers. You can make a binary code out of any unmatched pair.

Braille is a special kind of binary where the bits are raised dots and blank spaces.

In Morse code, the bits are long and short pulses of sound or light.

And in digital circuits, the bits are a low voltage and a higher voltage. In other words, computers and other electronic devices think in a binary code made of electricity!

To process the code, they rely on something called a logic gate. A logic gate is sort of like an electric switch. Binary bits of electricity flow into it through one or more inputs.

Depending on the value of those bits, the gate will send a 0 or a 1 as an output. Our little friend here works like an AND gate. His output voltage will only be high when both inputs are high. If one or both inputs are low, the output will be low.

We can view these combinations in a truth table. See? The output is 0 unless both inputs receive a 1.

Right, the house alarm is a good example.

The siren will only sound if it receives a 1 from this AND gate. One of the gate's inputs connects to the keypad. Pressing on sends a 1 to that input; otherwise, it gets a 0. A motion detector connects to the other input. It sends out a 1 if something inside the house moves. So if the system is on and something moves, the AND gate gets two 1s. That means it outputs a 1, and the siren goes off.

Oh, right, the back door! There's a motion detector there, too.

That means we have to add an OR gate to the circuit. Now, if one or both detectors gets tripped, a 1 will be sent to the AND gate. And if the system is on, the siren will sound.

I was just getting to the windows. Each one has a NOT gate attached to it.

When a window is closed, it sends a 1 through the gate. The NOT gate reverses that to a 0, and the alarm won't sound. If a window is opened, it sends a 0 to the gate. The NOT gate changes that to a 1, and if the system is on, the siren sounds.

Yeah, once you start stacking gates together, they can make some pretty smart decisions. And this circuit is still really basic; it has one purpose and only uses the simplest three gates.

There are four other basic gates, each with its own specific truth table.

The NAND-gate: when she gets too much juice, she shuts down.

The NOR-gate: this guy likes 0s, simple as that.

The X-OR-gate: when she gets different inputs, she's a happy camper.

And the X-NOR gate: he's matchy. He likes it when his inputs are the same.

Computers have millions and millions of these gates packed inside them. They're clustered inside a computer's microprocessor, the part that manages all your apps and programs. The gates here are specially arranged so that they can process information from lots of different programs.

So whether you're finding your position on a map or spinning tiles before they fall, the circuitry is always doing the exact same thing. The only difference is in how each program uses it!

Oh, right: those millions of gates are why your phone can get hot. The more apps you're using, the more bits the gates are processing. That's millions of electric pulses per second, and they throw off some heat!

DO THE ONLINE QUIZ

[pic]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download