Principles of Computer Design

36
Principles of Computer Design Sujata Rao

description

Principles of Computer Design. Sujata Rao. address. Memory. Processor. data. instructions. I/O. Basic Computer Organisation. 2. 19-9-06. Structure & Function. Structure : The way in which components are interrelated. - PowerPoint PPT Presentation

Transcript of Principles of Computer Design

Page 1: Principles  of  Computer  Design

Principles of Computer Design

Sujata Rao

Page 2: Principles  of  Computer  Design

Basic Computer Organisation

19-9-06 2

Processor

Memory

I/O

address

data

instructions

Page 3: Principles  of  Computer  Design

Structure & Function

19-9-06 3

Structure : The way in which components are interrelated.

Function: operation of each individual component as part of a structure.

Page 4: Principles  of  Computer  Design

Structure

19-9-06 4

Central Processing Unit (CPU) - processor Controls the operation of the

Computer & Performs Processing

Main Memory - Stores Data

I-O - Moves Data between computer & its external environment

System Interconnection Mechanism that provides

communication among CPU, Main Memory & I-O

PROCESSOR

Memory

I/O

address

data

instructions

Page 5: Principles  of  Computer  Design

Computer Organisation

19-9-06 5

Page 6: Principles  of  Computer  Design

Structures

19-9-06 6

Control Unit - Controls the operation of the CPU

Arithmetic & Logic Unit - performs data processing functions

Registers - Provides storage internal to the CPU

CPU Interconnections - mechanism that provide communication among CU, ALU & Registers

P C M A R

I R M B R

I/O A R

I/O B R

Execution Unit

C P U

Page 7: Principles  of  Computer  Design

Inside Pentium 4

19-9-06 7

Page 8: Principles  of  Computer  Design

Architecture

19-9-06 8

Refers to attributes of system visible to a programmer.

Attributes that have direct impact on the logical execution of the program.

Architectural attributes include instruction set The no. of bits used to represent a data type Techniques for addressing the memory.

Thus a family of computers may have same architecture but different organisation.

Page 9: Principles  of  Computer  Design

Computer Architecture

19-9-06 9

Computer Architecture =

Instruction Set Architecture

+

Machine Organization

Page 10: Principles  of  Computer  Design

Processor

19-9-06 10

Reads in instruction & Data Writes out data after processing Uses control signal to control overall

operation Also receives interrupt signal

Page 11: Principles  of  Computer  Design

Logic CircuitsEach functional component of the microarchitecture is built

up of circuits that make “decisions” based on simple rules

DevicesFinally, each logic circuit is actually built of electronic

devices such as CMOS or NMOS or GaAs (etc.) transistors.

19-9-06 11

Page 12: Principles  of  Computer  Design

Interconnection Structures

19-9-06 12

N-1

0

MemoryRead

Write

Address

Data

Data

I/O ModuleRead

Write

Address

Internal Data

External Data

Internal Data

External Data

Interrupt Signals

M Ports

Page 13: Principles  of  Computer  Design

19-9-06 13

C P U

Read

Write

Data

Interrupt Signals

Address

Data

Control Signals

Page 14: Principles  of  Computer  Design

BUS Interconnection

19-9-06 14

C P U Memory Memory I/O I/O

Data Lines

Address Lines

Control Lines

Page 15: Principles  of  Computer  Design

OPERATING SYSTEMSProf. Sujata RaoLesson 4

Page 16: Principles  of  Computer  Design

Introduction and Overview

What is an operating system? How have operating systems

evolved? Why study operating systems?

Introduction to Operating Systems

Page 17: Principles  of  Computer  Design

What is an Operating System?

OS:Everything in system that isn’t an application or hardware

OS:Software that converts hardware into a useful form for applications

Not easy to define precisely…

Users

Hardware

Operating System

Applicationscompilersdatabasesword processors

CPUmemoryI/O devices

Page 18: Principles  of  Computer  Design

Roles of an OS

Role #1Provide standard Library (I.e., abstract

resources)

Role #2Resource coordinator (I.e., manager)

Page 19: Principles  of  Computer  Design

What is the role of the OS?

Role #1: Provide standard Library (I.e., abstract resources) What is a resource?

Anything valuable (e.g., CPU, memory, disk) Advantages of standard library

Allow applications to reuse common facilities Make different devices look the same Provide higher-level abstractions

Challenges What are the correct abstractions? How much of hardware should be exposed?

Page 20: Principles  of  Computer  Design

What is the role of the OS? Role #2: Resource coordinator (I.e., manager) Advantages of resource coordinator

Virtualize resources so multiple users or applications can share

Protect applications from one anotherProvide efficient and fair access to resources

ChallengesWhat are the correct mechanisms?What are the correct policies?

Page 21: Principles  of  Computer  Design

What Functionality belongs in OS? No single right answer

Desired functionality depends on outside factorsOS must adapt to both user expectations and

technology changes Change abstractions provided to users Change algorithms to implement those abstractions Change low-level implementation to deal with hardware

Current operating systems driven by evolution

Page 22: Principles  of  Computer  Design

History of the OS

Two distinct phases of historyPhase 1: Computers are expensive

Goal: Use computer’s time efficiently Maximize throughput (I.e., jobs per second) Maximize utilization (I.e., percentage busy)

Phase 2: Computers are inexpensive Goal: Use people’s time efficiently Minimize response time

Page 23: Principles  of  Computer  Design

First commercial systems 1950s Hardware

Enormous, expensive, and slow Input/Output: Punch cards and line printers

Goal of OS Get the hardware working Single operator/programmer/user runs and debugs

interactively

OS Functionality Standard library only (no sharing or coordination of resources) Monitor that is always resident; transfer control to programs

Page 24: Principles  of  Computer  Design

First commercial systems

AdvantagesWorked and allowed interactive debugging

Problems Inefficient use of hardware (throughput and

utilization)

Page 25: Principles  of  Computer  Design

Batch Processing Goal of OS: Better throughput and utilization Batch: Group of jobs submitted together

Operator collects jobs; orders efficiently; runs one at a time

Advantages Amortize setup costs over many jobs Operator more skilled at loading tapes Keep machine busy while programmer thinks Improves throughput and utilization

Problems User must wait until batch is done for results Machine idle when job is reading from cards and

writing to printers

Page 26: Principles  of  Computer  Design

Spooling Hardware

Mechanical I/O devices much slower than CPU Read 17 cards/sec vs. execute 1000s

instructions/sec Goal of OS

Improve performance by overlapping I/O with CPU execution

Page 27: Principles  of  Computer  Design

Spooling: Simultaneous Peripheral Operations On-Line

1. Read card punches to disk2. Compute (while reading and writing to disk)3. Write output from disk to printer

OS Functionality Buffering and interrupt handling

Problem Machine idle when job waits for I/O to/from

disk

Page 28: Principles  of  Computer  Design

Multiprogrammed Batch Systems Observation: Spooling provides pool of ready jobs Goal of OS

Improve performance by always running a job Keep multiple jobs resident in memory When job waits for disk I/O, OS switches to another job

OS Functionality Job scheduling policies Memory management and protection

Advantage: Improves throughput and utilization Disadvantage: Machine not interactive

Page 29: Principles  of  Computer  Design

Inexpensive Peripherals 1960s Hardware

Expensive mainframes, but inexpensive keyboards and monitors

Enables text editors and interactive debuggers Goal of OS

Improve user’s response time OS Functionality

Time-sharing: switch between jobs to give appearance of dedicated machine

More complex job scheduling Concurrency control and synchronization

Advantage Users easily submit jobs and get immediate feedback

Page 30: Principles  of  Computer  Design

Inexpensive Personal Computers 1980s Hardware

Entire machine is inexpensive One dedicated machine per user

Goal of OS Give user control over machine

OS Functionality Remove time-sharing of jobs, protection, and virtual memory

Advantages Simplicity Works with little main memory Machine is all your own (performance is predictable)

Disadvantages No time-sharing or protection between jobs

Page 31: Principles  of  Computer  Design

Inexpensive, Powerful Computers 1990s+ Hardware

PCs with increasing computation and storage Users connected to the web

Goal of OS Allow single user to run several applications

simultaneously Provide security from malicious attacks Efficiently support web servers

OS Functionality Add back time-sharing, protection, and virtual memory

Page 32: Principles  of  Computer  Design

Current Systems Conclusion: OS changes due to both hardware and

users Current trends

Multiprocessors Networked systems Virtual machines

OS code base is large Millions of lines of code 1000 person-years of work

Code is complex and poorly understood System outlives any of its builders System will always contain bugs Behavior is hard to predict, tuning is done by guessing

Page 33: Principles  of  Computer  Design

OS Components Kernel: Core components of the OS

Process scheduler Determines when and for long each process executes

Memory manager Determines when and how memory is allocated to

processes Decides what to do when main memory is full

File system Organizes named collections of data in persistent storage

Networking Enables processes to communicate with one another

Page 34: Principles  of  Computer  Design

Why study Operating Systems? Build, modify, or administer an operating system Understand system performance

Behavior of OS impacts entire machineChallenge to understand large, complex systemTune workload performanceApply knowledge across many areas

Computer architecture, programming languages, data structures and algorithms, and performance modeling

Page 35: Principles  of  Computer  Design
Page 36: Principles  of  Computer  Design

Faster Clock Shorter Running Time

19-9-06 36

Faster steps do not necessarily mean shorter travel time.

1 GHz

2 GHz

4 steps

Solution

20 steps