1
\$\begingroup\$

MATLAB has a function fixdt() that creates objects describing fixed-point or floating-point data type. So if we write

a = fixdt(0,16,26)

MATLAB will return

  NumericType with properties:

      DataTypeMode: 'Fixed-point: binary point scaling'
        Signedness: 'Unsigned'
        WordLength: 16
    FractionLength: 26
           IsAlias: 0
         DataScope: 'Auto'
        HeaderFile: ''
       Description: ''

My question is, is it even possible to have a fixed point data type, with fraction length exceeding the word length. Doesn't the fraction length represents the location of the binary point from LSB? I'm trying to fully understand what exactly a data type of word length 16 with fraction length 26 exactly represent. Many thanks for your inputs!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ How is it an EE question? \$\endgroup\$
    – Eugene Sh.
    Commented Apr 16, 2015 at 20:09
  • 2
    \$\begingroup\$ @EugeneSh. Fixed point math is very relevant to EE. All the PIC and AVR cores are fixed point, as well as the ARM cores under Cortex M4 and a bunch of AD Blackfin DSPs. \$\endgroup\$
    – Matt Young
    Commented Apr 16, 2015 at 20:53
  • \$\begingroup\$ Some helpful links on this from Mathworks, pointed out by Yuval Filmus at CS forums: here and here \$\endgroup\$
    – Adeel
    Commented Apr 16, 2015 at 21:06

1 Answer 1

2
\$\begingroup\$

While this is a marginally EE question since simulation of fixed-point algorithms is crucial to a lot of signal processing and control firmware development, you should be able to find this easily in the MATLAB documentation.

The representation is as follows:

\$RealWorldValue = StoredInteger \times 2^{-FractionLength}\$

If FractionLength = 26 and word length = 16 and StoredInteger = 32767, then the RealWorldValue is 0.00048826634884 (the maximum value that can be represented).

You can think of the FractionLength as an exponent, but one that is implied and not part of the variable.

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.