User`s guide

Table Of Contents
Fixed-Point Numbers
2-5
in this notation. This is (1 sign bit) + (m = 0 integer bits) + (n = 15 fractional
bits) = 16 bits total in the data type. In Q format notation the m = 0 is often
implied, as in
Q.15
In the Fixed-Point Blockset, this data type is expressed as
sfrac16
or
sfix16_En15
In the Filter Design Toolbox, this data type is expressed as
[16 15]
Example — Q1.30
Multiplying two Q.15 numbers yields a product that is a signed 32-bit data type
with n = 30 bits to the right of the binary point. One bit is the designated sign
bit, thereby forcing m to be 1:
m+n+1 = 1+30+1 = 32 bits total
Therefore this number is expressed as
Q1.30
In the Fixed-Point Blockset, this data type is expressed as
sfix32_En30
In the Filter Design Toolbox, this data type is expressed as
[32 30]
Example — Q-2.17
Consider a signed 16-bit number with a scaling of 2
(-17)
. This requires n = 17
bits to the right of the binary point, meaning that the most significant bit is
a sign-extended bit.
Sign extension fills additional bits with the value of the MSB. For example,
consider a 4-bit two's complement number 1011. When this number is extended