Physics Wallah

Logic Gates, Definition, Types, Functions, Truth Tables And Boolean Expressions

Logic gates - A logic gate is a fundamental building block used to perform logical operations on binary data. Learn about AND, OR, XOR, NOT, NAND, NOR, and XNOR gates.
authorImagePratibha Bohra8 Dec, 2023
Share

Share

Logic Gate

Logic Gate: A logic gate is a fundamental building block used to perform logical operations on binary data. It is an electronic circuit that takes one or more binary inputs (0 or 1) and produces a binary output based on predefined logic rules. These gates are the building blocks of more complex digital circuits and are used to perform various logical operations, such as AND, OR, NOT, NAND, NOR, XOR, and XNOR.

What is Logic Gate?

A logic gate is like a building block for digital circuits. It's a small device that does simple logical tasks, which are important for how computers and electronic devices work. You can find logic gates in many of the electronic devices we use every day, like smartphones, tablets, and memory devices. Imagine a logic gate as a decision-maker inside a circuit. It looks at the signals it receives as input, which are usually just 0s and 1s. Most logic gates have two inputs and one output. They follow a set of rules, kind of like a math game called Boolean algebra. In this game, 0 means "false," and 1 means "true." Depending on the type of logic gate and the signals it gets, it will produce a different output. You can think of a logic gate as a light switch. In one position, it's off (0), and in the other, it's on (1). Logic gates are super important in electronics, and they're often used together in tiny chips called integrated circuits (ICs). These ICs power many electronic devices we use and rely on every day.

Types of Logic Gates

Logic gates are essential components in digital systems, and they come in various types. Some of the common ones include:
  • OR Gate- This gate combines inputs and gives an output of "true" (1) if at least one input is true.
  • AND Gate- It also takes inputs and produces "true" (1) only when all inputs are true.
  • NOT Gate- This gate inverts the input; if it's "true" (1), the output will be "false" (0), and vice versa.
  • XOR Gate- The Exclusive OR gate provides a "true" output when the number of true inputs is odd; otherwise, it gives a "false" output.
These gates can be used individually or combined to create more complex gates like:
  • NAND Gate combines AND gate followed by a NOT gate, producing the opposite output of an AND gate.
  • NOR Gate- It's an OR gate followed by a NOT gate, giving the opposite output of an OR gate.
  • EXOR Gate- It's a combination of an OR gate and an AND gate, providing an output when inputs are different.
  • EXNOR Gate- This gate is an inverted version of the EXOR gate, giving an output when inputs are the same.

AND Gate

The AND gate gets its name because it works just like the logical "and" operator. In this context, we call 0 "false" and 1 "true." The AND gate has two inputs and one output. It has a symbol that looks like this: (the inputs are on the left, and the output is on the right). When both inputs are "true" (1), the output is also "true" (1). However, if either or both inputs are "false" (0), the output becomes "false" (0). To put it simply, the AND gate only gives a "true" output (1) when both input one and input two are "true" (1).

AND Gate Truthtable

The AND gate is a fundamental logic gate represented by the Boolean expression Y = A.B. It has two inputs, A and B, and one output, Y. The truth table for the two-input AND gate is as follows:
AND Gate Truthtable
Input A Input B Output Y
0 0 0
0 1 0
1 0 0
1 1 1

OR Gate

The OR gate is called so because it works like the logical "or" operator. When we say 0 is "false" and 1 is "true," the OR gate has two inputs and one output. If either or both of the inputs are "true" (1), then the output is also "true" (1). However, if both inputs are "false" (0), the output becomes "false" (0). To put it simply, the OR gate produces a "true" output (1) if at least one of the inputs (input one or input two) is "true" (1).

OR Gate Truthtable

The OR gate is a type of logic gate used in digital circuits. Its Boolean expression is written as Y = A + B, which means Y is equal to A 'OR' B. In simple terms, the OR gate takes two inputs, A and B, and produces one output, Y. Here's the truth table for a two-input OR gate:
OR Gate Truthtable
Input A Input B Output Y
0 0 0
0 1 1
1 0 1
1 1 1

NOT Gate

A logical inverter, also known as a NOT gate, is a simple electronic device with only one input. Its main function is to flip or reverse the logic state of the input signal. When the input is 1 (true), the output becomes 0 (false). Conversely, when the input is 0 (false), the output becomes 1 (true). In other words, the NOT gate changes a "true" input to a "false" output and vice versa. It's like a switch that turns things around: when you give it a 1, it gives you back a 0, and when you give it a 0, it gives you back a 1.

NOT Gate Truthtable

The Boolean expression for the NOT gate is written as Y = NOT A, which means Y is equal to "NOT" A. In simpler terms, the NOT gate is like a logical inverter with only one input, A. Its main job is to reverse the logic state of the input signal. If the input A is 1 (true), the output Y becomes 0 (false). Similarly, if the input A is 0 (false), the output Y becomes 1 (true). In other words, the NOT gate switches the value of the input: if you give it a 1, it gives you back a 0, and if you give it a 0, it gives you back a 1. Here's the truth table for the NOT gate:
NOT Gate Truthtable
Input A Output Y
0 1
1 0

XOR Gate

The XOR (exclusive-OR) gate works like the logical "either/or" operator. If either of the inputs is "true" (1) but not both, the output is "true" (1). However, if both inputs are either "false" (0) or "true" (1) together, the output becomes "false" (0). Another way to understand the XOR gate is that it gives a "true" output (1) when the inputs are different, but it gives a "false" output (0) when the inputs are the same. In summary, the XOR gate behaves like a special kind of "OR" gate, producing 1 when the inputs are different and 0 when they are the same.

XOR Gate Truthtable

The XOR gate takes two inputs, A and B, which can have values of 0 (false) or 1 (true). The output of the XOR gate depends on the combination of inputs:
  • If both inputs A and B are 0, the output is 0.
  • If input A is 0 and input B is 1 (or vice versa), the output is 1.
  • If both inputs A and B are 1, the output is 0.
  • Therefore, the XOR gate produces a "true" output (1) when the inputs are different and a "false" output (0) when the inputs are the same.
XOR Gate Truthtable
Input A Input B Output
0 0 0
0 1 1
1 0 1
1 1 0

NAND Gate

The NAND gate is a special type of gate that behaves like an AND gate followed by a NOT gate. It combines the logical "and" operation with negation. If both inputs are "true" (1), the output becomes "false" (0). However, if at least one of the inputs is "false" (0), the output becomes "true" (1). In simple terms, the NAND gate gives a "false" output (0) only when both inputs are "true" (1), and it gives a "true" output (1) for all other combinations of inputs.

NAND Gate Truthtable

The NAND gate takes two inputs, A and B, which can have values of 0 (false) or 1 (true). The output of the NAND gate is the opposite of what you get from an AND gate. It behaves like an AND gate followed by a NOT gate. Here's a quick explanation of the outputs:
  • If both inputs A and B are 0, the output is 1 (true).
  • If either input A or input B is 1 (or both are 1), the output is 0 (false).
  • In summary, the NAND gate gives a "true" output (1) when at least one of the inputs is "false" (0), and it gives a "false" output (0) only when both inputs are "true" (1).
NAND Gate Truthtable
Input A Input B Output
0 0 1
0 1 1
1 0 1
1 1 0

NOR Gate

The NOR gate is a special type of gate that combines an OR gate followed by an inverter (logical NOT gate). Its main function is to produce a "true" output (1) only when both inputs are "false" (0). However, if either or both of the inputs are "true" (1), the output becomes "false" (0). In simpler terms, the NOR gate acts like a gatekeeper, and it gives you a "true" output (1) only when both inputs are "false," but it gives a "false" output (0) for any other combination of inputs.

NOR Gate Truthtable

In this truth table, the NOR gate takes two inputs, A and B, which can have values of 0 (false) or 1 (true). The output of the NOR gate is the opposite of what you get from an OR gate. It behaves like an OR gate followed by a NOT gate (inverter). Here's a quick explanation of the output:
  • If both inputs A and B are 0, the output is 1 (true).
  • If input A is 0 and input B is 1 (or vice versa), the output is 0 (false).
  • If both inputs A and B are 1, the output is 0 (false).
  • In summary, the NOR gate gives a "true" output (1) only when both inputs are "false" (0), and it gives a "false" output (0) for any other combination of inputs.
NOR Gate Truthtable
Input A Input B Output
0 0 1
0 1 0
1 0 0
1 1 0

XNOR Gate

The XNOR (exclusive-NOR) gate is a special type of gate that combines an XOR gate followed by an inverter (logical NOT gate). Its primary function is to produce a "true" output (1) when the inputs are the same, and a "false" output (0) when the inputs are different. In simpler terms, the XNOR gate acts like a matcher: if both inputs are equal (either both 0 or both 1), it gives you a "true" output (1). But if the inputs are different (one 0 and the other 1), it gives a "false" output (0).

XNOR Gate Truthtable

The XNOR gate takes two inputs, A and B, which can have values of 0 (false) or 1 (true). The output of the XNOR gate represents whether the inputs are the same or different. Here's a quick explanation of the outputs:
  • If both inputs A and B are 0, the output is 1 (true) since they are the same.
  • If input A is 0 and input B is 1 (or vice versa), the output is 0 (false) because they are different.
  • If both inputs A and B are 1, the output is 1 (true) again because they are the same.
  • In summary, the XNOR gate gives a "true" output (1) when the inputs are the same (either both 0 or both 1), and it gives a "false" output (0) when the inputs are different (one 0 and the other 1).
XNOR Gate Truthtable
Input A Input B Output
0 0 1
0 1 0
1 0 0
1 1 1

Logic Gate FAQs

What is Logic Gate?

A logic gate is a fundamental building block used in digital electronics and computer science. It is an electronic circuit that performs logical operations on binary data, which consists of only two possible values: 0 or 1 (representing false or true, respectively). Logic gates take one or more binary inputs and produce a binary output based on predefined logical rules.

What are universal gates?

NAND and NOR Gates are called universal gates.

What are the types of logic gates?

There are seven types of logic gates: AND, OR, XOR, NOT, NAND, NOR, and XNOR.

What are the applications of logic gates?

Logic gates are used in digital electronics and computer systems for various applications, including circuit design, arithmetic operations, data processing, and controlling the flow of information in microprocessors and memory units. They form the foundation of all digital technologies, enabling the functioning of computers, smartphones, and various electronic devices we use daily.
Join 15 Million students on the app today!
Point IconLive & recorded classes available at ease
Point IconDashboard for progress tracking
Point IconMillions of practice questions at your fingertips
Download ButtonDownload Button
Banner Image
Banner Image
Free Learning Resources
Know about Physics Wallah
Physics Wallah is an Indian edtech platform that provides accessible & comprehensive learning experiences to students from Class 6th to postgraduate level. We also provide extensive NCERT solutions, sample paper, NEET, JEE Mains, BITSAT previous year papers & more such resources to students. Physics Wallah also caters to over 3.5 million registered students and over 78 lakh+ Youtube subscribers with 4.8 rating on its app.
We Stand Out because
We provide students with intensive courses with India’s qualified & experienced faculties & mentors. PW strives to make the learning experience comprehensive and accessible for students of all sections of society. We believe in empowering every single student who couldn't dream of a good career in engineering and medical field earlier.
Our Key Focus Areas
Physics Wallah's main focus is to make the learning experience as economical as possible for all students. With our affordable courses like Lakshya, Udaan and Arjuna and many others, we have been able to provide a platform for lakhs of aspirants. From providing Chemistry, Maths, Physics formula to giving e-books of eminent authors like RD Sharma, RS Aggarwal and Lakhmir Singh, PW focuses on every single student's need for preparation.
What Makes Us Different
Physics Wallah strives to develop a comprehensive pedagogical structure for students, where they get a state-of-the-art learning experience with study material and resources. Apart from catering students preparing for JEE Mains and NEET, PW also provides study material for each state board like Uttar Pradesh, Bihar, and others

Copyright © 2025 Physicswallah Limited All rights reserved.