Eli5 Where exactly do computers make decisions?

651 views

I understand the concept of coding, that it’s a bunch of if/then/unless kind of hardwired decisions. But where, PHYSICALLY, and how does this happen? This one I need actually explained like I’m five. I’ve never understood how code physically implements itself into fruition.

In: 1

10 Answers

Anonymous 0 Comments

A processor is made out of transistors. You can think of a transistor like a light switch, where when you flip it it lets electricity flow. If you hook two together, you can create “AND,” logic where both switch A *and* switch B have to be flipped in order for electricity to pass. We call these “logic gates,” and we can do other configurations for OR gates, and so on, building some complex logic.

An entire microchip is made out of billions of these transistors all set up almost like dominoes, where if a certain set of “input,” transistors are turned on, they change the path electricity takes through the chip, usually switching other transistors in the process. Each of these input configurations is called an “instruction,” and is usually represented as a bunch of 1s and 0s (1 for “on,” and 0 for “off.”). A single instruction might be “ADD 1, 2” where the instruction “ADD” switches the process to ADD mode, which means next two binary numbers it gets (0001 and 0010 in this case) will be sent to the part of the circuit that handles adding numbers.

When we program, we *could* type in the 1s and 0s, but that would be ridiculous. Instead we type in a programming language (the if/then/unless logic you mentioned in your post) and that gets “compiled,” to the binary instructions that the processor can understand.

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