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

Similar documents
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

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

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

CMPUT101 Introduction to Computing - Summer 2002

Computer Architecture (part 2)

CS1004: Intro to CS in Java, Spring 2005

Von Neumann Architecture

Computer Architecture

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

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

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

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

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

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

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

Chapter 4 The Von Neumann Model

The Stored Program Computer

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

Chapter 5: Computer Systems Organization

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

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

Chapter 4 The Von Neumann Model

Introduction to CPU architecture using the M6800 microprocessor

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

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

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

Chapter 4 The Von Neumann Model

AS/A Level Computing Syllabus 2011

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

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

Wednesday, September 13, Chapter 4

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

Wednesday, February 4, Chapter 4

Computer Organization II CMSC 3833 Lecture 33

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

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

Information Science 1

LC-3 Architecture. (Ch4 ish material)

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Diskrečioji matematika

Computer Architecture and Organization (CS-507)

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

Computer Architecture and Assembly Language. Spring

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

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

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

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Topics: Microcontrollers Programming Basics: structure and variables Digital Output Analog to Digital Conversion. Arduino

Microcontroller Systems

Computer Architecture 2/26/01 Lecture #

2. Computer Evolution and Performance

Introduction to Computer Science. Homework 1

2.2 THE MARIE Instruction Set Architecture

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

CS 101, Mock Computer Architecture

CC411: Introduction To Microprocessors

Teaching London Computing

The Stored Program Computer

Where Does The Cpu Store The Address Of The


1. Fundamental Concepts

Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

CS311 Lecture: The Architecture of a Simple Computer

Chapter 4. Computer Organization

PESIT Bangalore South Campus

Computer Architecture and Data Manipulation. Von Neumann Architecture

Chapter 2 Data Manipulation

C Functions and Pointers. C Pointers. CS270 - Fall Colorado State University. CS270 - Fall Colorado State University

Machine code. Nils Jansen December 12, 2017

Computer Organization Question Bank

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

Computer Organization

Computer Architecture COMP360

EE 2700 Project 2 Microprocessor Design

Computer Architecture Review CS 595

Concept of Memory. The memory of computer is broadly categories into two categories:

Module 5 - CPU Design

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

How does the CPU execute programs? Nils Jansen December 5, 2017 (Based on slides by Jeroen Keiren and Niek Janssen)

THE MICROPROCESSOR Von Neumann s Architecture Model

Computer Architecture

Processing Unit CS206T

Intermediate Programming & Design (C++) Notation

Class Notes. Dr.C.N.Zhang. Department of Computer Science. University of Regina. Regina, SK, Canada, S4S 0A2

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

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

STRUCTURE OF DESKTOP COMPUTERS

Hardware Level Organization

Top-Level View of Computer Organization

Introduction to Computers - Chapter 4

Introduction to Computers & Programming

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

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

Computer Systems Organization

Algorithms, Computer Systems, and Programming Languages

Information Science 1

COMPUTER STRUCTURE AND ORGANIZATION

CS101 Lecture 25: The Machinery of Computation: Computer Architecture. John Magee 29 July 2013 Some material copyright Jones and Bartlett

Transcription:

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

Part 3: von Neumann Architecture von Neumann Architecture Our goal: understand the basics of von Neumann architecture, including memory, control unit and arithmetic logic unit understand the basics of machine language instructions know how control unit works with machine instructions

Part 3: von Neumann Architecture Overview: why von Neumann architecture a rough idea about how von Neumann architecture works? main memory in von Neumann architecture arithmetic logic unit in von Neumann architecture control unit in von Neumann architecture

Why von-neumann architecture All computers more or less based on the same basic design, the von Neumann Architecture! what ever it be a multi-million dollar mainframe or a Palm Pilot. The von Neumann architecture describes a general framework, or structure, that a computer's hardware, programming, and data should follow, and the central idea is stored program, i.e. program and data reside in memory in the format of binary

How von-neumann architecture works stores both data and instructions Arithmetic Logic Unit (ALU) instruction do arithmetic logic operation requested by program data program Input Device Main Memory Output Device address instruction interprets the instructions in memory and causes them to be executed Program Control Unit (CC) communicate with outside world, e.g. screen, keyboard, storage device

How von-neumann architecture works Step 1. send data and program 1+1 to main memory through input device Arithmetic Logic 2Unit =2 (ALU) 1 + instruction Step 4. ALU store results to memory data 1+1 program Input Device Main Memory Output Device Step 2. CC read + instruction from memory according to address Step 3. CC send instruction to ALU, and then read data 1 and 1 from memory to ALU according to address address 11 + 12 Program Control + Unit (CC) instruction Step 5. output results from memory to output device through instruction

Memory What is memory? Structure of memory Basic operations on memory

What is memory Memory A storage unit consisting of many memory cells with a fixed size. Each cell has an address associated with it: 0, 1, Each cell has two important characteristics: (1) its address (where it is), (2) its contents (what s stored at the given location).

Structure of memory Memory width (W) How many bits is each memory cell, typically one byte (=8 bits) Address width (N) How many bits used to represent each address, determines the maximum memory size = address space If address width is N-bits, then address space is 2 N (0,1,...,2 N -1) 0 1 2 N 0000000000000001... 1 bit 2 N Address space the number of uniquely identifiable memory locations. 2 N -1 W 9

Structure of memory: an example For example, for a 256 Mbyte memory, suppose its memory width is 8 bits (or 1 bytes) What is its address space? 2 28 What is its address width? 28 bits

Structure of memory: an example For another example a memory space is as follows: 000 001 010 011 100 0000 0110 101 110 0000 0010 111 what is its memory width? 8 bits what is its address space? 8 what is its address width? 3 bits what is the content of memory location address 100? (0000 0110)

Basic operations to memory Operations on Memory Fetch (address): Fetch a copy of the content of memory cell with the specified address. Non-destructive, copies value in memory cell. Store (address, value): Store the specific value into the memory cell specified by address. Destructive, overwrites the previous value of the memory cell.

Basic operations to memory: an example Question: How does processing unit get data to/from memory? MAR: Memory Address Register MDR: Memory Data Register Fetch (Address): 1. Load the address (A) into the MAR. 2. Copy the content of memory cell with specified address into MDR. Store (Address, Value): MAR MDR MEMORY 1. Load the address (A) into MAR; load the value into MDR 2. copy content of MDR into memory cell with specified address.

Arithmetic Logic Unit - ALU What is ALU? Structure of ALU

What is ALU The ALU performs mathematical operations (+, -, x, /, ) logic operations (=, <, >, and, or, not,...) In today's computers integrated into the CPU Consists of: Circuits to do the arithmetic/logic operations. Registers (fast storage units) to store intermediate computational results. Bus that connects the two.

Structure of 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. Bus: Data path interconnecting the registers to the ALU circuitry. R0 R1 R2 Rn ALU circuitry GT EQ LT

Control Unit What is Control Unit? Machine Language Instructions in Control Unit How Control Unit Works

What is control unit Program is stored in memory as machine language instructions, in binary The task of the control unit is to execute programs by repeatedly: Fetch from memory the next instruction to be executed. Decode it, that is, determine what is to be done. Execute it by issuing the appropriate signals to the ALU, memory, and I/O subsystems. Continues until the HALT instruction

What is machine language instruction A machine language instruction consists of: Operation code/opcode, telling which operation to perform Address field(s)/operands, telling the memory addresses of the values on which the operation works. So, a machine language instruction = Opcode + Operands

Machine language instruction: an example For Example: ADD X, Y - Opcode ADD tell the ALU to execute the add function - X and Y is the address of memory cell - execute ADD X,Y means ADD content of memory locations X and Y, and store back in memory location Y. Assume: opcode for ADD is 9 in decimal, and addresses X=99, Y=100 in decimal How to represent this instruction in memory of computer? suppose the memory width for opcode and address is 8 bits and 16 bits, respectively Opcode (8 bits) Address 1 (16 bits) Address 2 (16 bits) 00001001 0000000001100011 0000000001100100

Machine language instruction: an example suppose X=4 and Y=6, con(x) = 6 and con (Y) =2 After execute the instruction ADD X,Y before execute instruction after execute instruction X Y 000 0000 0000 001 0000 0000 010 0000 0000 011 0000 0000 100 0000 0110 101 0000 0000 110 0000 0010 111 0000 0000 Content of address X is 6 Content of address Y is 2

Typical machine instructions Notation: We use X, Y, Z to denote address of memory cells Assume only one register R (for simplicity) Use English-like descriptions (should be binary) Data Transfer Instructions LOAD X Read content of memory location X to R STORE X Write content of R to memory location X MOVE X, Y Copy content of memory location X to location Y

Typical machine instructions: an example For example: LOAD X means read the content of memory location X to register R Suppose X=2, and memory with address 4 is assigned as R X memory space 000 0000 0000 001 0000 0110 after execute instruction 000 0000 0000 001 0000 0110 010 0011 0000 010 0011 0000 register R 011 0000 0000 100 0000 0000 011 0000 0000 100 0011 0000 101 0000 0000 101 0000 0000

Typical machine instructions Arithmetic ADD X, Y, Z CON(Z) = CON(X) + CON(Y) ADD X, Y CON(Y) = CON(X) + CON(Y) ADD X R = CON(X) + R similar instructions for other operators, e.g. SUBTR,OR,... Compare COMPARE X, Y Compare the content of memory cell X to the content of memory cell Y and set the condition codes (CCR) accordingly.

Typical machine instructions: an example For example: Compare X, Y means compare the content of memory cell X to the content of memory cell Y and then set the condition codes (CCR) accordingly. Suppose X=2, Y=4, and address 5 is assigned as CCR memory space CCR X Y 000 0000 0000 001 0000 0110 010 0000 1000 011 0000 0000 100 0000 0000 101 0000 0000 after execute instruction con(x)=8,con(y)=0,and the logic result of compare instruction is true, the second bit in CCR is the flag of greater than, it set to 1 if greater than is true 101 0000 0010

Typical machine instructions Branch JUMP X Load next instruction from memory location X JUMPGT X Load next instruction from memory location X only if GT flag in CCR is set, otherwise load statement from next sequence location as usual JUMPEQ, JUMPLT, JUMPGE, JUMPLE,JUMPNEQ Control HALT Stop program execution.

Thank you for your attendance Any questions?