Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. [16 marks] The snippets of code below show Timero being used to time the execution of sections of code and the results for time

image text in transcribed
3. [16 marks] The snippets of code below show Timero being used to time the execution of sections of code and the results for time and flag. In each case determine the minimum amount of time for the code to run in Toy and seconds. Read the code carefully! Show your work. Unsigned int time, Flag set_osc_32MHz(); OpenTimer (TIMER_INT_OPE & TO_SOURCE_INT 6 TO_16BIT 6 TO_PS_1_16); TMROIE - 0; WriteTimer0(0); // code to time time - ReadTimer00); flag - TMROIE; printf("u tu, time, f1 37346 0 TO SOURCE INT 6 TO 16BIT 6 TOPS 14); unsigned int time, flag: set_OSC8MHz(); Open Timer (TIMER_INTOFF TMROIF - 0; WriteTimer (0) // code to time time = Readiner(); flag - TROIF; printf("%u&u", time, 47000 1 TO_16BIT 6 TO_PS_1_2); unsigned int time, Elag; set Osc_1MHz(); OpenTimer (TIMER_INT_OFF 6 TO_SOURCE_INT TMROIF = 0; WriteTimero (30000); // code to time time - Readinero); flag - TMROIE; printf("u tu", time, flag); 60000 1 unsigned int time, flag: setosc BMHz(); OpenTimero(TIMER_INT_OFF & TO_SOURCE_INT TMRDIF - 0; Write Timer0(0); // code to time TO_8BIT 5 TO_PS_1_4): time - ReadTimero): flag - TMROIF printf("lu tu", tine, flag); 157 1 3. [16 marks] The snippets of code below show Timero being used to time the execution of sections of code and the results for time and flag. In each case determine the minimum amount of time for the code to run in Toy and seconds. Read the code carefully! Show your work. Unsigned int time, Flag set_osc_32MHz(); OpenTimer (TIMER_INT_OPE & TO_SOURCE_INT 6 TO_16BIT 6 TO_PS_1_16); TMROIE - 0; WriteTimer0(0); // code to time time - ReadTimer00); flag - TMROIE; printf("u tu, time, f1 37346 0 TO SOURCE INT 6 TO 16BIT 6 TOPS 14); unsigned int time, flag: set_OSC8MHz(); Open Timer (TIMER_INTOFF TMROIF - 0; WriteTimer (0) // code to time time = Readiner(); flag - TROIF; printf("%u&u", time, 47000 1 TO_16BIT 6 TO_PS_1_2); unsigned int time, Elag; set Osc_1MHz(); OpenTimer (TIMER_INT_OFF 6 TO_SOURCE_INT TMROIF = 0; WriteTimero (30000); // code to time time - Readinero); flag - TMROIE; printf("u tu", time, flag); 60000 1 unsigned int time, flag: setosc BMHz(); OpenTimero(TIMER_INT_OFF & TO_SOURCE_INT TMRDIF - 0; Write Timer0(0); // code to time TO_8BIT 5 TO_PS_1_4): time - ReadTimero): flag - TMROIF printf("lu tu", tine, flag); 157 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain why income taxes reduce the size of the multiplier?

Answered: 1 week ago

Question

What is a verb?

Answered: 1 week ago

Question

Can workers be trained in ethics? How? Defend your answer.

Answered: 1 week ago