﻿ SunFp: Fixed Point Representation HTML App
16.16 Fixed Point Representation Application

Please see below for usage notes and the link to my article discussing fixed-point arithmetic.

Decimal number 1

Internal fixed-point representation: Binary representation: Click a binary digit to change to value
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Decimal number 2

Internal fixed-point representation: Binary representation:Click a binary digit to change to value
 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Operations (These operations uses both numerical values from above)
(These operations use only numerical value 1 from above)

Result Result value:-
Internal FP representation:
Hex = -
Bin = -

## Description

This site contains the representation of my 16.16 fixed point number format including some basic operations on them.
Please refer to my article Understanding and implementing fixed point numbers for an detailed discussion.

### Usage

To specify a decimal value, there are two options:

• Enter the value into a text field and press the update button or press 'Enter' inside the text field.
• Click a binary digit of the number to toggle it between 0 and 1.

After a decimal value is updated, the GUI updates automatically the other representations (like the hexadecimal one).

Then you can perform the basic operations Add, Sub, Mul and Div in fixed-point arithmetic on both values or operations Floor, Ceil and Round in fixed-point arithemtic on the first operand solely.
The result is then displayed below.

NOTE

Because of the 16.16 format, the decimal values shall be in range [-32768, 32.767]. This applies also to the result value - all other values will not give valid results! (E.g. the result of 20000 * 4 will be out of range, although both input values are valid.)

### History

2017/04/18: Initial release.