ARh Sir (Logic Gate)
ARh Sir (Logic Gate)
Boolean Algebra
Boolean algebra is a type of logical algebra in which symbols represent logic
levels.
The digits(or symbols) 1 and 0 are related to the logic levels in this algebra; in
electrical circuits, logic 1 will represent a closed switch, a high voltage, or a
device’s “on” state. An open switch, low voltage, or “off” state of the device will
be represented by logic 0.
At any one time, a digital device will be in one of these two binary situations. A
light bulb can be used to demonstrate the operation of a logic gate. When logic
0 is supplied to the switch, it is turned off, and the bulb does not light up. The
switch is in an ON state when logic 1 is applied, and the bulb would light up. In
integrated circuits (IC), logic gates are widely employed.
Truth Table: The outputs for all conceivable combinations of inputs that may be
applied to a logic gate or circuit are listed in a truth table. When we enter values
into a truth table, we usually express them as 1 or 0, with 1 denoting True logic
and 0 denoting False logic.
Input Output
A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1
Symbol of AND gate
Therefore, in And gate, the output is high when all the inputs are high.
OR Gate
Two or more inputs and one output can be used in an OR gate.
1. The logic of this gate is that if at least one of the inputs is 1, the output
will be 1.
2. The OR gate’s output will be given by the following mathematical
procedure if there are two inputs A and B: Y=A+B
Input Output
A B A OR B
0 0 0
0 1 1
1 0 1
1 1 1
Symbol of OR gate
Therefore, in the OR gate, the output is high when any of the inputs is high.
NOT Gate
The NOT gate is a basic one-input, one-output gate.
1. When the input is 1, the output is 0, and vice versa. A NOT gate is
sometimes called an inverter because of its feature.
2. If there is only one input A, the output may be calculated using the
Boolean equation Y=A’.
Input Output
A Not A
0 1
1 0
A NOT gate, as its truth table shows, reverses the input signal.
Input Output
A B A NOR B
0 0 1
0 1 0
1 0 0
1 1 0
By comparing the truth tables, we can observe that the outputs of the NOR gate
are the polar opposite of those of an OR gate. The NOR gate is sometimes
known as a universal gate since it may be used to implement the OR, AND, and
NOT gates.
NAND Gate
A NAND gate, sometimes known as a ‘NOT-AND’ gate, is essentially a Not gate
followed by an AND gate.
1. This gate’s output is 0 only if none of the inputs is 0. Alternatively,
when all of the inputs are not high and at least one is low, the output
is high.
2. If there are two inputs A and B, the Boolean expression for the NAND
gate is Y=(A.B)’
Input Output
A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0
By comparing their truth tables, we can observe that their outputs are the polar
opposite of an AND gate. The NAND gate is known as a universal gate because
it may be used to implement the AND, OR, and NOT gates.
Input Output
A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0
Its outputs are based on OR gate logic, as we can see from the truth table.
XNOR Gate
The Exclusive-NOR or ‘EX-NOR’ gate is a digital logic gate that accepts more
than two inputs but only outputs one.
1. If both inputs are ‘High,’ the output of the XNOR Gate is ‘High.’ If both
inputs are ‘Low,’ the output is ‘High.’ If one of the inputs is ‘Low,’ the
output is ‘Low.’
2. If there are two inputs A and B, then the XNOR gate’s Boolean equation
is: Y=A.B+A’B’.
Input Output
A B A XNOR B
0 0 1
0 1 0
1 0 0
1 1 1
The truth table shows that its outputs are based on NOR gate logic.
Suppose in an industrial plant if one or more than one parameter exceeds the
safe value, some protective measure is needed to be done. In that case OR gate
is used. We are going to show this with the help of a diagram.
With the help of these gates parity check operation can be also performed. The
diagrams below show even and odd parity check.
Figure (a) shows the parity check using Ex-OR gates and the figure (b) shows
the parity check using Ex-NOR gates.
The above figure shows the most fundamental circuit made of ring
configuration to generate square wave oscillator. The frequency of this type
generator is given by
DownloadFavorite
"The power of the quantum computer, meanwhile, lies in its much richer
repertoire of states. A quantum computer also has bits — but instead of
0 and 1, its quantum bits, or qubits, can represent a 0, 1, or linear
combination of both ..."
Moreover we will create several quantum gates and we will learn how
to use an universal and reversible quantum gate, the Toffoli gate, to
create in a easy way the OR, AND, NOR and NAND quantum gates to
compute any arbitrary no reversible classsical boolean functions.
In the image you can see a circuit with one qubit (q0) initialize to the
ground state and its Q-sphere.
As you can see the probability our circuit was in the ground state is
100%
The simplest gate is the NOT gate: it flips the 0 to a 1, or vice versa
After the execution of this gate, the qubit 1, initialized to the state |0>,
will have the same value as qubit 0
Quantum logic gates are reversible, unlike many classical logic gates.
Some universal classical logic gates, such as the Toffoli gate, provide
reversibility and can be directly mapped onto quantum logic gates.
The Toffoli gate has 3-qubits inputs and outputs.
INPUTS OUTPUTS
q0 q1 q2 q0 q1 q2
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
1 1 0 1 1 1
1 1 1 1 1 0
The inputs in the image are red colored and the outputs are green
colored.
Go to the composer and proof how the outputs change when you
change the inputs
INPUTS OUTPUTS
q0 q1 q2 q0 q1 q2
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 0 1
1 1 0 1 1 1
1 1 1 1 1 0
If you pay attention, the inputs q0 and q1 (red) are all the possibles
values for two classical bits and the output q2 (blue) implements the
NAND gate. The input q2 (red) always is 1 and the ouputs q0 and q1
(blue) replicate the inputs values.
In the circuit in the image you can see the qubit q2 initialized to the
ground state and after that a NOT gate to flip its state to |1>.
To implement the AND gate just only apply a NOT gate to the qubit
q2.
In the circuit:
• q0 is always |1>
• The circuit implement1 OR (q1,q2) and the result is present in q3
• In the image the gate is showing OR (1, 0) = 1
To implement the NOR gate just only apply a NOT gate to the qubit q3
In the circuit:
• q0 is always |1>
• The gate implement XOR (q1,q2) and the result is present in q3
• In the image the gate is showing XOR (1, 1) = 0
In the circuit:
• q3 is always |1>
• The circuit implements f (q0,q1,q4) and the result is present in q5
• In the image the gate is showing f (1, 1, 0) = 1
But the real power of a quantum computer are the superposition and
the entanglement.