subject

Consider a dashboard display that displays "normal" when brakes in the car operate normally and "emergency" when there is a failure. The intended behavior is that once "emergency" has been displayed, "normal" will not again be displayed. That is, "emergency" remains on the display until the system is reset.
In the following code, assume that the variable display defines what is displayed. Whatever its value, that is what appears on the dashboard.

volatile static int8_t alerted;
volatile static char * display;
voidISRA() {
if(alerted == 0) {
display = "normal";
}
}
voidISRB() {
display = "emergency";
alerted = 1;
}
voidmain() {
alerted = 0;
...set up interrupts...
...enable interrupts...
...
}

Assume that ISRA is an interrupt service routine that is invoked when the brakes are applied by the driver. Assume that ISRB is invoked if a sensor indicates that the brakes are being applied at the same time that the accelerator pedal is depressed. Assume that neither ISR can interrupt itself, but that ISRB has higher priority than ISRA, and hence ISRB can interrupt ISRA, but ISRA cannot interrupt ISRB. Assume further (unrealistically) that each line of code is atomic.
(a) Does this program always exhibit the intended behavior? Explain. In the remaining parts of this problem, you will construct various models that will either demonstrate that the behavior is corrector will illustrate how it can be incorrect.
(b) Construct a determinate extended state machine modelingISRA. Assume that:
• alerted is a variable of type {0,1} ⊂ uint8 t,
• there is a pure input A that when present indicates an interrupt request for ISRA, and
• display is an output of type char*.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Which of the following has not been attributed at least in part to social media a. drug addiction b. depression c. kidnapping d. murder
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
You know the right answer?
Consider a dashboard display that displays "normal" when brakes in the car operate normally and "eme...
Questions
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Chemistry, 18.09.2020 14:01
question
Spanish, 18.09.2020 14:01
question
History, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Biology, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
World Languages, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Social Studies, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
English, 18.09.2020 14:01
question
Mathematics, 18.09.2020 14:01
question
Social Studies, 18.09.2020 14:01
Questions on the website: 13722367