Question

In: Computer Science

Assume that a floating-point number system has base 2, word length 32 bits, mantissa length 24...

Assume that a floating-point number system has base 2, word length 32 bits, mantissa length 24 bits, and does rounding. Assume also that the first bit is implicit. Represent the numbers 1/2, 2/3 and 3/5 as floating-point numbers in this system. (Hint: For less confusion, you might want to write out all 25 binary digits.)

Could you please me give me full procedure?

Solutions

Expert Solution

A binary single precision representation of floating point number has 3 parts:

1) Sign bit - this is a single bit to represent the sign of the number (0 for positive and 1 for negative).

2) Exponent - This is the exponent part of the fraction (eg 1.011006) here 6 is the exponent part. It can be positive to represent numbers greater than 1, or negative to represent numbers less than 1. to represent this number in binary, we add 127 to it for the negative numbers in the floating point.

Eg, to represent 6 in the exponent we add 127 = 133. So, it becomes 10000101

Or to represent -5 in the exponent we add 127 = 122. so, it becomes 01111010

3) Mantissa - After we move the decimal point to the point where only one non-zero value is to its left (eg, 110.0110 becomes 1.100110), we discard the 1 left to the decimal point and the rest becomes the mantissa.

For this exercise, we have mantissa of length 24 and the sign bit is implicitly assumed, so we will just represent the Exponent (8 bits) and the mantissa(24 bits).

1) 1/2 in fractions is 0.5

Converting to binary:

0 in binary is 0. fractional part 0.5 in binary:

0.5*2 = 1.0 (integral part: 1, fractional part is 0) we stop here.

So, 0.5 in binary is 0.1

Exponent becomes -1 as the number is less than 1. And we add 127 for the representation: 126

in binary: 1111110

Mantissa is 1.

So, 01111110 10000000000000000000000 (not including sign bit)

2) 2/3 in fractions is 0.67

In binary for the fractional part:

0.67*2 = 1.34 (integral part: 1)

0.34*2 = 0.68 (integral part: 0)

0.68*2 = 1.36 (integral part:1)

0.36*2 = 0.72 (integral part: 0)

0.72*2 = 1.44 (integral part: 1)

0.44*2 = 0.88 (integral part: 0)

0.88*2 = 1.76 (integral part: 1)

0.76*2 = 1.52 (integral part: 1)

0.52*2 = 1.04 (integral part: 1)

0.04*2 = 0.08 (integral part: 0)

....

In binary it becomes: 0.1010101110

Here, the exponent is again -1, so adding 127 to it we get 126. In binary: 01111110.

Mantissa 1010101110

Floating representation: 01111110 101010111000000000000000

3) 3/5 in fraction is 0.6

In binary the fractional part:

0.6*2 = 1.2 (integral part: 1)

0.2*2 = 0.4 (integral part: 0)

0.4*2 = 0.8 (integral part: 0)

0.8*2 = 1.6 (integral part: 1)

0.6*2 = 1.2  (integral part: 1) repeating now

So, it becomes 0.100100100..

Exponent is -1, becomes 126.

Mantissa is 100100100...

Floating rep: 01111110 100100100100100100100100


Related Solutions

Write a program that converts a given floating point binary number with a 24-bit normalized mantissa...
Write a program that converts a given floating point binary number with a 24-bit normalized mantissa and an 8-bit exponent to its decimal (i.e. base 10) equivalent. For the mantissa, use the representation that has a hidden bit, and for the exponent use a bias of 127 instead of a sign bit. Of course, you need to take care of negative numbers in the mantissa also. Use your program to answer the following questions: (a) Mantissa: 11110010 11000101 01101010, exponent:...
13. A digital computer has a memory unit with 32 bits per word. The instruction set...
13. A digital computer has a memory unit with 32 bits per word. The instruction set consists of 260 different operations. All instructions have an operation code part (opcode) and an address part (allowing for only one address). Each instruction is stored in one word of memory. a) How many bits are needed for the opcode? b) How many bits are left for the address part of the instruction? c) What is the maximum allowable size for memory? d) What...
IEEE 754 format of 32-bit floating-point is as follows. 1 8 (bits) 23 (bits) What’s stored...
IEEE 754 format of 32-bit floating-point is as follows. 1 8 (bits) 23 (bits) What’s stored in each region? What’s the bias value and how to get it? For decimal fraction: – 0.625, please represent it as given format (Note: you must show the specific procedure/stepsin order to get full credits. If you only present final result directly, you will only get half of the credits even if it is correct.).  
A formula with a positive integer (less than 32 bits) and a positive decimal (number with...
A formula with a positive integer (less than 32 bits) and a positive decimal (number with decimal points) is expressed in the median formula. Change the given median to postfix and write a program that outputs the results of the calculation. operand ::= positive integer or positive error Positive integer ::= A number expressed as less than 32 bits consisting of 0 to 9. Positive integer representation of 0, 0100, 00934, 1056, 65535 is allowed Positive decimal ::= Positive integer...
Computer Architecture 1. Define what a "word" is in computer architecture: The size (number of bits)...
Computer Architecture 1. Define what a "word" is in computer architecture: The size (number of bits) of the address The total number of bits of an instruction (e.g. 16 bits) Word and width are synonymous. A word is the contents of a memory register. 2. What is the difference between a register’s width and a register’s address? (choose all that apply - there may be more than one correct answer) They are both the same! Address is the same for...
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.
Assume that you have a 12-bit floating point number system, similar to the IEEE floating point...
Assume that you have a 12-bit floating point number system, similar to the IEEE floating point standard, with the format shown below and a bias of 7. The value of a floating point number in this system is represented as    FP = (-1)^S X 1.F X 2^(E-bias) for the floating point numbers A = 8.75 and B = -5.375. The binary representation of A is given as A = 0101 0000 1100 Show the hexidecimal representation of B.
Two numbers x and y that are not machine numbers are read into a 32-bit word-length...
Two numbers x and y that are not machine numbers are read into a 32-bit word-length computer. The machine computes to xy2. what sort of relative error can be expected? Assume no underflow or overflow
The number –11.375 (decimal) represented as a 32-bit floating-point binary number according to the IEEE 754...
The number –11.375 (decimal) represented as a 32-bit floating-point binary number according to the IEEE 754 standard is
Questions 24-32: based on the following sample data set that reports the number of boats shipped...
Questions 24-32: based on the following sample data set that reports the number of boats shipped per week by Ottertail Boats, Inc. 83, 115, 119, 120, 121, 122, 122, 126, 129, 130, 131, 132, 133, 134, 135, 135, 135, 190 24. The third quartile is a. 135 b. 134 c. 134.25 d. 135.25 25. The 40th percentile is a. 7.6 b. 122 c. 124.4 d. 126 26. The 56th percentile is a. 10.64 b. 130 c. 131 d. 130.64 27....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT