how do logic gates work

1.13K views

I don’t get the concept

In: 0

15 Answers

Anonymous 0 Comments

Logic gates are designed to allow combing inputs that we typically treat as true or false, or other binary values to come up with some combined result.

Consider the following statements:

IF it is raining today AND IF I have to go to work THEN I should use an umbrella.

In this statement there are two true/false clauses (preceded by IFs) and a Boolean logic operation, the AND. Its easy to IF statement individually. IF its raining? This is either true or false. IF I have to go to work? This is either true or false as well. The combined statement being true or false will depend on combining the two individual results. For an AND statement, the end result is true if and only if BOTH the individual statements are true. If either one (or both!) are false, the overall result is false. You can see that below:

|Raining?|Go to work?|Bring umbrella|
|:-|:-|:-|
|False|False|False|
|False|True|False|
|True|False|False|
|True|True|True|

Logic gates take this kind of evaluation and model it using circuits and electricity (usually, though you could do it other ways if you really wanted to).

Instead of “true” and “false” this is usually represented as electrical signals with certain values. The circuitry of the logic gate is built in such a way as to model the same output as the logical operation if you were to evaluate it manually.

For example if we say that a signal of 5 V is “true” and 0 V is “false”. If the circuit input is two 5 V signals (i.e. both true) the output value should also be 5 V. This is the same as the 4th case from the above table.

The exact details of how different logic gates are wired and operate is beyond the scope of ELI5, you need to understand a bit about electrical engineering and Boolean logic. But the basic idea is to model the same rules using electricity as we otherwise evaluate with our brains.

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