1 patt and patel ch. 1 abstraction and computer systems

21
1 Patt and Patel Ch. 1 Patt and Patel Ch. 1 Abstraction and Abstraction and Computer Systems Computer Systems

Post on 22-Dec-2015

243 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

1

Patt and Patel Ch. 1Patt and Patel Ch. 1

Abstraction and Computer Abstraction and Computer Systems Systems

Page 2: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

2

Page 3: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

3

• Definition: Interface between a Definition: Interface between a computers hardware and its computers hardware and its software. Defines exactly what the software. Defines exactly what the computer’s instructions do, and computer’s instructions do, and how they are specified.how they are specified.

• Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)

Computer ArchitectureComputer Architecture

Page 4: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

4

HighLevel

Language

AssemblyLanguage

MachineLanguage

Compiler Assembler

Programming FlowProgramming Flow

• Compiler: A computer program that translates Compiler: A computer program that translates code written in a high level language into an code written in a high level language into an intermediate level abstract language.intermediate level abstract language.

• Assembler: A computer program that Assembler: A computer program that translates code written in assembly language translates code written in assembly language to the binary form that the CPU can execute.to the binary form that the CPU can execute.

Page 5: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

5

• Definition: Fundamentally the study of Definition: Fundamentally the study of algorithms and data structures.algorithms and data structures.

• Abstraction: Use of level of abstraction Abstraction: Use of level of abstraction in software design allows the in software design allows the programmer to focus on a critical set of programmer to focus on a critical set of problems without having to deal with problems without having to deal with irrelevant details.irrelevant details.

Computer ScienceComputer Science

Page 6: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

6

Computing MachinesComputing Machines

EverywhereEverywhere

– General purpose: servers, desktops, laptops, PDAs, etc.

– Special purpose: cash registers, ATMs, games, telephone switches, etc.

– Embedded: cars, hotel doors, printers, VCRs, industrial machinery, medical equipment, etc.

Page 7: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

7

Computing MachinesComputing Machines

Distinguishing CharacteristicsDistinguishing Characteristics

– Speed

– Cost

– Ease of use, software support & interface

– Scalability

Page 8: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

8

Two recurring themesTwo recurring themes

AbstractionAbstraction

–The notion that we can concentrate on one “level” of the big picture at a time, with confidence that we can then connect effectively with the levels above and below.

–Framing the levels of abstraction appropriately is one of the most important skills in any undertaking.

Page 9: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

9

Procedure or FunctionProcedure or Function

int average (a, b)int average (a, b)

beginbegin

int avg;int avg;avg = avg =

(a+b)/2;(a+b)/2;return (avg);return (avg);

endend

main ()main ()

……

x = 4;x = 4;

y = 2;y = 2;

k = average (x,y);k = average (x,y);

print (“%d”, k);print (“%d”, k);

……

Abstraction in ActionAbstraction in Action

Page 10: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

10

Hardware vs. SoftwareHardware vs. Software

– On the other hand, abstraction does not mean being clueless about the neighboring levels.

– In particular, hardware and software are inseparably connected, especially at the level we will be studying.

Two recurring themesTwo recurring themes

Page 11: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

11

What is Computer What is Computer Organization?Organization?

ElectronicDevices

DesiredBehavior

There is a fundamentally wide gap between the There is a fundamentally wide gap between the intended behavior desired and the workings of the intended behavior desired and the workings of the electronic devices that do the work.electronic devices that do the work.

Before the digital computers of today special purpose Before the digital computers of today special purpose analog devices (mechanical, electrical, or electronic) analog devices (mechanical, electrical, or electronic) where built for each desired behavior.where built for each desired behavior.

Page 12: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

12

Role of General Purpose Role of General Purpose ComputersComputers

A general purpose computer is the bridge that links the desired behavior (application) and the basic building blocks (electronic devices).

ElectronicDevices

DesiredBehavior

GeneralPurpose

Computer

computerorganization

software

Page 13: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

13

Central Processing UnitCentral Processing UnitThe heart of computing systemsThe heart of computing systems

ca 1980It took 10 of these boards

to make a Central Processing Unit (CPU)

ca 2000No wonder they called

this CPU a microprocessor!

Page 14: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

14

Modern’ish Motherboard of a Computer

Page 15: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

15

Computing SystemComputing System

A personal computer (PC)

Page 16: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

16

11stst Very Important Idea Very Important Idea

Universal Computational DevicesUniversal Computational Devices

• Given enough time and memory, all Given enough time and memory, all computers are capable of computing computers are capable of computing exactly the same things (irrespective of exactly the same things (irrespective of speed, size or cost).speed, size or cost).

• Turing’s Thesis: every computation can Turing’s Thesis: every computation can be performed by some “Turing Machine” be performed by some “Turing Machine” - a theoretical universal computational - a theoretical universal computational devicedevice

Page 17: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

17

Problem TransformationProblem Transformation• The ultimate objective is to transform a The ultimate objective is to transform a

problem expressed in natural language problem expressed in natural language into electrons running around a circuit!into electrons running around a circuit!

• That’s what Computer Science and That’s what Computer Science and Computer Engineering are all about: a Computer Engineering are all about: a continuum that embraces software & continuum that embraces software & hardware.hardware.

22ndnd Very Important Idea Very Important Idea

Page 18: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

18

A Turing MachineA Turing Machine

Also known as a Universal Computational Device: a theoretical device that accepts both input data and instructions on how to operate on the data

Page 19: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

19

Our Simple View For NowOur Simple View For Now

• CPU Interacts with the memory in 3 ways:CPU Interacts with the memory in 3 ways:

– fetches instructions– loads the value of a variable– stores the new value of a variable

• Memory is capable of only 2 operations:Memory is capable of only 2 operations:

– reads – a load or a fetch– writes – operation of storing the value of a variable

MemoryWrite data

Read data

Control info

CPU

Page 20: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

20

Questions?Questions?

Page 21: 1 Patt and Patel Ch. 1 Abstraction and Computer Systems

21