Understanding Binary Conversion and Computer Performance
Classified in Computers
Written on in
English with a size of 3.88 KB
Binary Conversion
Single-Precision Floating-Point
Format: 1 sign bit, 8 exponent bits, 23 fraction bits
Bias: +127 (decimal to binary), -127 (binary to decimal)
Double-Precision Floating-Point
Format: 1 sign bit, 11 exponent bits, 52 fraction bits
Bias: +1023 (decimal to binary), -1023 (binary to decimal)
Example: -17.6875 (Single-Precision)
- Sign Bit: + = 0, - = 1 (In this case, 1)
- Integer Part to Binary: Repeatedly divide the integer part by 2 and record the remainders.
- Fractional Part to Binary: Repeatedly multiply the fractional part by 2 and record the integer parts.
- Combine and Normalize: Combine the binary integer and fractional parts. Normalize to the form 1.xxx * 2^exponent.
- Calculate Exponent: Add the bias to the exponent.
| Divide | Answer | Remainder |
|---|---|---|
| 17 |