Advertisement
anta40

algorithm

Oct 10th, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 0.98 KB | None | 0 0
  1. \documentclass[10pt]{article}
  2. \usepackage {algorithm}
  3. \usepackage {algorithmic}
  4.  
  5. \begin{document}
  6. \begin{algorithm}
  7. \vspace{2mm}
  8.  
  9. \textbf{VARIABLES AND STRUCTURES}\\
  10. $x$: references block, \textbar B \textbar: total cache size\\
  11. $T1$,$T2$: partitions for a disk and a flash memory\\
  12. $cumulated\_ref\_count$: cumulated reference count\\
  13.  
  14. \textbf{MAIN ALGORITHM}
  15. \begin{algorithmic}[1]
  16.     \STATE Initialize required variables and structures
  17.     \STATE Determine the access pattern of each block if it is a sequential or random at every reference of blocks
  18.     \STATE Increase $cumulated\_ref\_count$
  19.     \STATE If a cache hit occurs in $T1$ (or $T2$)
  20.     \STATE Move the block to the MRU in $T1$ (or $T2$)
  21.     \STATE \hspace{4mm} Execute \textbf{H\_update}
  22.     \STATE Else
  23.     \STATE \hspace{4mm}Execute \textbf{List\_update}
  24.     \STATE If $cumulated\_ref\_count = W$
  25.     \STATE \hspace{4mm}Execute the \textbf{dynamic partitioning algorithm} in Fig. 4
  26. \end{algorithmic}
  27. \end{algorithm}
  28.  
  29. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement