haas:fall2023:discrete:projects:blf0
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
haas:fall2023:discrete:projects:blf0 [2024/04/12 07:14] – [BACKGROUND] wedge | haas:fall2023:discrete:projects:blf0 [2024/04/12 07:16] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 37: | Line 37: | ||
^ sign (bit 31) ^ exponent (bits 30-23) | ^ sign (bit 31) ^ exponent (bits 30-23) | ||
- | | 1 | 100 0011 0 | 111 1000 1100 0000 0000 0000 | | + | | 1 | |
===Determine the exponent=== | ===Determine the exponent=== | ||
- | In this example, we have **1000 0110** or **0x86** in our exponent section. | + | In this example, we have **< |
What we do now is take that value, and subtract a **0x7F** from it to get our actual exponent value: | What we do now is take that value, and subtract a **0x7F** from it to get our actual exponent value: | ||
Line 49: | Line 49: | ||
We then start to setup our whole number value, which conceptually is to the immediate left of the mantissa. We assign a 1 to it by default. As a result, our floating point value (in binary) is currently: | We then start to setup our whole number value, which conceptually is to the immediate left of the mantissa. We assign a 1 to it by default. As a result, our floating point value (in binary) is currently: | ||
- | * 1 . 111 1000 1100 0000 0000 0000 | + | * < |
===bit shift by exponent=== | ===bit shift by exponent=== | ||
Line 68: | Line 68: | ||
===determine value to the left of the decimal point=== | ===determine value to the left of the decimal point=== | ||
- | The value we have to the left of the decimal point is **11111000**, | + | The value we have to the left of the decimal point is **< |
We prefix the sign to this (1 indicates negative, which in this example it was), so: **-248.** | We prefix the sign to this (1 indicates negative, which in this example it was), so: **-248.** | ||
Line 75: | Line 75: | ||
Now, to get the component to the right of the decimal point, we basically add together the bit positions, which correspond to **1/ | Now, to get the component to the right of the decimal point, we basically add together the bit positions, which correspond to **1/ | ||
- | So, with our current value of **1100 0000 0000 0000**, we have exactly 2 values containing a 1. Positions 1 and 2. | + | So, with our current value of **< |
According to our formula: | According to our formula: |
haas/fall2023/discrete/projects/blf0.txt · Last modified: 2024/04/12 07:18 by wedge