02.10.2019 Views

UploadFile_6417

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

252 Chapter 6 IMPLEMENTATION OF DISCRETE-TIME FILTERS<br />

where each bit b i represents either a0ora1.This representation will<br />

help us to understand the advantages and disadvantages of each signed<br />

format and to develop simple MATLAB functions. We will then extend<br />

these concepts to fractional real numbers for both fixed-point and floatingpoint<br />

arithmetic.<br />

6.6.1 FIXED-POINT SIGNED INTEGER ARITHMETIC<br />

In this arithmetic, positive numbers are coded using their binary representation.<br />

For example, using 3 bits, we can represent numbers from 0 to<br />

7as<br />

0 1 2 3 4 5 6 7<br />

-+----+----+----+----+----+----+----+-<br />

000 001 010 011 100 101 110 111<br />

Thus, with 8 bits the numbers represented can be 0 to 255, with 10 bits<br />

we can represent the numbers from 0 to 1023, and with 16 bits the range<br />

covered is 0 to 65535. For negative numbers, the following three formats<br />

are used: sign-magnitude, one’s-complement, and two’s-complement.<br />

Sign-magnitude format In this format, positive numbers are represented<br />

using bits as before. However, the leftmost bit (also known as the<br />

most-significant bit or MSB) is used as the sign bit (0 is +, and 1 is −),<br />

and the remaining bits hold the absolute magnitude of the number as<br />

shown here:<br />

Sign Bit<br />

-+ Absolute Magnitude<br />

+---+----------------------+<br />

| | |<br />

+---+----------------------+<br />

This system has thus two different codes for 0, one for the positive 0, the<br />

other one for the negative 0. For example, using 3 bits, we can represent<br />

numbers from −3 to3as<br />

-3 -2 -1 -0 0 1 2 3<br />

-+----+----+----+----+----+----+----+-<br />

111 110 101 100 000 001 010 011<br />

Thus, 8 bits cover the interval [−127, +127], while 16 bits cover [−32, 767,<br />

+32, 767]. If we use B bits in the sign-magnitude format, then we can<br />

represent integers from −(2 B−1 − 1) to +(2 B−1 − 1) only.<br />

This format has two drawbacks. First, there are two representations<br />

for 0. Second, the arithmetic using sign-magnitude format requires one<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!