diff --git a/Homework 10/assignment10.pdf b/Homework 10/assignment10.pdf index 76de7fb..cd068aa 100644 Binary files a/Homework 10/assignment10.pdf and b/Homework 10/assignment10.pdf differ diff --git a/Homework 10/assignment10.tex b/Homework 10/assignment10.tex index ef14d6a..c0a8c6f 100644 --- a/Homework 10/assignment10.tex +++ b/Homework 10/assignment10.tex @@ -1,5 +1,5 @@ \documentclass[12pt]{article} -\title{Assignment 10} +\title{Computer Architecture -- Assignment 10} \author{Claudio Maggioni \and Tommaso Rodolfo Masera} \date{} @@ -116,4 +116,17 @@ $1010011010.01000000000000\ =\ 2^9\ +\ 2^7\ +\ 2^4\ +\ 2^3\ +\ 2^1 +\ 2^{-2}\ =\ \subsection{Exercise 2.4} +In order to compute the number of IEEE 754 single-precision floating point numbers between 0 and 1 (both included), we first consider +a constant positive ($= 1$) sign bit (and therefore we do not count it in our calculation of possible permutations). + +Then we count the number of denormalized numbers (including 0), which is: $2^{23} = 8388608$. + +After that, we count the number of valid from $2^{126}$ to $2^{1}$ included, which is 126. All these exponents will generate +a number $< 1$ even with the highest possible mantissa. Then, we compute the number of numbers with these exponents, equal to: +$126 * 2^{23} = 1056964608$. + +Finally, we consider the number 1 itself (0x3f800000) and we sum all the combinations: $8388608 + 1056964608 + 1 = 1065353217$ + +Therefore, there are 1065353217 IEEE 754 single-precision floating point numbers between 0 and 1 (both included). + \end{document} \ No newline at end of file