Question: (a)(i) A microcontroller based on Harvard architecture executes a program that consists of 14 instructions. Each instruction takes two machine cycles to complete: fetching
(a)(i) A microcontroller based on Harvard architecture executes a program that consists of 14 instructions. Each instruction takes two machine cycles to complete: fetching the opcode and executing the instruction take 5 T-states each. If the microcontroller operates at a clock speed of 5 MHz, calculate the total time taken to execute the program. [7 marks] (ii) Calculate the total time taken by the microcontroller to execute the program if it had a Von Neumann architecture. [6 marks] (b) Write an Arduino sketch that adjusts the speed of a DC motor connected to Pin 9 based on the output voltage obtained from a potentiometer connected at analog input A0. The motor will rotate only if a switch connected to Pin 4 is ON. [12 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
