Eli5 Where exactly do computers make decisions?

653 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

They kind of do it everywhere! Every transistor, of which there are billions in a computer, either turns “on” (conducts electricity) or “off” (does not conduct much) based on the voltages supplied to it.

The code you are probably thinking of is mostly executed in the microprocessor (CPU). Transistors are used to construct simple circuits that implement simple logical “decision making blocks” such as OR, AND, etc. These are commonly called logic gates.

The transistors are wired up into logic gates, which are constructed into more complex circuits, which can be constructed into even more complex circuits, etc. etc. It’s like building things out of Legos to make bigger more complicated Lego things, which can be combined to make even bigger more complicated ones, etc. etc.

There are quite a few other devices besides the CPU that are also “making decisions”, i.e. executing code. It’s just not the main program code that you are thinking of, but executing driver code, firmware, etc. And all of those devices are commonly passing data/instructions to each other to run.

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