Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 3 Estimating ISR Execution Time ( Preparation + 4 0 % Laboratory ) Assembly code is at this time mostly employed in situations, where
Task Estimating ISR Execution Time Preparation Laboratory Assembly code is at this time mostly employed in situations, where speed is very important, and very short execution time for the code is critical. This is because the code can be optimised or tuned to execute in as short a time as possible, by careful choices in instructions, and careful design of the algorithm to be used. Instances of code that are commonly written in assembly language are algorithms which are executed at very high frequencies number of times per second in operating systems, embedded code, and code for multimedia libraries or applications. In operating systems, code used in the kernel for context switching and in device drivers, often includes assembly code routines. ISRs, which are usually incorporated in a device driver, are very often written in assembly code. How can we estimate the time it takes for a fragment of assembly code to execute? As you have learned across a number of FIT lectures, the execution of an instruction takes place over several machine clock cycles. How many clock cycles depends both on the architecture of the processor core, and how the core has been designed internally. In general, the less work the instruction has to perform on its operands, the fewer clock cycles are required. If more work is performed, more clock cycles are required. Consider a RISC processor that runs at a clock frequency of GigaHertz. Each clock cycle has a duration of nanosecond: fcore Hz; tcycle fcore ; tcycle secns; A short instruction such as a copy from register to register might require clock cycle, and will take nanosecond to execute. A complex instruction such as an integer multiply between two registers might take clock cycles, or nanoseconds to execute. We assume the instruction is in cache, and all instructions are prefetched, so we do not have to count the opcode fetch cycle in the execution time.
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