Design a logic program that will track the activity for one turnstile. there wil
ID: 1814868 • Letter: D
Question
Design a logic program that will track the activity for one turnstile. there will be three inputs PHASEA, B and RESET. there will be no output. the program should be able to track 999 total guests. turnstile the two switches, phase a and b that are mounted so that as a guest passses through the turnstile the two switches will turn on in a seqwuence. the sequence depends on whether the guest is entering or exiting the park. when someone enters the gate PHASEA outputs a signal before switch PHASEB. When someone leaves PHASEB outputs a signal before PHASEA. since the two switches are located close togetherk, there wil always be some overlap in their pulse outputs unless a guest starts through a gate and then backs out. if guest backs out, it wil create a false trigger that should not be counted.
Explanation / Answer
There is a simple logic. If someone will pass through the trunstile ther will one time when both the phase are ON. (Also if a person back out there will be no such case so in a way we would not count false trigger.)
So we will count these and divide by 2 since each person will be counted twice once when he comes in and next when he leaves.
Logic is
------------------------------
count = 0
if (phaseA=1 and phaseB=1) then
{count = count+1
}
number of guests = count/2
Please rate if this helps. Thank you
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.