PF Lecture 1
PF Lecture 1
Fundamentals
Lecture # 1
Introduction
Lecturer
Sarah Naveed
Lab Engineer
Introduce Yourself !
Name?
FSC-PreEng/ FSC-PreMed /ICS?
College?
Why BS-AI?
Title of Course : Programming Fundamentals
Course Code :
Credit Hours : 3+1
Language Used : C++
5
Assignments 10 Points
Quizzes (Un announced) 10 Points
Mid-Term exam 30 Points
Final-Term exam 50 Points
6
RECOMMENDED TEXT BOOK
how to program in c++ by dietel and dietel( latest
Edition)
REFERENCE MATERIAL
Starting out with C++, by Tony Gaddis, 7nd
Robert Lafore, “Object-Oriented Programming in C++”,
3rd/4th Edition
7
Data Types
Conditional Statements
Repetition Structures
Functions
Arrays
String Manipulation
Structures
Pointers
File Handling
8
Von-Neumann computer architecture design was proposed
in 1945.It was later known as Von-Neumann architecture.
Historically there have been 2 types of Computers:
Fixed Program Computers – Their function is very specific
and they couldn’t be reprogrammed, e.g. Calculators.
Stored Program Computers – These can be programmed to
carry out many different tasks, applications are stored on
them, hence the name.
Modern computers are based on a stored-program concept
introduced by John Von Neumann. In this stored-program
concept, programs and data are stored in the same
memory. This novel idea meant that a computer built with
this architecture would be much easier to reprogram.
9
10
It is also known as ISA (Instruction set architecture)
computer and is having three basic units:
11
Control Unit –
A control unit (CU) handles all processor control signals.
It directs all input and output flow, fetches code for
instructions, and controls how data moves around the
system.
Arithmetic and Logic Unit (ALU) –
The arithmetic logic unit is that part of the CPU that
handles all the calculations the CPU may need, e.g.
Addition, Subtraction, Comparisons. It performs Logical
Operations, Bit Shifting Operations, and Arithmetic
operations.
Assignment question
Give a detailed overview of Von-Newman Architeture
12
“Electronic device for storing and processing
data, making calculations, or controlling
machinery.” (The Pocket Oxford Dictionary)
Hardware Software
All the machinery • All the instructions that
and equipment in a tell the computer how
computer system to perform a task
Hard devices in the • Tell the computer what
computer
to do
Anything that can
be touched • Also called a program
• Thousands of
programs exist 16
All computers follow same basic operations.
Input
Processing
Output
Storage
Communication (optional)
17
1. Input
Input - whatever is put into
(“input”) a computer system.
Memory chips
Motherboard - the
main circuit board in
the computer.
Everything else
attaches to the
motherboard
through connections
called ports.
Expansion slots -
“plugs” on the
motherboard for
expanding the PC’s
capabilities via
additional circuit
boards. Motherboard
22
3. Storage
Primary storage •Secondary storage (storage) -
(memory) - RAM
vs.
•The area in the computer
Computer circuitry where data or information is
that temporarily held permanently
holds data waiting
to be processed
Hard-disk drive - a
storage device that
stores billions of
characters of data on a
non-removable disk
platter.
Magnetic storage
(Floppy and hard drive)
uses a magnet to Hard-disk drive
access data.
24
3. Storage
CD (Compact
Disk) drive or
DVD (Digital
Video Disk) drive
- a storage device
that uses laser
technology to
read data from
optical disks.
25
3. Storage
Flash Memory
and USB Drive
Stores data by
turning million of
tiny switches on
and off.
Flash Memory
and USB Drive
26
4. Output
Output hardware -
devices which translate
information processed by
the computer into a form
that humans can
understand.
Speakers - the
devices that play
sounds
transmitted as
electrical signals
from the sound
card.
Speakers
28
4. Output
Video card -
converts the
processor’s
output
information into a
video signal that
can be sent
through a cable
to the monitor.
29
4. Output
Monitor
30
4. Output
Printer - an
output device
that produces
text and graphics
on paper.
Printer
31
5.
Communicati
ons
Modem - a device
that sends and
receives data
over telephone
lines to and from
computers.
32
33
We still need the
Software
!
34
The majority of people who purchase computers, do
so, because of software.
35
System software
and…
36
Application
software
Word Processing
Photo Editing
Creating web pages
Computer Games…
37
38
A programming language is a vocabulary and set of
grammatical rules for instructing a to perform specific
tasks.
The term programming language usually refers to
high-level languages, such as BASIC, C, C++, C#, Java,
FORTRAN, Ada, and Pascal.
In this course we will study C++ programming language.
39