Overview of Computer Systems and C Programming - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Overview of Computer Systems and C Programming

Description:

Overview of computer systems, instruction, and data storage (Slides) ... Kilobyte (KB) = 1,024 bytes (210) Megabyte (MB) = 1,048,576 bytes (220) ... – PowerPoint PPT presentation

Number of Views:58
Avg rating:3.0/5.0
Slides: 25
Provided by: solo65
Category:

less

Transcript and Presenter's Notes

Title: Overview of Computer Systems and C Programming


1
Overview of Computer Systems and C Programming
  • Week 1
  • Department of Computer Science
  • Faculty of Science and Technology
  • Assumption University

2
Agenda
  • Course Organization (Course Outline)
  • Overview of computer systems, instruction, and
    data storage (Slides)
  • Computer programs, programming languages, and
    software engineering (Slides)
  • Programming Demonstration
  • Creating your first C program (Hello World)
  • Understanding C program structure
  • Understanding Dev-C IDE

3
Computer Systems
4
Anatomy of a Computer
5
Computer Components
  • Central Processing Unit
  • Main Memory
  • Input and Output
  • System Interconnection

6
Central Processing Unit
  • A component in a digital computer capable of
    executing a program
  • Interpret computer program instructions and
    processes data
  • Components of a CPU
  • Control Unit (CU)
  • Arithmetic Logic Unit (ALU)

7
Primary Storage (Main Memory)
  • Main memory is the only one directly accessible
    to the CPU.
  • CPU continuously reads instructions stored there
    and executes them.
  • Any data actively operated on is also stored
    there in uniform manner.

8
Memory Organization
9
Memory Size
  • Bit (Binary Digit) is the smallest unit of memory
    which can store a 0 or a 1.
  • Byte contains 8 bits.
  • Kilobyte (KB) 1,024 bytes (210)
  • Megabyte (MB) 1,048,576 bytes (220)
  • Gigabyte (GB) 1,073,741,824 bytes (230)
  • Terabyte (TB) 1,099,511,627,776 bytes (240)

10
Secondary Storage
  • Secondary storage differs from primary storage in
    that it is not directly accessible by the CPU.
  • The computer usually uses its input/output
    channels to access secondary storage and
    transfers desired data using intermediate area in
    primary storage.
  • Secondary storage does not loose the data when
    device is powered down (non-volatile).

11
Input/Output Devices
  • Input device is a hardware mechanism that
    transforms information in the external world into
    the computer.
  • Output device is any piece of computer hardware
    equipment used to communicate the results of data
    processing carried out by an information
    processing system (such as a computer) to the
    outside world.

12
Bus System
  • An information highway or bus system connects the
    components of the system
  • Address Bus carries the address of the memory
    location or I/O device being accessed.
  • Data Bus carries the data signals.
  • Control Bus carries the control signals between
    the CPU and the other components of the system

13
Computer Programs
14
Program
  • Program is a series of instructions stored in the
    main memory that are executed sequentially by the
    processor.
  • Program is written by a programmer using program
    language.
  • The program of a computer system is called its
    software and includes
  • System software
  • Application software

15
Algorithm
  • Algorithm is a finite list of well-defined
    instructions for accomplishing some task that,
    given an initial state, will proceed through a
    well-defined series of successive states,
    eventually terminating in an end-state.

16
Programming Languages
  • Programming language is an artificial language
    that can be used to control the behavior of a
    machine.
  • Programming languages, like natural languages,
    are defined by syntactic and semantic rules which
    describe their structure and meaning
    respectively.
  • Syntax are the rules of a language that describe
    how the words of that language are to be
    arranged.
  • Semantic is the study of meaning in
    communication.
  • Two major classes of programming languages
  • Low-level languages
  • High-level languages

17
Low-Level Programming Language
  • Low-level programming language is a language that
    provides little or no abstraction from a
    computer's microprocessor.
  • There are basically two types of low-level
    programming language
  • Machine language
  • Assembly language

18
High-Level Programming Language
  • High-level programming language is a programming
    language that are more abstract, easier to use,
    or more portable across platforms
  • Such languages often abstract CPU operations such
    as memory access models and management of scope
  • Examples of high-level programming languages
    include Fortran, Cobol, Pascal, C, C, Java

19
Compilers
  • Compiler is a computer program (or set of
    programs) that translates text written in a
    computer language (the source language) into
    another computer language (the target language).
  • The original sequence is usually called the
    source code and the output called object code.

20
C Compilers
  • C is a general-purpose programming language
    with high-level and low-level capabilities.
  • C is a statically typed, free-form,
    multi-paradigm, usually compiled language
    supporting procedural programming, data
    abstraction, object-oriented programming, and
    generic programming.
  • C is regarded as a mid-level language. This
    indicates that C comprises a combination of
    both high-level and low-level language features.

21
Stages in Programming
  • Problem specification define what the solution
    should accomplish.
  • Solution design define the process that can be
    used to achieve the desired result.
  • Implementation translate an algorithm into
    working commands or instructions (code).
  • Documentation describe what the program should
    accomplish and explain how various segments of
    the code are designed.
  • Testing and debugging ensure a computer program
    produces a correct result for many sets of input.

22
Software Engineering
  • Software engineering is the application of a
    systematic, disciplined, quantifiable approach to
    the development, operation, and maintenance of
    software
  • The goals of software design are to ensure that
    software is
  • Reliable
  • Easy to write
  • Easy to understand and use
  • Easy to upgrade

23
Software Engineering
  • Techniques for achieving software engineering
    goals
  • Abstraction and top-down design no coding can
    begin until a sufficient level of detail has been
    reached in the design of the system
  • Reuse of well-tested code save development time
  • Modularity subdivide a larger object into
    smaller pieces that are self-contained and
    self-standing
  • Information hiding allow safe use of a device
    without requiring that the users understand the
    inner working of that device

24
Mechanics of Writing Programs
  • Editing Writing a program
  • Compiling Translating from C into machine
    language
  • Linking Combining your program with other
    libraries
  • Running Letting the computer execute a program
  • Debugging Running step by step through a program
    searching for mistakes
Write a Comment
User Comments (0)
About PowerShow.com