diff options
author | Camil Staps | 2015-10-08 21:46:12 +0200 |
---|---|---|
committer | Camil Staps | 2015-10-08 21:46:12 +0200 |
commit | 81d05d6012218b29b13b00e2d9ab47ac419291f2 (patch) | |
tree | 9d92d562b73ae822a6acb8c65b46e19a75520996 /assignment6/assignment6.tex | |
parent | Assignment 5, figures on new page (diff) |
Assignment 6
Diffstat (limited to 'assignment6/assignment6.tex')
-rw-r--r-- | assignment6/assignment6.tex | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/assignment6/assignment6.tex b/assignment6/assignment6.tex new file mode 100644 index 0000000..245ff90 --- /dev/null +++ b/assignment6/assignment6.tex @@ -0,0 +1,60 @@ +\documentclass[10pt,a4paper]{article} + +\usepackage[margin=2cm]{geometry} +\usepackage{pdfpages} + +% textcomp package is not available everywhere, and we only need the Copyright symbol +% taken from http://tex.stackexchange.com/a/1677/23992 +\DeclareTextCommandDefault{\textregistered}{\textcircled{\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}} + +\usepackage{fancyhdr} +\renewcommand{\headrulewidth}{0pt} +\renewcommand{\footrulewidth}{0pt} +\fancyhead{} +\fancyfoot[C]{Copyright {\textcopyright} 2015 Camil Staps} +\pagestyle{fancy} + +\usepackage{amsmath} +\usepackage{amsfonts} +\usepackage{mathtools} + +\usepackage{enumitem} +\setenumerate[1]{label=\alph*.} +\setenumerate[2]{label=(\roman*)} + +\parindent0pt + +\title{Operating Systems - assignment 6} +\author{Camil Staps\\\small{s4498062}} + +\begin{document} + +\maketitle +\thispagestyle{fancy} + +\section*{8.1} +\begin{enumerate} + \item Given a virtual address $a$ with page and offset $a=(p,o)$ we find entry $p$ in the page table. This gives a page frame number $f$. We then take the physical address $f\cdot 1024 + o$. + \item \begin{enumerate} + \item Entry $1$ gives frame $7$. This gives us $7\cdot1024 + 052 = 7220$. + \item Entry $2$ does not correspond to a frame, so this address is invalid. + \item Entry $5$ gives frame $0$. This gives us $0\cdot1024 + 499 = 499$. + \end{enumerate} +\end{enumerate} + +\section*{8.2} +\begin{enumerate} + \item The \texttt{j} variable doesn't generate page faults because for all $n$ all $A[n,i]$ are in the same page (and the same for $B$ and $C$). The \texttt{i} variable generates page faults every four iterations, and then for every array. This gives us a total of $\frac34$ page faults per addition executed. + \item Yes, the indices should be swapped (e.g. $C[j,i]$ instead of $C[i,j]$). + \item Every four iterations of $j$, that is, $16$ per array or $48$ in total. That gives a frequency of $48/64^2 = \frac3{256} \approx 0.0117$. +\end{enumerate} + +\section*{8.4} +See the next page. + +I don't count the first three references. The optimal algorithm has $6$ page faults over $17$ references, which is approximately $35\%$. The FIFO algorithm has $10$ page faults on the same number of references, approximately $59\%$. The LRU algorithm has $7$ page faults, approximately $41\%$. + +\includepdf{exercise-8-4.pdf} + +\end{document} + |