AnsweredAssumed Answered

There is a problem about the clock cycle used by the operator when executed in the MPC5744P

Question asked by 永超 丁 on Apr 21, 2017
Latest reply on May 2, 2017 by 永超 丁

Hi:

 When I execute a for (unsigned short i = 0; i <5000; i ++) {} in the MPC5744P, It takes about  500us. When I execute a for (unsigned short i = 0; i <5000; i ++) { a = b+c;} in the MPC5744P, It takes about 1000us.The MPC5744P clock speed is 160MHz.But according to the MPC5744P reference manual, the '+' operator takes only one clock cycle, the '*' operator takes two clock cycles, Why this code takes so long time?Or what else should I use to speed up the execution?This question has bothered me for a long time and hope you can help me.

Thanks very much!

Outcomes