Anda di halaman 1dari 63

CS2100 Computer Organisation

Use IVLE

Introduction
(AY20011/12) Semester 1

Logistics (1)
Lecturer:

Associate Professor Wong Weng Fai


Office: COM2-03-56
Email: wongwf@comp.nus.edu.sg

2011 Sem 1

Introduction

Logistics (2)

Lectures:
Wednesdays 12-2pm @ LT19
Fridays 4-5pm @ LT19
Special make-up lecture:
19 Sep 10am-12pm
Venue to be announced later

Tutorials and Labs to start the week of


August 22
Remember to bid for your tutorial groups next week

2011 Sem 1

Introduction

Assessment
Lab

assignments have to be handed up


Two individual take home assignments
In-class pop quizzes
Mid-term test
19 Sep 2011 2pm @ LT19
Final

exam

Monday, 21 Nov 2010 - 9am


Venue to be determined later
2011 Sem 1

Introduction

Texts
First

half of the course will mainly come


from:
Tan Tuck Choy, Digital Logic Design,
McGraw-Hill 2005.

Second

half of the course will mainly come

from:
David A. Patterson and John L. Hennessy,
Computer Organization and Design, 3rd
edition. Morgan Kaufmann Publishers.
2011 Sem 1

Introduction

Why CS2100?
Give

you an idea of the inner workings of


a computer

Expose

you to some very clever ideas

Outside software (out of the box)


Give

you a taste of hardware from a CS


perspective

2011 Sem 1

Introduction

How to succeed in CS2100

Good attitude, stay positive


Stay curious

Do your tutorials and labs

Attend lectures
Not just in physical presence

2011 Sem 1

Ask!
Introduction

Lets get started!

Long long time ago

It all starts with numbers!


All languages have some form of numbers
followed by arithmetic operations: addition, subtraction,
division, and so on

History of number is quite interesting in itself


E.g. Concept of negative number
Chinese ~200AD
India/Arabians ~1000AD
European ~1800AD

2011 Sem 1

Introduction

Computing/Computer
Simple

computing == arithmetic

Performing mathematical operations


Lets

2011 Sem 1

look at definitions of a computer

Introduction

10

Computing/Computer
Def: Oxford English Dictionary (1955)
n. A person who makes calculations or computations; a
calculator, a reckoner; spec. a person employed to make
calculations in an observatory, in surveying, etc.

Def: Oxford English Dictionary (today)


n. an electronic device (or system of devices) which is used to
store, manipulate, and communicate information, perform
complex calculations, or control or regulate other devices or
machines, and is capable of receiving information (data) and of
processing it in accordance with variable procedural instructions
(programs or software).
2011 Sem 1

Introduction

11

Early History Calculating devices


Abacus

(or counting frame)

Middle east (early versions)


3000 BC

Roman
1 AD

China:
Earliest written document (1400 AD)

2011 Sem 1

Introduction

12

1600s

1612 Napiers Bones


By John Napier

1630 Circular Slide Rule


By William Oughtred
Developed the slide-ruler

2011 Sem 1

Introduction

13

Napier Bone Example


Arrange the bones to make 4896.

First number is 2, write down 2.


Add 4+3=7, write down 7.
Add 6+6=12, write down 2, carry the
Add 5+8(+1)=14, write down 4, carry
Add 2(+1)=3, write down 3.
There is your answer!

7 x 4896 =
2011 Sem 1

Introduction

14

1600s cont

1642 Pascaline
by Blaise Pascal
Adding machine that used eight 10-toothed wheels

1673 Calculator
by Gottfried Wilhelm von Leihniz
Used gears and dials: +-/*

2011 Sem 1

Introduction

15

1800s cont
1822

Difference Engine

by Charles Babbage
Often called the father of computing

Designed a mechanical machine


Tabulate logarithm and trigonometric

Never completed

2011 Sem 1

Introduction

16

1800s cont
1833

Analytical Engine

Charles Babbage
A more general design
Programmable!

Four functions
Processing arithmetic operations
Storage 1000 50-digit numbers
Input and output

Ada Augusta Lovelace


Developed the first program!

2011 Sem 1

Introduction

17

1890

Tabulating Machine

by Herman Hollerith
Punch cards machines contained data for US census
Machine counted and summarized data
Founded Computing, Tabulating and Recording
Corporation

2011 Sem 1

Introduction

18

Early 1900s
1936

The ABC computer

Atanasoff and Berry Computer


Fully electronic computer
Data represented as 50-bit binary number

Prof. Atanasoff with his machine


at Iowa State University.

2011 Sem 1

Introduction

19

Early 1900s

Alan Turing (1912-1954)


British
A brilliant mathematician and computer enthusiast
PhD from Princeton in the US in 2 years only

One of the crackers of the Germany ciphers in WII


Proposed the Universal Machine Concept
Envisioned a computer that was programmable and flexible

Turing is considered one of the fathers of modern


computing theory
The highest award in CS is called the Turing award

2011 Sem 1

Introduction

20

Early 1900s
1944

Mark I

Electro-mechanical relays
Built by IBM and Howard Aiken of Harvard
Grace Hopper (US Navy) programmed the Mark I
Grace Hopper went on to develop the COBOL
programming language

2011 Sem 1

Introduction

21

"First" Actual Computer Bug

2011 Sem 1

Introduction

22

Early 1900s

1944 ENIAC

Electronic Numerical Integrator and Calculator


Eckert and Mauchly University of Pennsylvania
30 tons, 18000 vacuum tubes, 100times faster than Mark I
Commissioned by US army during WWI to compute
missile/ordinance trajectories
(it was completed at WWII)

2011 Sem 1

Introduction

23

How to program on ENIAC?

2011 Sem 1

Introduction

24

Early 1900s

1945 EDSAC
Electronic Delay Storage Automatic Computer
John Von Neumann (US)
Neumanns design hailed as a huge advancement
Von Neumann proposed the fetch-and-execute cycle
ALL computers use this architecture now

John Von
Neumann

2011 Sem 1

Introduction

25

CS2100 = How computers work

HOW DO COMPUTERS WORK?

What is a computer?
Types: desktops, notebooks, servers, supercomputers,
embedded devices,
Uses: Genomics, business, controls, graphics, games,
Manufacturers: Intel, IBM, Apple, Microsoft, Sun,

Analogy: a course on automotive vehicles


Similarities from vehicle to vehicle
Differences from vehicle to vehicle

Best way to learn:


Focus on a specific instance and learn how it works
While learning general principles and historical perspectives.

2011 Sem 1

Introduction

27

WHY? (FROM USER TO BUILDER)

You want to call yourself a computer scientist.


You want to build software people use.
You need to make purchasing decisions.
You need to offer expert advice.
Hardware and software affect performance
Algorithm determines number of source-level statements
(CS1101, CS1102)
Language, compiler, and architecture determine machine
instructions (COD chapters 2 and 3)
Processor and memory determine how fast instructions are
executed (COD chapters 5, 6 and 7)

Understanding performance (COD chapter 4)

2011 Sem 1

Introduction

28

SO, WHAT IS A COMPUTER? (1)

A machine?
Driver
Example: An automobile augments
our power of locomotion.

A computer is a device capable of


solving problems according to
designed programs. It simply
augments our power of storage and
speed of calculation.
2011 Sem 1

Introduction

Programmer
29

SO, WHAT IS A COMPUTER? (2)

Computers as information processors.

Raw
data

2011 Sem 1

Computer
system

Introduction

Processed
information

30

SO, WHAT IS A COMPUTER? (3)

From computer organisation perspective, we study the components


and how they work together
Processor, memory, input/output devices, networks,
Headphone
(Output)
Monitor
(Output)

Hardware box
(contains processor,
memory, buses etc.)

Mouse and Keyboard (Input)


2011 Sem 1

Introduction

31

SO, WHAT IS A COMPUTER? (4)


Network card and
CRT card
Motherboard
(Printed Circuit
Board)
Floppy disk
drive and
Hard disk
drive

Cage for
Processor
mounting drives
above picture: Patterson and Hennessy
2011 Sem 1

Introduction

Slots for RAM chips

32

SO, WHAT IS A COMPUTER? (5)

PC motherboard

2011 Sem 1

Introduction

33

SO, WHAT IS A COMPUTER? (6)

Computer organisation

Computer
CPU

2011 Sem 1

Memory

Devices

Control

Input

Datapath

Output

Introduction

34

SO, WHAT IS A COMPUTER? (7)

Inside a Pentium processor chip

2011 Sem 1

Introduction

35

SO, WHAT IS A COMPUTER? (8)

One of our focuses is the processor (datapath and


control)
Implemented using millions of transistors
Impossible to understand by looking at each transistor
Hence, we need

2011 Sem 1

Introduction

36

Today

Intel Core 2 Yorkfield (45nm)

Intel Core i7 Bloomfield (45nm)

Intel Core i7 Gulftown (32nm)

2011 Sem 1

Introduction

37

From ground up
Transistor
Logic Gate
Circuits
Memory
Processor
2011 Sem 1

Introduction

38

Fundamentals
In

the beginning there was the transistor

John Bardeen
(1908-1991)

Won a second
Nobel prize for
Physics in 1972!

Walter Houser Brattain


(1902-1987)

William Shockley
(1910-1989)

The 1956 Nobel Prize in Physics

"for their researches on semiconductors and their discovery of the transistor


effect"
2011 Sem 1

Introduction

39

On December 23, 1947


A single

2011 Sem 1

invention was to change the world

Introduction

40

So what is a transistor?
It

is a solid state switch

The input switches on or off the output


That why computers can only deal with 1s
and 0s switch on or off
It

is an amplifier

The output signal is much stronger than the


input
You can connect things up
2011 Sem 1

Introduction

41

The Metallic Oxide Semiconductor Field


Effect Transistor
Gate oxide insulator
Gate

N+ source

+
+

P- substrate

N+ drain

N-Channel Metallic Oxide Semiconductor Field Effect Transistor


2011 Sem 1

Introduction

42

ACTION!
++++++

Gate oxide insulator

Gate

+++++++++++++++

------------------N+ source

- -

+ -

N+ drain

P substrate
-

+
-

N-Channel Metallic Oxide Semiconductor Field Effect Transistor


2011 Sem 1

Introduction

43

State of the Art


The diameter of
the human hair is
about 20,000 nm

5 atoms thick
oxide layer

Intels 90nm
technology
MOSFET
transistor (2002)

2011 Sem 1

Introduction

44

From switch to gates


Just

switching on and off not enough to


compute
Need to build Boolean logic gates so as to
compute Boolean logic functions
The basic gates:
NOT
OR, AND
NAND, NOR
2011 Sem 1

Introduction

45

N-channel and P-channel

2011 Sem 1

Introduction

46

CMOS NOT Gate


VDD
P-channel MOSFET

Input:
0 = 0V
1 = +5V

Output

CMOS Inverter
N-channel MOSFET

GND
2011 Sem 1

Introduction

47

CMOS NOT Gate


VDD
P-channel MOSFET

Input:
1 = +5V

Output = 0

CMOS Inverter
N-channel MOSFET

GND
2011 Sem 1

Introduction

48

CMOS NOT Gate


VDD
P-channel MOSFET

Input:
0 = 0V

Output = 1

CMOS Inverter
N-channel MOSFET

GND
2011 Sem 1

Introduction

49

A very important gate


The CMOS NAND gate

Can you figure out what is


happening here?

GND
2011 Sem 1

Introduction

A
AND
B

A
NAND
B

0
0
1
1

0
1
0
1

0
0
0
1

1
1
1
0
50

Physical realization

GND
2011 Sem 1

Introduction

51

An Excursion
How do they make it?

2011 Sem 1

Introduction

52

90nm, 65nm, 45nm


The so-call technology node is the
basic unit of the rules (the size of the
grids) used to make such design. It is
determined by many factors including
the resolution of the printing, the
purity of the material etc.

Each move from one node to another


requires the building of entirely new
wafer fabs in the tune of billions of
dollars.

2011 Sem 1

Introduction

53

Today
2

1.16

m
rs
216m transisto
ION
L
L
I
B

Intel Sandy Bridge (32nm)

Intel Core i7 Bloomfield (45nm)

Intel Core i7 Gulftown (32nm)

2011 Sem 1

Introduction

54

Ive seen the future, baby


An image of the template of the
quantum dot device showing a central
hole where seven phosphorus atoms
are incorporated.
Running diagonally from top left to
bottom right are the two electronic leads
to connect to the dot.
May 24, 2010
UNSW Centre for Quantum Computer
Technology and University of
Wisconsin-Madison

2011 Sem 1

Introduction

55

ABSTRACTION (1/2)
Delving into
depth reveals
more information
Abstraction
omits
unnecessary
details

2011 Sem 1

Introduction

56

ABSTRACTION (2/2)

Need to learn abstractions such as:

Application and system software


Assembly language and machine language
Architectural issues such as pipelining, caches, virtual memory
Combinational logic, arithmetic circuits
Sequential logic, finite state machines
Boolean logic (1s and 0s)
Transistors used to build logic gates (CMOS)
Semi-conductors/silicon used to build transistors
Properties of atoms, electrons and quantum dynamics

So much to learn!

2011 Sem 1

Introduction

57

HOW DO THE PIECES FIT


TOGETHER?
Software

Application (IE, Excel, etc.)


Compiler
Assembler

Operating
System
(Windows XP)

Processor Memory I/O system


Datapath & Control

Hardware

Digital Design
transistors

Instruction Set
Architecture

Computer Architecture
Digital Logic Design

Coordination of many levels of abstraction


Under a rapidly changing set of forces
Design, measurement, and evaluation

2011 Sem 1

Introduction

58

LEVELS OF REPRESENTATION

2011 Sem 1

Introduction

59

WHAT WILL WE LEARN IN CS2100?


1.

How are things represented in


hardware?
Binary representation

2.

How are computations actually done


using hardware?
Boolean algebra
Computer arithmetic
Logic design

2011 Sem 1

Introduction

60

WHAT WILL WE LEARN IN CS2100?


3.

How to program the CPU at the level


closest to hardware?
Assembly programming

4.

How are computer instructions


processed internally?
Control path
Data path
Pipelining

2011 Sem 1

Introduction

61

WHAT WILL WE LEARN IN CS2100?


5.

How does a computer record things?


Memory

6.

How does communication take place


internally?
Bus

7.

How does disk work?


Permanent recording media

2011 Sem 1

Introduction

62

END

2011 Sem 1

Introduction

63