Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

what is bias in IEEE 754 format ?

Status
Not open for further replies.

electroboy

Member level 5
Joined
Dec 30, 2010
Messages
86
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,879
In IEEE 754 format, we add the power of 2 value with the bias value (127 for 32bit) to get the exponent......what is bias? why is this bias necessary?
pls explain... thanks in advance....
 

Bias in IEEE754 is a nice little trick that allows us to do comparative operations (=, <, > etc) without scaling and normalising the floating point numbers.

Basically, we want to represent the magnitude of the number with an exponent, i.e. mantissa * 2^exponent. In single precision IEEE754 we have 8 bits to represent this exponent which takes values between -127 and 128. This range of numbers could be encoded using 2's complement, but representing it as unsigned with an implied bias allows us to do single instruction cycle compares of floating point numbers.

This applet is good to play around with if you are learning: **broken link removed**

Let me know if anything there doesn't make sense and I'll get back with more detail...
 
Basically, we want to represent the magnitude of the number with an exponent, i.e. mantissa * 2^exponent. In single precision IEEE754 we have 8 bits to represent this exponent which takes values between -127 and 128. This range of numbers could be encoded using 2's complement, but representing it as unsigned with an implied bias allows us to do single instruction cycle compares of floating point numbers.

couldn't get this clearly..... pls help...
 

I'll help you if you help me. Can you please be more specific about what you do or don't understand?

1. Bias is an offset. A constant amount which you add to another number.

2. Bias is used in IEEE754 to speed up comparative operations like: <, >, =, != etc
 
Last edited:
-127 or 123 .. anyway the processor is going to convert it to binary..... similarly in 2^value, adding the value(+ve or -ve) with bias(127) yields the same 8-bit binary combination as in the range -128 to 127..
for eg: for 2^3, 127+3=130= 1000 0010 which is -126( 2's complement)...
how does it helps in comparisons......?
 

In a CPU you have an ALU (Arithmetic Logic Unit), this device can only do integer arithmetic. i.e. with numbers like 1, 243, -42... not 4.52 or -7.6 x 10^-3 etc

To work with numbers like 4.52, you need an FPU (floating point unit) hardware. FPUs are much slower than ALUs.

Remember, IEEE754 uses a sign bit.

As a result of using bias, if you read the interpret the 1's and 0's of a IEEE754 number as an integer number during comparison operations you'll get the correct answer.

Comparison operations for IEEE754 numbers are done in the ALU, NOT the FPU.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top