DOC PREVIEW
U of I CS 433 - Computer System Organization

This preview shows page 1-2-3-4 out of 13 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 13 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS433U: Computer System OrganizationTypes for Signal and Media ProcessingSignal DataFixed Point TypesUnsigned Fixed Point FractionsSigned Fixed Point FractionsMultiplicationMultiplication ContinuedAccumulator TypesUnsigned Accumulator TypesAccumulators and PrecisionSaturation versus RoundingAccumulator ExtractionCS433U: Computer System OrganizationLuddy HarrisonLecture 3ASignal and Media TypesTypes for Signal and Media Processingz Signal and media processing uses most every arithmetic type you can think of:z Fixed pointz Integers (signed and unsigned)z Fractions (signed and unsigned)z Mixed integers / fractions (e.g., accumulator types)z Floating pointz Of various precisions. Even 16-bit floating point!z Complex numbers <real, imaginary>z Fixed pointz Floating pointSignal Data•Signal data often originates from A/D conversion•An analog signal is sampled at fixed time intervals (see clock below)•A stream of numbers emerges from the A/D converter•These numbers lie in a fixed range, and represent the instaneousamplitude of the signalFixed Point TypesMAGNITUDEMAGNITUDESIGNUNSIGNEDINTEGER:SIGNEDINTEGER:MAGNITUDEMAGNITUDESIGNUNSIGNEDFRACTION:SIGNEDFRACTION:0 .. 2N-1-2N-1 .. 2N-1-10 .. 1 - 2-N-1 .. 1 - 2-N+1BinarypointUnsigned Fixed Point Fractionsz “0.16” = 16 bits of fractional magnitude, binary point fully at leftz “0.32” = 32 bits of fractional magnitudez Addition and multiplication work exactly as for twos-complement integersz .1000 X .1000 = .01000000z But: discard the lower bits if the final value has same preceision as the inputs!z .1000 + .1000 = 1.0000 (overflow)z If saturating arithmetic is used, 1.0000 is rounded to the nearest reprentable value, .1111 in this case.Signed Fixed Point Fractionsz “1.15” = 1 sign bit, 15 magnitude bitsz “1.31” = 1 sign bit, 31 magnitude bitsz 0100 = ½z 1100 = -½z Most positive value = 0111 … 11z Most negative value = 1000 … 00z Multiplication produces two sign bits:z 0.100 X 0.100 = 00.010000z One is normally shifted away to yield 1.N format (shift result left by one bit)z This is usually done by the multiply instruction (or multiply-accumulate instruction)Multiplicationz Multiplication of M bits by N bits producesM + N bits.z E.g., 32 × 16 → 48z Subsequent truncation, rounding, saturation, etc., is a separate operation (conceptually)z If you keep these discrete steps straight in your head you won’t be confused about multiplication.z Note that 1.15 × 0.16 yields 1.31. No redundant sign bit in this case.z When we multiply 32 × 32 in a C program, which 32 bits are discarded from the 64-bit product?Multiplication Continuedz 32 × 32 multiply yields 64 bitsz If we are performing integer arithmetic and want a 32-bit result, we discard the upper 64 bits of the resultz Works great unless there is an overflow!z Rather disastrous if there is an undetected overflow however, because we are discarding the most significant bits of the resultz In signal processing and when working with fractional types, we discard LSBs of a productz This is much safer of courseAccumulator TypesMAGNITUDEGUARDSMAGNITUDES9.311.31MAGNITUDEGUARDSMAGNITUDESACCUMULATOR:REGISTER:•Guard bits are initialized by sign-extending the 1.31 form. I.e., guard bits = sign bit initially•1.31 values are sign-extended to 9.31 in order to add them to the accumulator•Only when 8 digits of overflow have occurred are we at risk of overflowing the accumulator.•By bounding the number of adds that are done to the accumulator we can guarantee against overflow.Unsigned Accumulator TypesMAGNITUDEGUARDMAGNITUDE8.320.32MAGNITUDEGUARDMAGNITUDEACCUMULATOR:REGISTER:0•In the case of unsigned fractions, the guard bits are initialized with zero•A 32-bit fraction is zero-extended to prepare it for addition to the accumulatorAccumulators and Precision•1.15 must be filled (in the LSBs) in order to prepare it for addition to 1.31 or 9.31 (accumulator)MAGNITUDEGUARDSMAGNITUDES9.311.15MAGNITUDEGUARDSMAGNITUDESACCUMULATOR:REGISTER:0Saturation versus Roundingz Saturation is a means of discarding MSBs (upper bits) while causing minimum damage to the valuez 1.0000 becomes .1111 (5 bit unsigned intermediate value saturated to 4 bits)z Rounding is a means of discarding LSBs (lower bits) while causing minimum damage to the valuez .00111111 becomes .0100 (8 bit unsigned fraction rounded to 4 bit unsigned fraction)z Truncation refers to the simple dropping of bits when reducing precision. This is simply an operation on the representation of a number and naturally does not have very good mathematical properties.z The underlined bits above are the bits that are discardedz Saturation and rounding solve different problemsz Saturation prevents radical errorz E.g, change of signz E.g, wrapping from MAXINT to 0z Rounding prevents smaller errors (but they can accumulate)Accumulator


View Full Document

U of I CS 433 - Computer System Organization

Download Computer System Organization
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Computer System Organization and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Computer System Organization 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?