Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help in a Microprocessor Applications Tutorial
#1
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/Lec...ture10.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. Wink

Edit: might want to start a homework thread. I'll be glad to help anyone who needs it if it's within my capabilities.
be the best version of yourself, that's all you can do.

Users browsing this thread: 2 Guest(s)