Fixed-point arithmetic refers to how signed or unsigned binary words are operated on. The simplicity of fixed-point arithmetic functions such as addition and subtraction allows for cost-effective hardware implementations.
Addition, subtraction, multiplication, casts, modulo and two’s complement arithmetic
Rules for Arithmetic Operations
Describes the rules that the Simulink® software follows when arithmetic operations are performed on inputs and parameters.
Nearly all microprocessors and digital signal processors support well-defined bit-shift operations for integers.
Conversions and Arithmetic Operations
Provides an example highlighting the way the data types are converted and arithmetic operations are performed on inputs and parameters in the Simulink software
Addition is the most common arithmetic operation a processor performs. When two n-bit numbers are added together, it is always possible to produce a result with n + 1 nonzero digits due to a carry from the leftmost digit.
The multiplication of an n-bit binary number with an m-bit binary number results in a product that is up to m + n bits in length for both signed and unsigned words.
The C programming language provides access to integer division only for fixed-point data types. Depending on the size of the numerator, you can obtain some of the fractional bits by performing a shift prior to the integer division.
fimath Properties Usage for Fixed-Point Arithmetic
Using fimath
objects to control the results of fixed-point
arithmetic with fi
objects.