DSP Blockset Previous page   Next Page

Arithmetic Operations

The following sections describe the arithmetic operations used by fixed-point DSP Blockset blocks:

These sections will help you understand what data type and scaling choices will result in overflows or a loss of precision.

Modulo Arithmetic

Binary math is based on modulo arithmetic. Modulo arithmetic uses only a finite set of numbers, wrapping the results of any calculations that fall outside of the given set back into the set.

For example, the common everyday clock uses modulo 12 arithmetic. Numbers in this system may only be 1 through 12. Therefore, in the "clock" system, 9 plus 9 equals 6. This can be more easily visualized as a number circle:

Similarly, binary math may only use the numbers 0 and 1, and any arithmetic results that fall outside of this range are wrapped "around the circle" to either 0 or 1.


Previous page  Precision and Range Two's Complement Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS