Determining Computational Requirements

Discussion in 'Embedded Systems and Microcontrollers' started by Management, Dec 12, 2013.

  1. Management

    Thread Starter Active Member

    Sep 18, 2007
    306
    0
    What is the most effective means to determining computational requirements for a given hardware/application, e.g. 400MHz, 1GHz, 2.5GHz, etc?

    Any general rule of thumbs when analyzing hardware and looking at ones application? Thanks!
     
  2. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    Depends a lot on the application and the specific processor. E.g. does your application do a lot of floating point operations and does the processor have a floating point unit.
     
  3. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    And it depends even more on how good the person writing the code is. ;)
     
  4. Management

    Thread Starter Active Member

    Sep 18, 2007
    306
    0
    Valid point.
     
  5. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    It depends how much processing is to be done and how fast it needs to be.
    I have done loads of projects using 4MHz PIC microcontrollers and its amazing how much you can get them to do.
     
  6. John P

    AAC Fanatic!

    Oct 14, 2008
    1,632
    224
    As Turing proved--before there really was such a thing as a computer--any processor can compute any algorithm, given enough memory. But how fast do you want it done?

    You could run the program on your choice of processor (assuming you can cram it in there) and see how long it takes, and decide if that's satisfactory. Actually that's a good initial test: can you compile the program so it fits in the processor's memory? If not, stepping up to a more powerful processor is pretty much compulsory.
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    I wonder what all those numbers could mean.
     
  8. Potato Pudding

    Well-Known Member

    Jun 11, 2010
    684
    92
    Strictly speaking this is why a CompSci/Engineer student would need to learn combinatorial mathematics. If you think you have never heard of it before you are probably wrong. Multiplication is the simplest form of combinatorics and I expect you have heard of that. But then you get into variable or angular terms. So X*X and X*Y are square and rectangular data structures. X*X*X is cubic. What is the dimensional formula for a triangular or pyramidal data structure? A globe? You learn about permutations and combinations. You do a whole lot of factorial math!

    Classically you learn by talking about how cards work. So dealing 5 cards from a 52 card deck you have 52*51*50*49*48 but that includes many different irrelevant orders in which possible hands could be dealt so divide by 5*4*3*2*1 to eliminate the variations of which card is dealt first second etc.

    You will learn that many combinations of similar types can be solved with the formula, C(S,R) = S!/(R!*(S-R)!) Where Combinations C for Set of Size S with Rendered subset R, are described in the formula.

    What you are asking is how would you count many computations are needed to perform different tasks. A typical example is sorting data. Then you want to fit that into a time window and determine what the processing power requirements are.

    That probably doesn't clear anything up.
     
  9. Management

    Thread Starter Active Member

    Sep 18, 2007
    306
    0
    So lets use a process that will run on a single CPU.

    A set of methods will need to be run in a particular order and every 100ms. Before they run, data is taken from a data registry and after they run data is written to a data registry. So it appears this would only require a 10-20Hz CPU, correct? Can't be that simple.

    So based on what you say (and others), it will depend on following (1) how efficient are the algorithms (2) how many methods/algorithms (3) what type of math is being performed.

    At a high level, it appears that one would have to develop these methods/algorithms on a faster PC and then baseline the needed computation. Is there guidance on how the Math dictates the computation power needed?

    Please feel free to poke through the above or ask questions. Appreciate the help.
     
  10. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    If you just need to do some processing every 100mS (10 times a second) and load and store some data with a data table etc that sounds like a very simple application.

    A cheap 10 MHz PIC 18 using the HSPLL setting can do 10 million instructions per second, so that is a million instructions per 100mS "event".

    So now it comes down to;
    1. how much data do you need to load/store for each event?
    2. how much processing do you need to do for each event?
     
Loading...