Answered step by step
Verified Expert Solution
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 figure
The system will also have a reset switch, a clock input, a Prayers counter, and a timer.
The user starts the system by turning SW on then off At any time turning SW on will turn off all the LEDs and show on both display digits in order to start the system all over.
After restarting the system, Display digit will count up from to in a measurable time period. Following that, Fajr prayer time has reached.
While Fajr prayer time is active, the timer will count down from to in a measurable time period. During this period of time, LEDR will be on
If the user does the required pray by switching on SW before the timer reaches then LEDR will be turned off and LEDG will be on Moreover, Display digit will increase by to count on this prayer.
On the other hand, if the user doesnt turn on SW before the prayer time ends, LEDR will stay on LEDG 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 in order to complete the religious ritual and count it for the day.
The time related to Dhuhr prayer will be seconds with the timer counts from to The other Four prayers will be given seconds each with a down count from to
At the end of the last prayer, the Prayers counter will show the total number of completed prayers for that day between and 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 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 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
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