Write the bit pattern for the decimal value

Apr 2013
69
1
USA
Assuming a three-bit exponent field and a four-bit significand, write the bit pattern for the following decimal values:

(a) -12.5 (b) 13.0 (c) 0.43 (d) 0.1015625

Here are the answers I got for each:

(a) 1 110 1010

(b) 1 110 1010

(c) 0 001 1011

(d) 0 000 1101


I don't know how to check if these are correct. Could someone help me please?
 

chiro

MHF Helper
Sep 2012
6,608
1,263
Australia
Hey lamentofking.

Are these IEEE values (or derivatives)? Do you have the definition of the floating point number as a function of the exponent, significand, and sign bit?
 
  • Like
Reactions: 1 person
Apr 2013
69
1
USA
Hey lamentofking.

Are these IEEE values (or derivatives)? Do you have the definition of the floating point number as a function of the exponent, significand, and sign bit?
I don't know how to tell. These problems come from the Computer Systems by Warford textbook. Any the problem is before IEEE is covered so I would say no. These are floating point numbers. The sign bit is the first number, the next three numbers are the exponent, and the significand is the last four numbers.
 

chiro

MHF Helper
Sep 2012
6,608
1,263
Australia
It sounds like it is a quasi-IEEE (in other words, not a standard float or double, but a representation that has the same form only with the number of bits different).

Anyway, I can't really help you unless you have the formula to convert the representation to a decimal number (or a number in another base).

The only other suggestion I have is to see if its a fixed point representation. Fixed point is just a way of storing a number with so many possibilities for the integer value and so many possibilities for the non-integer value. Based on what you have said about the structure of the number, I don't think its a fixed point representation.

Take a look at this and see if it has a connection:

IEEE floating point - Wikipedia, the free encyclopedia