Teach Yourself PIC Microcontrollers | www.electronicspk.com | 16
inverter.
In a program, logic NOT operation is performed on one byte bits. The result is
a byte with inverted bits. If byte bits are considered to be a number, inverted
value is actually
a complement of that number, i.e. The complement of a
number is what is needed to add to it to make it reach the maximal 8 bit value
(255).
EXCLUSIVE OR gate
This gate is a bit complicated comparing to other gates. It represents combination
of all previously
described gates. It is not simple to define mutual dependence of input and output, but we will anyway try to
do it. A logic one (1) appears on its output only in case the inputs have different logic states.
In a program, this operation is commonly used to compare two bytes. Subtraction may be used for the same
purpose (if the result is 0, bytes are equal). The advantage of this logic operation
is that there is no danger
Teach Yourself PIC Microcontrollers | www.electronicspk.com | 17
to subtract larger number from smaller one.
Register
A register or a memory cell is an electronic circuit which can memorize the state of one byte. In other
words, what is a byte theoretically, it is a register practically.
Chia sẻ với bạn bè của bạn: