SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Linda Null ,julia Lobur
Chapter:
Data Representation In Computer Systems
Exercise:
Exercises
Question:18 | ISBN:9780763704445 | Edition: 3

Question

18. If the floating-point number storage on a certain system has a sign bit, a 3-bit exponent, and a 4-bit significand:

a) What is the largest positive and the smallest negative number that can be stored on this system if the storage is normalized? (Assume no bits are implied, there is no biasing, exponents use two’s complement notation, and exponents of all zeros and all ones are allowed.)

b) What bias should be used in the exponent if we prefer all exponents to be nonnegative? Why would you choose this bias?

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

a)

To determine the largest positive and smallest negative number that can be stored on the system, we need to consider the format and range of the floating-point representation.

Given the format:

  • Sign bit: 1 bit (to represent the sign of the number)
  • Exponent: 3 bits (to represent the exponent)
  • Significand: 4 bits (to represent the significand)

For normalized representation, the leading bit of the significand is assumed to be 1.

Largest positive number: To obtain the largest positive number, we need the maximum exponent and the maximum significand.

Assuming the exponent is in two's complement notation, the maximum exponent value in binary is 011 (3 bits with all ones).

The maximum significand value is obtained by setting all 4 bits to 1. Therefore, the largest positive number is represented as:

Sign: 0 (positive) Exponent: 011 Significand: 1111

Smallest negative number: To obtain the smallest negative number, we need the minimum exponent (negative value) and the minimum significand.

Assuming the exponent is in two's complement notation, the minimum exponent value in binary is 100 (3 bits with all zeros). The minimum significand value is obtained by setting all 4 bits to 0.

Therefore, the smallest negative number is represented as:

Sign: 1 (negative) Exponent: 100 Significand: 0000

 

b)

  • If we prefer all exponents to be nonnegative, we need to choose an appropriate bias for the exponent. The bias is added to the actual exponent value to obtain the stored exponent. The bias is chosen to make the exponent nonnegative when stored.
  • In this case, we have 3 bits to represent the exponent, which can represent values from -4 to 3 in two's complement notation. To make all exponents nonnegative, we need to bias the exponent by adding a positive value. Since we have 3 bits, we can represent 8 different values.
  • To ensure all exponents are nonnegative, we can use a bias of 4. By adding 4 to the actual exponent value, the stored exponent will always be nonnegative.

Using a bias of 4 allows us to represent the range from -4 to 3 as nonnegative values (0 to 7) in the 3-bit exponent field. This simplifies comparisons, calculations, and other operations on the exponents.

0 0

Discussions

Post the discussion to improve the above solution.