16
Course Overview

Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Embed Size (px)

Citation preview

Page 1: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Course Overview

Page 2: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

What are Computers?

• From Outside

– CPU box, Monitor, Keyboard, mouse and Printers

• From inside– ICs, Chipsets, Hard Disks, PCB cards, Drives, Buses– All the above are called Computer Hardware– The physical engine that solves problems

Page 3: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Programmability

• Unique feature of Computers• raw HW can not do anything on its own• needs programs or software to do things• Same hardware can be configured to do a variety of

functions• Programs provide this ability• `run' or `execute' the program in the machine for this

Page 4: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

What are Programs

• Sequence of precise instructions or commands• tell the HW to read input,• to compute simple arithmetic functions• and to print outputs etc.• Control HW to compute a variety of tasks• It is the programs that provide the rich problem

solving abilities Programming Main focus of this course

Page 5: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Low-level Programming

• Programs that can run in a computer are low-level,• Instructions are simple arithmetic and logical operation on

binary numbers (sequences of 0 and 1)• specific to the machine and will not run in other machines• called as machine programs (assembly programs)• very difficult to write and understand, error prone• for most common applications not necessary

Example mov R1,R2 – move the value from R1 to R2 add R2,R3,R4 – add R2 and R3 and store it in R4 sto R4, #010110 – store R4 in memory

Page 6: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

High-level programming• Instructions are complex operations on a variety of

data objects• programs are independent of machines• closer to problem domain• resembles natural language statements• easier to write, debug and understand• This is the focus of this course

• Examples– compute the interest for six months of Mr. Sachin's

Savings a/c– book a tkt. for Rahul from Mumbai to Bangalore– Switch on the alarm when belt not fastened

Page 7: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Translators/Compilers

• High level programs can not run directly on computers

• need to be translated to low level instructions

• compilers do this job

• compilers are themselves programs - system programs

• CS students learn how to write compiler software

Page 8: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Operating Systems

• Compilers alone are not enough• Other programs required for executing

application programs – Operating Systems• Provides a high level view of hardware• Efficient utilization of resources• various utility functions, like reading inputs,

printing, etc.• UNIX, Windows, SunOS, Solaris,• GNU/Linux

Page 9: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

A Simplified Picture

Hard Ware

Application

Cmd. Interpreter

Compilers, Editors

OS

System Programs

Page 10: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

OS is the boss• OS gateway to the machine• All interaction through the OS• OS is in control always• Safety, Security and Efficiency• Watches for inputs (mouse,keyboard) and

provides appropriate responses– Giving login Prompts, – Reading user name and passwords– Allows or rejects

• Runs the command line interpreter (window manager)

Page 11: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

The Shell

• The command line interface is called shell• Various versions of shell

– C-shell, Bash, etc.• After login, user commands are interpreted by the

shell and appropriate OS commands are executed• User commands to create/remove, edit files, compile

and execute programs etc. • When a user command is executed, there is a

momentary transfer of control • After execution, control is transferred back

Page 12: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Programming Languages

• Program instructions should be precise enough to be understood by machines or other programs

• Compilers and Raw HW are dumb• need precise syntactic rules and a unique

semantics• Programming languages define these rules

and semantics• Hundreds of languages - FORTRAN, Algol

60, PASCAL, BASIC, C, C++, Java,

Page 13: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Fortran

• We teach FORTRAN

• First High Level Language (1954 – 57)

• John Bachus (IBM), got Turing Award

• Revolutionary Step

• Grand father of all modern PL

• Name derived from Formula translation

• Simple idea: Mathematical formulae are high level descriptions of computations

Page 14: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Evolution of Fortran• Original Fortran very primitive, restrictive and

small• It has evolved over the years

– Fortran II– Fortran IV– Fortran 66, Fortran 77 – Fortran 90, Fortran 95

• Fortran 90 compares with all modern languages

• We will use FORTRAN 90• So, this is a course on Programming in

Fortran 90

Page 15: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Why Fortran

• Efficient compilers exist• Oldest and widely used• Large base of utilities and programs• It has all modern features• Fortran 90 is just a choice• Self-learning of Programming in C, Java or

any PL possible after this

Page 16: Course Overview. What are Computers? From Outside –CPU box, Monitor, Keyboard, mouse and Printers From inside –ICs, Chipsets, Hard Disks, PCB cards, Drives,

Main Focus

• Problem solving using computers• Fortran for concreteness• Exercises in programming in a HLL• All languages, at your level, are equivalent• Obtaining a solution is more difficult• Representing solution in a PL require mastery

over the language and comes with practice