Teach Yourself PIC Microcontrollers | www.electronicspk.com | 15
Boolean algebra. As some program instructions used by the microcontroller perform the same way as logic
gates but in form of commands, the principle of their operation will be discussed here.
AND gate
A logic gate “AND” has two or more inputs
and one output. Let
us presume that the gate
used in this case has only two inputs. A logic
one (1) will appear on its output only in case
both inputs (A AND B) are driven to logic one
(1). That’s all! Schematic symbol
of AND gate
is shown in the figure on the right.
Additionally, the table shows mutual
dependence between inputs and output.
In case the gate has more than two inputs, the
principle of operation is the same: a logic one
(1) will appear on
its output only in case all
inputs are driven to logic one (1). Any other
combination of input voltages will result in
logic zero (0) on its output.
When used in a program, logic
AND operation
is performed by the program instruction, which
will be discussed later. For the time being, it is
enough to remember
that logic AND in a
program refers to the corresponding bits of two
registers.
Chia sẻ với bạn bè của bạn: