Computers and Technology

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*.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:00, nika0001
When designing content as part of your content marketing strategy, what does the "think" stage represent in the "see, think, do, care" framework?
Answers: 3
image
Computers and Technology, 22.06.2019 21:00, depression4eternity
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
image
Computers and Technology, 23.06.2019 00:30, alex7078
Quick pl which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
image
Computers and Technology, 23.06.2019 07:00, MissSmartyPants88
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
Answers: 1
Do you know the correct answer?
Consider a dashboard display that displays "normal" when brakes in the car operate normally and "eme...

Questions in other subjects:

Konu
Mathematics, 11.06.2021 18:50