What are Logic Gates?
The devices which are used to perform Logical Operations in the form of binary inputs to produce binary outputs like 0 or 1 are called Logic Gates. These are the basic building blocks of electronic digital circuits. These logic gates use a Boolean Logic Concept for their work. These gates of various types joined together to make more complicated circuits to perform various sophisticated tasks like Arithmetic and Memory Operations.
Logic Gates are applicable to the material which conduct Electricity such as Semiconductors.
What are Semiconductors?
“A semiconductor is a material with certain electrical properties that make it useful for building computers and other electronic devices. It is usually a solid chemical element or compound that carry current under some conditions“
The electrical conductivity of a semiconductor is somewhere between that of a conductor, like copper metal, and that of an insulator, like glass. Its resistance goes down as the temperature goes up, while metals do the opposite. Doping a crystal structure with impurities can change the way it conducts electricity in a good way. A semiconductor junction is made when there are two different doped areas in the same crystal. Diodes, transistors, and most modern electronics are based on how charge carriers like electrons, ions, and electron holes behave at these junctions.
Silicon, germanium, gallium arsenide, and other elements on the so-called metalloid staircase of the periodic table are all semiconductors. Silicon is an important part of making almost all kinds of electrical circuits.
Working Principle of Logic Gates
Boolean Algebra is the basic working Principle of Logic Gates. It is also based on the use of Transistors which works on two states like ON and OFF or Input Signals.
Boolean Algebra
Boolean Algebra can be defined as;
“Boolean algebra is a type of algebra in which the values of the variables are the truth values true and false, which are usually written as 1 and 0. It is used to make digital circuits or digital gates easier to understand by looking at them. It’s also called “logical algebra” and “binary algebra.”
OR
“Boolean algebra is a branch of maths that deals with operations on logical values using binary variables like 0 or 1. The truths are shown by the Boolean variables as binary numbers: 1 means true and 0 means false. Elementary algebra is about operations with numbers, while Boolean algebra is about operations with logic“
Who discovered Boolean Algebra?
George Boole, an English mathematician, and logician came up with the idea for Boolean algebra. In 1854, Boole wrote a book called “An Investigation of the Laws of Thought” about the subject. His work helped make computer science and digital electronics what they are today.
George Boole, a British mathematician, and philosopher were one of the few people since Leibniz to think seriously about logic and its mathematical implications. Augustus de Morgan, who was also British and lived around the same time as Boole, was another. But, unlike Leibniz, Boole came to think that logic was mostly a branch of mathematics, not philosophy.
He didn’t show signs of his amazing maths skills until much later in life. His father, a tradesman who liked maths and logic in his spare time, taught him maths when he was young, but his favorite subject in school was the classics. He was a quiet, serious, and humble young man from a poor working-class family. He learned most of his maths on his own (he would borrow mathematical journals from his local Mechanics Institute).
His maths skills didn’t start to show until he went to college and after that. Even then, he was almost unknown in his own time, except for a few insightful but complicated papers on differential equations and the calculus of finite differences. But by the time he was 34, he had earned enough respect in his field to become the first professor of maths at Queen’s College (now University College) in Cork, Ireland.
Boole started to see that his algebra could be used to solve logical problems, and he pointed out that the symbols of algebra are very similar to the symbols that can be used to represent logical forms and syllogisms. In fact, he wanted to come up with and develop a system of algebraic logic that would define and model the way the human brain works. He had new ideas about logical methods because he had a lot of faith in symbolic reasoning. In the 1840s and 1850s, he thought about what he called a “calculus of reason.”
He was determined to find a way to put logical arguments into a language that could be changed and solved mathematically. He came up with Boolean algebra, which is a type of linguistic algebra. AND, OR, and NOT were the three most basic operations in this algebra. Boole thought that these were the only ones needed to compare sets of things and do basic maths functions.
Types of Logic Gates
There exist 3 basic types of Logic Gates which are as follows;
- OR Gate
- AND Gate
- Not Gate
OR Gate
An OR gate works like two switches that are wired together to power a light.
- OR gate is defined as the gate which shows output 1 when any of its inputs is 1. In this case, the light will turn ON.
- When all of its inputs are 0 then the output will be 0. In this case, the light will turn OFF.
Symbol of OR Gate
Boolean Expression for OR Gate
Y = A + B
This is the Boolean Expression for OR Gate which can be read like Y equals A OR B.
Truth Table of OR Gate
Input | Output | |
A | B | A OR B |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
Applications of OR Gate
- In the Field of Data Validation
OR gates are often used in digital systems to check if data is correct or not. For example, in a four-bit binary adder, the carry bit from the second bit can be checked with the help of an OR gate. - In the Field of Alarm Systems
OR gates are used in alarm systems to set it off when any of multiple conditions are met. For example, an OR gate can be used in a fire alarm system to make an alarm go off when several smoke detectors pick up smoke. - In the Field of Traffic Lights
OR gates can be used to confirm that only one light is green at a particular time in a traffic light system on roads. For instance, an OR gate can be used to turn off the green light in one direction when the green light from another way is turned on. - In the Field of Memory
OR gates are used in memory systems to make it possible to read and write. For example, if the write signal or any of the write enable signals are high, an OR gate can be used to turn on the write operation.
AND Gate
AND Gate is an example of a series circuit.
- AND Gate is defined as the gate which shows output 1 when all the inputs are 1. In this case, the light will turn ON.
- When any of the inputs is 0 then the output will be 0. In this case, the light will turn OFF.
Symbol of AND Gate
Boolean Expression for AND Gate
Y = A . B
This is the Boolean Expression for AND Gate which can be read like Y equals A AND B.
Truth Table of AND Gate
Input | Output | |
A | B | A AND B |
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Applications of AND Gate
- In the Field of Digital Logic Circuits
In digital logic circuits, AND gates are used to do logical operations like adding two or more signals together. For example, an AND gate can be used to make a circuit that only sends out a signal if two or more inputs are high. - In the Field of Boolean Algebra
AND is one of the most important logical operations in Boolean algebra. The AND gate is used to combine two or more Boolean variables using the AND operation. - In the Field of Multiplexer & Demultiplexer
Multiplexers and demultiplexers use AND gates to choose which input and output channels to send data to and from. - In the Field of Memory Devices
Memory devices like RAM and ROM use AND gates to control the read and write operations. - In the Field of Arithmetic Circuits
AND gates are used in digital arithmetic circuits along with other logic gates to do operations like multiplying and dividing. - In the Field of Control circuits
AND gates are used in control circuits to make control signals based on more than one signal. For example, an AND gate can be used to make a signal that turns on a safety feature only if all safety conditions are met.
NOT Gate
NOT includes single Input and single Output. This gate is also called an “Inverter“
- The Output of the NOT gate will be 1 when the Input will be 0.
- The Output of the NOT gate will be 0 when the Input will be 1.
Symbol of NOT Gate
Boolean Expression for NOT Gate
This is the Boolean Expression for NOT Gate which can be read like Y equals A NOT.
Truth Table of NOT Gate
Input | Output |
A | Not A |
0 | 1 |
1 | 0 |
Applications of NOT Gate
- In Inverter
Most of the time, the NOT gate is used as an inverter, where the output is the opposite of what was put in. Inverters are used in digital circuits to change the polarity of a signal or to cancel out a logical condition. - In Flip-Flops
Flip-flops, which are the basic building blocks of digital circuits, are made with the help of NOT gates. Flip-flops are used to store binary data and can be used for many things, like storing data in memory and making sure that everything is in sync. - In Clock Generators
Digital clock signals can be made with the help of NOT gates. A clock signal is a waveform that repeats at regular intervals and is used to keep digital circuits in sync with each other. - In Transistor Devices
NOT gates can be used to power transistors, which are used in digital circuits as switches. The input of the transistor is controlled by what comes out of the NOT gate. - In Signal Routing
NOT gates can be used to route signals by using their output to choose between two different input signals.
Types of NOT Gate
NOT Gate is divided into two further types depending upon its combination with OR Gate and AND Gate named NOR Gate and NAND Gate respectively. The details of these types are given below;
NOR Gate
NOR Gate is defined as the combination of NOT Gate and OR Gate.
- When all the inputs are 0 then the output will be 1.
- When all the inputs are 1 then the output will be 0.
- When any of the inputs is 0, the output will be 0.
- When any of the inputs is 1, the output will be 0.
Symbol of NOR Gate
Boolean Expression for NOR Gate
This is the Boolean Expression for NOR Gate
Truth Table of NOR Gate
Input | Output | |
A | B | A NOR B |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 0 |
Applications of NOR Gate
- In Logic gates
Many other logic gates, such as NAND gates, XOR gates, and XNOR gates, are built from NOR gates. They are also used to do different Boolean functions in combinational logic circuits. - In Memory Circuits
NOR gates are used to control read and write operations in memory circuits like static random access memory (SRAM) and dynamic random access memory (DRAM). - In Clock Circuits
NOR gates are used in clock circuits to make clock signals and make sure that digital circuits work at the same time. - In Power-on reset Circuits
NOR gates are used in power-on reset circuits to make sure that when power is turned on, the output of a digital circuit is in a known state. - In Flip Flops
Flip-flops, which are the basic building blocks of sequential logic circuits, use NOR gates. Flip-flops are used to store one bit of information and can be used to make different kinds of counters, registers, and shift registers. - In Error Detection and Correction
Error detection and correction circuits use NOR gates to find and fix mistakes in digital data transmissions. - In Boolean Algebra
In Boolean algebra, NOR gates are used to make Boolean expressions easier to understand and to carry out Boolean functions.
NAND Gate
NAND Gate is defined as the combination of NOT Gate and AND Gate.
- When all the inputs are 0 then the output will be 1.
- When all the inputs are 1 then the output will be 0.
- When any of the inputs is 0, the output will be 1.
- When any of the inputs is 1, the output will be 1.
Symbol of NAND Gate
Boolean Expression for NAND Gate
This is the Boolean Expression for NAND Gate
Truth Table of NAND Gate
Input | Output | |
A | B | A NAND B |
0 | 0 | 1 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Applications of NAND Gate
- In Digital logic circuits
Digital logic circuits like adders, counters, multiplexers, demultiplexers and flip-flops are all made with NAND gates. - In Memory circuits
Memory circuits like SRAM (static random-access memory), DRAM (dynamic random-access memory), and flash memory are made with NAND gates. - In Timer circuits
In timer circuits, NAND gates are used to make exact delays in time. - In Error detection and correction
In error detection and correction circuits, NAND gates are used to find and fix mistakes in the way data is sent. - In Programmable logic arrays (PLAs)
In PLAs, Boolean functions are done with the help of NAND gates. - In Address decoding
In a system with a microprocessor, NAND gates are used in address decoding circuits to choose a certain memory location or peripheral device. - In Power control circuits
In power control circuits, NAND gates are used to turn on and off electronic devices like motors, lights, and heaters.
Exclusive-OR gate (XOR Gate)
The gate which is formed by the combination of the NAND Gate and NOR Gate is called the Exclusive-OR gate (XOR Gate). In this Gate, there are 2 inputs put only 1 output.
- When all the inputs are 0 then the output will be 0.
- When all the inputs are 1 then the output will be 0.
- When any of the inputs is 0, the output will be 1.
- When any of the inputs is 1, the output will be 1.
Symbol of XOR Gate
Boolean Expression for XOR Gate
Or
These are the Boolean Expression for XOR Gate
Truth Table of XOR Gate
Input | Output | |
A | B | AN XOR B |
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Applications of XOR Gate
- In Binary adder & subtractor
In binary arithmetic circuits like adders and subtracters, the XOR gate is often used. In these kinds of circuits, the XOR gate is used to compare the two bits coming in and figure out the sum and carry. - In Error detection
A digital data transmission error can be found with the help of an XOR gate. By using the XOR operation on two data streams, we can get a third data stream called a checksum. This is used to make sure that the data transmission was done correctly. - In Data encryption
In data encryption algorithms, the XOR gate is used to make the data hard to read. In these kinds of algorithms, the data is XORed with a secret key to make encrypted data, which can only be read with the same secret key. - In Comparator
The XOR gate is used as a comparator to see if two binary inputs are the same or not. It does this by producing an output that shows if the two inputs are equal or not. - In Parity generation and checking
In communication systems, the XOR gate is used to make and check parity bits. A parity bit is a bit that is added to a data stream to find mistakes while the data is being sent. All of the bits in the data stream are XORed together to make the parity bit, and all of the bits received, including the parity bit, are XORed together to check the parity. - In Clock gating
In clock gating circuits, the XOR gate is used to change the clock signal. In these kinds of circuits, the XOR gate is used to compare the current clock signal with a gating signal and make an output signal that controls the clock signal.
Exclusive-NOR Gate (XNOR Gate)
The gate which is formed by the combination of XOR Gate and NOT Gate is called Exclusive-NOR Gate (XNOR Gate).
- When all the inputs are 0 then the output will be 1.
- When all the inputs are 1 then the output will be 1.
- When any of the inputs is 0, the output will be 0.
- When any of the inputs is 1, the output will be 0.
Symbol of XNOR Gate
Boolean Expression for XNOR Gate
Y = = AB + ĀB ̅.
These are the Boolean Expression for XNOR Gate.
Truth Table of XNOR Gate
Input | Output | |
A | B | A XNOR B |
0 | 0 | 1 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |
Applications of XNOR Gate
- In Binary comparators
In binary comparators, XNOR gates are often used to compare two binary values. If the two binary values are the same, the XNOR gate’s output will be 1, and if they are not the same, it will be 0. - In Arithmetic operations
Some maths operations, like subtraction and division, use XNOR gates. For example, to subtract one binary value from another, the two values are first swapped with an XNOR gate and then added together with a carry input. - In Error detection
Error-detection circuits can use XNOR gates to check if the data received is correct. The XNOR gate is used to compare the data that was received with the data that was expected. If the output is 1, then the data that was received was correct. - In Digital signal processing
In digital signal processing, XNOR gates are used to do things like filtering and correlating. - In Memory storage
Memory storage circuits can use XNOR gates to store binary data.
FAQ’s
How to use logic gates on the breadboard?
Connect the transistor’s collector pin to the negative rail. With a 220 ohm resistor, connect the emitter pin of the transistor to the positive rail, and then connect the positive leg of the LED to this junction. Connect the LED’s negative leg to the negative rail.
How many logic gates are in a CPU?
In a computer, there are many different logic gates that do different things. When making combinational and sequential circuits, these gates are used. There are AND, OR, NOT, NAND, NOR, XOR, and XNOR logic gates.
How do logic gates work?
When a transistor is on, or “open,” an electric current can flow through. When it’s turned off, no electricity flows. When you connect a bunch of these transistors together, you get what’s called a logic gate, which lets you add, subtract, multiply, and divide binary numbers in any way you can think of.
Are logic gates transistors?
“A logic gate on a microchip is made up of transistors that are set up in a certain way. The transistors in modern microchips are called Metal-Oxide-Semiconductor Field-Effect Transistors (MOSFET), and silicon is used as the semiconductor.
Can logic gates have 3 inputs?
Yes, The three-input NAND gate is different from the two-input NAND gate in that it has three inputs. The NAND gate with three inputs is shown by the following symbols. The logic NAND gate’s Boolean expression is represented by the binary operation dot (.). Where the inputs are A, B, and C and the output is Y.
How logic gates are made using transistors?
The ability of transistors to work as fast switches is what makes them useful for building logic gates. When the base-emitter diode is turned on enough to drive it into saturation, the collector voltage with respect to the emitter may be close to zero. This can be used to build gates for the TTL logic family.
What are logic gates used for in real life?
The basic logic gates are used in many circuits, like a push-button lock, a light-activated burglar alarm, a safety thermostat, an automatic watering system, etc. Without logical operations, digital communication would not be possible.
What are the different types of logic gates?
There are seven basic logic gates: AND, OR, XOR, NOT, NAND, NOR, XNOR.
How do logic gates perform logical operations?
In a circuit, logic gates decide what to do based on how many digital signals are sent to them. Most logic gates only have one output and two inputs. Boolean algebra is what is used to make logic gates. At any given time, each terminal is in either the false or the true state.
More Articles