Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There are five prayers to track which are: Fajr, Dhuhr, Asr, Maghrib, and Isha Each prayer will have a dedicated switch, a red LED, and

There are five prayers to track which are: Fajr, Dhuhr, Asr, Maghrib, and Isha
Each prayer will have a dedicated switch, a red LED, and a green LED as assigned in figure1.
The system will also have a reset switch, a clock input, a Prayers counter, and a timer.
The user starts the system by turning SW0 on then off . At any time turning SW0 on will turn off all the LEDs and show 0 on both display digits in order to start the system all over.
After restarting the system, Display digit 0 will count up from 0 to 5 in a measurable time period. Following that, Fajr prayer time has reached.
While Fajr prayer time is active, the timer will count down from 5 to 0 in a measurable time period. During this period of time, LEDR1 will be on.
If the user does the required pray by switching on SW1 before the timer reaches 0, then LEDR1 will be turned off and LEDG1 will be on. Moreover, Display digit 1 will increase by 1 to count on this prayer.
On the other hand, if the user doesnt turn on SW1 before the prayer time ends, LEDR1 will stay on, LEDG1 will stay off, and prayers counter wont increase.
After the Fajr prayer time ends, the second prayer time will start under the same conditions applied of Fajr prayer. In fact, this procedure will be applied for the five prayers ending with Isha. During each prayer time, the user is expected to turn the related switch on before the timer reaches 0 in order to complete the religious ritual and count it for the day.
The time related to Dhuhr prayer will be 8 seconds with the timer counts from 8 to 0. The other Four prayers will be given 5 seconds each with a down count from 5 to 0.
At the end of the last prayer, the Prayers counter will show the total number of completed prayers for that day (between 0 and 5) which will also represent the number of lighted green LEDs.
Please note that turning on a switch before or after its related prayer time wont have any effect over the system.
You may need to use the clock from experiment 8 in order to calculate the required delays.
Example: a user turned on the switches related to Fajr, Dhuhr and Isha while they were active but missed Maghreb and Asr. The final outcome will show 3 on the prayers count with three green LEDs and two Red ones are lighted.
do it without any always block of if statements .. only basic logic

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions

Question

What background experience do you have?

Answered: 1 week ago