Understanding Automotive Electronics, Sixth Edition

Let s look at an example of how a microcomputer might be used to replace some digital logic, and along the way learn about some more microcomputer instructions.
Microcomputers can be used in place of discrete logic circuits such as AND gates.
The digital logic to be replaced in this example is a simple AND gate circuit. Now, no one would use a microcomputer to replace only an AND gate, because an AND gate costs a fraction of what a microcomputer costs. However, if the system already has a microcomputer in it, the cost of the AND gate could be eliminated by performing the logical AND function in the computer rather than with the gate. This is a perfectly legitimate application for a microcomputer and is something that microcomputers do very well. Moreover, this example well illustrates the use of a microcomputer.
Suppose there are two signals that must be ANDed together to produce a third signal. One of the input signals comes from a pressure switch located under the driver s seat of an automobile; its purpose is to indicate whether someone is occupying the seat. This signal will be called A, and it is at logical high when someone is sitting in the seat. Signal B is developed within a circuit contained in the seat belt and is at logical high when the driver s seat belt is fastened. The output of the AND gate is signal C. It will be at logical high when someone...