0% found this document useful (0 votes)
47 views26 pages

Programming Fundamentals: Week 01

The document provides an introduction to computer organization and programming fundamentals. It discusses the central processing unit which coordinates the computer sections and can execute billions of instructions per second. It describes random access memory for rapid data access and hard disks for long-term storage. The document outlines the memory hierarchy from cache to memory to disks, and how speed decreases but space increases as one moves down the hierarchy. It also covers machine languages, assembly languages, and high-level languages that computers understand and humans write in. Flowcharts are introduced as a way to visually depict processes and workflows through different symbols and their connections.

Uploaded by

Usman Bokhari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views26 pages

Programming Fundamentals: Week 01

The document provides an introduction to computer organization and programming fundamentals. It discusses the central processing unit which coordinates the computer sections and can execute billions of instructions per second. It describes random access memory for rapid data access and hard disks for long-term storage. The document outlines the memory hierarchy from cache to memory to disks, and how speed decreases but space increases as one moves down the hierarchy. It also covers machine languages, assembly languages, and high-level languages that computers understand and humans write in. Flowcharts are introduced as a way to visually depict processes and workflows through different symbols and their connections.

Uploaded by

Usman Bokhari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Programming

Fundamentals
WEEK 01
Computer Organization
Computer Organization
Central Processing Unit
“Administrative” section of a computer
Coordinates and supervises the operation of the other
sections
Can execute billions of instructions per second
Multi-core processors:
◦ Implements multiple processors on a single integrated-circuit
chip—a dual-core processor has two
CPUs and a quad-core processor has four CPUs etc.
Random Access Memory (RAM)
Also called memory, main memory, or primary memory

Rapid-access of data (as compared to HDD)


Volatile—data is typically lost when the computer’s power
is turned off
Relatively low-capacity
◦ Measured in GBs
◦ 4 GB, 8 GB, 16 GB, and as large as 128 GB (in specially
high-end personal machines)
Hard Disk
Is a type of external storage
Long-term data storage
High-capacity (up to 8 TB)
Data Layout on Hard Disk
Track: one ring
Sector: one pie-shaped piece.
Block: intersection of a track and a sector.
Hard Disk (Speed)
Assuming that a disk spins at 3600 RPM (Revolutions per minute), one revolution occurs in 1/60
of a second, or 16.7ms Crudely speaking, one disk access takes about the same time as 200,000
instructions
Memory Hierarchy
speed
cache
on-chip
silicon

off-chip
memory
silicon

disk ferro-magnetic
space
Space vs. Speed
Speed becomes plentiful as we move up the pyramid

Space gets (dirt) cheap as we move down the pyramid

◦ Disk access ~105 x slower than memory access


◦ Memory access ~102 x slower than cache access
Data Hierarchy
Data Hierarchy
Bit
◦ One binary digit
◦ Unit of data storage
Character
◦ An ASCII (or any other code like Unicode) standard to read a set of bytes
Field
◦ A collection of multiple characters to represent a value (name, number, gender etc.)
Record
◦ Ac collection of fields (of multiple types)
File
◦ A collection of records
Database
◦ A collection of files
Machine Languages, Assembly
Languages and High-Level Languages
Three types of computer languages
– Machine language
◦ Only language computer directly understands
◦ “Natural language” of computer
◦ Defined by hardware design
◦ Generally consist of strings of numbers
◦ Ultimately 0s and 1s
◦ Instruct computers to perform elementary operations
◦ Cumbersome for humans
◦ Example instruction
◦ 01010101 11110000 10101010
Machine Instruction Cycle
Machine Instruction Cycle (2)
Machine Languages, Assembly
Languages and High-Level Languages
Three types of computer languages (Cont.)
– Assembly language
◦ English-like abbreviations representing elementary computer operations
◦ Clearer to humans
◦ Incomprehensible to computers
◦ Converted to machine language by translator programs (assemblers)
◦ Example
◦ loadbasepay
add overtimepay
store grosspay
Assembly Language Cycle
Machine Languages, Assembly
Languages and High-Level Languages
Three types of computer languages (Cont.)
– High-level languages
◦ Similar to everyday English
◦ Uses common mathematical notations
◦ Single statements accomplish substantial tasks
◦ Converted to machine language by translator programs (compilers)
◦ Interpreter programs
◦ Directly execute high-level language programs
◦ Execute more slowly than the compiled program
◦ Example
◦ grossPay = basePay + overTimePay
High-level Language Cycle
Interpreter Cycle
Introduction to Flowchart
A flowchart is a type of diagram that reflects a process or workflow. The flowchart displays the
steps as different types of boxes, and their order by connecting the boxes to arrows. This diag
rammatic representation shows a solution model for a specific issue.
Introduction to Flowchart
Symbol Purpose Description

Flow line Indicates the flow of logic by connecting


symbols.
Represents the start and the end of a
Terminal(Stop/Start)
flowchart.

Input/Output Used for input and output operation.

Used for arithmetic operations and data-


Processing
manipulations.
Used for decision making between two or
Decision
more alternatives.
On-page Connector Used to join different flow line

Off-page Connector Used to connect the flowchart portion on a


different page.
Predefine Represents a group of statements
Process/Function performing one processing task.
Example
Add two numbers entered by the user. Start

Input
Number: 1

Input
Number: 2

Number1+Number2

Output: Sum

End
Example
Find the largest number among the two number
Start
entered by the user.
Input N1

Input N2

If No
Output: N2
N1>N2?

YES

Output: N1 End
“He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever”
Chinese Proverb
Questions?

“The wise man doesn't give the right answers, he poses the right questions.”
Claude Levi-Strauss

“A wise man can learn more from a foolish question than a fool can learn from a wise answer.”
Bruce Lee

You might also like