how do logic gates work

1.14K views

I don’t get the concept

In: 0

15 Answers

Anonymous 0 Comments

First you have to understand what they are, logically.

A logical operation is like a mathematical operation except it works with logical values (true, false) instead of mathematical ones.

So the logical operation NOT takes a truth value and flips it to the opposite one. So NOT “True” is “False”. And NOT “False” is “True”.

The NOT logical operation is unique in that it only takes a single input, the rest take two inputs:

AND – outputs “True” if both inputs are “True” otherwise outputs “False”

OR – outputs “True” if either, or both, inputs are “True” otherwise outputs “False”

XOR – stands for “exclusive or”; outputs “True” if either, but *not* both, inputs are “True” otherwise outputs “False”

NAND – stands for “NOT AND”; outputs “True” if either, or none, inputs are “True” otherwise outputs “False”

NOR – stands for “NOT OR”; outputs “True” if both inputs are “False” otherwise outputs “False”

There were two big steps that allowed us to use these to develop computing:

**Logical operations can mimic mathematical ones.**

Instead of using “True” or “False” I can use something else. For example, I can replace “True” with “1” and “False” with “0”. Then let’s look at single bit addition (in binary):

0 + 0 = 00

0 + 1 = 01

1 + 0 = 01

1 + 1 = 10

With this interpretation (1 = True; 0 = False), we can see that the left-most digit of the output behaves according to the definition of AND (outputs a 1 only when both inputs are a 1) and the right-most digit of the output behaves according to the definition of XOR (outputs a 1 when either, but not both, inputs are a 1).

**We can construct physical devices that mimic logical operations.**

Lastly, we can build physical devices whose function mimics that of logical operators. At first we tried to do this purely mechanically, but that became expensive to do all but the simplest of things. Later we would learn to do it electronically, first with vacuum tubes and then with transistors. With electronic circuits, a high voltage acts like our TRUE/1 value and a low voltage acts like our FALSE/0 value.

This means we can make electronic circuits that behave like logical operations and therefore can do math. These electronic circuits we call **logic gates.**

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