Need help in a Microprocessor Applications Tutorial - Printable Version +- (wL) Forums (https://war-lords.net/forum) +-- Forum: Resources (https://war-lords.net/forum/forum-31.html) +--- Forum: Programming (https://war-lords.net/forum/forum-33.html) +--- Thread: Need help in a Microprocessor Applications Tutorial (/thread-6638.html) |
Need help in a Microprocessor Applications Tutorial - Spartacus - Mar 26 2012 So, as you can tell I'm desperate at the moment. Just hoping to tap on the pool of programmers or anyone related to the field who know what this is about. I've been stuck at this question the whole day, re-reading my notes and books, googling online for help to no avail. Quote:Write a program to compute the average of the squares of 32 8-bit numbers stored in a table labeled "array". Save the average in the data memory locations 0x21-0x22.[Notice that if you store the sum of the squares using two bytes, over-flow may happen. This needs to be taken care of.] Explain your idea using pseudo code or flow chart first. Question was taken from the book "PIC Microcontroller - An introduction to software and hardware interfacing" by Han-way Huang. Some guides Found a similar question here on slide 11. http://www.engr.colostate.edu/ECE251/Lectures/Lecture10.pdf And if i'm not wrong, I have to do some "shifting to the right" method to divide the average as the sum of the squares would be a 16-bit integer.(prevent an overflow) Thanks in advance. Edit: might want to start a homework thread. I'll be glad to help anyone who needs it if it's within my capabilities. |