<< Chapter < Page Chapter >> Page >
1 0 0 0 0 0 0 0 0 - 0 0 0 1 1 0 1 1= 1 1 1 0 0 1 0 1

Notice that this result is one plus the one's-complement representation for -27 (modulo-2 addition). What about thesecond value of 0? That representation is

1 0 0 0 0 0 0 0 .

This value equals -128 in two's-complement notation!

1 0 0 0 0 0 0 0 0 - 1 0 0 0 0 0 0 0= 1 0 0 0 0 0 0 0

The value represented here is -128; we know it is negative, because the result has a 1 in the MSB.Two's-complement is used because it can represent one extra negative value. More importantly, if the sum of a series oftwo's-complement numbers is within the range, overflows that occur during the summation will not affect the final answer!The range of an 8-bit two's complement integer is [-128,127].

Floating point

Floating point notation is used to represent a much widerrange of numbers. The tradeoff is that the resolution is variable: it decreases as the magnitude of the number increases. In the fixed pointexamples above, the resolution was fixed at 1. It is possible to represent decimals with fixed point notation, butfor a fixed word length any increase in resolution is matched by a decrease in the range of possible values.

A floating point number, F, has two parts: a mantissa , M, and an exponent , E.

F = M * 2 E

The mantissa is a signed fraction, which has a power of two in the denominator.The exponent is a signed integer, which represents the power of two that the mantissa must be multiplied by.These signed numbers may be represented with any of the three fixed-point number formats.The IEEE has a standard for floating point numbers (IEEE 754). For a 32-bit number, the first bit is the mantissa's sign. The exponenttakes up the next 8 bits (1 for the sign, 7 for the quantity), and the mantissa is contained in the remaining 23 bits. The range of values for this numberis ( - 1 . 18 * 10 - 38 , 3 . 40 * 10 38 ).

To add two floating point numbers, the exponents must be the same. If the exponents are different, the mantissa is adjusted until the exponents match.If a very small number is added to a large one, the result may be the same as the large number! For instance, if 0 . 15600 0 * 2 30 is added to 0 . 62500 0 * 2 - 3 , the second number would be converted to 0 . 0000 0 * 2 30 before addition. Since the mantissa only holds 23 binary digits, the decimal digits 625would be lost in the conversion. In short, the second number is rounded down to zero. Formultiplication, the two exponents are added and the mantissas multiplied.

Quantization

Introduction

Quantization is the act of rounding off the value of a signal or quantity to certain discrete levels.For example, digital scales may round off weight to the nearest gram. Analog voltage signals in acontrol system may be rounded off to the nearest volt before they enter a digital controller.Generally, all numbers need to be quantized before they can be represented in a computer.

Digital images are also quantized. The gray levels in a black and white photograph must be quantizedin order to store an image in a computer. The “brightness" of thephoto at each pixel is assigned an integer value between 0 and 255 (typically), where 0 corresponds to black, and 255 to white.Since an 8-bit number can represent 256 different values, such an image is called an “8-bit grayscale" image.An image which is quantized to just 1 bit per pixel (in other words only black and white pixels) is called a halftone image. Many printers work by placing, or not placing, aspot of colorant on the paper at each point. To accommodate this, an image must be halftoned before it is printed.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Purdue digital signal processing labs (ece 438). OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10593/1.4
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?

Ask