%--*- latex -*-----------------------------------------------------------------
%$Author: saulius $
%$Date: 2020-06-04 14:58:32 +0300 (Thu, 04 Jun 2020) $ 
%$Revision: 1524 $
%$URL: svn+ssh://saulius-grazulis.lt/home/saulius/svn-repositories/seminarai/2020-verifikacjos-seminarui/slides.tex $
%------------------------------------------------------------------------------

\documentclass[mathserif]{beamer}
\usetheme{Warwick}
\useoutertheme{infolines}
\setbeamertemplate{headline}{} % removes the headline the infolines inserts
%\setbeamertemplate{footline}[frame number]
\renewcommand\familydefault{\rmdefault}
% For XeLaTeX:
% https://tex.stackexchange.com/questions/452151/how-do-i-render-the-word-v%C7%ABlundarkvi%C3%B0a-with-bookman-and-xelatex
% "Use an OpenType clone of Bookman, for instance TeX Gyre Bonum":
\usepackage{fontspec}
\setmainfont{TeX Gyre Bonum}

\usepackage[style=authoryear,maxnames=1,doi=true,url=true,backend=biber]{biblatex}
%\addbibresource{bibliography/citations.bib}
%% \addbibresource{bibliography/Intel.bib}
%% \addbibresource{bibliography/Jorgensen.bib}
\addbibresource{bibliography/AMD.bib}
\addbibresource{bibliography/Zhmakin.bib}
\addbibresource{bibliography/Gustafson.bib}
\addbibresource{bibliography/Coleman.bib}
\addbibresource{bibliography/Engelen.bib}
\addbibresource{bibliography/Goldberg.bib}
\newcommand{\mycite}{\parencite}


\usepackage{colordvi}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{snakes}
\usepackage{chemfig}
\usepackage{listings}
% https://tex.stackexchange.com/questions/212069/listings-cannot-load-requested-language
\lstset{defaultdialect=[x86masm]Assembler}

% https://en.wikibooks.org/wiki/LaTeX/Algorithms
% http://mirror.datacenter.by/pub/mirrors/CTAN/macros/latex/contrib/algorithmicx/algorithmicx.pdf
\usepackage{algpseudocode}
\usepackage{algorithm}
\usepackage{amssymb}

\include{commands}

\newcommand{\RCSid}[1]{\fontsize{7pt}{7pt}\selectfont $#1$ \today}

%%BEGIN LANGUAGE lt
\title{Našumo siekis}
%%END LANGUAGE lt



\author{Saulius Gražulis}

\date{Vilnius, 2020}

% Define colors as in
% https://venngage.com/blog/color-blind-friendly-palette/ ``Retro''
\definecolor{Bluish}{HTML}{63ACBE}
\definecolor{Magentish}{HTML}{601A4A}
\definecolor{Orangish}{HTML}{EE442F}

\begin{document}

\colorlet{IdentifierColor}{red!40!black}
\colorlet{StringColor}{green!70!black}
\colorlet{KwdColor}{Bluish}
\colorlet{CommentColor}{Orangish}

%------------------------------------------------------------------------------

\begin{frame}
    \titlepage

\input{affiliation_lt}
    
    \begin{center}
      \mbox{}
      \hfill\hfill\hfill
      \includegraphics[height=1.5cm]{images/sp_VU_zenklas.eps}
      \hfill
      \includegraphics[height=1.5cm]{images/2019-05-02_Melynas_MIF-zenklas242x244.png}
      \hfill\hfill\hfill
      \mbox{}
    \end{center}

    \vfill

    %% \tiny
    %% \RCSid{
    %%   $Id: slides.tex 1524 2020-06-04 11:58:32Z saulius $
    %% }
    \begin{flushright}
      \begin{minipage}[c]{0.67\textwidth}
        \tiny\raggedright
        %%BEGIN LANGUAGE lt
        Šį skaidrių rinkinį galima kopijuoti,
        kaip nurodyta Creative Commons
        %%END LANGUAGE lt
        \myhref{http://creativecommons.org/licenses/by-sa/4.0/}{Attribution-ShareAlike
          4.0 International}
licenzijoje
      \end{minipage}
      %%
      \begin{minipage}[c]{1.5cm}
        \myhref{http://creativecommons.org/licenses/by-sa/4.0/}{
          \includegraphics[width=1.5cm]{images/CC-BY-SA.eps}
        }
      \end{minipage}
    \end{flushright}

\end{frame}

%==============================================================================

\begin{frame}
\frametitle{Atminties valdymas 64 bitų režime}

  \begin{quote}
    Besser als viel Speicher ist noch mehr Speicher...
  \end{quote}
  %%BEGIN LANGUAGE lt
  \begin{quote}
    (Geriau negu daug atminties yra dar daugiau atminties...)
  \end{quote}
  \rightline{Vokiškas anekdotas}
  %%END LANGUAGE lt

  \begin{itemize}
  \item
    %%BEGIN LANGUAGE lt
    Puslapiavimas (paging)
    %%END LANGUAGE lt
  \item
    %%BEGIN LANGUAGE lt
    Segmentavimas (segmentation)
    %%END LANGUAGE lt
  \end{itemize}

\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Atminties valdymas 64 bitų režime}

  \begin{center}
    x86, 86\_64 CPU

    \includegraphics[page=46,width=10cm,trim=3cm 14cm 3cm 7cm,clip]{images/AMD-dokumentacija/AMD64_Architecture_Programmers_Manual_Vol_1.pdf}
  \end{center}
  
  \leftline{\scriptsize\mycite{AMD2017}}

\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Virtuali Atmintis. Segmentai}

  \begin{center}
    \includegraphics<1-2>[page=54,height=7cm,trim=2cm 10.5cm 2cm 3.7cm,clip]{images/AMD-dokumentacija/AMD64_Architecture_Programmers_Manual_Vol_2.pdf}
    \includegraphics<2>[height=2cm]{drawings/segments/new-segment.eps}
  \end{center}
  
  {
    \scriptsize
    \setmainfont{Liberation Serif}
    \leftline{\mycite{Жмакин2006,AMD2012}}
  }
  
\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Virtuali atmintis. Puslapiavimas}

  \begin{center}
    \parbox[c]{8.5cm}{
      \includegraphics[page=56,width=\linewidth,trim=2cm 11.5cm 3cm 4.3cm,clip]{images/AMD-dokumentacija/AMD64_Architecture_Programmers_Manual_Vol_2.pdf}
    }
    \parbox[c]{1.3cm}{
      \visible<3-4>{
        \only<3>{
          \includegraphics[width=\linewidth]{drawings/pages/pages.eps}
        }
        \only<4>{
          \includegraphics[width=\linewidth]{drawings/pages/new-page.eps}
        }
      }
      \vspace{-\baselineskip}
    }
  \end{center}

  \small
  \visible<2->{
    Translation-Lookaside Buffer (TLB) $\Leftrightarrow$
    page-translation cache
  }
  
  \leftline{\scriptsize\mycite{AMD2012}}
  
\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Virtuali atmintis. Skirtingi puslapių dydžiai}

  \begin{center}
    \includegraphics<1>[page=180,height=7cm,trim=3cm 12cm 3cm 4.3cm,clip]{images/AMD-dokumentacija/AMD64_Architecture_Programmers_Manual_Vol_2.pdf}
    \includegraphics<2>[page=182,height=7cm,trim=3cm 6.8cm 3cm 9.5cm,clip]{images/AMD-dokumentacija/AMD64_Architecture_Programmers_Manual_Vol_2.pdf}
    \includegraphics<3>[page=184,height=7cm,trim=3cm 12cm 3cm 4.3cm,clip]{images/AMD-dokumentacija/AMD64_Architecture_Programmers_Manual_Vol_2.pdf}
  \end{center}
  
  \leftline{\scriptsize\mycite{AMD2012}}
  
\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Virtuali atmintis. Puslapių atributai}

  \begin{center}
    \includegraphics[page=181,width=11cm,trim=2cm 4.5cm 2cm 14cm,clip]{images/AMD-dokumentacija/AMD64_Architecture_Programmers_Manual_Vol_2.pdf}
  \end{center}
  
  \leftline{\scriptsize\mycite{AMD2012}}
  
\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Spartinanti atmintis}

\framesubtitle{Asociatyvinė atmintis}

  \begin{center}
    \includegraphics[width=11cm]{drawings/caches/associative-cache.eps}
  \end{center}
  
  {
    \setmainfont{Liberation Serif}
    \mycite{Жмакин2006}
  }
  
\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Spartinančios atminties atnaujinimas}

  \begin{center}
    \includegraphics[width=5cm]{images/CPU-cache/Write-back_with_write-allocation.eps}
    \hspace{1em}
    \includegraphics[width=5cm]{images/CPU-cache/Write-through_with_no-write-allocation.eps}
  \end{center}
  \leftline{\scriptsize Flin00, CC0, via \myhref{https://en.wikipedia.org/wiki/Cache\_(computing)}{Wikimedia Commons}}
  
\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Spartinančios atminties neprieštaringumas}

  \begin{center}
    \parbox{7cm}{
      % https://tex.stackexchange.com/questions/7602/how-to-add-a-gif-file-to-my-latex-file
      % (recommends conversion using 'convert')
      \includegraphics<1>[height=5cm]{images/CPU-cache/Coherent-0.png}
      \includegraphics<2>[height=5cm]{images/CPU-cache/Coherent-1.png}
      \includegraphics<3>[height=5cm]{images/CPU-cache/Coherent-2.png}
      \includegraphics<4>[height=5cm]{images/CPU-cache/Coherent-3.png}
      \includegraphics<5>[height=5cm]{images/CPU-cache/Coherent-4.png}
      \includegraphics<6>[height=5cm]{images/CPU-cache/Coherent-5.png}
      \includegraphics<7>[height=5cm]{images/CPU-cache/Coherent-6.png}
      \includegraphics<8>[height=5cm]{images/CPU-cache/Coherent-7.png}
      \includegraphics<9>[height=5cm]{images/CPU-cache/Coherent-8.png}
      \includegraphics<10>[height=5cm]{images/CPU-cache/Coherent-9.png}
      \includegraphics<11>[height=5cm]{images/CPU-cache/Coherent-10.png}
      \includegraphics<12>[height=5cm]{images/CPU-cache/Coherent-11.png}
      \includegraphics<13>[height=5cm]{images/CPU-cache/Coherent-12.png}
      \includegraphics<14>[height=5cm]{images/CPU-cache/Coherent-13.png}
      \includegraphics<15>[height=5cm]{images/CPU-cache/Coherent-14.png}
    }
  \end{center}
  \rightline{\scriptsize \myhref{https://commons.wikimedia.org/w/index.php?curid=52362567}{By M3tainfo - Own work, CC BY-SA 4.0}}

\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Eksponentinis skaičių užrašymas}

  $$
  602\underbrace{00\dots0}_{21
\textrm{\ kartų}
  } = 6.02\times10^{23}
  $$

  $$
  \pm d_0 . d_1 d_2 \dots d_{p-1} \times \beta^e =  
  \sum_{i=0}^{p-1} d_i \beta^{-i} \times \beta^e, (0 \le d_i < \beta) 
  $$
  
\end{frame}

%------------------------------------------------------------------------------

%% \begin{frame}
%%   %%LANGUAGE en \frametitle{Fixed point numbers}
%%   %%LANGUAGE lt \frametitle{Fiksuoto kablelio skaičiai}
%%   %%LANGUAGE ru \frametitle{Числа с фиксированной запятой}
%% 
%% \end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{Slankaus kablelio skaičiai}

  $$
  \pm d_0 . d_1 d_2 \dots d_{p-1} \times \beta^e =  
  \sum_{i=0}^{p-1} d_i \beta^{-i} \times \beta^e, (0 \le d_i < \beta) 
  $$

  $$
  \begin{array}{rl}
    \beta &= 2 \\
  \end{array}
  $$

  $$
  0.1 \approx 1.10011001100110011001101 \times 2^{-4}
  $$
  
\end{frame}

%------------------------------------------------------------------------------

\begin{frame}
\frametitle{IEEE 754 standartas}

  \begin{itemize}
  \item
    %%BEGIN LANGUAGE lt
    Mantisė: absoliutus dydis su ženklu
    %%END LANGUAGE lt
  \item
    %%BEGIN LANGUAGE lt
    Eksponentė: skaičius su postūmiu
    %%END LANGUAGE lt
  \item
    %%BEGIN LANGUAGE lt
    „Paslėptas“ bitas
    %%END LANGUAGE lt
  \end{itemize}

  $$
  0.1 \approx \textcolor{gray}{1}.10011001100110011001101 \times 2^{-4}
  $$

  p: 23+1
bitas
  e: $-126 - 127$ (8
bitai
  )
  
  {
    \raggedright
    \tt
    $f =$ \textcolor{gray}{1.}10011001100110011001101 \\
    $e =$ 127 + (-4) = $\tt 123_{10}$ = $\tt 01111011_2$
  }

  \begin{center}
    \tt
    \textcolor{Bluish}{0} \textcolor{Magentish}{01111011} \textcolor{Orangish}{10011001100110011001101}
  \end{center}

\end{frame}

%------------------------------------------------------------------------------

\begin{frame}%%[allowframebreaks]
\frametitle{Šaltiniai}

  \setmainfont{Liberation Serif}
  \renewcommand{\bibfont}{\scriptsize}
  \printbibliography

\end{frame}

%------------------------------------------------------------------------------                                                                                                          
\end{document}
% 2020-12-06 17:55:14 EET
