The Von Neumann Architecture

Slides:



Advertisements
Similar presentations
The Von Neumann Architecture Odds and Ends
Advertisements

Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Chapter 5: Computer Systems Organization Invitation to Computer Science, C++ Version, Third Edition Added to by S. Steinfadt - Spring 2005 Additional source.
The Von Neumann Architecture
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Elements of the Computer (How a processor works)
Invitation to Computer Science 5th Edition
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
Chapter 5: Computer Systems Organization Invitation to Computer Science, C++ Version, Third Edition.
Computer Architecture And Organization UNIT-II Structured Organization.
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
CPU How It Works. 2 Generic Block Diagram CPU MemoryInputOutput Address Bus Data Bus.
Invitation to Computer Science 6th Edition Chapter 5 Computer Systems Organization.
INTRODUCTION TO COMPUTING CHAPTER NO. 05. Computer System Organization The Von Neumann Architecture Memory and Cache Input/Output and Storage devices.
General Concepts of Computer Organization Overview of Microcomputer.
Computer Architecture And Organization UNIT-II General System Architecture.
Computer Science 101 Computer Systems Organization.
Computer Science 101 Computer Systems Organization ALU, Control Unit, Instruction Set.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
Dale & Lewis Chapter 5 Computing components
Invitation to Computer Science 6 th Edition Chapter 5 Computer Systems Organization.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
Chapter 5: Computer Systems Organization Invitation to Computer Science,
Von Neumann Machines. 3 The Von Neumann Architecture Model for designing and building computers, based on the following three characteristics: 1)The.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Computer Architecture Adapted from CS10051 originally by Professor: Johnnie Baker Computer Science Department Kent State University von Neuman model.
Computer Architecture and Number Systems
Rocky K. C. Chang, 12 September 2017 Version 0.1
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Control Unit Lecture 6.
Chapter 4 The Von Neumann Model
Introduction to Computer Architecture
Introduction of microprocessor
Chapter 4 The Von Neumann Model
Computer Organization and Architecture
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
The Processor and Machine Language
Chapter 4 The Von Neumann Model
Functional Units.
COMS 161 Introduction to Computing
Computer Systems Organization
The Von Neumann Model Basic components Instruction processing
Control Unit Introduction Types Comparison Control Memory
MARIE: An Introduction to a Simple Computer
Chapter 5: Computer Systems Organization
Sequencing, Selection, and Loops in Machine Language
Computer Architecture
William Stallings Computer Organization and Architecture 8th Edition
Chapter 4 The Von Neumann Model
The Von Neumann Architecture Odds and Ends
The Stored Program Computer
Chapter 5 Computer Organization
Basic components Instruction processing
Information Representation: Machine Instructions
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Presentation transcript:

The Von Neumann Architecture Chapter 5.1-5.2 Von Neumann Architecture

Designing Computers All computers more or less based on the same basic design, the Von Neumann Architecture! CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

The Von Neumann Architecture Model for designing and building computers, based on the following three characteristics: The computer consists of four main sub-systems: Memory ALU (Arithmetic/Logic Unit) Control Unit Input/Output System (I/O) Program is stored in memory during execution. Program instructions are executed sequentially. CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

The Von Neumann Architecture Bus Memory Processor (CPU) Input-Output Control Unit Communicate with "outside world", e.g. Screen Keyboard Storage devices ... Store data and program Execute program ALU Do arithmetic/logic operations requested by program CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Memory Subsystem Memory, also called RAM (Random Access Memory), Consists of many memory cells (storage units) of a fixed size. Each cell has an address associated with it: 0, 1, … All accesses to memory are to a specified address. A cell is the minimum unit of access (fetch/store a complete cell). The time it takes to fetch/store a cell is the same for all cells. When the computer is running, both Program Data (variables) are stored in the memory. CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

RAM Need to distinguish between Memory width (W): Address width (N): the address of a memory cell and the content of a memory cell 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 2N (0,1,...,2N-1) 0000000000000001 1 bit 1 2 ... 2N 2N-1 W CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Memory Size / Speed Typical memory in a personal computer (PC): 64MB - 256MB Memory sizes: Kilobyte (KB) = 210 = 1,024 bytes ~ 1 thousand Megabyte(MB) = 220 = 1,048,576 bytes ~ 1 million Gigabyte (GB) = 230 = 1,073,741,824 bytes ~ 1 billion Memory Access Time (read from/ write to memory) 50-75 nanoseconds (1 nsec. = 0.000000001 sec.) RAM is volatile (can only store when power is on) relatively expensive CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Operations on Memory Fetch (address): Store (address, value): 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 specified value into the memory cell specified by address. Destructive, overwrites the previous value of the memory cell. The memory system is interfaced via: Memory Address Register (MAR) Memory Data Register (MDR) Fetch/Store signal CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Structure of the Memory Subsystem Fetch(address) Load address into MAR. Decode the address in MAR. Copy the content of memory cell with specified address into MDR. Store(address, value) Load the address into MAR. Load the value into MDR. Decode the address in MAR Copy the content of MDR into memory cell with the specified address. MAR MDR F/S Memory decoder circuit Fetch/Store controller ... CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Input/Output Subsystem Handles devices that allow the computer system to: Communicate and interact with the outside world Screen, keyboard, printer, ... Store information (mass-storage) Hard-drives, floppies, CD, tapes, … Mass-Storage Device Access Methods: Direct Access Storage Devices (DASDs) Hard-drives, floppy-disks, CD-ROMs, ... Sequential Access Storage Devices (SASDs) Tapes (for example, used as backup devices) CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

I/O Controllers Speed of I/O devices is slow compared to RAM RAM ~ 50 nsec. Hard-Drive ~ 10msec. = (10,000,000 nsec) Solution: I/O Controller, a special purpose processor: Has a small memory buffer, and a control logic to control I/O device (e.g. move disk arm). Sends an interrupt signal to CPU when done read/write. Data transferred between RAM and memory buffer. Processor free to do something else while I/O controller reads/writes data from/to device into I/O buffer. CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Structure of the I/O Subsystem Interrupt signal (to processor) Data from/to memory I/O controller I/O Buffer Control/Logic I/O device CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

The ALU Subsystem The ALU (Arithmetic/Logic Unit) 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. CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Structure of the ALU Registers: ALU circuitry: Bus: 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 CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

The 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 CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Machine Language Instructions A machine language instruction consists of: Operation code, telling which operation to perform Address field(s), telling the memory addresses of the values on which the operation works. Example: ADD X, Y (Add content of memory locations X and Y, and store back in memory location Y). Assume: opcode for ADD is 9, and addresses X=99, Y=100 Opcode (8 bits) Address 1 (16 bits) Address 2 (16 bits) 00001001 0000000001100011 0000000001100100 CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Instruction Set Design Two different approaches: 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 require more circuitry. CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Typical Machine Instructions Notation: We use X, Y, Z to denote RAM cells Assume only one register R (for simplicity) Use English-like descriptions (should be binary) Data Transfer Instructions LOAD X Load content of memory location X to R STORE X Load content of R to memory location X MOVE X, Y Copy content of memory location X to loc. Y (not absolutely necessary) CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Machine Instructions (cont.) 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. E.g. If CON(X) = R then set EQ=1, GT=0, LT=0 CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Machine Instructions (cont.) Branch JUMP X Load next instruction from memory loc. X JUMPGT X Load next instruction from memory loc. X only if GT flag in CCR is set, otherwise load statement from next sequence loc. as usual. JUMPEQ, JUMPLT, JUMPGE, JUMPLE,JUMPNEQ Control HALT Stop program execution. CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Example Pseudo-code: Set A to B + C Assuming variable: A stored in memory cell 100, B stored in memory cell 150, C stored in memory cell 151 Machine language (really in binary) LOAD 150 ADD 151 STORE 100 or (ADD 150, 151, 100) CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Structure of the Control Unit PC (Program Counter): stores the address of next instruction to fetch IR (Instruction Register): stores the instruction fetched from memory Instruction Decoder: Decodes instruction and activates necessary circuitry PC IR +1 Instruction Decoder CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

von Neumann Architecture CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

How does this all work together? Program Execution: PC is set to the address where the first program instruction is stored in memory. Repeat until HALT instruction or fatal error Fetch instruction Decode instruction Execute instruction End of loop CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Program Execution (cont.) Fetch phase PC --> MAR (put address in PC into MAR) Fetch signal (signal memory to fetch value into MDR) MDR --> IR (move value to Instruction Register) PC + 1 --> PC (Increase address in program counter) Decode Phase IR -> Instruction decoder (decode instruction in IR) Instruction decoder will then generate the signals to activate the circuitry to carry out the instruction CMPUT101 Introduction to Computing (c) Yngvi Bjornsson

Program Execution (cont.) CMPUT101 Introduction to Computing - Spring 2001 Program Execution (cont.) Execute Phase Differs from one instruction to the next. Example: LOAD X (load value in addr. X into register) IR_address -> MAR Fetch signal MDR --> R ADD X left as an exercise CMPUT101 Introduction to Computing (c) Yngvi Bjornsson Chapter 5 The Von Neumann Architecture

Instruction Set for Our Von Neumann Machine CMPUT101 Introduction to Computing - Spring 2001 Instruction Set for Our Von Neumann Machine Opcode Operation Meaning 0000 LOAD X CON(X) --> R 0001 STORE X R --> CON(X) 0010 CLEAR X 0 --> CON(X) 0011 ADD X R + CON(X) --> R 0100 INCREMENT X CON(X) + 1 --> CON(X) 0101 SUBTRACT X R - CON(X) --> R DECREMENT X CON(X) - 1 --> CON(X) 0111 COMPARE 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 JUMP X Get next instruction from memory location X 1001 JUMPGT X Get next instruction from memory loc. X if GT=1 ... JUMPxx X xx = LT / EQ / NEQ 1101 IN X Input an integer value and store in X 1110 OUT X Output, in decimal notation, content of mem. loc. X 1111 HALT Stop program execution CMPUT101 Introduction to Computing (c) Yngvi Bjornsson Chapter 5 The Von Neumann Architecture