Introduction of gates:
AND GATE:
The AND gate is an electronic circuit which gives a high output only if all its inputs are high. The AND operation is represented by a dot (.) sign.
![Logic Gates](https://static.javatpoint.com/tutorial/coa/images/logic-gates.png)
OR GATE:
The OR gate is an electronic circuit which gives a high output if one or more of its inputs are high. The operation performed by an OR gate is represented by a plus (+) sign.
![Logic Gates](https://static.javatpoint.com/tutorial/coa/images/logic-gates2.png)
NOT GATE:
The NOT gate is an electronic circuit which produces an inverted version of the input at its output. It is also known as an Inverter.
![](https://pramodhmyjavanotes.wordpress.com/wp-content/uploads/2021/10/image-1.png?w=300)
NAND GATE:
The NOT-AND (NAND) gate which is equal to an AND gate followed by a NOT gate. The NAND gate gives a high output if any of the inputs are low. The NAND gate is represented by a AND gate with a small circle on the output. The small circle represents inversion.13.7KWoman Screams Excitedly When She Opens Her Acceptance Application With Her Family
![Logic Gates](https://static.javatpoint.com/tutorial/coa/images/logic-gates3.png)
NOR GATE:
The NOT-OR (NOR) gate which is equal to an OR gate followed by a NOT gate. The NOR gate gives a low output if any of the inputs are high. The NOR gate is represented by an OR gate with a small circle on the output. The small circle represents inversion.
![Logic Gates](https://static.javatpoint.com/tutorial/coa/images/logic-gates4.png)
Exclusive-OR/ XOR GATE:
The ‘Exclusive-OR’ gate is a circuit which will give a high output if one of its inputs is high but not both of them. The XOR operation is represented by an encircled plus sign.
![Logic Gates](https://static.javatpoint.com/tutorial/coa/images/logic-gates5.png)
EXCLUSIVE-NOR/Equivalence GATE:
The ‘Exclusive-NOR’ gate is a circuit that does the inverse operation to the XOR gate. It will give a low output if one of its inputs is high but not both of them. The small circle represents inversion.
![Logic Gates](https://static.javatpoint.com/tutorial/coa/images/logic-gates6.png)
logic gates Symbols in java:
boolean a, b;
Operation | Meaning | Note |
---|---|---|
a && b | logical AND | short-circuiting |
a || b | logical OR | short-circuiting |
a & b | boolean logical AND | not short-circuiting |
a | b | boolean logical OR | not short-circuiting |
a ^ b | boolean logical exclusive OR | |
!a | logical NOT |