a) In Assembly programming what is the functionality of the following instructions DECFSZ BTFSC MOVLW MOVWF goto

Delmar's Standard Textbook Of Electricity
7th Edition
ISBN:9781337900348
Author:Stephen L. Herman
Publisher:Stephen L. Herman
Chapter13: Magnetic Induction
Section: Chapter Questions
Problem 1PA
icon
Related questions
Question
a) In Assembly programming what is the functionality of the following instructions
DECFSZ
ВTESC
MOVLW
MOVWF
goto
b) A piece of code is required for a time critical activity. Should this be written in assembly
language or C? Explain your answer.
5 Explain the difference between the (For) and (While) loops. Highlight the main
components of the (For) loop that are required for its execution.
Consider the following C program designed to run on a PIC 18F4455.
int main(void)
2 {
1
double voltage;
double current;
double milliwatts;
double energyUsed;
double cummulativeEnergy = 0;
while (1)
{
voltage=analogRead (VOLTAGE_PIN)*voltageScaleFactor;
current=analogRead (CURRENT_PIN)*currentScaleFactor;
milliwatts=voltage*current;
energyUsed=milliWatts*0.5;
cummulativeEnergy=cummulativeEnergy+energyUsed;
10
11
12
13
14
15
_delay_ms (500);
16
}
17
a) What is the role of the symbols "{" and "}"
b) The code here is indented. Explain the importance of indentation
N m 4 n Or 00 o A m
Transcribed Image Text:a) In Assembly programming what is the functionality of the following instructions DECFSZ ВTESC MOVLW MOVWF goto b) A piece of code is required for a time critical activity. Should this be written in assembly language or C? Explain your answer. 5 Explain the difference between the (For) and (While) loops. Highlight the main components of the (For) loop that are required for its execution. Consider the following C program designed to run on a PIC 18F4455. int main(void) 2 { 1 double voltage; double current; double milliwatts; double energyUsed; double cummulativeEnergy = 0; while (1) { voltage=analogRead (VOLTAGE_PIN)*voltageScaleFactor; current=analogRead (CURRENT_PIN)*currentScaleFactor; milliwatts=voltage*current; energyUsed=milliWatts*0.5; cummulativeEnergy=cummulativeEnergy+energyUsed; 10 11 12 13 14 15 _delay_ms (500); 16 } 17 a) What is the role of the symbols "{" and "}" b) The code here is indented. Explain the importance of indentation N m 4 n Or 00 o A m
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Pulse Code Modulation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, electrical-engineering and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
Electric Motor Control
Electric Motor Control
Electrical Engineering
ISBN:
9781133702818
Author:
Herman
Publisher:
CENGAGE L