Intro comparch

19
Introduction to Computer Architecture Lecture :- 1 Date :- 15/02/11 Designed by :- Er Sanjay Agal

Transcript of Intro comparch

Page 1: Intro comparch

Introduction to Computer Architecture

Lecture :- 1Date :- 15/02/11

Designed by :- Er Sanjay Agal

Page 2: Intro comparch

What is binary?

We use the decimal (base 10) number system

Binary is the base 2 number system Ten different numbers are used in

base 10. How many are used in base 2?

Designed by Sanjay Agal

Page 3: Intro comparch

Bits & Bytes

kilo, mega, and giga are different in binary!

bit (b) – binary digitByte (B) – 8 binary digitsKiloByte (KB) – 210 bytesMegaByte (MB) – 220 bytesGigaByte (GB) – 230 bytes

Designed by Sanjay Agal

Page 4: Intro comparch

Storage Scam!

Example: iPod Nano 8GB

Designed by Sanjay Agal

Page 5: Intro comparch

What is computer architecture?

What does “architecture” mean? Layout and interactions of a computer

system What is a computer system? Input Process Output Can a computer system be more than

one computer? Think of an example...

Designed by Sanjay Agal

Page 6: Intro comparch

Major Components of a Computer

Central Processing Unit (CPU) Random Access Memory (RAM) Hard Drive / Disk

Designed by Sanjay Agal

Page 7: Intro comparch

ON-OFF-ON-ON

1 0 1 1

Several ways to remember the state of a switch: Electrical – RAM, flash memory Magnetic – Hard drives, magnetic tapes Optical – CDs, DVDs

Designed by Sanjay Agal

Page 8: Intro comparch

What does memory look like?

Memory ~ RAM Looks like a table Address and Data Address is the

location Data is the actual

value Memory stores both

data and assembly instructions

Address Data0 361 37652 7863 3564 2525 679806 23557 42348 3466

Designed by Sanjay Agal

Page 9: Intro comparch

Central Processing Unit (CPU) Also called the “chip”

or “processor” The brain of the

computer Major components:

Arithmetic Logic Unit (ALU) calculator

Control unit controls the calculator

Communication bus systems

What’s a bus?!?

Control Unit

ALU

Memory

Address Bus

Data Bus

Designed by Sanjay Agal

Page 10: Intro comparch

Fetch-Execute Cycle

1. Fetch instruction from memory

2. Decode instruction in control unit

3. Execute instruction (data may be fetched from memory)

4. Store results if necessary5. Repeat!

Control Unit

ALU

Memory

Address Bus

Data Bus

Designed by Sanjay Agal

Page 11: Intro comparch

Registers

Temporary storage containers used inside the CPU

Extremely fast Fixed size, usually multiples of 8-bits

Also called a “word” Example: 32-bit machines (4-byte words)

How large is a word in a 64-bit machine?

Designed by Sanjay Agal

Page 12: Intro comparch

Cache Slower than registers Faster than RAM Located in front of

main RAM Different levels of

cache Level1 (L1) and Level2

(L2) Size is usually around

1 MB Designed by Sanjay Agal

Page 13: Intro comparch

Memory Hierarchy

Designed by Sanjay Agal

Page 14: Intro comparch

Virtual Memory

What if a program is too big for RAM?

If a program is too big for memory (RAM), then we start using the hard drive (disk) to store data

Designed by Sanjay Agal

Page 15: Intro comparch

Hard Drives

Designed by Sanjay Agal

Page 16: Intro comparch

CD/DVDs Lands and pits used to represent

binary Optical medium - lasers and refraction

used to read lands and pits

Designed by Sanjay Agal

Page 17: Intro comparch

Direct Access also known as “random access” No need to go through other data to get

the data you want We already know where the data is, so

we just get it “Magic data retrieval” – no

movement/motion Example: registers, cache, RAM

Designed by Sanjay Agal

Page 18: Intro comparch

Sequential Access

also known as “serial-access” Data is ordered in some sequential

fashion To get to your data, you need to go

through other data in front of it Example:

Fast-forwarding through a tape to get to the song you want

Designed by Sanjay Agal

Page 19: Intro comparch

Direct-Access vs. Sequential Access

Direct-Access: Advantage: fast access Disadvantage: data cannot be accessed in sequential or sorted

order Data is placed randomly on the disk Accessing things in order then requires an index file Slower when trying to access sequential data that is not already in

order (back-and-forth-and-back-and-forth) Example: hard drives (disks)

Sequential Access Advantage: Simple to organize (already in some sequential

order) Disadvantage: Slow when accessing specific things in no order Example: magnetic tape backups

Could we implement sequential access using a hard disk? Designed by Sanjay Agal