Professional Documents
Culture Documents
(c) What causes Control and Structural hazards in pipeline CPU? How to overcome [3]
these hazards?
Q.3 (a) Write in brief the purpose of following Cortex M0 registers. [2]
LR, APSR, PRIMASK, CONTROL
(b) Explain the simple interrupt handling process of Cortex M0 with waveforms of [3]
interrupt source, pending status, processor modes/operation. Also mark various
events on waveforms.
When interrupt occurs the stacking saves few registers in stack automatically. How
would you save other registers in stack?
(c) Write Cortex M0 assembly code to enable IRQ#5 and IRQ#23 and then set priority [3]
Level 1 for IRQ#5 and Level 3 for IRQ#23
(d) Draw flow chart and write Cortex M0 assembly code to find Cube root of 32-bit [3]
number (available in R3). Store the result in R2.
(e) Write Cortex M0 assembly program with no more than 4 instructions to order bytes [2]
of 32-bit register from R0 (B3B2B1B0) to R0 (B2B1B0 B3)
OR
Assuming that current values of Cortex M0 stack pointer MSP is 0x2000FFF8.
Write the stack addresses (in hex) of locations where R12, LR (R14), PC (R15) and
xPSR will be saved when an exception/ interrupt occurs.
(f) What is the use of PSP and MSP of Cortex M0? What is the advantage using two [2]
stack pointers?
Q.4 (a) What is WIC (wake up interrupt controller)? How it helps reducing power in Cortex [2]
M0 processor?
(b) Explain the sleep mode operation achieved with WFI in Cortex M0. How Sleep-on- [2]
exit feature works?
(c) A preemptive scheduler is invoked at every 0.5 unit of time and selects a process [5]
from ready queue. Deadlines shown in table are with respect to 0 time.
Process --> P1 P2 P3
Released Time 1 3 2
Run time 3 1 2
Deadline 5.5 5 4.5
Show how processes are scheduled if it uses Least Slack Time First policy. Also
compute the waiting time of each process.
If there is a tie, it will be resolved with following criteria in that order
A process already running will be preferred
A process with earlier deadline time will be preferred.
(d) Explain the concept of process (task) and thread. What is context switching? [2]