# Logic Gate Calculator

By Purnima Singh, PhD
Last updated: Aug 05, 2021

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.

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

The Boolean expression for the AND logic gate is `A ⋅ B = Output`, where the multiplication sign (`⋅`) refers to AND in Boolean algebra.

• 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.

The Boolean expression for the OR logic gate is `A + B = Output`, where the addition sign (`+`) is referred to as OR in Boolean algebra.

• 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.

The Boolean expression for the NOT logic gate is `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.

The Boolean expression for the NAND logic gate is

• 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.

The Boolean expression for the NOR logic gate is

• 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.

The Boolean expression for the XOR logic gate is `A ⋅ B̄ + Ā ⋅ B = Output`, or

• 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`).

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

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!

If you are more of an analog electronics person, you can check our op-amp gain 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
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.

### Drone flight time

Wondering how long your drone will hover in the air? Check out this drone flight time calculator!

### IP subnet

Given an IP address and a subnet mask, this IP subnet calculator will show you everything you need to know about the network and IP address. 