how do logic gates work

1.12K 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.**

Anonymous 0 Comments

Electricity is electrons, and circuits (made up of logic gates) essentially guide electrons from one place to another using components such as transistors and capacitors to carry out logical operations.

A simple example of a logic gate is the AND operation which equates to true (ON) only when both inputs are true. This can easily be simulated using a component that only can hold a charge up to but no more than one of the signals. So say you have two signals that are connected to the component and each is 5V. If the component they are attached to can only hold 5V then the other 5V “goes through” such that we only see the output of 5V if and only if both signals are ON (true AND true = true).

A simple OR operation can effectively be two 10V signals and a component that still only holds 5V. If either signal is on then the extra will always go through and we see it as ON when either signal is one (true OR false = true, false OR true = true).

These are just examples of how the simplest logic gates work and there is more than one way to implement them, not just the way I described. Combining a bunch of logic gates can give you circuits, some of which can be designed in a way that allows flexible meaning to the operations and ultimately is programmable logic arrays and on to full blown processors (which are millions/billions of logic gates chained together for more complex calculations all using simple logic operations).

Anonymous 0 Comments

Electricity is electrons, and circuits (made up of logic gates) essentially guide electrons from one place to another using components such as transistors and capacitors to carry out logical operations.

A simple example of a logic gate is the AND operation which equates to true (ON) only when both inputs are true. This can easily be simulated using a component that only can hold a charge up to but no more than one of the signals. So say you have two signals that are connected to the component and each is 5V. If the component they are attached to can only hold 5V then the other 5V “goes through” such that we only see the output of 5V if and only if both signals are ON (true AND true = true).

A simple OR operation can effectively be two 10V signals and a component that still only holds 5V. If either signal is on then the extra will always go through and we see it as ON when either signal is one (true OR false = true, false OR true = true).

These are just examples of how the simplest logic gates work and there is more than one way to implement them, not just the way I described. Combining a bunch of logic gates can give you circuits, some of which can be designed in a way that allows flexible meaning to the operations and ultimately is programmable logic arrays and on to full blown processors (which are millions/billions of logic gates chained together for more complex calculations all using simple logic operations).

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.**

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.**

Anonymous 0 Comments

Electricity is electrons, and circuits (made up of logic gates) essentially guide electrons from one place to another using components such as transistors and capacitors to carry out logical operations.

A simple example of a logic gate is the AND operation which equates to true (ON) only when both inputs are true. This can easily be simulated using a component that only can hold a charge up to but no more than one of the signals. So say you have two signals that are connected to the component and each is 5V. If the component they are attached to can only hold 5V then the other 5V “goes through” such that we only see the output of 5V if and only if both signals are ON (true AND true = true).

A simple OR operation can effectively be two 10V signals and a component that still only holds 5V. If either signal is on then the extra will always go through and we see it as ON when either signal is one (true OR false = true, false OR true = true).

These are just examples of how the simplest logic gates work and there is more than one way to implement them, not just the way I described. Combining a bunch of logic gates can give you circuits, some of which can be designed in a way that allows flexible meaning to the operations and ultimately is programmable logic arrays and on to full blown processors (which are millions/billions of logic gates chained together for more complex calculations all using simple logic operations).

Anonymous 0 Comments

Logic gates are just systems with two (or one) inputs and one output.

They can be made for electricity like we have in computers but also for all sorts of other stuff like water flowing in pipes or red stone in minecraft.

They are at their most basic level a system that you put in one or two yes or no type signals and get a yes or no type signal out.

For example an AND logic gate outputs “yes” if an only if both inputs are “yes”.

An OR logic gate outputs “yes” if an if one or both inputs are “yes”.

A XOR logic gate outputs “yes” if an if one but not both inputs are “yes”.

And so on.

There is also the very simple NOT gate that outputs the opposite of what you put in Yes into No and No into Yes.

You can make these logic gates from transistors but in the past we have also made them with vacuum tubes and electronically relays.

What they are made of does not really matter much they all function the same way.

Once you have logic gates, you can build more complicated structures from them.

For example by connecting two XOR, two AND and one OR gate together you can create a circuit that can add two binary digits. (You can also use 9 NAND gates for the same results)

Once you have that you can chain those adders together to get a design that you can put two numbers in and get the result of their addition out.

You can similarly create a circuit that will multiply numbers from logic gates.

Eventually if you can connect enough of them together you get a full general digital computer.

Anonymous 0 Comments

Logic gates are just systems with two (or one) inputs and one output.

They can be made for electricity like we have in computers but also for all sorts of other stuff like water flowing in pipes or red stone in minecraft.

They are at their most basic level a system that you put in one or two yes or no type signals and get a yes or no type signal out.

For example an AND logic gate outputs “yes” if an only if both inputs are “yes”.

An OR logic gate outputs “yes” if an if one or both inputs are “yes”.

A XOR logic gate outputs “yes” if an if one but not both inputs are “yes”.

And so on.

There is also the very simple NOT gate that outputs the opposite of what you put in Yes into No and No into Yes.

You can make these logic gates from transistors but in the past we have also made them with vacuum tubes and electronically relays.

What they are made of does not really matter much they all function the same way.

Once you have logic gates, you can build more complicated structures from them.

For example by connecting two XOR, two AND and one OR gate together you can create a circuit that can add two binary digits. (You can also use 9 NAND gates for the same results)

Once you have that you can chain those adders together to get a design that you can put two numbers in and get the result of their addition out.

You can similarly create a circuit that will multiply numbers from logic gates.

Eventually if you can connect enough of them together you get a full general digital computer.

Anonymous 0 Comments

Logic gates are just systems with two (or one) inputs and one output.

They can be made for electricity like we have in computers but also for all sorts of other stuff like water flowing in pipes or red stone in minecraft.

They are at their most basic level a system that you put in one or two yes or no type signals and get a yes or no type signal out.

For example an AND logic gate outputs “yes” if an only if both inputs are “yes”.

An OR logic gate outputs “yes” if an if one or both inputs are “yes”.

A XOR logic gate outputs “yes” if an if one but not both inputs are “yes”.

And so on.

There is also the very simple NOT gate that outputs the opposite of what you put in Yes into No and No into Yes.

You can make these logic gates from transistors but in the past we have also made them with vacuum tubes and electronically relays.

What they are made of does not really matter much they all function the same way.

Once you have logic gates, you can build more complicated structures from them.

For example by connecting two XOR, two AND and one OR gate together you can create a circuit that can add two binary digits. (You can also use 9 NAND gates for the same results)

Once you have that you can chain those adders together to get a design that you can put two numbers in and get the result of their addition out.

You can similarly create a circuit that will multiply numbers from logic gates.

Eventually if you can connect enough of them together you get a full general digital computer.

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.