Digital logic gates is an electronic component which results perticular ouput after implementing its logic on the input signals. Digital logic gates are the basic building block of any digital circuits. It can have one or more than inputs and exactly one output. Inputs or outputs signals are two types of voltage – High(1) voltage and Low(0) voltage, it can also be represented as On(1) and Off(0) or True(1) and False(0). Logic gate’s inputs and output represented using Truth table. Truth table helps us to understand the behaviour of logic gates. Truth table shows all possible input combinations and resultant output on each input combinations. For example a 2-input logic gates will have four(22) input combinations – (0,0), (0,1), (1,0), (1,1). Therefore, 3-input logic gate will have eight(23) input combinations.

### Basic gates:

#### AND gate:

AND gate is an electronic circuit where output will be 1 when all its inputs are 1 otherwise 0. A 2-input AND gate can be represented as:- Truth Table:

Input-1 Input-2 Output
0 0 0
0 1 0
1 0 0
1 1 1

Using this Truth table we can easily perform AND operation on two binary numbers. If we want to perform AND operation on numbers with different base e.g. Octal, Decimal or Hex then, we can first convert the number to binary number and then do the AND operation. We can use online Any base converter tool to convert numbers to binary equivalent. For example, if we want to do AND on two decimal numbers 17 & 45 :-

```17 (decimal) = 010001 (binary) 45 (decimal) = 101101 (binary) ----------------------------------- (AND) 000001 = 1 (decimal)```

We can use online AND calculator tool to calculate AND on Octal, Decimal, Hex or Binary numbers.

#### OR gate:

OR gate is an electronic circuit where output will be 1 when any one inputs are 1 otherwise 0. A 2-input OR gate can be represented as:- Truth Table:

Input-1 Input-2 Output
0 0 0
0 1 1
1 0 1
1 1 1

Using this Truth table we can easily perform OR operation on two binary numbers. If we want to perform OR operation on numbers with different base e.g. Octal, Decimal or Hex then, we can first convert the number to binary number and then do the OR operation. We can use online Any base converter tool to convert numbers to binary equivalent. For example, if we want to do OR on two decimal numbers 18 & 46 :-

```18 (decimal) = 010010 (binary) 46 (decimal) = 101110 (binary) ----------------------------------- (OR) 111110 = 62 (decimal)```

We can use online OR calculator tool to calculate OR on Octal, Decimal, Hex or Binary numbers.

#### NOT gate:

NOT gate is a single input electronic circuit where output will be 1 when input is 0 and output will be 0 when input is 1. A NOT gate can be represented as:- Truth Table:

Input Output
0 1
1 0

Using this Truth table we can easily perform NOT operation on binary numbers. If we want to perform NOT operation on numbers with different base e.g. Octal, Decimal or Hex then, we can first convert the number to binary number and then do the NOT operation. We can use online Any base converter tool to convert numbers to binary equivalent. For example, if we want to do NOT on decimal number 46 :-

```46 (decimal) = 101110 (binary) ----------------------------------- (NOT) 010001 = 17 (decimal)```

We can use online NOT calculator tool to calculate NOT on Octal, Decimal, Hex or Binary numbers.

### Universal gates:

#### NAND gate:

NAND gate is an electronic circuit where output will be 1 when any of the inputs are 0 otherwise 1. NAND gate is just opposite of AND gate, it can be created using AND gate followed by a NOT gate. A 2-input NAND gate can be represented as:- Truth Table:

Input-1 Input-2 Output
0 0 1
0 1 1
1 0 1
1 1 0

Using this Truth table we can easily perform NAND operation on two binary numbers. If we want to perform NAND operation on numbers with different base e.g. Octal, Decimal or Hex then, we can first convert the number to binary number and then do the NAND operation. We can use online Any base converter tool to convert numbers to binary equivalent. For example, if we want to do NAND on two decimal numbers 17 & 45 :-

```17 (decimal) = 010001 (binary) 45 (decimal) = 101101 (binary) ----------------------------------- (NAND) 111110 = 62 (decimal)```

We can use online NAND calculator tool to calculate NAND on Octal, Decimal, Hex or Binary numbers.

#### NOR gate:

NOR gate is an electronic circuit where output will be 1 when both the inputs are 0 otherwise 0. NOR gate is just opposite of OR gate, it can be created using OR gate followed by a NOT gate. A 2-input NOR gate can be represented as:- Truth Table:

Input-1 Input-2 Output
0 0 1
0 1 0
1 0 0
1 1 0

Using this Truth table we can easily perform NOR operation on two binary numbers. If we want to perform NOR operation on numbers with different base e.g. Octal, Decimal or Hex then, we can first convert the number to binary number and then do the NOR operation. We can use online Any base converter tool to convert numbers to binary equivalent. For example, if we want to do NOR on two decimal numbers 17 & 45 :-

```17 (decimal) = 010001 (binary) 45 (decimal) = 101101 (binary) ----------------------------------- (NOR) 000010 = 2 (decimal)```

We can use online NOR calculator tool to calculate NOR on Octal, Decimal, Hex or Binary numbers.

#### XOR gate:

XOR gate is an electronic circuit which will give output 1 if either, but not both, of its two inputs are 1 otherwise 0. A XOR gate can be represented as:- Truth Table:

Input-1 Input-2 Output
0 0 0
0 1 1
1 0 1
1 1 0

Using this Truth table we can easily perform XOR operation on two binary numbers. If we want to perform XOR operation on numbers with different base e.g. Octal, Decimal or Hex then, we can first convert the number to binary number and then do the XOR operation. We can use online Any base converter tool to convert numbers to binary equivalent. For example, if we want to do XOR on two decimal numbers 17 & 45 :-

```17 (decimal) = 010001 (binary) 45 (decimal) = 101101 (binary) ----------------------------------- (XOR) 111100 = 60 (decimal)```

We can use online XOR calculator tool to calculate XOR on Octal, Decimal, Hex or Binary numbers.

#### XNOR gate:

XNOR gate is an electronic circuit which will give output 0 if either, but not both, of its two inputs are 1 otherwise 1. XNOR gate is just opposite of XOR gate, it can be created using XOR gate followed by a NOT gate. A XNOR gate can be represented as:- Truth Table:

Input-1 Input-2 Output
0 0 1
0 1 0
1 0 0
1 1 1

Using this Truth table we can easily perform XNOR operation on two binary numbers. If we want to perform XNOR operation on numbers with different base e.g. Octal, Decimal or Hex then, we can first convert the number to binary number and then do the XNOR operation. We can use online Any base converter tool to convert numbers to binary equivalent. For example, if we want to do XNOR on two decimal numbers 17 & 45 :-

```17 (decimal) = 010001 (binary) 45 (decimal) = 101101 (binary) ----------------------------------- (XNOR) 000011 = 3 (decimal)```

We can use online XNOR calculator tool to calculate XNOR on Octal, Decimal, Hex or Binary numbers.