To get a logical
zero,
connect the input of the gate to ground to have zero
(0) volts input.
To get a logical
one,
connect the input of the gate to a five (5) volts source to have five
volts at the input.
Each button controls one
switch (two buttons - two switches) so that you can control the individual
inputs to the gate.
Each time you click a
button, you toggle
the switch to the opposite position.
Question
Q1. You
have an AND gate. Both inputs are zero. What is the output?
We now have two ways of representing an AND gate, the truth table and the
circuit diagram. However, there is a third way of representing this
information - a symbolic way - that will take us toward Boolean
algebra.
Let us consider our variables, A, B and C to be algebraic variables, but
algebraic variables that can only take on two values, 0 and 1. Then
we represent the AND function symbolically in either of two ways.
C = A�B
or C = AB
Some will prefer always to insert the dot between the variables so that
the AND operation is clearly indicated. Many times, the context
will allow you just to use AB, without a dot between A and B, but if there
is a variable named AB, then confusion can
arise.
Once we introduce Boolean variables, we can rethink the concept of a truth
table. In the truth table below, if A, B and C are truth tables and
we have an AND gate with A and B as inputs and C as the output, the truth
table would look like this.
A
B
C
0
0
0
0
1
0
1
0
0
1
1
1
OR
Gates
Consider a case where a pressure can be high and a temperature can be high
Let's assume we have two sensors that measure temperature and pressure..
The first sensor has an output, T, that is 1
when a temperature in a boiler is too high, and 0
otherwise. The second sensor produces an output, P, that is 1
when the pressure is too high, and 0 otherwise.
Now, for the boiler, we have a dangerous situation when either the temperature
or the pressure is too high. It only takes one. Let's construct
a truth table for this situation. The output, D, is 1
when danger exists.
T
P
D
False
False
False
False
True
True
True
False
True
True
True
True
What we have done is defined an OR gate.
An OR gate is a gate for which the output is 1
whenever one or more of the inputs is 1. The output of an OR gate
is 0 only when all inputs are 0. Shown
below is a schematic symbol for an OR gate, together with the simulated
LEDs and input buttons so that you can explore OR gate behavior.
In terms of Boolean variables, the truth
table for an OR gate looks like this.
A
B
C
0
0
0
0
1
1
1
0
1
1
1
1
NOT
Gates (Inverters)
A third important logical element is the inverter. An inverter does
pretty much what it says. If the input is 0,
the output is 1. Conversely, if the
input is 1, the output is 0.
The symbol for an inverter is shown below. Again, you can putter
with this inverter with the simulated LEDs. X
is the input to the inverter. The output is NOT-X
represented
as ~1 or:
The
truth table for an inverter is pretty simple since there is only one input.
Call the input A, and the output C, and the truth table is:
A
C
0
1
1
0
Example
Problem
You need to control two pumps that supply two different concentrations
of reactant to a chemical process. The strong reactant is used when
pH is very far from the desired value, and the weak reactant when pH is
close to desired.
You need to ensure that only one of the two pumps runs at any time.
Each pump controller responds to standard logic signals, that is when the
input to the pump controller is 1, the pump operates, and when that input
is 0, the pump does not operate.
You have a bunch of two-input AND gates (IC chips), OR gates and Inverters,
and you need to design a logic circuit to control the pumps. You
can generate a signal that is 1 when Pump S is ON, and 0 when Pump W is
ON. Can you design the circuit?
In order to solve the problem, consider that the pump controls should receive
logical inverse signals. When one pump signal is one, the other is
zero. Given that recognition this circuit should work. Here,
if X is 1, Pump S pumps.
Notice the simple way
we can use a switch and a five volt supply to produce a single logic signal
that is ""0"" (ground) or 1
(5 volts).
NAND
Gates
There is another important kind of gate, the NAND
gate. Actually, the way to start thinking about a NAND gate is to
think of it as an AND gate with an inverter on the output. That's
shown below.
Actually, however, the symbol for a NAND
gate compresses the inverter down to a dot at the output of the NAND gate
as shown below.