DEV Community

Cover image for What are Logic Gates?
Bharath Muppa for Entangled Cognition

Posted on • Updated on

What are Logic Gates?

Pinch of History

George Boole, the son of a shoemaker, left school at sixteen and ended up a Professor of Mathematics at Queens College in Cork in Ireland

In 1854 he wrote a book called An Investigation of the Laws of Thought which distilled the essence of logical thought down to terms like AND, OR, and NOT, or combinations of these.

So, What is the Relation between Logic Gates and George Bool? 🤔

Boolean Logic

Boolean Logic is at the core of all computing machines that humans ever worked with. Wonder why?

By the time when computer scientists Decided to use binary system, There exists a well-established branch of mathematics which dealt with true or false values called Boolean algebra.

In simple words "Logic Gates are a high-level abstraction of the circuit to perform a Boolean operation"

As I mentioned in our previous article, A circuit is made of transistors, capacitors and other electronic units. if you arrange a circuit in a specific order so that it performs a boolean function then this arrangement is called a Logic gate.

Created using kapwing

Most of the developers already knew what are basic gates and how they work, So it is advisable for them to jump to Advanced Gate Concepts.

Each Gates will be represented in 3 ways based on the person who looks at it

  • Mathematical perspective - Truth tables
  • Software Perspective - Gate Representation
  • electronic Perspective - Circuit Representation

Based on alignment there are 6 major gates

1. AND

The AND gate is an electronic circuit that gives a high output (1) only if all its inputs are high. A dot (.) is used to show the AND operation i.e. A.B

Alt Text

2. OR

The OR gate is an electronic circuit that gives a high output (1) if one or more of its inputs are high. A plus (+) is used to show the OR operation.

Alt Text

3. NAND

This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate. The outputs of all NAND gates are high if any of the inputs are low. The symbol is an AND gate with a small circle on the output. The small circle represents inversion.

Alt Text

4. NOR

This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR gates are low if any of the inputs are high.
The symbol is an OR gate with a small circle on the output. The small circle represents inversion.

5. XOR

The 'Exclusive-OR' gate is a circuit which will give a high output if either, but not both, of its two inputs are high. An encircled plus sign () is used to show the EOR operation.

6. NOT

The NOT gate is an electronic circuit that produces an inverted version of the input at its output. It is also known as an inverter. If the input variable is A, the inverted output is known as NOT A. This is also shown as A', or A with a bar over the top, as shown at the outputs. The diagrams below show two ways that the NAND logic gate can be configured to produce a NOT gate. It can also be done using NOR logic gates in the same way.

Alt Text

The NOT gate is an electronic circuit that produces an inverted version of the input at its output.

This is a Unary Gate which means it takes only one input.

Advanced Topics

Logic gates Conversation

Top comments (0)