CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Processor Data Path and Control Diana Palsetia UPenn
The CPU The Central Presentation Unit What is the CPU?
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Chapter 4 - ISA 1.The Von Neumann Model. 4-2 The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer.
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
LC-3 Architecture Patt and Patel Ch. 4 1.
The processor and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
The central processing unit and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
Elements of the Computer (How a processor works)
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Computer Science 210 Computer Organization The Instruction Execution Cycle.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
Chapter 4 The Von Neumann Model
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.
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
General Concepts of Computer Organization Overview of Microcomputer.
Computer Architecture And Organization UNIT-II General System Architecture.
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Dale & Lewis Chapter 5 Computing components
Processor Data Path and Control How they work together.
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
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 4 The Von Neumann Model
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Click to edit Master title style Click to edit Master text styles – –Second level Third level – –Fourth level » »Fifth level 1 – –Second level Third level.
1 Chapter 1 Basic Structures Of Computers. Computer : Introduction A computer is an electronic machine,devised for performing calculations and controlling.
Control Unit Lecture 6.
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Introduction to Computer Engineering
Computer Architecture
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
The Processor and Machine Language
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Functional Units.
Introduction to Computer Engineering
Topic 6 LC-3.
The Von Neumann Model Basic components Instruction processing
Computer Architecture
Chapter 4 The Von Neumann Model
The Von Neumann Architecture
The Stored Program Computer
Basic components Instruction processing
A Top-Level View Of Computer Function And Interconnection
Information Representation: Machine Instructions
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Presentation transcript:

CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model Topics Basic components of a computer Instruction processing Examples from the LC-3 simulator Changing the sequence of execution S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Basic Components of a Computer System The basic components are: Central processing unit (CPU) Memory Input devices Output devices A clock controls all the operations performed in a computer system. A computer system is a synchronous machine. S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Von Neumann Model of a Computer System S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Central Processing Unit (CPU) The CPU consists of: Arithmetic logic unit (ALU) Control unit (CU) Small set of storage areas, called registers Arithmetic Logic Unit (ALU) The ALU is the primary processing unit in a computer. It performs all the arithmetic and logic operations. Control Unit (CU) The CU controls all the operations performed by a computer and determines what operations the program calls for and in what order they need to be carried out. S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

CPU (Continued) The CPU is responsible for: The complete processing of information All the decision-making operations Word Size of a processor: Number of bits the processor reads from or writes into the memory in one clock cycle Number of bits normally processed by ALU in one instruction Also width of registers LC-3 is a 16 bit processor S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Memory Memory provides the storage space for the program that is currently being executed the data that is needed during the execution of the program The memory unit consists of a number of memory locations of the same width. The number of bits that can be stored in a memory location corresponds to the memory width. Each memory location is identified by a unique address. Memory capacity = Total number of memory locations * memory width S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Interface to Memory MAR: Memory Address Register MDR: Memory Data Register S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Block Diagram of a Memory Unit memory width 7 6 5 4 3 2 1 0 1 2 . MAR 10 bits . 8 bits MDR 10-bit memory address . 8-bit data (A9 – A0) . (D7 – D0) 1023 For this example, memory capacity = 210 x 8 bits = 1 Kbytes (The above figure does not show the control signals needed to control the memory read and memory write operations.) S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Memory - Basic Operations LOAD - Read data from a memory location Write the address of the location into the MAR. Send a “read” signal to the memory. Read the data from MDR. STORE - Write data to a memory location Write the data to the MDR. Send a “write” signal to the memory. S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Input/Output (I/O) Devices Input devices transfer information from the outside world into the memory of a computer system. Examples: Keyboard, disk drives, scanner, mouse Output devices transfer information from the memory of a computer system into the outside world. Examples: Printers, display units, plotters, disk drives Some devices provide both input and output Examples: disk, network Driver - Program that controls access to a device S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Buses in a Computer System Buses are the physical link between the various components within the computer. The computer employs mainly three types of buses: Address bus Data bus Control bus S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Buses in a Computer System (Continued) Three types of buses in a computer system: Address bus: Carries the address generated by the CPU to the memory and I/O. Data bus: Allows the transfer of data between the CPU, memory and I/O. Control bus: Carries the control signals, generated by the control unit, to the various components in the system in order to ensure proper sequencing of data and instruction movement. S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Block Diagram of a Basic Computer Architecture CPU   Clock CU ALU Clock Generator Address Bus p Data Bus q Control Bus r   Main Memory I/O Unit I/O Bus (represents address, data, & control)   Keyboard Printer Secondary Memory S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

The instruction specifies two items: Opcode: operation to be performed Operands: data/locations to be used for operation An instruction is encoded as a sequence of bits. Often, but not always, instructions have a fixed length, such as 16 or 32 bits. Instruction Format – The binary representation of an instruction S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction (Continued) Control unit interprets the instruction generates sequence of control signals to carry out operation. A computer’s instructions and their formats is known as its Instruction Set Architecture (ISA). S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing Fetch instruction from memory Decode instruction Evaluate address Fetch operands from memory Execute operation Store result S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: FETCH Load the instruction from memory into Instruction Register Copy contents of PC into MAR MAR ← PC Increment PC so that PC points to the next instruction in sequence PC ← PC + 1 Send “read” control signal to memory MDR ← Memory [MAR] Copy contents of MDR into IR IR ← MDR D EA OP EX S S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Example Instruction: LDR Instruction LDR R2, R3, #6 – Loads (reads) data from memory into the destination register R2 Memory address: Base register + SEXT (offset) Memory address = R3 + 6 Load the contents of the memory location [R3 + 6] to R2 S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: DECODE F First identify the opcode Identify the operands Example: LDR R2, R3, #6 Opcode: IR[15:12] = 0110 Operands: Offset: IR[5:0] = #6 (6 decimal; 000110 binary) Base register: IR[8:6] = 011 = R3 D EA OP EX S S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: EVALUATE ADDRESS F For instructions that require memory access, compute address used for memory access. Example: LDR R2, R3, #6 Address = SEXT (offset) + Base Register MAR ← 6 + R3 D EA OP EX S S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: FETCH OPERANDS Obtain source operands needed to perform operation. Example: LDR R2, R3, #6 Load data from memory (LDR) MDR ← Memory [MAR] D EA OP EX S S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: EXECUTE F Perform the operation, using the source operands. Example: LDR R2, R3, #6 No operation done in this step D EA OP EX S S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: STORE RESULT F Write results to destination. Destination can be a register or Memory. Example: LDR R2, R3, #6 Data read from the memory is placed in destination register. R2 ← MDR D EA OP EX S S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Changing the Sequence of Instructions In the FETCH phase, we increment PC by 1. Need special instructions called control instructions to change the contents of the PC during the Execute phase. jumps (unconditional) Always change the PC branches (conditional) PC is changed only if the specified condition is true S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Examples: LC-3 Control Instructions JMP R2 ; PC ← R2 RET ; PC ← R7 BRzp NEXT ; if the last result was zero or positive then PC ← address corresponding to NEXT S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing Summary Three basic kinds of instructions: Arithmetic/logic instructions (ADD, AND, …) Data transfer instructions (LD, ST, …) Control instructions (JMP, BRnz, …) Six basic phases of instruction processing: F  D  EA  OP  EX  S Not all phases are needed by every instruction Phases may take variable number of machine cycles S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Example Instruction: LDR Instruction LDR R2, R3, #6 ; R2 ← mem [R3 + 6] Opcode: IR[15:12] = 0110 Operands: Base register: R3 given by IR[8:6] Offset: 6 given by IR[5:0] Destination: R2 given by IR[11:9] S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: LDR R2, R3, #6 Fetch MAR ← PC PC ← PC + 1 MDR ← Memory [MAR] IR ← MDR Decode Identify the opcode Identify the operands Execute MAR ← 6 + R3 R2 ← MDR S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Example Instruction: ADD Instruction ADD R6, R2, R6 ; R6 ← R2 + R6 Opcode: IR[15:12] = 0001 Operands: Source1: R2 given by IR[8:6] Source2: R6 given by IR[2:0] Destination: R6 given by IR[11:9] S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: ADD R6, R2, R6 Fetch MAR ← PC PC ← PC + 1 MDR ← Memory [MAR] IR ← MDR Decode Identify the opcode Identify the operands Execute R6 ← R2 + R6 S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Example Instruction: JMP Instruction JMP R3 ; PC ← R3 Opcode: IR[15:12] = 0001 Operand: Base register R3 given by IR[8:6] S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu

Instruction Processing: JMP R3 Fetch MAR ← PC PC ← PC + 1 MDR ← Memory [MAR] IR ← MDR Decode Identify the opcode Identify the operand Execute PC ← R3 S. Barua – CPSC 240 sbarua@fullerton.edu http://sbarua.ecs.fullerton.edu