This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Hardware bit reversal for MSP430 MPY32 unit.

Other Parts Discussed in Thread: CC3200, TMS320C5535

Hi,

I want to have fast hardware division in ASM, but MPY32 unit is lacking bit-reversal functionality. Not all devices have LEA unit, so I wonder why bit-reversal was not implemented in MPY32.

Thanks,
Alexey

  • Alexey,
    There are a number of contributing factors that go into deciding which features go into a peripheral. This type of feedback regarding features is quite valuable and I appreciate the input. I will pass this along to the design team. Is there a certain requirement or goal that you are trying to achieve (code size, speed, etc) that requires the bit-reversal?

    Thanks and Regards,
    Chris
  • Chris Sterzik said:
    Is there a certain requirement or goal that you are trying to achieve (code size, speed, etc) that requires the bit-reversal?

    Chris,

    The MSP family devices have specific features to achieve lowest power consumption possible. This also includes lower working frequencies, lower latencies by eliminating RTOSs, lowest length of algorithms to solve the same mathematical problems, lowest memory footprint and so on. So it is natural way to go to assembly language to fit them all. And good hardware support is essential to achieve this. MSP432 with ARM Cortex M4F and MSP430 with LEA have them all. So adding bit-reversal for MPY32 is less important than adding buffered parallel interface peripheral, for example. The last one can get fast transmission support for low resolution color cameras and displays.

    Thanks,

    Alexey

  • PS: I thought again and solved that to have a parallel buffer interface in MCU is impractical, but that is a good practice to implement multi-frame buffer in digital camera sensor and two-frames memory in display device. I hope will be available on a market soon ultra-low power 0.3 MP color cameras and displays (in a few mA power consumption or even less).

  • Alexey Bagaev said:
    I thought again and solved that to have a parallel buffer interface in MCU is impractical

    The CC3200 Cortex-M4 based MCU does have a 8-bit parallel Camera Interface.

  • I know. CC3200 consumes significantly more power that FRAM MCUs or MSP432, but using generally available ports as 8-16-24-32 parallel input-output port is not impossible, the only thing is problematic - the integrity of real-time data transfers because of lacking intermediate buffer.

  • I think of using TMS320C5535 for camera module because it has enough performance even for MPEG-4 encoder/decoder and camera interface, but this platform is too complicated to me.

  • I'm just curious, why do you want a bit reverse feature to implement a division? What kind of division are we talking about, integer division?

        -- Anders Lindgren, IAR Systems

  • Anders,

    I remember that I posted a sci-fi scene where people use their own body temperature as a source for terminal and I commented that such science fiction is not fiction any more because of currently available ULP electronics, community judged this as a hype. Did they do this because they didn't know about it or because they didn't understand it or maybe they wanted to present such products first to become leaders to market?
    We are talking definitely not about integer division. I know that bit reversal is used primarily for FFT, as well as MAC (multiply-accumulate) for FFT. But there is mathematical rule for division A/B = (A)*(1/B). If we can convert in hardware B to 1/B in one cycle the division can be done using fused multiplication for fixed point math without losing bit precision.
    Is this become clearer?

    Alexey

  • Yes, much clearer. However, I would say that the function you're after is not bit reversal but the inverse function.

    If B is constant, this transformation can be done at compile time. In fact, the IAR compiler do this. For example "u16 / 100 is converted" to "((((unsigned long)u16) * 41943) + 41943) >> 22" which is transformed to the following code sequence:

    MOV.W #0xa3d7, R14
    MOV.W #0x0, R15
    PUSH.W SR
    DINT
    NOP
    MOV.W R12, &__iar_HWMUL // MPY
    MOV.W R14, &__iar_HWMUL + 8 // OP2
    ADD.W &__iar_HWMUL + 10, R14 // RESLO
    ADDC.W &__iar_HWMUL + 12, R15 // RESHI
    NOP
    POP.W SR
    MOV.W R15, R12
    RRUM.W #0x4, R12
    RRUM.W #0x2, R12

    -- Anders Lindgren, IAR Systems, Author of the IAR compiler for MSP430
  • While it is not really helpful for the chosen architecture - the Cortex M3/M4 (i.e. the MSP432) has a "rev" instruction that does exactly that ...

  • To be more precise the command is actually "RBIT". But MSP432 has full range of dividers implemented in hardware.

**Attention** This is a public forum