Jump to content


128 bit fixed point


  • You cannot reply to this topic
2 replies to this topic

#1 rizgarmella

    Member

  • Members
  • PipPip
  • 4 posts

Posted 16 November 2008 - 02:16 PM

I need to implement arithmetic to 128 bit (fixed point) precision . I have seen many libraries and approaches, very few with the intent of going to hardware. I was wondering if there is any suggestions on the best way using impulse c to achieve this. I have no problem with a lack of higher level maths available, i can implement them myself. But i really need to know the best or at least the most sensible way of doing this.


Thank you
Rizgar Mella

#2 RalphBodenner

    Advanced Member

  • Admin
  • PipPipPip
  • 348 posts

Posted 17 November 2008 - 11:14 AM

The Impulse C compiler will generate integer arithmetic operations for any bitwidth in hardware. Simply use co_intN/co_uintN types with the usual C arithmetic operators. The compiler ships with definitions for bit-accurate types up to 64 bits, plus 128- and 256-bit types. You are free to define your own integer types, using the co_intN/co_uintN naming conventions.

To do fixed-point arithmetic with a co_uint128, you can adapt the fixed-point macros in co_math.h. These macros are currently defined for basic operations on the bitwidths that correspond to the standard C types (8, 16, 32, 64 bits), but there's no reason you can't write your own for 128-bit numbers.

Ralph Bodenner
Impulse Accelerated Technologies, Inc.

#3 rizgarmella

    Member

  • Members
  • PipPip
  • 4 posts

Posted 24 November 2008 - 12:57 AM

Thank you that was a very completely answer to my question.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users