Question

In: Computer Science

Sample Problems – Floating Point Notation and Using Registers For Problems # 1 – 5 Illustrate...

Sample Problems – Floating Point Notation and Using Registers

For Problems # 1 – 5 Illustrate the value using floating point notation setting the precision of the mantissa to four (4). Truncate values as required.

  1. - 3,567

  2. 26,426

  3. .44444

  4. 32.0711

  5. .00003

For problems # 6 -10 solve the equations using binary values in signed integer register ‘R’ of size four (4). Check your work to verify if there is an “overflow error”.

  1. 2+3=?

  2. 2+(-3)=?

  3. 7+5=?

  4. -8+(-7)=?

  5. -5+(-3)=?

For problems # 11 -15 determine the decimal value of the values stored in floating-point register ‘F’. Note: The first bit is the “sign bit”, followed by the “characteristic bit” (using the excess 5 methods), then the mantissa.

  1. F: 05258 14. F: 18516

  2. F: 09987 15. F: 11101

  3. F: 02657

Solutions

Expert Solution

1. For Problems # 1 – 5 Illustrate the value using floating point notation setting the precision of the mantissa to four (4). Truncate values as required.

Move the decimal point and update the exponent accordingly. ( if decimal point moved right side then decrease exponent those many positions. if decimal point moved left side then increase the exponent)

  1. -3,567 = -3567. * 100 = -3.567 * 103

  2. 26,426 = 26426. * 100 = 2.642 * 103 (after truncating matissa to 4 places)

  3. .44444 = .4444 * 100 = 4.444 * 10-1

  4. 32.0711 = 32.0711 *100 = 3.207 * 101

  5. .00003 = 0.00003 * 100 = 3.0 * 10-5

2. For problems # 6 -10 solve the equations using binary values in signed integer register ‘R’ of size four (4). Check your work to verify if there is an “overflow error”.

Lets represent the numbers in signed 2's complement representation (in 4-bits, MSB is sign) and perform the addition (add the numbers including sign bit, disacrd any carry). If the signs of two numbers is same and the sign of the resultant is different then overflow is possible.

2+3= 0 010 + 0 011 = 0 101, no overflow

2+(-3)= 0 010 + 1 101 = 1 111 (this is in signed 2's complement form) = 1 001 (in signed magnitude form), no overflow

7+5= 0 111 + 0 101 = 1 100 , overflow

-8+(-7)= 1 000 + 1 001 = 0 001, overflow

-5+(-3)= 1 011 + 1 101 = 1 000, no overflow.

For problems # 11 -15 determine the decimal value of the values stored in floating-point register ‘F’. Note: The first bit is the “sign bit”, followed by the “characteristic bit” (using the excess 5 methods), then the mantissa.

F: 05258 :

Sign bit = 0 , number is positive

characteristic bit = 5 , to get exponent subtract 5 (as given excess 5 exponent) , which is = 5-5 =0

Hence the number = +0.258*100 = 0.258 (since matissa has decimal point at left)

F: 09987

Sign bit = 0 , number is positive

characteristic bit = 9 , to get exponent subtract 5 (as given excess 5 exponent) , which is = 9-5 =4

Hence the number = +0.987*104 = 9870

F: 02657

Sign bit = 0 , number is positive

characteristic bit = 2 , to get exponent subtract 5 (as given excess 5 exponent) , which is = 2-5 =-3

Hence the number = +0.657*10-3 = 0.000657

F: 18516

Sign bit = 1 , number is negative

characteristic bit = 8 , to get exponent subtract 5 (as given excess 5 exponent) , which is = 8-5 =3

Hence the number = -0.516*103 = -516

F: 11101

Sign bit = 1 , number is negative

characteristic bit = 1 , to get exponent subtract 5 (as given excess 5 exponent) , which is = 1-5 =-4

Hence the number = -0.101*10-4 = -0.0000101


Related Solutions

Using the simple model for representing binary floating point numbers A floating-point number is 14 bits...
Using the simple model for representing binary floating point numbers A floating-point number is 14 bits in length. The exponent field is 5 bits. The significand field is 8 bits. The bias is 15 Represent -32.5010 in the simple model.
verilog code to implement 32 bit Floating Point Adder in Verilog using IEEE 754 floating point...
verilog code to implement 32 bit Floating Point Adder in Verilog using IEEE 754 floating point representation.
Convert the following floating-point number (stored using IEEE floating-point standard 754) to a binary number in...
Convert the following floating-point number (stored using IEEE floating-point standard 754) to a binary number in non-standard form. 0100_0001_1110_0010_1000_0000_0000_0000
USING C# 1. Write a program that takes outputs a string, an integer and a floating-point...
USING C# 1. Write a program that takes outputs a string, an integer and a floating-point number separated by commas. Sample output: Bob Marley, 20, 5.2 2. 2. Write a program that asks the user for a string of letters of any size (no spaces), and finally a special character (values 33 to 47 in the Ascii table, or ‘!’ to ‘/’). Generate a random number of any size, integer or floating point, and combine those three pieces of information...
Point out and illustrate key aspects of the principal and agent problems that exist within the...
Point out and illustrate key aspects of the principal and agent problems that exist within the Islamic Financial Institution and that can result in loss of value for shareholders.
(1 Point) A sample of soils was taken by using the sand cone method. The sample...
(1 Point) A sample of soils was taken by using the sand cone method. The sample was placed inside a sealed jar and the total weight jar + sample was 3.08 lbs. The empty jar had weighted 0.75 lbs. before collecting the sample. After collecting the sample, the cone and the calibrated sand bottle were placed on the plate. The sand being used was calibrated in advance and it was determined its relative density was 2.55. The density of water...
Solve the following problems using the concepts and notation of set theory and vector spaces: What...
Solve the following problems using the concepts and notation of set theory and vector spaces: What is a Cartesian vector? What is a real vector space? Does the rational numbers fulfill the definition of a field? Define linearly dependency for any set of vectors. Assess the linearly dependency (or not) of the following vectors: u=<2,-1,1>, v=<3,-4,-2>, and w=<5,-10,-8> Define basis
Solve each of the following problems by translating the values into two’s complement notation (using patterns...
Solve each of the following problems by translating the values into two’s complement notation (using patterns of 5 bits), converting any subtraction problem to an equivalent addition problem, and performing that addition. Check your work by converting your answer to base 10 notation. (Watch out for overflow.) a. 5 + 1 b. 12 – 5 c. 5 – 11 d. 12 + 5 e. 5 – 1
Generate a sample of 1000 random floating numbers (from 0 to 1) using numpy. Then plot...
Generate a sample of 1000 random floating numbers (from 0 to 1) using numpy. Then plot it and compare with a normal distribution plot close to that region (from 0 to 1) as well. Hint: Using Seaborn module
Represent the following numbers in IEEE half-precision floating point. Indicate problems where you run into them....
Represent the following numbers in IEEE half-precision floating point. Indicate problems where you run into them. 1 -10 55595472 -π (PI) The speed of light in meters per second
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT