What are Logic Gates?
Tags: computerscience, beginners, architecture, programming
Published: 2021-09-27 16:51:37

## __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. 

{% youtube aEjzjLv-YjI%}

## __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](https://dev.to/entangledcognition/ultimate-alchemy-turning-sand-into-a-computer-a-comprehensive-guide-to-understand-computer-making-for-computer-grad-s-32e5), 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](https://dev-to-uploads.s3.amazonaws.com/i/hxjag3auk0kmk5r0xtkv.gif)

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](#Advanced Topics). 


> 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](https://dev-to-uploads.s3.amazonaws.com/i/bs8ficxv1tygo6yth2eb.png "Extracted from https://www.101computing.net/")

## 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](https://dev-to-uploads.s3.amazonaws.com/i/ycqxfx3jn67j4oxrzetq.png "Extracted from https://www.101computing.net/")

## 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](https://dev-to-uploads.s3.amazonaws.com/i/dc3pczurj3ar45cnbe2s.png "Extracted from https://www.101computing.net/")

## 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](https://dev-to-uploads.s3.amazonaws.com/i/eaqpw5i3347hzr8bc7mk.png "Extracted from https://www.101computing.net/")

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](https://dev-to-uploads.s3.amazonaws.com/i/588xwxdaci9iv0fqkpsz.gif)