Sunday, July 18, 2010

Optimization techniques

To optimize the memory size of program(for microcontrollers)

    1. If you are working with 8 bit of data or no. between 0 to 255 then use char datatype.

    int j = 0;
    for ( j =  0; j<=100 ; j++);

    Here instead of int use char. It will help u in optimizing program by a bunch of byte.

    2. Use just if rather than if-else or switch or array. It saves a lot of space.

    3. Design your own algorithm for any data (in which there are options to be selected) which can be obtainded by just subtracting or adding a no. or combination rather than using switch or if-else statements.

   4. Always try to design a nice logic, because you have brain.

more to come... till then enjoy programming..

No comments:

Post a Comment

Website is being updated with new UI!

Hi E veryone , Pardon me. It took me very long to get back on managing this website. You all during some part of a time in your life, you ...