*After studying this chapter, you should be able to:*

- understand various errors and their sources
- perform precise computations
- write MATLAB
^{®}code for accurate results

Though in everyday life, numbers are almost exclusively represented using the base 10 decimal system, computers use a base 2 system, which is called binary system. An integer *N* is represented in an *n*-bit system as,

*N* = (*a*_{n−1}..*a*_{j}..*a*_{1}*a*_{0} = *a*_{n−1} × 2^{n−1} + *a*_{1} × 2^{1} + *a*_{0} × 2^{0}

where *a _{i}*′s are only 0 or 1. An example of a binary number in an 8-bits system is as follows:

*N* = (01101101)_{2} = 0 ×2^{7} + 1 × 2^{6} + 1 × 2^{5} + 0 × 2^{4} + 1 × 2^{3} + 1 × 2^{2} + 0 × 2^{1} + 1 × 2^{0}

You can determine the binary representation of integers in MATLAB by the command *dec2bin ...*

Start Free Trial

No credit card required