0% found this document useful (0 votes)
4 views

Lecture_1

The document outlines the course CS226 Computer Organization and Assembly Language, detailing the syllabus, textbooks, and assessment criteria. It discusses key concepts such as Moore's Law, Bell's Law, and the evolution of computer classes, alongside the impact of technology on various applications. Additionally, it covers computer performance metrics, types of computers, and the significance of abstraction in computer architecture.

Uploaded by

Hurr Abbas
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture_1

The document outlines the course CS226 Computer Organization and Assembly Language, detailing the syllabus, textbooks, and assessment criteria. It discusses key concepts such as Moore's Law, Bell's Law, and the evolution of computer classes, alongside the impact of technology on various applications. Additionally, it covers computer performance metrics, types of computers, and the significance of abstraction in computer architecture.

Uploaded by

Hurr Abbas
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 51

CS226 COMPUTER

ORGANIZATION AND
ASSEMBLY LANGUAGE

Civilization advances by extending the


number of important operations which
we can perform without thinking about
them. Alfred North Whitehead

Instructor: Asra Masood


Lecturer
Department of Creative Technologies
FCAI
Text books:

 “Assembly Language for Intel-based Computers


”, 7th Edition, Irvine, Prentice Hall 2003

 Computer Organization and Design The


Hardware/Software Interface, 5th Edition (2014)
by David A. Patterson and John L. Hennessy
Morgan Kaufmann Publishers

Assessment:
 Assignments: 15%
 Quizzes: 15%
 Midterm test: 25%
 Final exam: 45%
COMPUTER ORGANIZATION 5th
AND DESIGN Editio
n
The Hardware/Software Interface

Chapter 1
Computer Abstractions
and Technology
MOORE’S LAW
 Moore’s Law states that integrated
circuit resources double every two
years (18–24) months.
 Moore’s Law resulted from a 1965
prediction of such growth in IC
capacity made by Gordon Moore,
one of the founders of Intel.
 Moore’s Law graph to represent
designing for rapid change
MOORE’S LAW
Year of introduction Transistors
4004 1971 2,250
8008 1972 2,500
8080 1974 5,000
8086 1978 29,000
286 1982 120,000
386™ 1985 275,000
486™ DX 1989 1,180,000
Pentium® 1993 3,100,000
Pentium II 1997 7,500,000
Pentium III 1999 24,000,000
Pentium 4 2000 42,000,000
IS MOORE’S LAW ENDING?
 Intel’s former chief architect Bob Colwell
says: Moore’s law will be dead within a
decade (August 2013).
 Theoretical physicist Michio Kaku
believes Moore's Law has about
10 years of life left
before ever-shrinking transistor sizes
smack up against limitations imposed
by the laws of thermodynamics and
quantum physics (April 2013).
https://www.intel.com/content/www/us/
en/newsroom/resources/moores-law.ht
ml#gs.kawmkf
IS MOORE’S LAW ENDING? (2)
BELL’S LAW
Bell's Law for the birth and death of computer
classes:
 Bell's law of computer classes formulated by

Gordon Bell in 1972 describes how computing


systems (computer classes) form, evolve and
may eventually die out.
 Roughly every decade a new, lower priced

computer class forms based on a new


programming platform, network, and
interface resulting in new industry.
 In 1951, men could walk inside a computer

and now, computers are beginning to “walk”


inside of us .
BELL’S LAW

Source: B Bell, “Bell’s Law for the Birth and Death of Computer Classes”, Comms of
ACM, 2008
GENERATION
THE 1ST
COMPUTER

Source:
COMPUTERS TODAY
Introduction
§1.1
THE COMPUTER REVOLUTION
 Progress in computer
technology
 Underpinned by Moore’s Law
 Makes novel applications
feasible
 Computers in automobiles
 Cell phones
 Human genome project
 World Wide Web
 Search Engines

Introduction
§1.1
THE COMPUTER REVOLUTION
(2)
 Computers in automobiles
 reduce pollution, improve fuel efficiency
via engine controls, and increase safety
through blind spot warnings, lane
departure warnings, moving object
detection, and air bag inflation to
protect occupants in a crash
 Cell phones
 more than half of the planet having
mobile phones, allowing person-to-
person communication to almost
anyone anywhere in the world
THE COMPUTER REVOLUTION

Introduction
§1.1
(3)
 Human genome project
 a global effort to identify the estimated
30,000 genes in human DNA to figure
out the sequences of the chemical
bases that make up human DNA to
address ethical, legal, and social issues
 The cost of computer equipment to
map and analyze human DNA
sequences was hundreds of millions of
dollars. Since, costs continue to drop,
we will soon be able to acquire our
own genome, allowing medical care to
be tailored to us
Introduction
§1.1
THE COMPUTER REVOLUTION
(4)
 World Wide Web
 has transformed our society. Web
has replaced libraries and
newspapers
 Search Engines
 As the content of the web grew in size
and in value, many people rely on
search engines for such a large part of
their lives that it would be a hardship to
go without them
CLASSES OF COMPUTERS

 Personal
computers
 Server computers

 Supercomputers

 Embedded

computers
CLASSES OF COMPUTERS
 Personal computers
 Computers designed for use by an
individual
 General purpose, variety of software
 Subject to cost/performance tradeoff
 Server computers
 Computers used for running larger
programs for multiple users, often
simultaneously
 Network based
 High capacity, performance, reliability
 Range from small servers to building
CLASSES OF COMPUTERS
 Supercomputers
 Consist thousands of processors and
many terabytes of memory
 High-level scientific and engineering
calculations
 Highest capability and cost but represent a
small fraction of the overall computer
market
 Embedded computers
 Hidden as components of systems
 Largest class of computers and span the
widest range of applications

THE POSTPC ERA
 Smart phones
represent the recent
growth in cell phone
industry, and they
passed PCs in 2011.
 Tablets are the
fastest growing
category, nearly
doubling between
2011
and 2012.
 Recent PCs and
traditional cell
phone categories
are relatively flat or
THE POSTPC ERA
 Personal Mobile Devices (PMDs)
 Small wireless devices
 Battery operated
 Connects to the Internet
 Hundreds of dollars
 Smart phones, tablets, electronic
glasses
THE POSTPC ERA
 Cloud computing
 Term cloud essentially used for the
Internet
 Portion of software run on a PMD
and a portion run in the Cloud
 Warehouse Scale Computers
(WSC)

Big datacenters containing 100,000
servers

Amazon and Google cloud vendors
 Software as a Service (SaaS)

Delivers software and data as a service
over the Internet
WHAT YOU WILL LEARN
 How programs are translated
into machine language
 and how hardware executes
them
The hardware/software

interface
 What determines program
performance
 and how it can be improved
 How hardware designers
improve performance
UNDERSTANDING PERFORMANCE
 Algorithm
 determines number of operations

executed
 Programming language, compiler,
architecture
 determine number of machine

instructions executed per operation


 Processor and memory system
 determine how fast instructions are

executed
 I/O system (including OS)
Architecture
§1.2 Eight Great Ideas in Computer
EIGHT GREAT DESIGN IDEAS
 Design for Moore’s Law

Computer designs can take years, resources
available per chip can easily double or
quadruple between start and finish of project

Anticipate where technology will be when
design finishes
 Use Abstraction to simplify design
 Hide lower-level details to offer a simpler model
at higher levels
 Make the Common Case Fast

To enhance performance better than
optimizing the rare case
Architecture
§1.2 Eight Great Ideas in Computer
EIGHT GREAT DESIGN IDEAS
 Performance via Parallelism

A form of computation in which many
calculations are carried out simultaneously
 Performance via Pipelining

A particular pattern of parallelism

A set of data processing elements connected
in series, so that the output of one element is
the input of the next one
 Performance via Prediction

It can be faster on average to guess
and start working rather than wait
Architecture
§1.2 Eight Great Ideas in Computer
EIGHT GREAT DESIGN IDEAS
 Hierarchy of memories

The closer to the top, the faster and more
expensive per bit of memory

The wider the base of the layer, the
bigger the memory
 Dependability via redundancy

Design systems dependable by
including redundant components

to take over when failure occurs,
and

to help detect failures
Program
§1.3 Below Your
BELOW YOUR PROGRAM
 Application software

Written in high-level language
 System software

Compiler: translates HLL
code to machine code

Operating System:

Handling input/output

Managing memory and storage

Scheduling tasks & sharing
resources
 Hardware

Processor, memory, I/O
controllers
LEVELS OF PROGRAM CODE
 High-level language

Level of abstraction
closer to problem
domain

Provides for
productivity and
portability
 Assembly language

Textual
representation of
instructions
 Hardware
representation

Binary digits (bits)
Covers
§1.4 Under the
COMPONENTS OF A COMPUTER
The BIG Picture
 Same components
for all kinds of
computer

Desktop,
Server,
Embedded
 Input/Output
includes

User-interface devices

Display, keyboard,
mouse

Storage devices

Hard disk, CD/DVD,
flash
ABSTRACTIONS
The BIG Picture
 Abstraction helps us deal with
complexity
 Hides lower-level details
 Instruction Set Architecture
(ISA) or Computer Architecture
 The hardware/software interface
 Includes instructions, registers,
memory access, I/O, and so on
 Operating system hides details of
doing I/O, allocating memory from
A SAFE PLACE FOR DATA
 Volatile main memory
 Loses instructions and data when
power off
 Non-volatile secondary memory
 Flash memory
 Optical disk (CDROM, DVD)
 Magnetic disk
NETWORKS
Backbone of computer systems
 Communication


Information is exchanged between computers
at high speeds
 Resource sharing

Rather than each computer having its own
I/O devices, computers on the network can
share I/O devices
 Nonlocal access

By connecting computers over long
distances, users need not be near the
computer they are using
NETWORKS
 Local area network (LAN): Ethernet
 A network designed to carry data
within a geographically confined area,
typically within a single building
 Wide area network (WAN): the
Internet
 A network extended over
hundreds of kilometers that can
span a continent
 Wireless network: WiFi,
Bluetooth
Performance
§1.6
DEFINING PERFORMANCE
 Which airplane has the best
performance?
Boeing 777 Boeing 777

Boeing 747 Boeing 747

BAC/Sud BAC/Sud
Concord Concord
e e
Dougla Douglas
s DC-8- DC- 8-
50 50

0 Passenger 0 Cruising Range


Capacity (miles)
1 2
0 0
0 0
Boeing Boeing 777 0
777 2
0 Boeing 747
Boeing 0 4
747 BAC/Sud 0
3 Concord 0
BAC/Sud 0 0
e
Concord 0
Douglas
e
4 DC- 8- 6
Dougla 0 500 1000 1500 50 0 100000 200000 300000
s DC-8- 0 0 400000
50 Cruising Speed 0 Passengers x
5 (mph) mph
0
0 8
0
0
0
RESPONSE TIME AND
THROUGHPUT
 Response time

How long it takes to do a task
 Throughput

Total work done per unit time
e.g., tasks/transactions/… per hour
 How are response time and throughput
affected by

Replacing the processor with a faster version?

Adding more processors?
 We’ll focus on response time for now…
RELATIVE PERFORMANCE
 Define Performance = 1/Execution
Time
 “XPerformance
is n timesXfaster thanY Y”
Performance
 Execution time Y Execution
time X  n
 Example: time taken to run a
program
 10s on A, 15s on B
 Execution TimeB / Execution TimeA
= 15s / 10s = 1.5 = 1½
 So A is 1½ times faster than B
MEASURING EXECUTION TIME
 Elapsed time

Total response time, including all aspects

Processing, I/O, OS overhead, idle time

Determines system performance
 CPU time

Time spent processing a given job

Minus I/O time, other jobs’ shares

Includes user CPU time and system CPU
time

Different programs are affected differently
by CPU and system performance

Running on servers – I/O performance –
hardware and software

Total elapsed time is of interest

Define performance metric and then proceed
CPU CLOCKING
 Operation of digital hardware
governed by a constant-rate clock
Clock
period

Clock (cycles)

Data transfer
and
computation
Update state
 Clock period: duration of a clock
cycle

e.g., 250ps = 0.25ns = 250×10–12s
 Clock frequency (rate): cycles per
second
CPU TIME
CPU Time  CPU Clock Cycles Clock Cycle
Time

CPU Clock

 Performance can be improved by
Cycles Clock
 Reducing number
Rate of clock cycles
 Increasing clock rate
 Hardware designer must often trade off
clock rate against cycle count
CPU TIME EXAMPLE
 Computer A: 2GHz clock, 10s CPU time
 Designing Computer B
 Aim for 6s CPU time

 Can do faster clock, but causes 1.2 × clock cycles

 How fast must Computer B clock be?

Clock B 
Clock CyclesB 1.2 Clock
CPU Time 
Rate Cycles
B
6s A
Clock CyclesA  CPU Time A Clock
RateA

 10s 2GHz 9 20 109


1.2  20 10 24
Clock RateB  
1096s
 4GHz
6s
INSTRUCTION COUNT AND CPI
Clock Cycles  Instruction Count  Cycles Per
Instruction
CPU Time  Instruction Count  CPI Clock
Cycle Time
 Instruction
Instruction Count Count CPI
for aprogram


Determined by program,
Clock Rate ISA, and
compiler
 Average cycles per instruction

Determined by CPU hardware

If different instructions have different
CPI

Average CPI gets affected by
CPI EXAMPLE
 Computer A: Cycle Time = 250ps, CPI
= 2.0
 Computer B: Cycle Time = 500ps, CPI

= 1.2
 Same ISA

Which
 CPU TimeisA faster? by how
 Instruction Countmuch?
 CPIA  Cycle
A is faster…
Time A

 I 2.0  250ps  I 500ps

CPU TimeB  Instruction Count  CPIB 


CPU TimeB I 600ps … b y this
Cycle TimeB   much

 I1.2  500ps  I 600ps


CPU Time
CPI IN MORE DETAIL
 If different instruction classes take
different numbers of cycles
n

Clock Cycles   (CPIi Instructio n


Counti )
 Weighted average
i1

CPI Clock Cycles n


 Instruction
CPI   CPI i 
 Instruction i1
 Instruction
Count i 
Count  Count 
Relative
frequency
CPI EXAMPLE
 Alternative compiled code sequences
using instructions in classes A, B, C
Class A B C
CPI for class 1 2 3
IC in sequence 1 2 1 2
IC in sequence 2 4 1 1

 Sequence 1: IC =  Sequence 2: IC
5 = 6
Clock Cycles

Clock Cycles = 4×1 + 1×2 +
= 2×1 + 1×2 + 1×3
2×3 =9
= 10 
Avg. CPI = 9/6 =
 1.5
PERFORMANCE SUMMARY
The BIG Picture

Instructions Clock Cycles


CPU Time   
Seconds Program Instruction
Clock Cycle

 Performance depends on
 Algorithm: affects IC, possibly CPI
 Programming language: affects IC, CPI
 Compiler: affects IC, CPI
 Instruction set architecture: affects IC,
Wall
§1.7 The Power
POWER TRENDS

Clock rate and Power for Intel x86 microprocessors over eight
generations
 In CMOS IC technology
Power  Capacitive load Voltage 2

Frequency
×30 5V → 1V ×1000
REDUCING POWER
 Suppose a new CPU has
 85% of capacitive load of old CPU
 15% voltage and 15% frequency
reduction
Pnew Cold  0.85  (Vold2 0.85)2 Fold  0.854 
Pold  C  V F
old old 0.52
old
0.85

 The power wall
 We can’t reduce voltage further
 We can’t remove more heat
 How else can we improve
performance?
Multiprocessors
§1.8 The Sea Change: The Switch to
UNIPROCESSOR PERFORMANCE
Technology
driven

Advanced architectural and organizational ideas

Constrained by power, instruction-level parallelism,


memory latency
MULTIPROCESSORS
 Multicore microprocessors
 More than one processor per chip
 Requires explicitly parallel
programming
 Compare with instruction level
parallelism

Hardware executes multiple instructions
at once

Hidden from the programmer
 Hard to do (Why?)

Programming for performance

Load balancing
Remarks
§1.9 Concluding
CONCLUDING REMARKS
 Cost/performance is improving
 Due to underlying technology
development
 Hierarchical layers of abstraction
 In both hardware and software
 Instruction set architecture
 The hardware/software interface
 Execution time: the best
performance measure
 Power is a limiting factor
 Use parallelism to improve
performance
ACKNOWLEDGEMENT
•The slides are adopted from Computer Organization
and Design, 5th Edition by David A. Patterson and
John L. Hennessy 2014, published by MK (Elsevier)

You might also like