Programming Language, Programs-Computer Fundamentals-Lecture Slides, Slides of Computer Fundamentals

Following points have been discussed in these lecture slides by Baljit Ashvin at Indian Institute of Information Technology (IIIT) under subject of Computer Fundamentals: Program, Programming, Language, IDE, C/C , Introduction, Hello, World, Perform, Specified

Typology: Slides

2011/2012

Uploaded on 07/03/2012

mehr5
mehr5 🇮🇳

4.4

(8)

36 documents

1 / 39

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ME-101
Computer Fundamentals
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27

Partial preview of the text

Download Programming Language, Programs-Computer Fundamentals-Lecture Slides and more Slides Computer Fundamentals in PDF only on Docsity!

ME-

Computer Fundamentals

WE ARE SWITCHING TO PROGRAMMING FOR A WHILE

WHAT IS A PROGRAM

A computer program (also software , or just a program ) is a sequence of instructions written to perform a specified task with a computer.

Ref: Stair, Ralph M., et al. (2003). Principles of Information Systems, Sixth Edition

WHAT IS PROGRAMMING LANGUAGE

A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer

PROGRAMMING LANGUAGES

Assembly Language

  • English like abbreviations
  • Translators programs called “Assemblers” to convert assembly language programs to machine language.

E.g. add overtime to base pay and store result in gross pay

LOAD BASEPAY

ADD OVERPAY

STORE GROSSPAY

PROGRAMMING LANGUAGES

High-level languages

  • To speed up programming even further
  • Single statements for accomplishing substantial tasks
  • Translator programs called “Compilers” to convert high- level programs into machine language

E.g. add overtime to base pay and store result in gross pay grossPay = basePay + overtimePay

WHAT IS C?

 C

 A language written by Brian Kernighan

and Dennis Ritchie. This was to be the

language that UNIX was written in to

become the first "portable" language

In recent years C has been used as a general- purpose language because of its popularity with programmers.

HISTORY OF C

  • Evolved from two previous languagesBCPL , B
    • BCPL (Basic Combined Programming Language) used for writing OS & compilers
  • B used for creating early versions of UNIX OS
  • Both were “ typeless ” languages
  • C language evolved from B (Dennis Ritchie – Bell labs)

** Typelessno datatypes. Every data item occupied 1 word in memory.

HISTORY

In 1972 Dennis Ritchie at Bell Labs writes C and in 1978 the publication of The C Programming Language by Kernighan & Ritchie caused a revolution in the computing world

In 1983, the American National Standards Institute (ANSI) established a committee to provide a modern, comprehensive definition of C. The resulting definition, the ANSI standard, or "ANSI C", was completed late 1988.

WHY C STILL USEFUL?

C provides:  Efficiency, high performance and high quality s/ws  flexibility and power  many high-level and low-level operations  middle level  Stability and small size code  Provide functionality through rich set of function libraries  Gateway for other professional languages like C  C++  Java

C is used:  System software Compilers, Editors, embedded systems  data compression, graphics and computational geometry, utility programs  databases, operating systems, device drivers, system level routines  there are zillions of lines of C legacy code  Also used in application programs

DEVELOPMENT WITH C

Four stagesEditing: Writing the source code by using some IDE or editor  Preprocessing or libraries: Already available routines  compiling: translates or converts source to object code for a specific platform source code -> object code  linking: resolves external references and produces the executable module

Portable programs will run on any machine but…..

Note! Program correctness and robustness are most important than program efficiency

C STANDARD LIBRARY

  • Two parts to learning the “C” world
    • Learn C itself
    • Take advantage of rich collection of existing functions called C Standard Library
  • Avoid reinventing the wheel
  • SW reusability

BASICS OF C ENVIRONMENT

Phase 1^ Editor^ Disk

Program edited in Editor and stored on disk

Phase 2^ Preprocessor^ Disk

Preprocessor program processes the code

Phase 3^ Compiler^ Disk

Creates object code and stores on disk

Phase 4^ Linker^ Disk

Links object code with libraries and stores on disk

BASICS OF C ENVIRONMENT

Phase 5^ Loader

Puts program in memory

Primary memory

Phase 6^ CPU

Takes each instruction and executes it storing new data values

Primary memory