CS 309 Exam 2 Chapter 2

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Figure 2.9 demonstrates a floating point system with a two-bit exponent with a 2-bit stored significand. The value zero is represented by ____ _________. The next positive normalized value is represented by 00 100 (i.e., 2-b x 1.00 where b is the bias).

00 000

Original bit pattern before shift is 1101 0111, what would the bit pattern be after a logical shift right?

0110 1011

What is the algorithm for using hardware to multiply (Booth's algorithm)?

1) Set a counter to n. (The size of the numbers that are being multiplied). 2) Clear the 2n-bit partial product register 3) If the right most bit of the multiplier is one- add the multiplicand to the n most-significant bits of the partial product. 4) Shift the partial product one place to the right. 5) Shift the multiplier one place to the right. 6) Decrement the counter and repeat at step c until the counter is 0 (after n-cycles). The result is in the 2n-bit partial product register.

What are three things needed to add to a basic register to make it useful?

1) parallel input 2) asynchronous clear 3) parallel input

Here is an example: (-1.5 * 10^38 +1.5 * 10^38) + 1.0 = ____ -1.5 * 10^38 + (1.5 * 10^38 + 1.0) = _____ These are the actual calculations produced by OneNote. The moral of the story - If you are doing floating Point calculations check your inputs numbers and your answers. Especially if you are using a parallel machine that dynamically assigns calculations to processors.

1, 0

Original bit pattern before shift is 1101 0111, what would the bit pattern be after a arithmetic shift left?

1010 1110

Original bit pattern before shift is 1101 0111, what would the bit pattern be after a logical shift left?

1010 1110

Original bit pattern before shift is 1101 0111, what would the bit pattern be after a circular shift left?

1010 1111

Original bit pattern before shift is 1101 0111, what would the bit pattern be after a arithmetic shift right?

1110 1011

Original bit pattern before shift is 1101 0111, what would the bit pattern be after a circular shift right?

1110 1011

Suppose an 8-bit exponent is used and all exponents are biased by 127. If a number's exponent is 0, it is stored as 0 + 127 = 127. If the exponent is -2, it is stored as -2 + 127 = ______. Example this binary number: 1010.1111 is normalized to get +1.0101111 x 2^3. The true exponent is +3, which is stored as a biased exponent of 3 + 127; that is 130(10) or 1000 0010 in binary form. The advantage of the biased representation of exponents is that the most negative exponent is represented by zero.-127 + 127 = 0 . The exponent is getting smaller, smaller and smaller as it gets closer and closer to zero. The floating-point value of zero is represented by 0.0...0 x 2^most negative exponent. In this case it is -127.

125

For 64 bits (floating point): _____-significant decimal digits Decimal Range: 10^-300 to 10^300.

16

Multiplication of two n-bit numbers needs to have ____-bits to store the results.

2n

Based on this how many floating point numbers can I represent? Sign 2 Exponent 2^8 Mantissa 2^23 Total 2^____ = 4,294,967,296

32

For 128-bits: Decimal Range: 10^-4900 to 10^4900 ____ decimal digits

34

No clock. Dependent on gate delays for everything to settle (Latches)

Asynchronous

Good trick is to shift then add until you get the desired result. This typically is much faster than _____________ _______________

Booth's Algorithm

Better behaved then Taylor series . Errors distributed more evenly. Fewer terms are required to converge the series.

Chebyshev series

____________ Floating Point Format is how floating point numbers are stored in the computer. Before calculations are performed on them they have to be unpacked. The exponent and significant are increased to fill the available space. So the 8-bit exponent may expand to 16 or 32 bit. The significant will have the leading 1 added and these 24 bits get expanded to 32 bits. When the calculations are complete the number is packed back into the format for storage.

IEEE

Why is the MSB for a shift right retained?

If this was not done the sign of the number could be changed. All of the sudden a positive number turns into a negative number. Always want to keep the sign bit the way it is for an arithmetic shift right.

How many real numbers are between 10^-45 and 10^38 ? __________. ---So it looks like we are going to have to leave a few out.

Infinite

Grabs what is on the input and stores it until the input changes. NO CLOCK. Asynchronous

Latch

___________ _________________ can then be used to better approximate values in between store values.

Linear interpretation

In C define the array for a look up table for multiplication as Multi(100, 100) of integers which covers decimal range of 0 to 99. For binary declare it 00 to FF (255) has to return a 16-bit result. ______________________ provides the result.

Multiply (a,b)

_________________ allows the highest available precision by using all significant bits. If a floating-point calculation were to yield the result: 0.110... x 2^e, the result would be normalized to give 1.10... x2^(e-1). Similarly, the result: 10.1... x 2^e would be normalized to 1.01... x 2^(e+1).

Normalization

What is the problem with using a look-up table for larger numbers?

Requires a very large amount of memory

Example: f(x) = 2x^3 + 4x^2 + 3x + 2 and determine the estimated error for when x =2 f'(x) = 6x^2 + 8x + 3 f'(2) = 6*4 + 8*2 + 3 = 43____

Rx

___________ ____________ ____________ used to calculate functions such as sqrt(x) and sin(x). Look-up tables stored in ROM have been and continue to be used to look up functions. Instead of doing a calculation all that is required is a memory access.

Taylor series expansion

Examples of how to avoid using floating point 1) _____ __________ - change the units from dollars to cents. So, $123.67 would be defined as an integer instead of a floating point. Just have to remember to change the format before it is displayed. 2) ____________- again change the units so that integer calculations can be used. For example: a) Tenths of miles - 35.4 miles store as 354. b) Thousands of miles - Assuming the least 3 significant digits are not important and would still fit in 32- bit unsigned number. So, 45698734 would become 45698. c) Little easier with the metric system since everything is already on power of 10. So instead of keeping the units in kilometers you can do it in meters.

US Currency, Distance

___________ error propagations are much smaller than the multiplication error propagations.

addition

the sign bit is preserved

arithmetic shift

Floating Point in the computer is an approximation. Floating point addition is not _______________. The order the numbers are added make a difference!

associative

Scientific notation is strictly a _____________ ____________ notation for very large or very small (magnitude) for positive and negative numbers.

base 10

The size of the ____________ changes when you go to more bits for the Floating Point number.

bias

The significand of an IEEE format floating-point number is represented in sign and magnitude form. The exponent is represented in a _____________ form, by adding a constant to the true exponent.

biased

Floating-Point is strictly a ____________(computer) representation of number.

binary

Now let's look at addition. If these two floating-point numbers were to be added by hand, we would automatically align the ___________ ____________ of A and B as follows. 10101.001 + 1100.1100 ----------- 100001.1110

binary points

In an arithmetic shift right, The MSB is copied into the MSB for a Shift Right and the LSB moves into the _________ Flag.

carry

Least Significant Bit (LSB) has a 0 shifted in for a Left Shift. The MSB moves into the ___________ Flag. Makes since - want to multiple by 2.

carry

Behavior of master-slave flip flop 1) The output may ____________ only once 2) A change in the output is triggered by the ___________ edge of the clock 3) Change may occur only during the clock's negative level

change, negative

the bit that would be lost is moved into the register.

circular shift

What shows up on the D input is what is stored in the next _____________ ______________

clock cycle

The drawback to high speed multiplication (the shift then add method) is you have to multiply by a known ____________

constant

How many Rational numbers are there? Infinite but ______________.

countable

SR (Set Reset) Latch can be implemented with _________ ____________ NORs or NANDs

cross coupled

What does the D in D flip flop stand for?

data

The number 0.0 is defined by a mantissa (F) of 0 together with the special exponential (E ) value 0 and Sign (S) of 0. The IEEE standard also allows the values ±∞, very small _________________ numbers, and various other special conditions. Overall, the standard allows approximately seven significant decimal digits and an approximate value range of 10^-45 to 10^38.

denormalized

To calculate the propagation error for a polynomial we can take the first ____________ of the function and put in the value to be calculated and multiply by the estimated error. We can do this because of Rx^2 or greater does not contribute much to the overall error calculation. Book goes into the math behind this by using the Taylor series expansion.

derivative

Shifting bits to the right one position ________________ the binary number by 2

divides

The ARM does not have a ______________ instruction at the assembly level. You have to write that yourself. The easiest algorithm is just do repeated subtraction until you get 0 or a negative number for a remainder.

division

The calculations used for _______________ _______________ with computer calculations are the same formula as for errors in physic or chemistry lab measures.

error propagation

The exponent is formatted using ____________-______ notation, with an implied base of 2. This would theoretically allow an exponent range of 2^-127 to 2^128. In actuality, the stored exponent values 0 and 255 are used to indicate special values, and the exponential range of this format is thus restricted to For 32-Bits: Binary range: 2^-126 to 2^127 Decimal range : around 10^-45 to 10^38

excess-27

A _________-_________ is a latch plus the addition of other gates to only allow transition during specific times during a clock phase.

flip-flop

Scientific notation is not the same as __________________-____________ notation.

floating point

There is a 16-bit format is extremely limited in both range and precision, but is useful for simple ___________ applications.

graphics

In a serial transfer from one register to another: Shift control has to be ___________ and at each clock pulse one bit at a time is copied from A to B. SO stands for Serial Output and SI stands for Serial Input. What does the SOa to SIa accomplish? Retains value of _________ ____.

high, Register A

The output of sequential circuits are a function of the ___________ and its current __________.

inputs, state

Additional issues can happen when you mix single and double precision numbers. Z = x + y If x and y are double precision and z is single precision. A double calculation is done but the extra precision is lost when put into a single. Taking the 64-bit answer and cramming it into a 32-bit result. This is not just a problem with floating put but also with ______________ calculations.

integer

The memory elements for sequential circuits can be ___________ (no clock) and/or ________ ___________ (clocks)

latches, flip flops

in coming bit is 0 and loose the bit being shifted out.

logical shift

Multiplication can also be done via a ________-_____ __________ like an array. Define the table in memory (Read only memory (ROM)) and use the input numbers to look up the result. Fast because only one memory reference is required.

look-up table

A binary floating-point number is represented by ________________x 2^ exponent

mantissa

Shifting bits to the left one position _________________ the binary number by 2

multiplies

These techniques (truncation, rounding to nearest, rounding to positive infinity or negative infinity, or rounding midway between two points) all produce errors (induced errors) in the final calculations. Rounding to ____________ is the preferred method because it is more accurate and gives an unbiased error. Truncation always produces a smaller result from the actual value. Rounding can produce a ____________ OR ____________ result from the actual value.

nearest, smaller, larger

Don't use _______________ numbers with Booth's algorithm

negative

The output of the master slave FF is the value that was stored in the master immediately before the _____________edge occurred.

negative

With arithmetic shift lefts, for a word of 32-bits you shift it 32 times you zero out the word. This works well for positive and negative numbers until the MSB changes from a 1 to a 0 or a 0 to a 1. Went from a _____________ number to a __________________ number or positive number to a negative number.

negative, positive

By choosing the biased exponent system we arrange that zero is represented by a zero significand and a zero exponent. So technically a floating point zero is the smallest positive number that can be represented in this notation. Have to be careful because multiplying a FP-Zero by some other number may yield a _____-_________ result. Because of the way the Mantissa is represented there is still an implied 1.

non-zero

An IEEE-754 floating-point significand is always ________________ (unless it is equal to zero) and is in the range 1.000...0 x 2^e to 1.111...1 x 2^e. A normalized number always begins with a leading 1.

normalized

However, as these numbers are held in a _______________ floating-point format the computer has the following problem of adding 1.1101001 x 2^4 + 1.1001100 x 2^3

normalized

There is a forbidden zone around zero where floating-point values can't be represented because they are not _________________. This region where the exponent is zero and the leading bit is also zero, is still used to represent valid floating-point numbers. Such numbers are unnormalized and have a lower _______________ than normalized numbers, thus providing gradual underflow.

normalized, precision

How many Real numbers are there? Infinite but _________ ___________________.

not countable

A floating-point value is stored as two components: a _______________ and the location of the _________ (In base 10 it is called the decimal) point within the number.

number, radix

D flip flops store how many bits?

one

SKIP non restoring division, if it is positive, ___________ is shifted into the least significant position of the quotient and half the division is subtracted from the partial dividend.

one

In rounding to _____________ ____________ or ______________ ____________, the nearest valid floating-point number in the direction positive infinity or negative infinity respectively is chosen.

positive infinity, negative infinity

Normalizing a significand takes full advantage of the available ________________; for example, the unnormalized 8-bit significand: has only four significant bits, whereas the normalized 8-bit significand 1.0100 011 has eight significant bits.

precision

One other thing-floating point calculations may vary between different _________________ due to the implementation details between the floating point processors.

processors

Error propagation in floating-point arithmetic: X and Y are the __________ values. X' and Y' are the values represented in the _____________. Rx and Ry are the differences between the real value and the represented values. Error values. So: X ' = X + Rx and Y' = Y + Ry Relative error calculation are Rx/X and Ry/Y. This gives a percentage of error. If we do this calculation: X * Y in reality what is calculated is: X' * Y' where X' = X + Rx and Y' = Y + Ry (X + Rx)(Y + Ry) XY + X*Ry + Y*Rx + Rx * Ry since Rx and Ry are "small" values we can ignore Rx * Ry. The error for the calculation is now: X*Ry + Y*Rx And the relative error calculation is now: ( X*Ry + Y*Rx ) / ( X * Y)

real, computer

A ________________ is a group of flip-flops which share a common clock. An n-bit register has n flip-flops. It is capable of storing n-bits of information. May have additional logic to allow for other functions.

register

In ___________ _________ ______________, the closest floating-point representation to the actual number is used.

rounding to nearest

Floating-point arithmetic lets you handle the very large and very small numbers found in ________________applications.

scientific

Move the bits stored in a register one or more positions to the right or left.

shift

Move the bits stored in a register one or more positions to the right or left. Moving to the right divides the binary number by 2. Moving to the left multiples the binary number by 2.

shift

Algorithm for multiplying by 10 (high speed multiplication)

shift left (*2) Shift left (*4) Add original value to shift result to itself (*5) Shift left *10

IEEE-754 FP in 32-bits uses the following format: S EEEEEEEE 1.MMMMMMMMMMMMMMMMMMMMMMM S-___________ in one bit E-exponent in Excess 127 format in 8 bits M - __________ leaving: 32 - 1 - 8 = 23 bits for the mantissa -implied leading 1 and decimal point. Neither are stored in the 32-bits.

sign, mantissa

The term mantissa has been replaced by _________________ to indicate the number of significant bits in a floating-point number.

significand

Consider an example using a 8-bit significand and an unbiased exponent with A = 1.0101001 x 2^4 and B = 1.1001100 x 2^3. To multiply these numbers you multiply the _____________ and ____________ the exponents; that is, A * B = 1.0101001 x 2^4 * 1.1001100 x 2^3 = 1.0101001 * 1.1001100 x 2^(3+4) = 10.00011010101100 x 2^7 Then normalize it to get = 1.000011010101100 x 2^8

significands, add

We can now add A to the denormalized B after taking the steps to denormalize the number with the ____________ exponent A = 1.1101001 x 2^4 B = +0.1100110 x 2^4 SUM: 10.1001111 x 2^4 Normalized Sum: 1.01001111 x 2^5

smaller

The computer has to carry out the following steps to equalize exponents to perform floating point addition. 1) Identify the number with the ____________ exponent. 2) Make the smaller exponent equal to the larger exponent by dividing the ______________ of the smaller number by the same factor by which its exponent was increased. 3) Add (or subtract) the significands. 4) If necessary, normalize the result (post normalization).

smaller, significand

Example of linear interpretation: Cos(30) = 0.866025403784439 Cos(35) = 0.819152044288992 Need to calculate Cos of 32. Note the Cos is not a linear function (not a straight line) but we use a straight line to get a better value. (0.8660-0.8192) / 5 = 0.0094 Value for every degree over this range from 30 to 35. 0.8660-(0.0094 * 2) = 0.8472 Cos(32) = 0.848048096156426 Not bad if all you really need is two significant digits and ___________ is more important the accuracy.

speed

Division can be performed by repeated ___________________. The loop stops when the result is less than the divisor.

subtraction

Has some sort of clock or trigger signal. (Flip-Flops)

synchronous

____-__________ ___________ are simple circuits which have lots of important applications. Makes design of circuits much simpler.

tri-state buffers

The simplest rounding mechanism is ______________ or "rounding towards zero".

truncation

Because a scientific number is defined as the product of two values, a floating-point value is not ____________; for example 10.110 x 2^4 = 1.011 x 2^5.

unique

If there are still not enough digits then you can build your own Quad^2 or Quad^4 integers as a class and create your own overloaded operators for those new classes / data types. If calculation speed and accurate representation are needed then this type of approach works well. The drawback is keeping track of the ____________, especially if there are calculations that take place. Make sure you are using compatible units. For example, you have keeping a distance in tenths of feet but to use 32 feet/second^2 to calculate the acceleration due to gravity the calculations will be off by a factor of 10.

units

Remember that there are gates delays that are involved with master slave flip flops and it will take a certain amount of time before that _________ signal or right data will arrive at the output or be stored in the register.

valid

SKIP Non-restoring division, if it is negative, _____________ is shifted into the least significant position of the quotient and half the divisor is added back to the partial dividend.

zero

When the number to be rounded is midway between two points on the floating-point continuum, IEEE rounding specifies the point whose least-significant digit is ______________ (i.e., round to even).

zero


संबंधित स्टडी सेट्स

Lower Gi, Liver, Pancreas, Biliary Tract Quiz

View Set