How do computers know what to do with binary 1’s and 0’s?

314 views

I’m very interested in learning how computers work, but can’t seem to find the exact information I’m looking for. My understanding is, and **please** correct me if I’m wrong, is that if you press the letter “A” on a keyboard, a circuit underneath will close which sends electricity to wires, and based on the combination of voltages on the wires, the computer outputs an “A”. But how does the computer know what do to with voltages? What do the voltages represent? At what point does any of this information get converted into binary, and once it does, what happens?

I don’t expect someone to be able to explain this like I’m five. For me, it’s a difficult, but really interesting subject. Any clarification and dumbing down is appreciated! I’m really hoping to get a better grasp on my understanding of all this.

Edit: I should’ve made the title “How do computers work?” Still wondering how computers know what to do with 1’s and 0’s, though.

In: 0

13 Answers

Anonymous 0 Comments

> But how does the computer know what do to with voltages?

It doesn’t know anything at that level. Voltage at a given point just does stuff based on physics. When you turn a light on, the light bulb doesn’t “know” to turn on. It makes light based on that the physics of enough current flowing through a filament makes light. Computers on the lowest level are like that.

You can visualize a computer as a giant machine where dropping a marble just pushes on stuff which pushes on other stuff and so on.

> What do the voltages represent?

In digital electronics, high voltages (eg, 5V) = 1, low voltages (eg, 0.7V and below) = 0

> At what point does any of this information get converted into binary, and once it does, what happens?

A huge chain of logic circuits. Here’s a machine that [adds in binary](https://www.youtube.com/watch?v=GcDshWmhF4A) made from wood and marbles. Digital electronics is very similar to that, just electric and much, much bigger.

As to how you get to say text, this is extremely oversimplified, but.

1. At a point in the past a bunch of people got in a room and came up with an alphabet, and decided that ‘A’ is in place #65.
2. 65 in decimal is 1000001 is binary, that’s just math.
3. When you press the A key, that’s wired to sending 1000001 over a set of wires. That is wire #1 gets a 5V, wire #2 gets no voltage, and so on. The keyboard is just physically wired such that pressing on a given key sends a given signal to a computer.
4. Inside a computer’s memory, there’s a table where there’s a picture of an ‘A’ in the 65th cell in that table.
5. The video hardware ends up drawing that picture on the screen.

That any of this does something useful comes down to that a bunch of people made some rules and systems that produce something useful when you press a key.

Anonymous 0 Comments

Do you know transistors? For example OR logic transistor has 2 inputs and 1 output. Give an electricity to one of the input or both, and it will output an electricity (as the result of OR logic). There is also AND logic transistor. You need to send 2 inputs of electricity for it to output an electricity (AND logic). There are also other logic like XOR. Just by using the combination of those transistors, you can create simple to complex logic machine like for example a vending machine.

Anonymous 0 Comments

They have what are called logic gates. I’ll pick two of the most common ones AND and OR. Logic gates usually have two inputs and produce an output. You can combine multiple logic gates to form more complex gates. An AND logic gate will output a 1 if both inputs are 1 and will output a zero otherwise. An OR logic gate will output a 1 if any of the inputs are 1. Now these zeros and 1s on the hardware level can be thought of as electric currents A zero is a low voltage signal and a 1 is a high voltage signal. To show a letter on the screen, the computer is simply outputting the results of various computations done on the logic gates. So if an OR gate gets a low voltage signal as one input and a high voltage signal as another input it will output a high voltage signal . This high voltage signal can be fed as input to another logic gate and the other input comes from the output of one or more logic gates. The result to an end user will be the letter you pressed appearing on your screen which is the output of multiple logic gates, a combination of low and high voltage signals. An operation as simple as addition can involve as many as five logic gates. Not sure if this was easy to follow. Computer architecture was not my fave class in college lol