Question

Write a documented program that will cause an output pilot light (PL) to be on when...

Write a documented program that will cause an output pilot light (PL) to be on when an on/off selector switch selector switch(SS) is in the on (Closed Position), a normally open pushbutton (PB) is depressed, and a normally open limit switch (LS) is closed.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

As it is not mentioned which language needs to be used, I am writing a C program with few assumptions

Selector switch SS = 1 when on(Closed position)

Push button PB = 1 when depressed

Limit Switch LS = 1 when closed

Pilot Light PL = 1 when ON

This is simply an logic AND operation to check if all the variables are at logic 1 i.e. ON

If you are using any board, you can check respective input pins for logic 1 instead of the scanf function used here and setting the output pin to 1

If you need code in verilog or VHDL, then use AND gate with 3 inputs

#include<stdio.h>

main()

{

int SS, PB, LS;

int PL = 0;

printf("Enter the status of Selector Switch:");

scanf("%d", &SS);

printf("Enter the status of Push Button:");

scanf("%d", &PB);

printf("Enter the status of Limit Switch:");

scanf("%d", &LS);

if(SS == 1)

{

if(PB && LS)

{PL = 1}

}

}

Add a comment
Know the answer?
Add Answer to:
Write a documented program that will cause an output pilot light (PL) to be on when...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT