How do you define “if” for computers?

430 views

I’m not a programmer, how do you get from binary 1s and 0s to “if x occurs complete y” How do you tell the computer to wait for a future input?

In: 2

11 Answers

Anonymous 0 Comments

Imagine that you arrange y (in the computer’s memory) as a domino arrangement that will “topple to completion” with one instruction triggering the next and the next and so on.

And then you run all of the possible options for x right next to the first domino tile in y, so that the moment x “happens to be 1 = true”, the set of domino tiles in y gets triggered.

In terms of the computer electronics, 1 = 5 volts and 0 = 0 volts (for example), and all of the transistors are connected together to form the set of domino tiles that forms your y condition. So as soon as x is calculated to be 1 (5 volts on that last connecting transistor), the whole set of transistors for y gets triggered (gets powered up with 5 volts, going down the chain).

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