Deanna L. answered 01/15/14
Tutor
5.0
(226)
Electrical engineering major and music lover with MIT degree
Paul,
This is similar to a traffic light project I did in a digital design class in college at MIT that took two weeks! Nevertheless, here is the way to approach this. You want to express R, G and A as functions of B and C. There's one small catch though: the way that B is defined, you'll need one more state to show when 15 yuan has been paid. Can you check the assignment again? That will help us define A. I'm just going to assume that B goes back to '00 when the correct amount of money has been paid.
At the rate it goes, here is the function:
First the light is green if there isn't a car or the meter's been paid
G=not(C) or nand(B)
The light is red if there's a car and the meter hasn't been paid
R=C and or(B)
The alarm triggers when the meter hasn't been paid and the car's left.
A=not(C) and or(B)
This is easier to draw in LaTex but that's just my two cents.
Deanna