COE 538: Microprocessor Systems Lab 4 – Assignment To construct a Timer of 3 seconds marking. And to indicate the Time overflow in case of interrupt subroutine being called in the middle of the...

i Just need the given instruction with assembly language , with codewarior, also no reference needed


COE 538: Microprocessor Systems Lab 4 – Assignment To construct a Timer of 3 seconds marking. And to indicate the Time overflow in case of interrupt subroutine being called in the middle of the program. Steps to be followed: 1. To write a subroutine containing a 3 second delay program. 2. To write an interrupt subroutine which causes a small delay (any delay operation of your choice). 3. To initialize the Accumulator value to “01” and then call the timer subroutine in the main loop in order to make the value being displayed for 3 seconds on the Accumulator. 4. At end the of 3rd second, reset the Accumulator to “00”. 5. To write another subroutine called interrupt subroutine which contains a small delay. 6. Call this interrupt subroutine at 2rd second of the timer routine. 7. We can see that the timer subroutine is stopped at 2rd second, and that the program performs the interrupt operation given in the subroutine. 8. After which, the program resumes to finish the timer program and we can see that the time has exceeded 3 seconds at the end of the program. 9. In order to mark the time being exceeded at the end, Time Overflow flag is set to “01” in the end. 10. Initialize the variables required. 11. Write a subroutine for the timer program. 12. Write a subroutine for the interrupt program (small delay). 13. Write a subroutine for the Time Overflow flag condition. 14. Call all these subroutines in the Main Loop. References: Clock Cycle: A clock cycle, or simply a "cycle," is a single electronic pulse of a CPU. During each cycle, a CPU can perform a basic operation such as fetching an instruction, accessing memory, or writing data. Clock Time: Clock time (CT) is the period of the clock that synchronizes the circuits in a processor. It is the reciprocal of the clock frequency. For example, a 1 GHz processor has a cycle time of 1.0 ns and a 4 GHz processor has a cycle time of 0.25 ns. https://techterms.com/definition/cpu Clocks Per Instruction: Clocks per instruction (CPI) is an effective average. It is averaged over all of the instruction executions in a program. Instruction Count Computer architects can reduce the instruction count by adding more powerful instructions to the instruction set. The Performance Equation: The performance equation analyzes execution time as a product of three factors that are relatively independent of each other. This equation remains valid if the time units are changed on both sides of the equation. The left- hand side and the factors on the right-hand side are discussed in the following sections. The three factors are, in order, known as the instruction count (IC), clocks per instruction (CPI), and clock time (CT). CPI is computed as an effective value. Example Problem: Suppose a program (or a program task) takes 1 billion instructions to execute on a processor running at 2 GHz. Suppose also that 50% of the instructions execute in 3 clock cycles, 30% execute in 4 clock cycles, and 20% execute in 5 clock cycles. What is the execution time for the program or task? Solution: We have the instruction count: 109 instructions. The clock time can be computed quickly from the clock rate to be 0.5×10-9 seconds. So we only need to compute clocks per instruction as an effective value: Value Frequency Product 3 0.5 1.5 4 0.3 1.2 5 0.2 1.0 CPI = 3.7 Then we have Execution time = 1.0×109 × 3.7 × 0.5×10-9 sec = 1.85 sec. Code Snippet: Calculate the Execution time for your system by taking your Processor speed into consideration. Main: JSR timer_1 JSR timer_1 JSR interrupt JSR timer_1 Timer_1: PSHA; takes 2 E. clock cycles PULA; takes 3 E. clock cycles NOP ; 1 E. cycle PSHX; LDX #value; DBNE X, lablename ; 3 E cycles PULX Interrupt: delay Time_Overflow: LDAB 01
Nov 09, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here