eli5: How do computers process binary digits as logic, from code?

114 views

eli5: How do computers process binary digits as logic, from code?

In: 0

2 Answers

Anonymous 0 Comments

Binary logic works, as the name suggests, in two states: on or off. Any code gets translated into machine code that the processor can understand. The processor has so called “logic gates”. They are pieces of hardware that allow electricity into a bit or cut it off so it can’t get any electricity.

It works similar to the light switches in your house. Power can only get to your light when the switch is on. The logic gates have two switches, but only 1 light.

The AND-gate will turn the light on only if both switches are ‘on’. The OR-gate will turn the light on if at least one switch is turned on. There are more types of switches, but they all work this way. Only in a specific state will the light turn on. otherwise electricity cannot reach it.

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