Académique Documents
Professionnel Documents
Culture Documents
john
April - 16 - 2010
4 Comments
AND GATE
OR GATE
NOT GATE
NAND GATE
NOR GATE
The reason for which the computers are capable of performing complex operation is due to the
interconnection of these logic gates. Logic gates are implemented by using transistors, diodes,
relays, optics and molecules or even by several mechanical elements. Due to this reason logic
gates can also be considered as electronic circuits. The logic gates can be build up in a wide
variety forms such as large-scale integrated circuits (LSI), very large-scale integrated circuits
(VLSI) and also in small-scale integrated circuits (SSI). Here the inputs and output of all the
gates of integrated devices can be accessible and also the external connections are made
available to them just like discrete logic gates.
Inputs and outputs of logic gates are in two levels termed as HIGH and LOW, or TRUE and
FALSE, or ON and OFF, or simply 1 and 0. A table which list out the combination of input
variables and the corresponding output variables is termed as TRUTH TABLE. It explains how
the logic circuit output responds to various combinations of logic levels at the inputs. Here we
are following level logic, in which the voltage levels are represented as logic 1 and logic 0. Level
logic is of two types such as positive logic or negative logic. In the positive logic system, higher
of the two voltage levels are represented as 1 and lower of the two voltage levels are represented
as 0. But in the negative logic system, higher of the two voltage levels are represented as 0 and
lower of the two voltage levels are represented as 1. While considering the transistor-transistor
logic (TTL), the lower state is assumed to be zero volts (0V) and the higher state is considered as
five volts positive (+5V).
AND GATE
An AND gate requires two or more inputs and produce only one output. The AND gate produces
an output of logic 1 state when each of the inputs are at logic 1 state and also produces an output
of logic 0 state even if any of its inputs are at logic 0 state. The symbol for AND operation is .,
or we use no symbol for representing. If the inputs are of X and Y, then the output can be
expressed as Z=XY. The AND gate is so named because, if 0 is called false and 1 is called
true, the gate performs in the same way as the logical and operator. The AND gate is also
named as all or nothing gate. The logic symbols and truth tables of two-input and three-input
AND gates are given below.
is also called as any or all gate. It is also called as an inclusive OR gate because it consists of the
condition of both the inputs can be present. The logic symbols and truth table for two-input
and three-input OR gates are given below.
either x=0V or Y=0V or when both inputs are equal to 0V, at that time the transistor Q1 is OFF
and therefore, output voltage Z= +5V. The truth table is given below:
To know the basics of Logic Gates and their applications, click on the links below.
TAKE A LOOK : LOGIC GATES
TAKE A LOOK : HALF ADDER AND FULL ADDER
TAKE A LOOK : FLIP FLOPS
With the invention of Logic gates, we can design electronic circuits that can simply work as a
calculator to high end devices that can be even used for scientific purposes. Earlier only humans
could add and subtract numbers. But with the applications of Boolean gates like Adders,
Subtractors, Counters and so on it is possible to create almost any logic.
With this post, we are going to help you and thus understand better, the logic behind using gates.
The steps are simple and creative. But for the implementation requires a relay and a 6 volt
battery. The very first implementation of Boolean gates also included relays. But the technology
has gone far beyond that they have been replaced by sub-microscopic transistors etched onto
silicon chips. Relays consume some amount of power, and they are bigger in size. But the
transistors used these days are microscopic and are faster than relays. They also consume very
less power when compared to a relay.
But you will get a clear idea about the working by using relays. They are also practically very
simple to use. All you need to know is know the basics of gates and their truth table. Enter the
input values and take the output values.
To know more about setting up a relay, and its working take a look at this link.
TAKE A LOOK : WORKING OF RELAYS
As we know there are only two states for a Gate a HIGH state and a LOW state. In a relay,
these states will be represented by two voltages. The HIGH state is represented by 6 volts and the
LOW state to be 0 volts. A 6 volt battery is required to power up the circuit.
NOT Gate
Take a look at the picture below to get a clear idea on how a NOT Gate is implemented. From
the circuit it is clear that when you apply 6 volts to A, you get 0 volts in Q and when you apply 0
volts to A you get 6 volts in Q.
AND Gate
As an AND bit requires a minimum of 2 inputs, two relays will be needed. The figure is shown
below.
Half Adder
With the help of half adder, we can design circuits that are capable of performing simple addition
with the help of logic gates.
OUTPUTS
SUM
CARRY
From the equation it is clear that this 1-bit adder can be easily implemented with the help of
EXOR Gate for the output SUM and an AND Gate for the carry. Take a look at the
implementation below.
Full Adder
This type of adder is a little more difficult to implement than a half-adder. The main difference
between a half-adder and a full-adder is that the full-adder has three inputs and two outputs. The
first two inputs are A and B and the third input is an input carry designated as CIN. When a full
adder logic is designed we will be able to string eight of them together to create a byte-wide
adder and cascade the carry bit from one adder to the next.
The output carry is designated as COUT and the normal output is designated as S. Take a look at
the truth-table.
INPUTS
OUTPUTS
CIN
COUT S
From the above truth-table, the full adder logic can be implemented. We can see that the output S
is an EXOR between the input A and the half-adder SUM output with B and CIN inputs. We
must also note that the COUT will only be true if any of the two inputs out of the three are
HIGH.
Thus, we can implement a full adder circuit with the help of two half adder circuits. The first will
half adder will be used to add A and B to produce a partial Sum. The second half adder logic can
be used to add CIN to the Sum produced by the first half adder to get the final S output. If any of
the half adder logic produces a carry, there will be an output carry. Thus, COUT will be an OR
function of the half-adder Carry outputs. Take a look at the implementation of the full adder
circuit shown below.
This article deals with the basic flip flop circuits like S-R Flip Flop, J-K Flip Flop, D Flip
Flop, and T Flip Flop along with truth tables and their corresponding circuit symbols.
Before going to the topic it is important that you get knowledge of its basics. Click on the links
below for more information.
TAKE A LOOK : BOOLEAN LOGIC
The SET-RESET flip flop is designed with the help of two NOR gates and also two NAND
gates. These flip flops are also called S-R Latch.
The design of such a flip flop includes two inputs, called the SET [S] and RESET [R]. There are
also two outputs, Q and Q. The diagram and truth table is shown below.
From the diagram it is evident that the flip flop has mainly four states. They are
S=1, R=0Q=1, Q=0
This state is also called the SET state.
S=0, R=1Q=0, Q=1
This state is known as the RESET state.
In both the states you can see that the outputs are just compliments of each other and that the
value of Q follows the value of S.
S=0, R=0Q & Q = Remember
If both the values of S and R are switched to 0, then the circuit remembers the value of S and R
in their previous state.
S=1, R=1Q=0, Q=0 [Invalid]
This is an invalid state because the values of both Q and Q are 0. They are supposed to be
compliments of each other. Normally, this state must be avoided.
The circuit of the S-R flip flop using NAND Gate and its truth table is shown below.
Like the NOR Gate S-R flip flop, this one also has four states. They are
S=1, R=0Q=0, Q=1
This state is also called the SET state.
S=0, R=1Q=1, Q=0
This state is known as the RESET state.
In both the states you can see that the outputs are just compliments of each other and that the
value of Q follows the compliment value of S.
S=0, R=0Q=1, & Q =1 [Invalid]
If both the values of S and R are switched to 0 it is an invalid state because the values of both Q
and Q are 1. They are supposed to be compliments of each other. Normally, this state must be
avoided.
S=1, R=1Q & Q= Remember
If both the values of S and R are switched to 1, then the circuit remembers the value of S and R
in their previous state.
A clock pulse [CP] is given to the inputs of the AND Gate. When the value of the clock pulse is
0, the outputs of both the AND Gates remain 0. As soon as a pulse is given the value of CP
turns 1. This makes the values at S and R to pass through the NOR Gate flip flop. But when the
values of both S and R values turn 1, the HIGH value of CP causes both of them to turn to 0
for a short moment. As soon as the pulse is removed, the flip flop state becomes intermediate.
Thus either of the two states may be caused, and it depends on whether the set or reset input of
the flip-flop remains a 1 longer than the transition to 0 at the end of the pulse. Thus the invalid
states can be eliminated.
2. D Flip Flop
D Flip Flop
D flip flop is actually a slight modification of the above explained clocked SR flip-flop. From the
figure you can see that the D input is connected to the S input and the complement of the D input
is connected to the R input. The D input is passed on to the flip flop when the value of CP is 1.
When CP is HIGH, the flip flop moves to the SET state. If it is 0, the flip flop switches to the
CLEAR state.
To know more about the triggering of flip flop click on the link below.
TAKE A LOOK : TRIGGERING OF FLIP FLOPS
TAKE A LOOK : MASTER-SLAVE FLIP FLOP CIRCUIT
3. J-K Flip Flop
The circuit diagram and truth-table of a J-K flip flop is shown below.
A J-K flip flop can also be defined as a modification of the S-R flip flop. The only difference is
that the intermediate state is more refined and precise than that of a S-R flip flop.
The behavior of inputs J and K is same as the S and R inputs of the S-R flip flop. The letter J
stands for SET and the letter K stands for CLEAR.
When both the inputs J and K have a HIGH state, the flip-flop switch to the complement state.
So, for a value of Q = 1, it switches to Q=0 and for a value of Q = 0, it switches to Q=1.
The circuit includes two 3-input AND gates. The output Q of the flip flop is returned back as a
feedback to the input of the AND along with other inputs like K and clock pulse [CP]. So, if the
value of CP is 1, the flip flop gets a CLEAR signal and with the condition that the value of Q
was earlier 1. Similarly output Q of the flip flop is given as a feedback to the input of the AND
along with other inputs like J and clock pulse [CP]. So the output becomes SET when the value
of CP is 1 only if the value of Q was earlier 1.
The output may be repeated in transitions once they have been complimented for J=K=1 because
of the feedback connection in the JK flip-flop. This can be avoided by setting a time duration
lesser than the propagation delay through the flip-flop. The restriction on the pulse width can be
eliminated with a master-slave or edge-triggered construction.
4. T Flip Flop
This is a much simpler version of the J-K flip flop. Both the J and K inputs are connected
together and thus are also called a single input J-K flip flop. When clock pulse is given to the flip
flop, the output begins to toggle. Here also the restriction on the pulse width can be eliminated
with a master-slave or edge-triggered construction. Take a look at the circuit and truth table
below.
T Flip Flop
john
April - 20 - 2010
3 Comments
Before knowing more about the master-slave flip flop you have to know more on the basics of a
J-K flip flop and S-R flip flop. To know more about the flip flops, click on the link below.
TAKE A LOOK : FLIP FLOPS
TAKE A LOOK : TRIGGERING OF FLIP FLOPS
Master-slave flip flop is designed using two separate flip flops. Out of these, one acts as the
master and the other as a slave. The figure of a master-slave J-K flip flop is shown below.
Working
When Clk=1, the master J-K flip flop gets disabled. The Clk input of the master input will be the
opposite of the slave input. So the master flip flop output will be recognized by the slave flip flop
only when the Clk value becomes 0. Thus, when the clock pulse males a transition from 1 to 0,
the locked outputs of the master flip flop are fed through to the inputs of the slave flip-flop
making this flip flop edge or pulse-triggered. To understand better take a look at the timing
diagram illustrated below.