\documentclass{beamer}
%
%
\makeatletter
\@ifundefined{lhs2tex.lhs2tex.sty.read}%
  {\@namedef{lhs2tex.lhs2tex.sty.read}{}%
   \newcommand\SkipToFmtEnd{}%
   \newcommand\EndFmtInput{}%
   \long\def\SkipToFmtEnd#1\EndFmtInput{}%
  }\SkipToFmtEnd

\newcommand\ReadOnlyOnce[1]{\@ifundefined{#1}{\@namedef{#1}{}}\SkipToFmtEnd}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage{stmaryrd}
\DeclareFontFamily{OT1}{cmtex}{}
\DeclareFontShape{OT1}{cmtex}{m}{n}
  {<5><6><7><8>cmtex8
   <9>cmtex9
   <10><10.95><12><14.4><17.28><20.74><24.88>cmtex10}{}
\DeclareFontShape{OT1}{cmtex}{m}{it}
  {<-> ssub * cmtt/m/it}{}
\newcommand{\texfamily}{\fontfamily{cmtex}\selectfont}
\DeclareFontShape{OT1}{cmtt}{bx}{n}
  {<5><6><7><8>cmtt8
   <9>cmbtt9
   <10><10.95><12><14.4><17.28><20.74><24.88>cmbtt10}{}
\DeclareFontShape{OT1}{cmtex}{bx}{n}
  {<-> ssub * cmtt/bx/n}{}
\newcommand{\tex}[1]{\text{\texfamily#1}}	% NEU

\newcommand{\Sp}{\hskip.33334em\relax}
\newcommand{\NB}{\textbf{NB}}
\newcommand{\Todo}[1]{$\langle$\textbf{To do:}~#1$\rangle$}

\EndFmtInput
\makeatother
%
\author{Piyush P Kurur\\
  Office no: 224\\
  Dept. of Comp. Sci. and Engg.\\
  IIT Kanpur}

\usepackage{dot2texi}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes,chains}
\usetikzlibrary{shapes.symbols}
\usetikzlibrary{matrix}
\usepackage{pgfkeys}
\pgfkeys %
    {%
       /tikz/noise/.style={
        starburst,
        draw=red
      },
      /tikz/qnoise/.style={
        starburst,
        fill=yellow,
        draw=red
      },
      /tikz/boxcolor/.style={
	draw=black
	top color=white,
	bottom color=red!50!black!50
      },
      /tikz/box/.style={
	rectangle,
	minimum size=1cm,
	/tikz/boxcolor
      },
      /tikz/unbox/.style={
	rectangle,
	minimum size=1cm
      },
      /tikz/point/.style={rectangle,minimum size=1cm}
    }

\usetikzlibrary{backgrounds}
\usetikzlibrary{shapes.geometric}
\usepackage{multicol}
\date{July 29, 2009}
\begin{document}
\begin{frame}

\frametitle{Summary of last class}

\begin{definition}
  Algorithms are finite sequence of \emph{basic instructions} to carry
  out a particular task. The actual instructions depends on the model
  of computation that we are talking about.
\end{definition}

\pause
\begin{block}{Examples}
  \begin{itemize}
  \item Cooking recipies,
  \item Operational manual of a music system,
  \item Navigational directions,
  \item And of course computer programs.
  \end{itemize}
\end{block}

\end{frame}

\begin{frame}

\frametitle{von Neumann architecture}
\begin{multicols}{2}
\input{figures/vonNeumann.tex}
\newpage
\pause
\begin{block}{Basic instructions}
  
\begin{itemize}
  \pause
\item Read/write data from memory/IO devices,
  \pause
\item Perform arithmetic logical operations on data,
  \pause
\item Read instructions from memory and interpret them.
  \pause
\item Proceed according to the instructions.
  \pause
\end{itemize}

\end{block}
\end{multicols}

\end{frame}

\begin{frame}
  \frametitle{Programming language}
  
  One can think of a programming language as
  a way of expressing algorithms, or as a model
  of computation

  \pause
  \begin{block}{Kinds of programming languages}
    \begin{itemize}
      \pause
    \item Low level languages; eg Assembly/Machine language
      \pause
    \item High level language; eg Pascal, Python etc.
      \pause
    \item Middle level language; eg C
    \end{itemize}
  \end{block}
  
  \pause
  The higher the level of language the closer to human beings.  The
  lower level language is closer to the machine.

\end{frame}

\begin{frame}
  \begin{block}{Why high level language?}
    \pause
    Look at computers from Programmers perspective.
    \begin{itemize}
      \pause
    \item Easier to write programs in.
      \pause
    \item Being generic, it is more portable.
    \end{itemize}
  \end{block}
  \begin{block}{Why then low level language?}
    \pause
    Easier to realise on hardware.
    
  \end{block}
  
\end{frame}




\begin{frame}

  \begin{tabbing}\tt
~~~~~\char35{}include\char60{}stdio\char46{}h\char62{}\\
\tt ~~~~~\\
\tt ~~~~~int~main\char40{}\char41{}\\
\tt ~~~~~\char123{}\\
\tt ~~~~~~~int~n\char59{}\\
\tt ~~~~~~~int~sum\char61{}0\char59{}\\
\tt ~~~~~~~scanf\char40{}\char34{}\char37{}d\char34{}\char44{}\char38{}n\char41{}\char59{}\\
\tt ~\\
\tt ~~~~~~~while\char40{}n~\char62{}~0\char41{}\\
\tt ~~~~~~~\char123{}\\
\tt ~~~~~~~~~sum~\char61{}~sum~\char43{}~n\char59{}\\
\tt ~~~~~~~~~n~~~\char61{}~n~\char45{}~1\char59{}\\
\tt ~~~~~~~\char125{}\\
\tt ~~~~~~~\\
\tt ~~~~~~~printf\char40{}\char34{}\char37{}d\char34{}\char44{}sum\char41{}\char59{}\\
\tt ~~~~~\char125{}
\end{tabbing}

\end{frame}

\begin{frame}
  \frametitle{Assemblers, Compilers, Interpreters}
 
  \begin{itemize}
    \pause
  \item Assemblers are the most basic translators.
    On Unix system the assembler is called \text{\tt as}.
    \pause
  \item High level language requires compilers. C, Pascal
    \pause
  \item Some languages are interpreted. eg Python, lisp etc
  \end{itemize}
\end{frame}



\begin{frame}
  \frametitle{Other classification of programming languages}

  \begin{itemize}
  \item Imperative programming language; eg C, Pascal, Python
    Glorified von Neumann architecture.
  \item Functional programming language; eg Haskell
    No states, only functions
  \item Object oriented languages; eg Smaltalk, Simula etc.
    Objects and messages to objects
  \item Logic based language; prolog
    Logic based techniques, Resolution.
  \item Scripting languages
  \end{itemize}
\end{frame}

\begin{frame}
  \frametitle{What to expect in this course}

  We will study one imperative language C.

  and a scripting language the shell.

\end{frame}
\end{document}
