(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (3 rd Week)

Similar documents
William Stallings Computer Organization and Architecture 10 th Edition Pearson Education, Inc., Hoboken, NJ. All rights reserved.

2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.

Chapter 3. Top Level View of Computer Function and Interconnection. Yonsei University

Top-Level View of Computer Organization

Computer Architecture and Organization (CS-507)

Chapter 3 - Top Level View of Computer Function

Unit 1. Chapter 3 Top Level View of Computer Function and Interconnection

Running Applications

Chapter 1 Computer System Overview

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

The von Neuman architecture characteristics are: Data and Instruction in same memory, memory contents addressable by location, execution in sequence.

Summary of Computer Architecture

CSC 553 Operating Systems

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION

Computer System Overview

Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

Introduction Electrical Considerations Data Transfer Synchronization Bus Arbitration VME Bus Local Buses PCI Bus PCI Bus Variants Serial Buses

GUJARAT TECHNOLOGICAL UNIVERSITY MASTER OF COMPUTER APPLICATION SEMESTER: III

UNIT- 5. Chapter 12 Processor Structure and Function

Computer Systems Organization

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

The Stored Program Computer

Computer System Overview. Chapter 1

Chapter 1 Computer System Overview

Peripheral Component Interconnect - Express

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

CPU Structure and Function

The Institution of Engineers - Sri Lanka

Input / Output. School of Computer Science G51CSA

Computer System Overview

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

CPU Structure and Function

Part One provides a background and context for the remainder of this book.

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

CN310 Microprocessor Systems Design

5 Computer Organization

2 MARKS Q&A 1 KNREDDY UNIT-I

William Stallings Computer Organization and Architecture

William Stallings Computer Organization and Architecture

DC57 COMPUTER ORGANIZATION JUNE 2013

Computer Architecture CS 355 Busses & I/O System

Control unit. Input/output devices provide a means for us to make use of a computer system. Computer System. Computer.

Chapter 5 Input/Output Organization. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals

Bus (Väylä) Stallings: Ch 3 What moves on Bus? Bus characteristics PCI-bus PCI Express

Computer Organization

Processing Unit CS206T

CC312: Computer Organization

Q.1 Explain Computer s Basic Elements

MARIE: An Introduction to a Simple Computer

Introduction. Computer System Organization. Languages, Levels, Virtual Machines. A multilevel machine. Sarjana Magister Program

Chapter 4. MARIE: An Introduction to a Simple Computer

Computer Organization and Architecture Lecture Notes

5 Computer Organization

Chapter 1 Computer System Overview

Interconnection Structures. Patrick Happ Raul Queiroz Feitosa

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

THE MICROPROCESSOR Von Neumann s Architecture Model

CprE 488 Embedded Systems Design. Lecture 4 Interfacing Technologies

STRUCTURE OF DESKTOP COMPUTERS

SAE5C Computer Organization and Architecture. Unit : I - V

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

Chapter 2 Instruction Set Architecture

General purpose registers These are memory units within the CPU designed to hold temporary data.

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Systems Architecture

EE108B Lecture 17 I/O Buses and Interfacing to CPU. Christos Kozyrakis Stanford University

Computer Architecture 2/26/01 Lecture #

A3 Computer Architecture

Unit 3 and Unit 4: Chapter 4 INPUT/OUTPUT ORGANIZATION

Computer Organization

MARIE: An Introduction to a Simple Computer

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

Chapter One. Introduction to Computer System

A (Very Hand-Wavy) Introduction to. PCI-Express. Jonathan Heathcote

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture

The Von Neumann Architecture Odds and Ends. Designing Computers. The Von Neumann Architecture. CMPUT101 Introduction to Computing - Spring 2001

For your convenience Apress has placed some of the front matter material after the index. Please use the Bookmarks and Contents at a Glance links to

A Review of Chapter 5 and. CSc 2010 Spring 2012 Instructor: Qian Hu

Module 5 - CPU Design

Computer Organization II CMSC 3833 Lecture 33

ADVANCED COMPUTER ARCHITECTURE TWO MARKS WITH ANSWERS

(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (4 th Week)

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

1. Define Peripherals. Explain I/O Bus and Interface Modules. Peripherals: Input-output device attached to the computer are also called peripherals.

Basics of Microprocessor

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

Chapter 12. CPU Structure and Function. Yonsei University

Programmed I/O Interrupt-Driven I/O Direct Memory Access (DMA) I/O Processors. 10/12/2017 Input/Output Systems and Peripheral Devices (02-2)


Unit 5. Memory and I/O System

Computer Organization and Architecture, Pt. 2

Wednesday, September 13, Chapter 4

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

Lecture 18: Communication Models and Architectures: Interconnection Networks

Chapter 2 Data Manipulation

CMPUT101 Introduction to Computing - Summer 2002

Transcription:

+ (Advanced) Computer Organization & Architechture Prof. Dr. Hasan Hüseyin BALIK (3 rd Week)

+ Outline 2. The computer system 2.1 A Top-Level View of Computer Function and Interconnection 2.2 Cache Memory 2.3 Internal Memory Technology 2.4 External Memory 2.5 Input/Output

+ 2.1 A Top-Level View of Computer Function and Interconnection

+ Computer Components Contemporary computer designs are based on concepts developed by John von Neumann at the Institute for Advanced Studies, Princeton Referred to as the von Neumann architecture and is based on three key concepts: Data and instructions are stored in a single read-write memory The contents of this memory are addressable by location, without regard to the type of data contained there Execution occurs in a sequential fashion (unless explicitly modified) from one instruction to the next Hardwired program The result of the process of connecting the various components in the desired configuration

+ Data Sequence of arithmetic and logic functions Results (a) Programming in hardware Hardware and Software Approaches I nstruction codes I nstruction interpreter Control signals Data General-purpose arithmetic and logic functions Results (b) Programming in software Figure 3.1 Hardware and Software Approaches

Software + A sequence of codes or instructions Part of the hardware interprets each instruction and generates control signals Provide a new sequence of codes for each new program instead of rewiring the hardware Major components: CPU Instruction interpreter Module of general-purpose arithmetic and logic functions I/O Components Input module Contains basic components for accepting data and instructions and converting them into an internal form of signals usable by the system Output module Means of reporting results Software I/O Components

PC IR CPU MAR MBR System Bus Main Memory Instruction Instruction Instruction 0 1 2 Execution unit I/O AR I/O BR Data Data Data Data I/O Module n 2 n 1 Buffers PC = Program counter IR = Instruction register MAR = Memory address register MBR = Memory buffer register I/O AR = Input/output address register I/O BR = Input/output buffer register Figure 3.2 Computer Components: Top-Level View

Memory address register (MAR) Specifies the address in memory for the next read or write Memory buffer register (MBR) Contains the data to be written into memory or receives the data read from memory MEMORY + I/O address register (I/OAR) Specifies a particular I/O device I/O buffer register (I/OBR) Used for the exchange of data between an I/O module and the CPU MAR MBR

Fetch Cycle Execute Cycle START Fetch Next Instruction Execute Instruction HALT Figure 3.3 Basic Instruction Cycle

+ Fetch Cycle At the beginning of each instruction cycle the processor fetches an instruction from memory The program counter (PC) holds the address of the instruction to be fetched next The processor increments the PC after each instruction fetch so that it will fetch the next instruction in sequence The fetched instruction is loaded into the instruction register (IR) The processor interprets the instruction and performs the required action

Action Categories Data transferred from processor to memory or from memory to processor Data transferred to or from a peripheral device by transferring between the processor and an I/O module Processormemory Processor- I/O Control Data processing An instruction may specify that the sequence of execution be altered The processor may perform some arithmetic or logic operation on data

0 3 4 15 Opcode Address (a) Instruction format 0 1 15 S Magnitude (b) Integer format Program Counter (PC) = Address of instruction Instruction Register (IR) = Instruction being executed Accumulator (AC) = Temporary storage (c) Internal CPU registers 0001 = Load AC from Memory 0010 = Store AC to Memory 0101 = Add to AC from Memory (d) Partial list of opcodes Figure 3.4 Characteristics of a Hypothetical Machine

Memory 300 1 9 4 0 301 5 9 4 1 302 2 9 4 1 940 0 0 0 3 941 0 0 0 2 CPU Registers 3 0 0 PC AC 1 9 4 0 IR Memory 300 1 9 4 0 301 5 9 4 1 302 2 9 4 1 940 0 0 0 3 941 0 0 0 2 CPU Registers 3 0 1 PC 0 0 0 3 AC 1 9 4 0 IR Step 1 Step 2 Memory 300 1 9 4 0 301 5 9 4 1 302 2 9 4 1 940 0 0 0 3 941 0 0 0 2 CPU Registers 3 0 1 PC 0 0 0 3 AC 5 9 4 1 IR Memory 300 1 9 4 0 301 5 9 4 1 302 2 9 4 1 940 0 0 0 3 941 0 0 0 2 CPU Registers 3 0 2 PC 0 0 0 5 AC 5 9 4 1 IR 3 + 2 = 5 Step 3 Step 4 Memory 300 1 9 4 0 301 5 9 4 1 302 2 9 4 1 940 0 0 0 3 941 0 0 0 2 CPU Registers 3 0 2 PC 0 0 0 5 AC 2 9 4 1 IR Memory 300 1 9 4 0 301 5 9 4 1 302 2 9 4 1 940 0 0 0 3 941 0 0 0 5 CPU Registers 3 0 3 PC 0 0 0 5 AC 2 9 4 1 IR Step 5 Step 6 Figure 3.5 Example of Program Execution (contents of memory and registers in hexadecimal)

Instruction fetch Operand fetch Operand store Multiple operands Multiple results Instruction address calculation Instruction operation decoding Operand address calculation Data Operation Operand address calculation Instruction complete, fetch next instruction Return for string or vector data Figure 3.6 Instruction Cycle State Diagram

Progr am Timer I/O Hardware failure 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, request service from the processor, or to signal a variety of error conditions. Generated by a failure such as power failure or memory parity error. Classes of Interrupts

User Program I/O Program User Program I/O Program User Program I/O Program 1 4 1 4 1 4 WRITE I/O Command WRITE I/O Command WRITE I/O Command 5 2 END 2a 2 2b Interrupt Handler Interrupt Handler WRITE WRITE 5 WRITE 5 3a END END 3 3 3b WRITE WRITE WRITE (a) No interrupts (b) Interrupts; short I/O wait (c) Interrupts; long I/O wait = interrupt occurs during course of execution of user program Figure 3.7 Program Flow of Control Without and With Interrupts

User Program Interrupt Handler 1 2 Interrupt occurs here i i + 1 M Figure 3.8 Transfer of Control via Interrupts

Fetch Cycle Execute Cycle Interrupt Cycle START Fetch Next Instruction Interrupts Disabled Execute Instruction Interrupts Enabled Check for Interrupt; Process Interrupt HALT Figure 3.9 Instruction Cycle with Interrupts

Time 1 1 4 I/O operation; processor waits 5 5 4 2a I/O operation concurrent with processor executing 2 2b 4 4 I/O operation; processor waits 3a 5 I/O operation concurrent with processor executing 5 3b 3 (b) With interrupts (a) Without interrupts Figure 3.10 Program Timing: Short I/O Wait

Time 1 4 1 4 5 I/O operation; processor waits 2 I/O operation concurrent with processor executing; then processor waits 2 5 4 4 I/O operation; processor waits 3 I/O operation concurrent with processor executing; then processor waits 5 5 3 (b) With interrupts (a) Without interrupts Figure 3.11 Program Timing: Long I/O Wait

Instruction fetch Operand fetch Operand store Multiple operands Multiple results Instruction address calculation Instruction operation decoding Operand address calculation Data Operation Operand address calculation Interrupt check Interrupt Instruction complete, fetch next instruction Return for string or vector data No interrupt Figure 3.12 Instruction Cycle State Diagram, With Interrupts

User program Interrupt handler X Interrupt handler Y (a) Sequential interrupt processing User program Interrupt handler X Interrupt handler Y (b) Nested interrupt processing Figure 3.13 Transfer of Control with Multiple Interrupts

User program t = 0 Printer interrupt service routine Communication interrupt service routine t = 10 t = 15 t = 25 t = 40 t = 25 Disk interrupt service routine t = 35 Figure 3.14 Example Time Sequence of Multiple Interrupts

+ I/O Function I/O module can exchange data directly with the processor Processor can read data from or write data to an I/O module Processor identifies a specific device that is controlled by a particular I/O module I/O instructions rather than memory referencing instructions In some cases it is desirable to allow I/O exchanges to occur directly with memory The processor grants to an I/O module the authority to read from or write to memory so that the I/O memory transfer can occur without tying up the processor The I/O module issues read or write commands to memory relieving the processor of responsibility for the exchange This operation is known as direct memory access (DMA)

Read Write Address Memory N Words 0 Data Data N 1 Read Write Address Internal Data External Data I/O Module M Ports Internal Data External Data Interrupt Signals Instructions Address Data CPU Control Signals Interrupt Signals Data Figure 3.15 Computer Modules

The interconnection structure must support the following types of transfers: Memory to processor Processor to memory I/O to processor Processor to I/O I/O to or from memory Processor reads an instruction or a unit of data from memory Processor writes a unit of data to memory Processor reads data from an I/O device via an I/O module Processor sends data to the I/O device An I/O module is allowed to exchange data directly with memory without going through the processor using direct memory access

Data Bus Data lines that provide a path for moving data among system modules May consist of 32, 64, 128, or more separate lines The number of lines is referred to as the width of the data bus The number of lines determines how many bits can be transferred at a time The width of the data bus is a key factor in determining overall system performance

+ Address Bus Control Bus Used to designate the source or destination of the data on the data bus If the processor wishes to read a word of data from memory it puts the address of the desired word on the address lines Width determines the maximum possible memory capacity of the system Also used to address I/O ports The higher order bits are used to select a particular module on the bus and the lower order bits select a memory location or I/O port within the module Used to control the access and the use of the data and address lines Because the data and address lines are shared by all components there must be a means of controlling their use Control signals transmit both command and timing information among system modules Timing signals indicate the validity of data and address information Command signals specify operations to be performed

CPU Memory Memory I/O I/O Control lines Address lines Bus Data lines Figure 3.16 Bus Interconnection Scheme

+ Point-to-Point Interconnect Principal reason for change was the electrical constraints encountered with increasing the frequency of wide synchronous buses At higher and higher data rates it becomes increasingly difficult to perform the synchronization and arbitration functions in a timely fashion A conventional shared bus on the same chip magnified the difficulties of increasing bus data rate and reducing bus latency to keep up with the processors Has lower latency, higher data rate, and better scalability

+ Quick Path Interconnect QPI Introduced in 2008 Multiple direct connections Direct pairwise connections to other components eliminating the need for arbitration found in shared transmission systems Layered protocol architecture These processor level interconnects use a layered protocol architecture rather than the simple use of control signals found in shared bus arrangements Packetized data transfer Data are sent as a sequence of packets each of which includes control headers and error control codes

DRAM I/O device Core A I/O Hub Core B I/O device DRAM DRAM Core C Core D DRAM I/O device I/O Hub I/O device QPI PCI Express Memory bus Figure 3.1 7 Multicore Configuratio n Using QPI

Protocol Packets Protocol Routing Routing Link Flits Link Physical Phits Physical Figure 3.1 8 QPI Layers

+ QPI Link Layer Performs two key functions: flow control and error control Operate on the level of the flit (flow control unit) Each flit consists of a 72- bit message payload and an 8-bit error control code called a cyclic redundancy check (CRC) Flow control function Needed to ensure that a sending QPI entity does not overwhelm a receiving QPI entity by sending data faster than the receiver can process the data and clear buffers for more incoming data Error control function Detects and recovers from bit errors, and so isolates higher layers from experiencing bit errors

+ QPI Routing and Protocol Layers Routing Layer Used to determine the course that a packet will traverse across the available system interconnects Defined by firmware and describe the possible paths that a packet can follow Protocol Layer Packet is defined as the unit of transfer One key function performed at this level is a cache coherency protocol which deals with making sure that main memory values held in multiple caches are consistent A typical data packet payload is a block of data being sent to or from a cache 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.

+ Peripheral Component Interconnect (PCI) A popular high bandwidth, processor independent bus that can function as a mezzanine or peripheral bus Delivers better system performance for high speed I/O subsystems PCI Special Interest Group (SIG) Created to develop further and maintain the compatibility of the PCI specifications PCI Express (PCIe) Point-to-point interconnect scheme intended to replace bus-based schemes such as PCI Key requirement is high capacity to support the needs of higher data rate I/O devices, such as Gigabit Ethernet Another requirement deals with the need to support time dependent data streams

Core Core Gigabit Ethernet PCIe Chipset Memory PCIe PCI Bridge PCIe Memory PCIe PCIe Switch PCIe PCIe PCIe Legacy endpoint PCIe endpoint PCIe endpoint PCIe endpoint Figure 3.2 1 Typical Configuration Using PCI e

Transaction Data Link Transaction layer packets (TLP) Data link layer packets (DLLP) Transaction Data Link Physical Physical Figure 3.2 2 PCI e Protocol Layers

+ PCIe Transaction Layer (TL) Receives read and write requests from the software above the TL and creates request packets for transmission to a destination via the link layer Most transactions use a split transaction technique A request packet is sent out by a source PCIe device which then waits for a response called a completion packet TL messages and some write transactions are posted transactions (meaning that no response is expected) TL packet format supports 32-bit memory addressing and extended 64-bit memory addressing

+ The TL supports four address spaces: Memory The memory space includes system main memory and PCIe I/O devices Certain ranges of memory addresses map into I/O devices I/O This address space is used for legacy PCI devices, with reserved address ranges used to address legacy I/O devices Configuration This address space enables the TL to read/write configuration registers associated with I/O devices Message This address space is for control signals related to interrupts, error handling, and power management

PCIe TLP Transaction Types Address Space TLP Type Purpose Memory Memory Read Request Transfer data to or from a location in the Memory Read Lock Request system memory map. Memory Write Request I/O I/O Read Request Transfer data to or from a location in the I/O Write Request system memory map for legacy devices. Config Type 0 Read Request Configuration Message Memory, I /O, Configuration Config Type 0 Write Request Config Type 1 Read Request Config Type 1 Write Request Message Request Message Request with Data Completion Completion with Data Completion Locked Completion Locked with Data Transfer data to or from a location in the configuration space of a PCIe device. Provides in-band messaging and event reporting. Returned for certain requests.