You are on page 1of 2

Introduction to Computing (CS101)

Assignment No. 01

Spring 2023

A) Encode the (negative) decimal fraction -9/2 to binary using the 8-bit
floating-point notation.

Sol:

 Fraction -9/2 translates into -4.5 in decimal notation.

 In binary notation -4.5 is represented as follows:-

22 =4 21 = 2 20 = 1 2-1 = 1/2

1 0 0 1

Hence, in binary notation -4.5 is represented by bit pattern 100.1


 Putting 100.1 in mantissa field in floating point notation.
____1001

 Since contents of mantissa field are imagined to have radix point to their left
side, which must be moved to its original position with the help of exponent.
As it can be seen that radix point needs to be moved by 3 bits to the right.
The exponent should therefore be a positive 3, which is represented by 111 in
excess 4 notation. So we place 111 in exponent field and floating point
notaion becomes;
_1111001
 For the sign bit, as the value being stored is negative, this means in sign bit we
need to put 1. The final form of fraction -9/2 in floating point notation will be
11111001

B) Determine the smallest (lowest) negative value which can be


Incorporated/represented using the 8-bit floating point notation.

Sol: in order to find this, we put

 The minimum possible value in mantissa, _ _ _ _ 0 0 0 1


 And to keep the radix at left most bit we put exponent as 0 0 0 which is
equivalent of -4, hence the notation wil become _ 0 0 0 0 0 0 1
 Finally to make it a negative value we will put 1 in sign bit, and final notation
will be 1 0 0 0 0 0 0 1.
 This byte when decoded gives the value –1/128, which is the smallest (lowest)
negative value which can be Incorporated/represented using the 8-bit floating
point notation.

C. Determine the largest (highest) positive value which can be


incorporated/represented using the 8- bit floating point notation.

Sol: in order to find this, we put

 The maximum possible value in mantissa, _ _ _ _ 1111


 And to keep the radix at right most bit we put exponent as 1 1 1 which is
equivalent of 3, hence the notation wil become _ 1 1 1 1 1 1 1
 Finally to make it a positive value we will put 0 in sign bit, and final notation
will be 0 1 1 1 1 1 1 1.
 This byte when decoded gives the value 7.5, which is the largest (highest)
positive value which can be Incorporated/represented using the 8-bit floating
point notation.

You might also like