SPRACN6 July   2019 F29H850TU , F29H859TU-Q1 , TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S , TMS320F28P550SJ , TMS320F28P559SJ-Q1 , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1

 

  1.   Fast Integer Division – A Differentiated Offering From C2000 Product Family
    1.     Trademarks
    2. 1 Introduction
    3. 2 Different Division Functions
      1. 2.1 Truncated Division or Traditional Division
      2. 2.2 Floored Division or Modulo Division
      3. 2.3 Euclidean Division
    4. 3 Intrinsic Support Through TI C2000 Compiler
      1. 3.1 Software Examples
    5. 4 Cycle Count
    6. 5 Summary
    7. 6 References

Introduction

Present day processing unit (CPU) used in real time MCUs implement a host of different functions in hardware to reduce the latency and improve the performance. Among these, division and modulo (remainder) are two complex functions to implement. To make matters hard, there are multiple definitions for division and modulo function according to the programming language and computer science literature. These different definitions provide different mathematical properties that can be beneficially employed in the application context. C28x CPU has added new instructions to enable applications to implement different division and modulo functions efficiently. By doing so, C28x CPU became the first CPU used in the MCU application space to implement these operations in hardware.

Low latency, ability to interrupt and higher efficiency are some of the important considerations when designing the instruction set architecture for the CPU of a real time MCU. The inputs from the real world which are used for processing can be of different types (unsigned, signed) and different sizes (16, 32, 64, 128, and so forth). The instruction set architecture should enable seamless processing of different combination of these values also. The new instructions used to enable integer division are interruptible, have very low latency and support different types of operations (ui32/ui32, i32/ui32, i64/i32, ui64/ui32, ui64/ui64, i64/i64, and so forth).