\documentclass{beamer} %include lhs2TeX.fmt \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{code} #include int main() { int n; int sum=0; scanf("%d",&n); while(n > 0) { sum = sum + n; n = n - 1; } printf("%d",sum); } \end{code} \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 |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}