Lecture 1 PF
Lecture 1 PF
Lecture 1 PF
Course
Course Title: Programming Fundamentals
Course Code: CS-111
Credit Hours: 4 (3 + 1)
🞂 Reference Books:
🞂 Computers
🞂 Components of computers
◦ Hardware
◦ Software
7
1. A Computer is an electronic machine
which is used for data processing.
9
🞂 Take input
🞂 Computes
🞂 High speed
🞂 Store information
🞂 Produces output
10
🞂 Two components
◦ Hardware
🞂 The physical equipment required to create, use, manipulate
and store electronic data
◦ Software
🞂 Set of instructions written in some programing language
🞂 The computerised instructions that operate a computer,
manipulate the data and execute particular functions or tasks.
11
12
🞂 Physical parts
◦ Memory (Main/ Secondary).
◦ CPU(Central Processing Unit)
🞂 ALU(Arithmetic and Logic Unit)
🞂 CU(Control Unit).
◦ I/O Devices
◦ Peripheral device
🞂 Central processing unit (CPU):
◦ The chip or chips at the heart of a computer that enable it to
process data.
◦ Also known as a processor
🞂 Memory:
◦ An area within a computer system that holds data waiting to be
processed.
🞂 Storage device:
◦ The place where a computer puts data.
🞂 Input devices
◦ The devices that allow data and instructions to enter a
computer (such as a keyboard, mouse, scanner)
🞂 Output devices:
◦ the devices that allow information to be represented (that is,
given out) to the user, such as a display screen or printer)
🞂 Peripheral device:
◦ Any piece of equipment in a computer system that is not
actually inside the computer itself.
◦ Printers, scanners and external disk drives
🞂 The most common type of memory that most
users are familiar with is ‘main memory’ or ‘RAM’
(Random-Access Memory).
🞂 RAM holds an area in the computer system unit
that temporarily holds a user’s data, operating
system instructions and program instructions.
🞂 The word ‘main’ is used to distinguish it from
external mass storage devices such as the hard
drive or disk drives.
Memory
▪ A computer’s memory consists of an ordered sequence of bytes for
storing programs as well as data that the program is working with.
▪ You can think of memory as the computer’s work area for
executing a program. A program and its data must be moved
into the computer’s memory before they can be executed by
the CPU.
▪ Every byte in the memory has a unique address, as shown in Figure
▪ The address is used to locate the byte for storing and retrieving
the data. Since the bytes in the memory can be accessed in any
order, the memory is also referred to as random-access
memory (RAM).
🞂 Read Only Memory
🞂 Memory on which data has been prerecorded.
🞂 Once data has been written onto a ROM chip, it
cannot be removed and can only be read.
🞂 Unlike main memory (RAM), ROM retains its contents
even when the computer is turned off.
🞂 ROM is referred to as being nonvolatile, whereas RAM
is volatile.
🞂 Most PCs contain a small amount of ROM that stores
critical programs such as the program that boots the
computer.
🞂 Different types of ROM
◦ PROM (programmable read-only memory).
◦ EPROM
1. Set of instructions that tells a computer
component (hardware) how to perform a
task.
🞂 Set of instruction = Program
🞂 Program is a set of instructions in any computer
programming language which directs computer to do
specific tasks.
1. Integrated set of programs
◦ System Software
◦ Application Software.
🞂 System software – programs to control the
operations of computer equipment
◦ Operating system
◦ Compiler
◦ Loader
◦ Linker
◦ Interpreter
Compiler
Loader
Linker
Interpreter
Why Programming ?