Question
DIGITAL DESIGN + BOOLEAN LOGIC Consider a simple electronic device that turns on a lamp whenever there is motion in a dark room. Assume that
DIGITAL DESIGN + BOOLEAN LOGIC
Consider a simple electronic device that turns on a lamp whenever there is motion in a dark room. Assume that we have a motion detector that has one output MOTION that has the value 1 when motion is detected and the value 0 otherwise. Likewise assume that we have a light detector that has one output LIGHT that has the value 1 when light is detected in the room and the value 0 when the room is dark. Finally, assume that we have an electronically controlled light with one input LAMP that turns a light on when the input has the value 1 and turns the light off when the input has the value 0. The device that we wish to build is a detector that is capable of turning on the lamp whenever someone is moving in a dark room. Given the values of the MOTION and LIGHT sensors, the detector must control the LAMP. Thus MOTION and LIGHT are the detectors primary inputs and LAMP is the devices primary output.
If the detector system was implemented as a full microprocessor, it could be controlled by a computer program. Create a high-level pseudo-code for a program capable of performing the necessary tasks. Complete the following code segment:
while (1) {
get (motion, light);
lamp = // complete this line with a Boolean expression
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started