Omni Calculator logo

Logic Gate Calculator

Created by Purnima Singh, PhD
Reviewed by Wojciech Sas, PhD and Steven Wooding
Last updated: Jan 18, 2024


Omni's logic gate calculator allows you to determine the output of various logic gates. You can also use this logic gate calculator to generate the truth table for various logic gates.

Whether you are a DIY person or an expert in electronics, logic gates are the most basic thing you should be acquainted with.
Continue reading if you want to know what a logic gate is. We'll also discuss various types of logic gates and the operations they can perform.

First order of business - get familiar with binary conversions and bitwise operations. Our binary converter and bitwise calculator can help you in this regard.

What is a logic gate?

A logic gate is a digital circuit that acts as a gate (or switch) for the flow of information (electric signal). It either allows or stops signals, depending upon whether certain logical conditions are satisfied or not.

A logic gate can have one or more inputs, through which it accepts digital signals. The output signal depends upon whether the input signals are on/high (1) or off/low (0) and the type of logical operation performed by the gate.

Logic gates are the basic building block of every digital system, including your computer. We can find them in almost every electronic circuit, for example, microprocessors, microcontrollers, alarms, streetlights, etc.

What are the basic logic gates?

There are three basic logic gates:

  • AND gate: The AND gate gives a high (1) output only when all of its inputs are high (1). Figure 1 shows the logic symbol of the AND gate with A and B as inputs.
Logic symbol of AND gate.
Fig. 1: Logic symbol of AND gate (Source: Wikimedia.org)

The Boolean expression for the AND logic gate is A ⋅ B = Output,
where the multiplication sign () refers to AND in Boolean algebra. Learn more about this with our binary multiplication calculator.

  • OR gate: The OR gate gives a high (1) output when either of its inputs is high (1). Figure 2 shows the logic symbol of the OR gate.
Logic symbol of OR gate.
Fig. 2: Logic symbol of OR gate (Source: Wikimedia.org)

The Boolean expression for the OR logic gate is A + B = Output,
where the addition sign (+) is referred to as OR in Boolean algebra. More on this is available in our binary calculator.

  • NOT gate: The NOT gate inverts the input, i.e., if the input is high (1), the output is low (0), and vice-versa. It is a single input and single output device. Figure 3 shows the logic symbol of the NOT gate.
Logic symbol of NOT gate.
Fig. 3: Logic symbol of NOT Gate. (Source: Wikimedia.org)

The Boolean expression for the NOT logic gate is A=Output\rm{\overline{A} = Output},
where the bar sign () is NOT in Boolean algebra.

Combination of basic logic gates

We can combine the basic logic gates (AND, OR, and NOT) to get many complex gates. A few popular combinations are:

  • NAND gate: A NAND (or NOT-AND) gate is a combination of an AND gate and a NOT gate, i.e., the output is low (0) only when all of its inputs are high (1). Figure 4 shows the logic symbol of the NAND gate.
Logic symbol of NAND gate.
Fig. 4: Logic symbol of NAND Gate. (Source: Wikimedia.org)

The Boolean expression for the NAND logic gate is

AB=Output\qquad \overline{\rm{A \cdot B}} = \rm{Output}
  • NOR gate: A NOR (or NOT-OR) gate is a combination of an OR gate and a NOT gate, i.e., the output is high (1) only when both of its inputs are low (0). Figure 5 shows the logic symbol of the NOR gate.
Logic symbol of NOR gate.
Fig. 5: Logic symbol of NOR Gate (Source: Wikimedia.org)

The Boolean expression for the NOR logic gate is

A+B=Output\qquad \overline{\rm{A + B}} = \rm{Output}
  • XOR gate: A XOR (or exclusive-OR) gate results from combining OR, AND, and NOT gates. The output of an XOR logic gate is high (1) when either of the inputs is high (1). Figure 6 shows the logic symbol of the XOR gate.
Logic symbol of XOR gate.
Fig. 6: Logic symbol of XOR Gate (Source: Wikimedia.org)

The Boolean expression for the XOR logic gate is AB+AB=Output \rm{A \cdot \overline{B} + \overline{A} \cdot B = Output}, or

AB+AB=OutputorAB=Output\qquad \begin{align*} &\rm{A \cdot \overline{B} + \overline{A} \cdot B = Output}\\[0.5em] & \kern{3.5em}\rm{or}\\[0.5em] &\rm{A \oplus B = Output} \end{align*}
  • XNOR gate: The XNOR gate is a combination of an XOR gate and a NOT gate. The output of an XNOR logic gate is high (1) when both of the inputs are high (1) or when both of the inputs are low (0). For further reading on XOR logic, head to our xor calculator
Logic symbol of XNOR gate.
Fig. 7: Logic symbol of XNOR Gate (Source: Wikimedia.org)

Figure 7 shows the logic symbol of the XNOR gate. The Boolean expression corresponding to the XNOR logic gate is

AB=Output\qquad \rm{\overline{A \oplus B} = Output}

If you are interested in more complex logical operations like bit shift, we recommend checking out the bit shift calculator.

Logic gates truth tables

A truth table shows all possible input combinations and the corresponding output combinations for a logic gate. The truth table for various logic gates is shown below.

Table I: Truth table for AND gate

A

B

Output

0

0

0

0

1

0

1

0

0

1

1

1

Table II: Truth table for OR gate

A

B

Output

0

0

0

0

1

1

1

0

1

1

1

1

Table III: Truth table for NOT gate

A

Output

0

1

1

0

Table IV: Truth table for NAND gate

A

B

Output

0

0

1

0

1

1

1

0

1

1

1

0

Table V: Truth table for NOR gate

A

B

Output

0

0

1

0

1

0

1

0

0

1

1

0

Table VI: Truth table for XOR gate

A

B

Output

0

0

0

0

1

1

1

0

1

1

1

0

Table VII: Truth table for XNOR gate

A

B

Output

0

0

1

0

1

0

1

0

0

1

1

1

How to generate logic gates truth table using logic gate calculator

Let us generate a truth table for the NOT gate using the logic gate calculator.

  1. Using the drop-down menu, select NOT gate.
  2. The calculator will display the input A and the symbol of NOT gate.
  3. Using the drop-down menu, select the input A (0 or 1).
  4. You will get the corresponding output value.
  5. Play with all possible input combinations to generate corresponding outputs so that you can create your own NOT truth table.

As you can see, determining the outcome of any logic gate is a piece of cake with our calculator!

FAQ

Which logic gate is called a universal gate?

NAND and NOR logic gates are called universal gates. It is possible to create all the basic gates using a combination of NAND (or NOR) gates. For example, we can join the two inputs of a NAND logic gate to make it a one-input device, which will function as a NOT gate.
We can then use these basic gates to create a large number of complicated circuits.

Which gate is called the logical inverter gate?

A NOT gate inverts the input, hence the name logical inverter. If the input of a NOT logic gate is 1, the output is 0, and if the input is 0, the output is 1.

We recommend you check this yourself using our logic gate calculator.

How to make an AND gate from a NAND gate?

When we connect a NAND gate output into a NOT gate, it is equivalent to an AND gate. Hence, to make an AND gate from a NAND gate, follow the instructions:

  1. Take a NAND gate and join its input together. It will now function like a NOT logic gate.
  2. Take another NAND gate and connect its output to the NOT gate of step 1.
  3. Congrats! You have a combination that acts like an AND gate.

How many types of digital logic gates are there?

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

Purnima Singh, PhD
Logic GATE output
GATE
Select logic gate
Check out 32 similar tech and electronics calculators 💻
3D printing costAmdahl's lawBattery capacity… 29 more
People also viewed…

BMR - Harris-Benedict equation

Harris-Benedict calculator uses one of the three most popular BMR formulas. Knowing your BMR (basal metabolic weight) may help you make important decisions about your diet and lifestyle.

Hamming distance

How much do two messages differ? Learn with our Hamming distance calculator!

Password entropy

This password entropy calculator can compute how strong your password is.

Secretary problem (Valentine's day)

Use the dating theory calculator to enhance your chances of picking the best lifetime partner.