Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A fixed point library with functions that manipulate 8.24 fixed point numbers. Other bases to be added.
C++ C
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app_example_fixed_point
app_example_uint64
app_test_against_double
doc
module_lib_fixed_8_24
module_lib_uint_32
module_lib_uint_64
.cproject
.gitignore
.project
LICENSE.txt
Makefile
README.rst

README.rst

Fixed point library

Version: unreleased
Status: 32-bit 8.24 feature complete.
Description: Fixed point library
Maintainer: https://github.com/henkmuller

This is a library of functions that implement standard mathematical functions in fixed point. One group of functions use a "8.24" fixed point format with 24 bits behind the binary point, and 8 bits before the binary point. Numbers are represented in 2's complement. Another group works on unsigned integers

More details to follow in the doc directory.

Key Features

  • 8.24 signed fixed point:
    • basic functions: mul, div, sqrt
    • emulation of manipulation of exponent and mantissa: ldexp, frexp
    • trigonometric functions: sin, cos
    • exponential functions: exp, log, sinh, cosh
    • test harness that checks on precision against double precision C.
  • 32.0 unsigned fiex point:
    • sqrt

To Do

  • Get size and speed into test harness.
  • Make 64 bit version, probably 16.48 (blocked by lack of long long in XC)
  • Run minimiser over errors in order to improve coefficients for our domain.
  • Add other mathematical functions (atan2, errf etc)
  • Add optional check on overflows (with a compile time flag for code that has size constraints)
  • Add optional check on domain errors, eg. sqrt(-1)

Firmware Overview

8.24

A collection of functions, all stored in a single module. The function names are suffixed with f8_24 to denote that these are single precision fixed point functions. There are some obvious dependencies, mostly on ldexp and frexp.

Two extra functions, mulf8_24 and divf8_24 perform multiplication and division on fixed point numbers.

32.0

A single function to compute sqrt

Known Issues

none

Required Repositories

  • xcommon git@github.com:xmos/xcommon.git

Support

Issues may be submitted via the Issues tab in this github repo. Response to any issues submitted as at the discretion of the maintainer for this line.

Something went wrong with that request. Please try again.