Programming and data structure
Download
1 / 14

Programming and Data Structure - PowerPoint PPT Presentation


  • 210 Views
  • Updated On :

Programming and Data Structure. Sudeshna Sarkar. Lecture 1. About the Course. L-T-P rating of 3-0-3. Single grade will be assigned for the theory and the laboratory courses combined. If a student fails in either the theory or the laboratory, or both, he/she gets a ‘F’ grade automatically.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Programming and Data Structure' - giulia


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Programming and data structure l.jpg

Programming and Data Structure

Sudeshna Sarkar

Lecture 1

Sudeshna Sarkar, IIT Kharagpur


About the course l.jpg
About the Course

  • L-T-P rating of 3-0-3.

    • Single grade will be assigned for the theory and the laboratory courses combined.

    • If a student fails in either the theory or the laboratory, or both, he/she gets a ‘F’ grade automatically.

    • 60% theory + 40% laboratory

  • Evaluation in the theory course:

    • Mid-semester (30 %)

    • End-semester (50%)

    • Two class tests (20%)

Sudeshna Sarkar, IIT Kharagpur


Course materials l.jpg
Course Materials

  • The course materials are available as PowerPoint slides.

  • How to get them?

    • A copy will be given to a representative to be kept at a xerox centre so it wil be available to all the students.

    • For students having access to Internet, the slides would be available on-line at http://facweb.iitkgp.ernet.in/~sudeshna/pds02/index.html

Sudeshna Sarkar, IIT Kharagpur


Reference books l.jpg
Reference Books

  • A Book on C

    • Al Kelley & Ira Pohl, 4th Edition, Pearson Education, Asia

  • Programming With C

    • B.S. Gottfried, Schaum’s Outline Series, Tata McGraw-Hill, 1991.

  • The C Programming Language, 2nd Edition (Ansi C),

    • B. W. Kernighan & D. M. Ritchie, Prentice Hall

  • Data Structures using C and C++, 2nd Edition

    • Langsam, Augenstein & Tenenbaum, PHI

Sudeshna Sarkar, IIT Kharagpur


What is a computer l.jpg
What is a computer ?

  • A computer is a machine which can accept data, process the data and supply results.

In

Computer

Out

Sudeshna Sarkar, IIT Kharagpur


A computer l.jpg
A computer

Input

Peripherals

Central

Processing

Unit (CPU)

Output

Peripherals

Main

Memory

Storage

Peripherals

Sudeshna Sarkar, IIT Kharagpur


Input devices l.jpg

Output Devices

Input Devices

  • VDU / Monitor

  • Printers

  • Plotters

  • Sound cards

  • Film and video

  • Robot arms

  • Keyboard

  • Mouse

  • Joystick

  • Scanners (OCR)

  • Bar code readers

  • Microphones / Sound digitizers

  • Voice recognition devices

Sudeshna Sarkar, IIT Kharagpur


Storage peripherals l.jpg
Storage Peripherals

  • Magnetic Tape

    • Data stored sequentially (back ups)

  • Magnetic Disks

    • Direct (random) access possible

    • Types

      • Hard Disks

      • Floppy Disks

  • Optical Disks

    • CDROM

    • CD-RW

Sudeshna Sarkar, IIT Kharagpur


Typical configuration of a pc l.jpg
Typical Configuration of a PC

  • CPU: Pentium 4, 1.5 GHz

  • Main Memory: 128 MB

  • Hard Disk: 40 GB

  • Floppy Disk: 1.44 MB

  • CDROM: 52X

  • Input Device: Keyboard, Mouse

  • Output Device: Color Monitor (17 inch)

Sudeshna Sarkar, IIT Kharagpur


How does a computer work l.jpg
How does a computer work?

  • Stored program

  • A program is a set of instructions for carrying out a specific task.

  • Programs are stored in secondary memory, when created.

  • Programs are in main memory during execution.

Sudeshna Sarkar, IIT Kharagpur


Slide11 l.jpg
CPU

  • Central Processing Unit (CPU) is where computing takes place in order for a computer to perform tasks.

  • CPU’s have large number of registers which temporarily store data and programs (instructions).

  • The CPU receives stored instructions, interprets them and acts upon them.

Sudeshna Sarkar, IIT Kharagpur


Computer program l.jpg
Computer Program

  • A program is simply

    • a sequence of numeric codes stored in memory which is converted into simple operations (instructions for the CPU).

      This type of code is known as machine code.

  • The instructions are retrieved from

    • consecutive memory locations

      unless the current instruction tells it otherwise (branch / jump instructions).

Sudeshna Sarkar, IIT Kharagpur


Programming languages l.jpg
Programming Languages

  • Machine language

  • Assembly Language

    • Mnemonics (opcodes)

  • Higher level languages

    • Compiled languages:

      • C, C++, Pascal, Fortran

      • Converted to machine code using compilers

    • Interpreted Languages:

      • Basic, lisp

      • Read-eval loop

Sudeshna Sarkar, IIT Kharagpur


Instruction set l.jpg

Program

Instruction Set

  • Start

  • Read M

  • Write M

  • Load Data, M

  • Copy M1, M2

  • Add M1, M2, M3

  • Sub M1, M2, M3

  • Compare M1, M2, M3

  • Jump L

  • J_Zero M, L

  • Halt

0: Start

1: Read 10

2: Read 11

3: Add 10, 11, 12

4: Write 12

5: Halt

Sudeshna Sarkar, IIT Kharagpur