FISR edits
All checks were successful
CI / Typst formatting (push) Successful in 6s
CI / Typos (push) Successful in 7s
CI / Build (push) Successful in 8m57s

This commit is contained in:
Mark 2025-02-17 08:24:51 -08:00 committed by Mark
parent fc5a1cbbaf
commit 7c75c6b5c9

View File

@ -28,7 +28,7 @@ Rewrite the following binary decimals in base 10: \
#v(1fr) #v(1fr)
#pagebreak() #pagebreak()
#definition() #definition(label: "floatbits")
Another way we can interpret a bit string is as a _signed floating-point decimal_, or a `float` for short. \ Another way we can interpret a bit string is as a _signed floating-point decimal_, or a `float` for short. \
Floats represent a subset of the real numbers, and are interpreted as follows: \ Floats represent a subset of the real numbers, and are interpreted as follows: \
#note([The following only applies to floats that consist of 32 bits. We won't encounter any others today.]) #note([The following only applies to floats that consist of 32 bits. We won't encounter any others today.])
@ -118,13 +118,17 @@ Floats represent a subset of the real numbers, and are interpreted as follows: \
#problem(label: "floata") #problem(label: "floata")
Consider `0b01000001_10101000_00000000_00000000`. \ Consider `0b01000001_10101000_00000000_00000000`. \
#hint([The underscores here do _not_ match those in @floatbits])
#v(2mm)
Find the $s$, $E$, and $F$ we get if we interpret this bit string as a `float`. \ Find the $s$, $E$, and $F$ we get if we interpret this bit string as a `float`. \
#note([Leave $F$ as a sum of powers of two.]) #note([Leave $F$ as a sum of powers of two.])
#solution([ #solution([
$s = 0$ \ $s = 0$ \
$E = 258$ \ $E = 131$ \
$F = 2^31+2^19 = 2,621,440$ $F = 2^21+2^19$
]) ])
#v(1fr) #v(1fr)
@ -160,9 +164,9 @@ What value do we get if we interpret this bit string as a float? \
#solution([ #solution([
This is 21: This is 21:
$ $
2^(131) times (1 + (2^(21) + 2^(19)) / (2^(23))) 2^4 times (1 + (2^(21) + 2^(19)) / (2^(23)))
= 2^(4) times (1 + 0.25 + 0.0625) = 2^(4) times (1 + 2^(-2) + 2^(-4))
= 16 times (1.3125) = 16 + 4 + 1
= 21 = 21
$ $
]) ])