Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan



Similar documents
PROBLEMS. which was discussed in Section

Chapter 1 Computer System Overview

Central Processing Unit (CPU)

CHAPTER 7: The CPU and Memory

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

The Central Processing Unit:

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

Central Processing Unit

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

MICROPROCESSOR AND MICROCOMPUTER BASICS

1. Computer System Structure and Components

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Computer-System Architecture

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX

Computer Organization. and Instruction Execution. August 22

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

CPU Organisation and Operation

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-17: Memory organisation, and types of memory

LSN 2 Computer Processors

CPU Organization and Assembly Language

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions

Computer Systems Structure Input/Output

Chapter 2 Logic Gates and Introduction to Computer Architecture

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

(Refer Slide Time: 00:01:16 min)

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

GUJARAT TECHNOLOGICAL UNIVERSITY, AHMEDABAD, GUJARAT. COURSE CURRICULUM COURSE TITLE: COMPUTER ORGANIZATION AND ARCHITECTURE (Code: )

1. Memory technology & Hierarchy

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Operating system Dr. Shroouq J.

1 PERSONAL COMPUTERS

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

Operating Systems 4 th Class

Let s put together a Manual Processor

Microprocessor & Assembly Language

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-12: ARM

Chapter 4 System Unit Components. Discovering Computers Your Interactive Guide to the Digital World

CSC 2405: Computer Systems II

Outline: Operating Systems

İSTANBUL AYDIN UNIVERSITY

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Python Programming: An Introduction to Computer Science

Chapter 1. The largest computers, used mainly for research, are called a. microcomputers. b. maxicomputers. c. supercomputers. d. mainframe computers.

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

Basic Concepts of Information Technology (IT)

Discovering Computers Living in a Digital World

Basic Computer Organization

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

EE361: Digital Computer Organization Course Syllabus

Introduction. What is an Operating System?

Parts of a Computer. Preparation. Objectives. Standards. Materials Micron Technology Foundation, Inc. All Rights Reserved

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Robert Wagner

Python Programming: An Introduction to Computer Science

CSCI 4717 Computer Architecture. Function. Data Storage. Data Processing. Data movement to a peripheral. Data Movement

EE482: Advanced Computer Organization Lecture #11 Processor Architecture Stanford University Wednesday, 31 May ILP Execution

BASIC COMPUTER ORGANIZATION AND DESIGN

Chapter 6, The Operating System Machine Level

Chap-02, Hardware and Software. Hardware Model

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Operating Systems Overview

Here is a diagram of a simple computer system: (this diagram will be the one needed for exams) CPU. cache

Price/performance Modern Memory Hierarchy

TECHNOLOGY BRIEF. Compaq RAID on a Chip Technology EXECUTIVE SUMMARY CONTENTS

Obj: Sec 1.0, to describe the relationship between hardware and software HW: Read p.2 9. Do Now: Name 3 parts of the computer.

Chapter 11 I/O Management and Disk Scheduling

A Lab Course on Computer Architecture

361 Computer Architecture Lecture 14: Cache Memory

Input / Ouput devices. I/O Chapter 8. Goals & Constraints. Measures of Performance. Anatomy of a Disk Drive. Introduction - 8.1

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

CISC, RISC, and DSP Microprocessors

Record Storage and Primary File Organization

Chapter 3. Operating Systems

Chapter 1: Introduction. What is an Operating System?

Chapter 11: Input/Output Organisation. Lesson 06: Programmed IO

CS 6290 I/O and Storage. Milos Prvulovic

MULTIPLE CHOICE FREE RESPONSE QUESTIONS

Block diagram of typical laptop/desktop

Learning Outcomes. Simple CPU Operation and Buses. Composition of a CPU. A simple CPU design

Overview and History of Operating Systems

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

Lecture 1 Operating System Overview

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Notes on Assembly Language

TEST CHAPTERS 1 & 2 OPERATING SYSTEMS

Homework # 2. Solutions. 4.1 What are the differences among sequential access, direct access, and random access?

Chapter Introduction. Storage and Other I/O Topics. p. 570( 頁 585) Fig I/O devices can be characterized by. I/O bus connections

1 Classical Universal Computer 3

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

COMPUTER ARCHITECTURE. Input/Output

Lecture 2: Computer Hardware and Ports.

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

Hardware: Input, Processing, and Output Devices. A PC in Every Home. Assembling a Computer System

Transcription:

Chapter 2 Basic Structure of Computers Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Outline Functional Units Basic Operational Concepts Bus Structures Software Performance Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 2

Content Coverage Main Memory System Address Data/Instruction Central Processing Unit (CPU) Cache memory Operational Registers Program Counter Arithmetic and Logic Unit Instruction Sets Control Unit Input/Output System Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 3

Functional Units A computer consists of three main parts: A processor (CPU) A main-memory system An I/O system The CPU consists of a control unit, registers, the arithmetic and logic unit, the instruction execution unit, and the interconnections among these components The information handled by a computer Instruction Govern the transfer information within a computer as well as between the computer and its I/O devices Specify the arithmetic and logic operations to be performed Data Numbers and encoded characters that are used as operands by the instructions Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 4

Program A list of instructions that performs a task is called a program The program usually is stored in a memory called program memory The computer is completely controlled by the stored program, except for possible external interruption by an operator or by I/O devices connected to the machine Information handled by a computer must be encoded in a suitable format. Most present-day hardware employs digital circuits that have only two stable states, 0 (OFF) and 1 (ON) Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 5

Memory The storage area in which programs are kept when they are running and that contains the data needed by the running programs Types of memory Volatile memory: storage that retains data only if it is receiving power, such as dynamic random access memory (DRAM) Nonvolatile memory: a form of memory that retains data even in the absence of a power source and that is used to store programs between runs, such as flash memory Usually, a computer has two classes of storage Primary memory and secondary memory Primary memory Memory Unit Also called main memory. Volatile memory used to hold programs while they are running; typically consists of DRAM in today s computers Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 6

Memory Unit Secondary memory Nonvolatile memory used to store programs and data between runs; typically consists of magnetic disks in today s computers The memory consists of storage cells, each capable of storing one bit of information The storage cells are processed in groups of fixed size called words To provide easy access to any word in the memory, a distinct address is associated with each word location The number of bits in each word is often referred to as the word length of the computer Typical word length from 16 to 64 bits The capacity of the memory is one factor that characterizes the size of a computer Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 7

Memory Unit Instruction and data can be written into the memory or read out under the control of the processor It is essential to be able to access any word location in the memory as quickly as possible Memory in which any location can be reached in a short and fixed amount of time after specifying its address called randomaccess memory (RAM) The time required to access one word is called the memory access time This time is fixed, independent of the location of the word being accessed The memory of a computer is normally implemented as a memory hierarchy of three or four levels The small, fast, RAM units are called caches The largest and slowest unit is referred to as the main memory Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 8

Arithmetic and Logic Unit Most computer operations are performed in the arithmetic and logic unit (ALU) of the processor For example, consider two numbers stored in the memory are to be added They are brought into the processor, and the actual addition is carried out by the ALU. Then sum may be stored in the memory or retained in the processor for immediate use Typical arithmetic and logic operation Addition, subtraction, multiplication, division, comparison, complement, etc. When operands are brought into the processor, they are stored in high-speed storage elements called registers. Each register can store one word of data Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 9

Control Unit The control unit is the nerve center that sends control signals to other units and senses their states Thus the control unit serves as a coordinator of the memory, arithmetic and logic, and input/output units The operation of a computer can be summarized as follows: The computer accepts information in the form of programs and data through an input unit and stores it in the memory Information stored in the memory is fetched, under program control, into an ALU, where it is processed Processed information leaves the computer through an output unit All activities inside the machine are directed by the control unit Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 10

Computer Components: Top-Level View Memory Input/Output System Bus Processor MAR PC IR MDR R 0 R 1. Control ALU R n-1 n general purpose registers Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 11

Basic Operational Concepts Memory Input/Output System Bus Processor MAR PC IR MDR R 0 R 1. Control ALU R n-1 n general purpose registers Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 12

A Partial Program Execution Example 300 1 9 4 0 300 301 5 9 4 1 302 2 9 4 1 940 941 Memory. 0 0 0 3 0 0 0 2 CPU Register 1 9 4 0 Step 1 PC AC IR 300 1 9 4 0 301 301 5 9 4 1 302 2 9 4 1 940 941 Memory. 0 0 0 3 0 0 0 2 CPU Register 0 0 0 3 1 9 4 0 Step 2 PC AC IR 300 1 9 4 0 301 301 5 9 4 1 302 2 9 4 1 940 941 Memory. 0 0 0 3 0 0 0 2 CPU Register 0 0 0 3 5 9 4 1 Step 3 PC AC IR 300 1 9 4 0 302 301 5 9 4 1 302 2 9 4 1 0 0 0 3 0 0 0 2 Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 13 940 941 Memory. CPU Register 0 0 0 53 5 9 4 1 3+2=5 Step 4 PC AC IR

A Partial Program Execution Example 300 1 9 4 0 302 301 5 9 4 1 302 2 9 4 1 940 941 Memory. 0 0 0 3 0 0 0 2 CPU Register 0 0 0 5 2 9 4 1 Step 5 PC AC IR 300 1 9 4 0 303 301 5 9 4 1 302 2 9 4 1 940 941 Memory. 0 0 0 3 0 0 0 5 CPU Register 0 0 0 5 2 9 4 1 Step 6 PC AC IR Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 14

Interrupt Normal execution of programs may be preempted if some device requires urgent servicing To deal with the situation immediately, the normal execution of the current program must be interrupted Procedure of interrupt operation The device raises an interrupt signal The processor provides the requested service by executing an appropriate interrupt-service routine The state of the processor is first saved before servicing the interrupt Normally, the contents of the PC, the general registers, and some control information are stored in memory When the interrupt-service routine is completed, the state of the processor is restored so that the interrupted program may continue Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 15

Classes of Interrupts Program Timer I/O Generated by some condition that occurs as a result of an instruction execution such as arithmetic overflow, division by zero, attempt to execute an illegal machine instruction, or reference outside a user s allowed memory space Generated by a timer within the processor. This allows the operating system to perform certain functions on a regular basis Generated by an I/O controller, to signal normal completion of an operation or to signal a variety of error conditions Hardware failure Generated by a failure such as power failure or memory parity error Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 16

Bus Structures A group of lines that serves a connecting path for several devices is called a bus In addition to the lines that carry the data, the bus must have lines for address and control purposes The simplest way to interconnect functional units is to use a single bus, as shown below Input Output Memory Processor Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 17

Drawbacks of the Single Bus Structure The devices connected to a bus vary widely in their speed of operation Some devices are relatively slow, such as printer and keyboard Some devices are considerably fast, such as optical disks Memory and processor units operate are the fastest parts of a computer Efficient transfer mechanism thus is needed to cope with this problem A common approach is to include buffer registers with the devices to hold the information during transfers An another approach is to use two-bus structure and an additional transfer mechanism A high-performance bus, a low-performance, and a bridge for transferring the data between the two buses. ARMA Bus belongs to this structure Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 18

Software In order for a user to enter and run an application program, the computer must already contain some system software in its memory System software is a collection of programs that are executed as needed to perform functions such as Receiving and interpreting user commands Running standard application programs such as word processors, or games Managing the storage and retrieval of files in secondary storage devices Running standard application programs such as word processors, etc Controlling I/O units to receive input information and produce output results Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 19

Software Translating programs from source form prepared by the user into object form consisting of machine instructions Linking and running user-written application programs with existing standard library routines, such as numerical computation packages System software is thus responsible for the coordination of all activities in a computing system Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 20

Operating System Operating system (OS) This is a large program, or actually a collection of routines, that is used to control the sharing of and interaction among various computer units as they perform application programs The OS routines perform the tasks required to assign computer resource to individual application programs These tasks include assigning memory and magnetic disk space to program and data files, moving data between memory and disk units, and handling I/O operations In the following, a system with one processor, one disk, and one printer is given to explain the basics of OS Assume that part of the program s task involves reading a data file from the disk into the memory, performing some computation on the data, and printing the results Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 21

User Program and OS Routine Sharing Printer t 0 -t 1 : OS routine initiates loading the application program from disk to memory, waits until the transfer is completed, and passes execution control to the application program. Disk OS routines Program t 0 t 1 t 2 t 3 t 4 t 5 Time Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 22

Multiprogramming or Multitasking Printer Disk OS routines Program t 0 t 1 t 2 t 3 t 4 t 5 Time Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 23

Performance The speed with which a computer executes programs is affected by the design of its hardware and its machine language instructions Because programs are usually written in a high-level language, performance is also affected by the compiler that translates programs into machine languages For best performance, the following factors must be considered Compiler Instruction set Hardware design Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 24

Performance Processor circuits are controlled by a timing signal called a clock The clock defines regular time intervals, called clock cycles To execute a machine instruction, the processor divides the action to be performed into a sequence of basic steps, such that each step can be completed in one clock cycle Let the length P of one clock cycle, its inverse is the clock rate, R=1/P Basic performance equation T=(NxS)/R, where T is the processor time required to execute a program, N is the number of instruction executions, and S is the average number of basic steps needed to execute one machine instruction Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 25

Faster Clock=Shorter Running Time? Faster steps do not necessarily mean shorter travel time 1 GHz Solution 4 steps 2 GHz 20 steps [Source: B. Parhami, UCSB] Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 26

System Balance is Essential Note that system balance is absolutely essential for improving performance If one replaces a machine s processor with a model having twice the performance, this will not double the overall system performance unless corresponding improvements are made to other parts of the system CPU - bound task Input Processing Output I/O -bound task [Source: B. Parhami, UCSB] Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 27

Performance Improvement Pipelining and superscalar operation Pipelining: by overlapping the execution of successive instructions Superscalar: different instructions are concurrently executed with multiple instruction pipelines. This means that multiple functional units are needed Clock rate improvement Improving the integrated-circuit technology makes logic circuits faster, which reduces the time needed to complete a basic step Reducing amount of processing done in one basic step also makes it possible to reduce the clock period, P. However, if the actions that have to be performed by an instruction remain the same, the number of basic steps needed may increase Reduce the number of basic steps to execute Reduced instruction set computers (RISC) and complex instruction set computers (CISC) Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 28

Reporting Computer Performance Measured or estimated execution times for three programs Analogy Program A Program B Program C All 3 prog s Time on machine X 20 1000 1500 2520 Time on machine Y If a car is driven to a city 100 km away at 100 km/hr and returns at 50 km/hr, the average speed is not (100 + 50) / 2 but is obtained from the fact that it travels 200 km in 3 hours 200 100 150 450 Speedup of Y over X 0.1 10.0 10.0 5.6 [Source: B. Parhami, UCSB] Advanced Reliable Systems (ARES) Lab. Jin-Fu Li, EE, NCU 29