A basic AND gate consists of two
inputs and an output. If the two inputs
are A and B, the
output (often called Q) is “on” only if both A and B are
also “on.”
In digital electronics, the on
state is often represented by a 1 and the off state
by a 0. The relationship between
the input signals and the output signals is
often summarized in a truth
table, which is a tabulation of all possible inputs
and the resulting outputs. For
the AND gate, there are four possible
combinations of input states: A=0,
B=0; A=0, B=1; A=1, B=0; and A=1, B=1.
In the following truth table,
these are listed in the left and middle columns.
The AND gate output is listed in
the right column.
Table 1Truth Table for AND Gate
A
|
B
|
Q=A
AND B
|
0
|
0
|
0
|
0
|
1
|
0
|
1
|
0
|
0
|
1
|
1
|
1
|
In LabVIEW, you can specify a
digital logic input by toggling a Boolean
switch; a Boolean LED indicator
can indicate an output. Because the AND
gate is provided as a basic
built-in LabVIEW function, you can easily wire
two switches to the gate inputs
and an indicator LED to the output to
produce a simple VI that demonstrates the AND gate.
Figure 1 LabVIEW AND
Function Wired to I/O Terminal Boxes
Run AND gate.vi from the Chap
1.llb VI library. Push the two input buttons
and note how the output indicator changes. Verify
the above truth table.
0 comments:
Post a Comment