Computer Architecture (part 2)

Similar documents
CMPUT101 Introduction to Computing - Summer 2002

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

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

Designing Computers. The Von Neumann Architecture. The Von Neumann Architecture. The Von Neumann Architecture

CMPUT101 Introduction to Computing - Summer 2002

CMPUT 101 with Solutions Quiz 2 (50 minutes) August 7, 2002

CS1004: Intro to CS in Java, Spring 2005

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

CMPUT 101 with Solutions Quiz 2 (50 minutes) November 7, 2003

CMPUT 101 with Solutions Quiz 2 (50 minutes) November 16, 2000

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

Chapter 5: Computer Systems Organization. Invitation to Computer Science, C++ Version, Third Edition

Chapter 5: Computer Systems Organization

Chapter 5 12/2/2013. Objectives. Computer Systems Organization. Objectives. Objectives (continued) Introduction. INVITATION TO Computer Science 1

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

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

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

Computer Architecture

Chapter 2 Data Manipulation

Computer Architecture 2/26/01 Lecture #

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

CS 101, Mock Computer Architecture

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

Computer Organization

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

Information Science 1

AS/A Level Computing Syllabus 2011

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store.

A B C ((NOT A) AND B) OR C

CISC Processor Design

The Stored Program Computer

EE 3170 Microcontroller Applications

Computer Organization II CMSC 3833 Lecture 33

Data Manipulation. Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan

Why learn Computer Programming? Computer-based problem solving in Science and Engineering. Why learn Fortran? Elementary Computer Organization

Level 2: The Hardware World Chapters 4 and 5 (topics of other cs courses)

Von Neumann Architecture

Wednesday, February 4, Chapter 4

Machine Architecture. or what s in the box? Lectures 2 & 3. Prof Leslie Smith. ITNP23 - Autumn 2014 Lectures 2&3, Slide 1

Introduction to Computers - Chapter 4

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Copyright 2000 N. AYDIN. All rights reserved. 1

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Machine code. Nils Jansen December 12, 2017

Computer Architecture and Data Manipulation. Von Neumann Architecture

Lecture Topics ECE 341. Lecture # 8. Functional Units. Information Processed by a Computer

Digital System Design Using Verilog. - Processing Unit Design

Chapter One. Introduction to Computer System

Wednesday, September 13, Chapter 4

Introduction to CPU architecture using the M6800 microprocessor

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

1. Fundamental Concepts

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

Chapter 4. Computer Organization

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

5 Computer Organization

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

BASIC COMPUTER ORGANIZATION. Operating System Concepts 8 th Edition

Systems Architecture

Typical Processor Execution Cycle

Chapter 4 The Von Neumann Model

Lecture 11: Control Unit and Instruction Encoding

Processor (I) - datapath & control. Hwansoo Han

Computer Architecture and Assembly Language. Spring

Teaching London Computing

5 Computer Organization

FACTFILE: GCE DIGITAL TECHNOLOGY

Latches. IT 3123 Hardware and Software Concepts. Registers. The Little Man has Registers. Data Registers. Program Counter

CC411: Introduction To Microprocessors

An Introduction to System Software and Virtual Machines

What Are The Main Differences Between Program Counter Pc And Instruction Register Ir

Computer System. Hiroaki Kobayashi 7/25/2011. Agenda. Von Neumann Model Stored-program instructions and data are stored on memory

Show how to connect three Full Adders to implement a 3-bit ripple-carry adder

The Itanium Bit Microprocessor Report

16.1. Unit 16. Computer Organization Design of a Simple Processor

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

COMPUTER STRUCTURE AND ORGANIZATION

Computer Architecture Review CS 595

Microcomputer Architecture and Programming

COA. Prepared By: Dhaval R. Patel Page 1. Q.1 Define MBR.

Chapter 4 The Von Neumann Model

LC-3 Architecture. (Ch4 ish material)

Single cycle MIPS data path without Forwarding, Control, or Hazard Unit

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE

18. Machine Language. Computer Systems. COMP1917: Computing 1. Machine Language Programming. History of Computer Technology

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION & ARCHITECTURE

Chapter 08: The Memory System. Lesson 01: Basic Concepts

SISTEMI EMBEDDED. Basic Concepts about Computers. Federico Baronti Last version:

THE MICROPROCESSOR Von Neumann s Architecture Model

Introduction to Computer Engineering. CS/ECE 252 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin Madison

The Institution of Engineers - Sri Lanka

COSC 122 Computer Fluency. Computer Organization. Dr. Ramon Lawrence University of British Columbia Okanagan

Introduction to Computer Science. Homework 1

Introduction to Computers & Programming

Computer Organization and Technology Processor and System Structures

Computer Organization

Introduction. Datapath Basics

Hardware Level Organization

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

Transcription:

Computer Architecture (part 2) Topics: Machine Organization Machine Cycle Program Execution Machine Language Types of Memory & Access 2 Chapter 5 The Von Neumann Architecture 1

Arithmetic Logic Unit (ALU) The ALU (Arithmetic/Logic Unit) Circuits for performing. mathematical operations (+, -, x, /, ) logic operations (=, <, >, and, or, not,...) Registers Buses connecting CPU registers and ALU registers 3 Structure of the ALU Registers: Very fast local memory cells, that store operands of operations and intermediate results. CCR (condition code register), a special purpose register that stores the result of <, =, > operations ALU circuitry: Contains an array of circuits to do mathematical/logic operations. R0 R1 R2 Rn ALU circuitry GT EQ LT 4 Chapter 5 The Von Neumann Architecture 2

A concrete example traced through the architecture s datapath Question: What happens to execute this pseudocode? Set bankbalance to bankbalance + deposit Needed: a particular machine instruction set 5 Opcode 0000 0001 0010 0011 0100 0101 0101 0111 1000 1001... 1101 1110 1111 Operation LOAD X STORE X CLEAR X ADD X INCREMENT X SUBTRACT X DECREMENT X COMPARE X JUMP X JUMPGT X JUMPxx X IN X OUT X HALT Meaning CON(X) --> R R --> CON(X) 0 --> CON(X) R + CON(X) --> R R - CON(X) --> R Instruction Set for Textbook s Simplified Von Neumann Machine CON(X) + 1 --> CON(X) CON(X) - 1 --> CON(X) If CON(X) > R then GT = 1 else 0 If CON(X) = R then EQ = 1 else 0 If CON(X) < R then LT = 1 else 0 Get next instruction from memory location X Get next instruction from memory loc. X if GT=1 xx = LT / EQ / NEQ Input an integer value and store in X Output, in decimal notation, content of mem. loc. X Stop program execution 6 Chapter 5 The Von Neumann Architecture 3

Stepping through the Machine Cycle: Adding two numbers (To simplify, we use decimal notation rather than binary for addresses and contents ) Set bankbalance to bankbalance plus deposit variable names memory cell address cell contents bankbalance 100 500 deposit 200 250 7 Adding 2 numbers... Machine level instructions (using textbook s machine lang.) load content of memory location 100 to register R0 add contents of memory location 204 to register R0 store the contents of R0 in memory location 100 Memory Cell Cell contents 34 Load 100 36 Add 204 38 Store 100 8 Chapter 5 The Von Neumann Architecture 4

Program Counter 34 Fetch PC s contents MAR Instruction at 34 MDR MDR Instruction Reg advance PC 36 Address Contents 34 Load 100 36 Add 204 38 Store 100 100 500 204 250 Decode the opcode found in Instruction Register ( load, source address) Execute address 100 MAR set fetch/store controller to fetch contents of 100 MDR MDR contents R0 9 Program Counter 36 Fetch PC s contents MAR Instruction at 36 MDR MDR Instruction Reg advance PC 38 Address Contents 34 Load 100 36 Add 204 38 Store 100 100 500 204 250 Decode the opcode found in Instruction Register ( add, location in memory to register in ALU) Execute contents of register and mem location accessed by ALU circuits ALU circuits perform add 10 Chapter 5 The Von Neumann Architecture 5

Program Counter 38 Fetch PC s contents MAR Instruction at 38 MDR MDR Instruction Reg advance PC 40 Decode Address Contents 34 Load 100 36 Add 204 38 Store 100 40... 100 500 750 204 250 the opcode found in Instruction Register ( store, CPU register, RAM address) Execute address 100 MAR set fetch/store controller to store contents of R0 MDR MDR contents address 100 11 Machine Instruction Set (revisited again): Instruction Set design. 8 bits 16 bits 16 bits 16 bits Operation Code Address Field 1 Address Field 2 Address Field 3 Hypothetical example... OpCode Operands Meaning 00000101 x add (contents at) x with contents of R0, put result back into x 00000110 x, y add con(x) and con(y) and put result in x 00000111 x, y, z add con(x) and con(y) and put result in z 12 Chapter 5 The Von Neumann Architecture 6

Instruction Set Design: Do we need 3 ways to add? Reduced Instruction Set Computers (RISC) Instruction set as small and simple as possible. Minimizes amount of circuitry --> faster computers Complex Instruction Set Computers (CISC) More instructions, many very complex Each instruction can do more work, but requires more circuitry. 13 Machine Instruction Set (revisited): 4 classes of instructions Data Transfer Instructions, e.g. LOAD X Load content of memory location X to R0 STORE X Load content of R0 to memory location X MOVE X, Y Copy content of memory location X to location Y a possible RISC approach to MOVE? 14 Chapter 5 The Von Neumann Architecture 7

Machine Instruction Classes (cont.) Arithmetic/Logic Instructions ADD X, Y, Z CON(Z) = CON(X) + CON(Y) AND OR Compare Instructions COMPARE X, Y Compare and set the condition code register (CCR) If CON(X) = CON(Y) then set EQ=1, GT=0, LT=0 These are condition codes that other instructions will reference.namely... 15 Machine Instruction Classes (cont.) Branch Instructions - deviations from sequential control JUMP X Load next instruction from memory loc. X JUMPGT X Load next instruction from memory loc. X only if GT condition code is set, otherwise load statement from next sequence loc. as usual. HALT If (a > b) then 50 compare 100,101 set c to a 51 jumpgt 54 Else set c to b 52 Move 101,102 100 value of a 101 value of b 102 value of c 53 Jump 55 54 Move 100, 102 55 <whatever next instr. Is> 16 Chapter 5 The Von Neumann Architecture 8

Instruction Set for Our Von Neumann Machine Opcode Operation Meaning 0000 0001 0010 0011 0100 0101 0101 0111 LOAD X STORE X CLEAR X ADD X INCREMENT X SUBTRACT X DECREMENT X COMPARE X CON(X) --> R R --> CON(X) 0 --> CON(X) R + CON(X) --> R CON(X) + 1 --> CON(X) R - CON(X) --> R CON(X) - 1 --> CON(X) If CON(X) > R then GT = 1 else 0 If CON(X) = R then EQ = 1 else 0 If CON(X) < R then LT = 1 else 0 1000 1001... 1101 1110 1111 JUMP X JUMPGT X JUMPxx X IN X OUT X HALT Get next instruction from memory location X Get next instruction from memory loc. X if GT=1 xx = LT / EQ / NEQ Input an integer value and store in X Output, in decimal notation, content of mem. loc. X Stop program execution 17 Input/Output The rest of the architecture Access to keyboard, screen, and secondary memory Issue CPU These devices are remote to the CPU A mismatch of speed in manipulating information I/O controller Interrupt Signal Data Buffer RAM Control logic To screen, keyboard, harddrive 18 Chapter 5 The Von Neumann Architecture 9

Check point practice problems on p. 200 19 ROM RAM Types of Memory: access and retrieval - read only memory - volatile - retrieve no less than 1 cell - each cell has unique address - each cell accessed at same speed Secondary Memory (hard drive, CDs, removable disks) - non-volatile - each memory location has unique address - retrieve no less than 1 memory location - different access times for memory locations 20 Chapter 5 The Von Neumann Architecture 10

Direct Access Memory Organization Track + Sector Layout tracks: concentric circles divided into sectors sector: a block holding address plus data cells Address for data location: a track # plus a sector # Access to a data location is a mechanical process 21 Quantifying Data Retrieval Time for Direct Access Memory Retrieval time = access time + transfer time Recall address is a particular track and particular sector on that track Access time = seek time + latency (rotational delay) Transfer time: time for entire sector to pass under read/write head 22 Chapter 5 The Von Neumann Architecture 11

Example Rotation speed: 2400 rev/min = 40 rev/sec time for 1 revolution? 1 rev every 1/40 of a second or.025 sec so, 25 milliseconds for 1 revolution Arm movement:.5 msec to go to next track # tracks : 100 # sectors/track: 10 Best worst avg Seek time 0 99*.5ms Rotational delay(latency) 0 ~.025 sec Transfer time 1/10 (.025) same same 23 Practice Problems on Memory Access/Storagepg. 189 24 Chapter 5 The Von Neumann Architecture 12

Machine Architecture: Key Ideas 1. Von Neumann design stored program / sequential execution of instructions 2. Machine instruction set (RISC/CISC; classes of instructions; binary representation - op codes, operands) 3. Fetch/Decode/Execute Cycle understand the basic architecture (PC, IR, ALU, MAR, MDR, fetch/store controller) especially low level movement of bits at each stage review pg. 206 role of circuits for selecting, decoding (multiplexors, decoders) 4. Types of Memory/ Access Operations 25 Machine Architecture: Key Skills 1. Write algorithms in machine language (as per practice problems) 2. Be able to reason about notions like address space, size of MAR, etc. 3. Be able to do simple calculations on accessing direct access memory (as per practice problems) 4. Be able to label/trace through the data-path on our simplified architecture 26 Chapter 5 The Von Neumann Architecture 13