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 22:00
What is the name of the option in most presentation applications with which you can modify slide elements? 1. the option enables you to modify a slide element in most presentation applications.
Answers: 3
question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
question
Computers and Technology, 25.06.2019 01:20
Jason typically uses the internet to buy various items. it the total cost of all of the items ordered, at one time, is $250 or more, then the shipping and handling is free, otherwise the shipping and handling is $15 per item. design an algorithm that prompts jason to enter the number of items ordered and the price of each item. (remember cost = number of items order times price) the algorithm then outputs the total billing amount including shipping and handling. your algorithm must use a loop (repetition structure) to get the number and price of each item. write this in algorithm format not program code format.
Answers: 2
You know the right answer?
Consider a dashboard display that displays "normal" when brakes in the car operate normally and "eme...
Questions
question
Mathematics, 27.03.2020 22:49
question
Mathematics, 27.03.2020 22:49
question
Mathematics, 27.03.2020 22:49
Questions on the website: 13722367