You are on page 1of 14

Elementary Computer

Programming
Chapter No. 1

Introduction to Computers
Outline

• A layered view of Computers


• Operating System
• Functions of Operating Systems
• How to communicate with Computers
• Computer Languages
• Translators
A Layered View of the Computer

Application Programs
Word-Processors, Spreadsheets,
…Database Software, etc
System Software
Compilers, Interpreters, etc.
Operating System, Device Drivers
Machine with all its hardware
Operating System

• Type of system software


• consisting of programs and data
– that runs on computers,
– manages computer hardware resources,
– and provides common services for execution of
various application software
e.g.
– Microsoft windows, DOS, Linux, Android
Functions of OS

• Process management
• Memory management
• Input / Output management
• File management
• Interpretation of commands and instructions.
• Facilitates easy communication
– between the computer system and the user.
Number system

• Binary (1, 0)
• Octal (0-7)
• Decimal (0-9)
• Hexadecimal (0-9, A-F)
Bits and Bytes

• A bit is a single numeric value either ‘1’or ‘0. that


encodes a single unit of digital information.
• A byte is a sequence of bits.
• 8 bits=1 byte.
How to Communicate with computer?

• Computer understands its own machine


language (language of 0s and 1s).

• Language instructs computer to perform tasks.

• We need to understand computer’s language to


communicate with it and to make it perform our
desired functions.

• So we have….
Programming Language

– Set of rules and symbols used to construct a


computer program

– A language used to interact with the computer


Computer Languages

• Machine Language
• Uses binary code
• Machine-dependent
• Not portable
• Assembly Language
– Uses mnemonics
• a mnemonic is an abbreviation for an operation. For
example, inc ("increase by one") is a mnemonic.
– Machine-dependent
– Not usually portable
• High-Level Language (HLL)
– Uses English-like language
– Machine independent
– Portable (but must be compiled for different platforms)
• Examples: Pascal, C, C++, Java, Fortran, . . .
Translators

• A computer program or set of programs that


transforms source code to object code.

• Assembler: translates assembly language


to machine language

• Compiler : translates high level language


programs in to machine code.
Activity

1. What is the smallest unit of information?


_________
2. Machine language is a language of _________
3. What is object code?
______________.
4. _______ translates the source code to object
code.

You might also like