Eli5 Where exactly do computers make decisions?

743 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

Computers don’t make decisions when they run code. They do exactly what the code says.

The code is a sequential list of instructions that get loaded and run (mostly) in order. The list of commands that a processor knows is called its instruction set. These commands are quite simple; stuff like “load this value here”, “add these values and store it here”, “if this value is greater than zero, skip the next line”, “instead of the next instruction, go to this instruction instead”. The way that computers have conditional execution is usually a combination of those last two.

For instance, these instructions will return the bigger value between A and B:

* If A is greater than B, don’t read the next sentence.
* Return B.
* Return A.

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