THE MICROPROCESSOR Von Neumann s Architecture Model

Similar documents
Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Chapter 5. Computer Architecture Organization and Design. Computer System Architecture Database Lab, SANGJI University

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

Chapter 05: Basic Processing Units Control Unit Design. Lesson 15: Microinstructions

csitnepal Unit 3 Basic Computer Organization and Design

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

CC312: Computer Organization

Computer Architecture

Faculty of Engineering Systems & Biomedical Dept. First Year Cairo University Sheet 6 Computer I

Digital System Design Using Verilog. - Processing Unit Design

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

Chapter 3 : Control Unit

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Module 5 - CPU Design

Basic Computer Organization and Design Part 2/3

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN

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

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

Chapter 4. MARIE: An Introduction to a Simple Computer

COMPUTER STRUCTURE AND ORGANIZATION

Blog -

UNIT:2 BASIC COMPUTER ORGANIZATION AND DESIGN

Computer Organization (Autonomous)

omputer Design Concept adao Nakamura

BASIC COMPUTER ORGANIZATION AND DESIGN

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

COMPUTER ORGANIZATION

MICROPROGRAMMED CONTROL

DC57 COMPUTER ORGANIZATION JUNE 2013

Microprogrammed Control

BASIC COMPUTER ORGANIZATION AND DESIGN

MARIE: An Introduction to a Simple Computer

CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle

Basic Computer Organization - Designing your first computer. Acknowledgment: Most of the slides are adapted from Prof. Hyunsoo Yoon s slides.

Fig: Computer memory with Program, data, and Stack. Blog - NEC (Autonomous) 1

MARIE: An Introduction to a Simple Computer

Micro-Operations. execution of a sequence of steps, i.e., cycles

Processing Unit CS206T

Department of Computer Science and Engineering CS6303-COMPUTER ARCHITECTURE UNIT-I OVERVIEW AND INSTRUCTIONS PART A

C.P.U Organization. Memory Unit. Central Processing Unit (C.P.U) Input-Output Processor (IOP) Figure (1) Digital Computer Block Diagram


SCRAM Introduction. Philipp Koehn. 19 February 2018

The Stored Program Computer

1. Fundamental Concepts

ADVANCED COMPUTER ARCHITECTURE TWO MARKS WITH ANSWERS

5-1 Instruction Codes

COMPUTER ORGANIZATION & ARCHITECTURE

SISTEMI EMBEDDED. Computer Organization Central Processing Unit (CPU) Federico Baronti Last version:

Computer Architecture 2/26/01 Lecture #

William Stallings Computer Organization and Architecture

Chapter 4. Chapter 4 Objectives. MARIE: An Introduction to a Simple Computer

Introduction to Computers - Chapter 4

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

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

Computer Organization CS 206 T Lec# 2: Instruction Sets

REGISTER TRANSFER LANGUAGE

CHAPTER 8: Central Processing Unit (CPU)

Computer Architecture

Chapter 16. Control Unit Operation. Yonsei University

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 II CMSC 3833 Lecture 33

Objective now How are such control statements registers and other components Managed to ensure proper execution of each instruction

COMPUTER ORGANIZATION AND ARCHITECTURE

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications

Register Transfer and Micro-operations

Computer Logic II CCE 2010

Micro-programmed Control Ch 15

Machine Instructions vs. Micro-instructions. Micro-programmed Control Ch 15. Machine Instructions vs. Micro-instructions (2) Hardwired Control (4)

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

Introduction to CPU Design

BASIC COMPUTER ORGANIZATION AND DESIGN

Micro-programmed Control Ch 15

Course Description: This course includes concepts of instruction set architecture,

CISC Processor Design

There are four registers involved in the fetch cycle: MAR, MBR, PC, and IR.

Chapter 2 Data Manipulation

Computer Architecture Programming the Basic Computer

TABLE 8-1. Control Signals for Binary Multiplier. Load. MUL0 Q 0 CAQ sr CAQ. Shift_dec. C out. Load LOADQ. CAQ sr CAQ. Shift_dec P P 1.

Microcontroller Systems

Note that none of the above MAY be a VALID ANSWER.

COS 140: Foundations of Computer Science

Lecture 11: Control Unit and Instruction Encoding

2 MARKS Q&A 1 KNREDDY UNIT-I

Chapter 4 The Von Neumann Model

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

Chapter 20 - Microprogrammed Control (9 th edition)

Computer Organization and Design

Programming Level A.R. Hurson Department of Computer Science Missouri University of Science & Technology Rolla, Missouri

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B DIGITAL SYSTEMS II Fall 1999

Examining the complete instruction cycle for one instruction illustrates the operation of the P8 CPU. Assume the following conditions: C C C

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

Micro-programmed Control Ch 17

Microprogramming is a technique to implement the control system of a CPU using a control store to hold the microoperations.

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

EECE 417 Computer Systems Architecture

CPU Structure and Function

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

Computer Organization and Architecture, Pt. 2

Transcription:

THE ICROPROCESSOR Von Neumann s Architecture odel Input/Output unit Provides instructions and data emory unit Stores both instructions and data Arithmetic and logic unit Processes everything Control unit Controls execution of instructions Central processing unit = ALU + CU Stored program Program can be manipulated as if it is data 1

System Bus Architecture odel System bus Data bus carries transmitted data Address bus identifies location of transmitted data Control bus specifies how data is transmitted Power bus supplies power to units I/O bus identifies i/o devices 2

Central Processing Unit AR A I N E O R Y RW DS Control DR OpCode OpAddr HZN PC A ALU 3

Instruction Cycle Program counter (PC) contains address of the instruction being executed Instruction register (IR) contains the instruction being interpreted Fetch-execute cycle: The steps that the control unit carries out in executing a program are: 1. Fetch the next instruction to be executed from memory 2. Decode the opcode 3. Read operand(s) from main memory, if any 4. Execute the instruction and store results 5. Go to step 1 Opcode: machine language code (syntax) Decoding Determine the type, operation and operand(s) of an instruction 4

Instruction Types Formats: Instructions are represented as sequence of fields. Code is usually 1 byte long and length of the others depends on Code Format 1: Code (ex: HLT) Format 2: Code Address (ex: JP $0123) Format 3: Code Data (ex: ADD R, $01) Format 4: Code Address1 Address2 (ex: OV $0123, $0200) Register Transfer Language (RTL) Instructions are sequences of microinstructions that execute within one clock pulse. Types: Arithmetic: SUB R1, R2 Logic: XOR R, $1010 Transfer: OV R1, R2 Branching: JNE $3210 Control: CLA 5

Fetch-Execute Cycle (Example) Step 0: Actual state of CPU AR A I N E O R Y Program... $002E:... $0030: ADD $0032: $0036 $0034: HLT $0036: $0001 $0038:...... RW DS Control DR OpCode OpAddr HZN $0030 $05 ALU PC (Program Counter) = $0030, A = $0005 Step 1: Fetch the instruction AR=$0030, PC = $0030 $0030 A I N E O R Y Program... $002E:... $0030: ADD $0032: $0036 $0034: HLT $0036: $0001 $0038:...... RW DS Control $0099 ADD OpAddr $0005 $0032 HZN ALU DR = $0099 (ADD), OpCode = $0099, PC = $0032 6

Fetch-Execute Cycle (Example) Step 2: Decode the OpCode $0099 = ADD, then needs one operand Step 3a: Fetch the operand AR=$0032, PC = $0032 $0032 A I N E O R Y Program... $002E:... $0030: ADD $0032: $0036 $0034: HLT $0036: $0001 $0038:...... RW DS Control $0036 ADD $0036 $0005 $0034 HZN ALU DR = $0036, OpAddr = $0036, PC = $0034 7

Fetch-Execute Cycle (Example) Step 3b: Fetch operand value AR=$0036 $0036 A I N E O R Y Program... $002E:... $0030: ADD $0032: $0036 $0034: HLT $0036: $0001 $0038:...... RW DS Control $0001 ADD $0036 $0005 HZN $0034 ALU DR = $0001 Step 4: Execute and store A = $0005 $0036 A I N E O R Y Program... $002E:... $0030: ADD $0032: $0036 $0034: HLT $0036: $0001 $0038:...... RW DS Control $0001 ADD $0036 HZN $0034 $0006 ALU DR = $0001, A = A + DR = $0006 8

Control Unit and Status Register Control Unit controls the instruction cycle. Decodes the instructions: interpretes the operations (OpCode) to perform according to the instructions formats Status Register: ALU is connected to CU through the status register. Each bit (called status bit) of the status register conveys information about the last performed operation. Example C H N Z... V C: Carry bit (1 if carry generated, 0 otherwise) H: Halt bit (1 if processor halted, 0 otherwise) N: Sign bit (1 if result negative, 0 otherwise) Z: Zero bit (1 if result is zero, 0 otherwise)...... (1 if... true, 0 otherwise) V: Overflow bit (1 if overflow, 0 otherwise) etc. 9

Implementations of Control Unit A control unit can be implemented in two ways: by Hardwired control: A synchronous sequential circuit that realizes all required control actions of the CPU. That is: all functions of the CU are implemented in hardware. With this method, the CPU is very fast but complex, very expensive and difficult to modify. icroprogrammed control: Binary control values of the CU are stored in a special memory called control memory (C). C is usually a PLD (RO, PLA or PAL). Each word of C is a microinstruction and the set of microinstructions is called microprogram. The microprogram implements operations on the registers and other parts of the CPU. It may contains program steps that collectively implement a single (macro)instruction. That is: all functions of the CU is defined in a microprogram. With this method, the CPU is simple, cheap and easy to modify but slow. ost current processors use microprogrammed control. 10

icroprogramming icroprogram = sequence of microinstructions defined to execute an instruction written in machine language Example of microprogram: An addition instruction (ADD) received by the CPU is reduced to a sequence of 3 microinstructions and 4 microinstructions, respectively during the fetch cycle and the execute cycle. Fetch cycle 1. Fetch the instruction (load in CPU) 2. Decode the instruction (interpret OpCode) 3. Increment Program Counter (PC++) Execute cycle 1. Fetch the first operand of addition 2. Fetch the second operand of addition 3. Add the operands (in accumulator register) 4. Store the result in memory 11

Register Transfer Language (RTL) icrooperations: A microinstruction is composed of microoperations: elementary operations performed on data stored in registers or memory. For instance, microinstruction 3 of execute cycle of instruction ADD is composed of 2 microoperations: 1. Addition in A: A A+ DR 2. Update status bit N: N A n 1 RTL is used to describe microoperations. Each microoperation involves transfering data from a source register S to a destination register R. In RTL, a microoperation is of the form D S where copies content of S into D. D is modified and S is not. 12

Register Transfer Language (RTL) (continued) Basic symbols for RTL Arithmetic microoperations Logic microoperations Shift microoperations (page 350) 13

Registers Addressing odes Specify rules for accessing operations operands that are stored in memory or registers, or directly provided by the instructions. Addressing modes should be designed to Increase the programming flexibility and ease Reduce the size of generated compiler code Adapt the program to the operating system Allow easy access to operands everywhere Effective address = absolute address of the operand obtained by the application of addressing 14

Addressing odes Implied mode: Operand is in a register implied by the OpCode of the instruction. Example: ADD #31 Immediate mode: Operand is a constant value specified in the instruction itself. Example: ADD R, #10 Register mode: Operand is in register specified in the instruction itself. Example: ADD S, D Register indirect mode: Operand are is in a memory address that is content of a register specified by the instruction itself. Example: ADD (D), #3 15

Addressing odes Direct mode: Absolute address of operand is explicitly specified in instruction. Example: ADD @1234, S Indirect mode: Absolute address of operand is content of a memory address. Example: ADD [@1234], #10 Relative mode: Content of PC + OpAddr. Example: ADD D, $S Indexed mode: Content of an index register + Op- Addr. Example: ADD D, @500(S) 16

Summary of Addressing odes 17

Instruction Set Architecture achine language: Binary language that define instructions. Lowest level language. Very difficult language. Example: in CISC architecture, the addition of 2 and 37 in machine language is 100010 00000010 00100101 Assembly language: Symbolic language in which codes of the machine language are replaced by symbolic names. Example: in RISC architecture, the addition of 2 and 37 (contents of register D and S) is ADD D, S Instruction set is the complete set of machine language instructions of a CPU. Two major types of instruction set architectures: Reduced Instruction Set Computers: Small set of simple instructions. Hardwired control Complex Instruction Set Computers: Large set of complex instructions. icroprogrammed control 18

Elementary Instruction Set Typical Data Transfer Instructions Typical Arithmetic Instructions 19

Elementary Instruction Set (continued) Typical Logical and Bit anipulation Instructions Typical Shift Instructions 20

Elementary Instruction Set (continued) Typical Program Control Instructions Conditional Branch Instructions Relating to Status Bits 21

Elementary Instruction Set (continued) Conditional Branch Instructions for Unsigned Numbers Conditional Branch Instructions for Signed Numbers 22

RISC Architectures 1. emory accesses are restricted to load and store instructions 2. Addressing modes are limited in number 3. Instruction formats are all of the same length 4. Small instruction set 5. Instructions perform elementary operations 6. Large number of registers 7. Size of a program is relatively large (memory) 8. Simple control unit 9. Hardwired control 10. Fast program execution 11. Data manipulation instructions are register to register 23

RISC Architectures (continued) 24

CISC Architectures 1. emory access is directly available to most types of instructions 2. Addressing modes are substantial in number 3. Instruction formats are of different lengths 4. Large instruction set 5. Instructions perform both elementary and complex operations 6. Small number of registers 7. Size of a program is relatively small (memory) 8. Complex control unit 9. icroprogrammed control 10. Slow program execution 25

CISC Architectures (continued) 26

CISC Architectures (continued) 27

Example of Assembly Language Programming under CISC architecture Example: Write a program that compare two positive numbers x and y. Output is 1 if x < y; 0 if x = y; +1 if x > y. Less: Zero: OVE R1, x OVE R2, y OVE R3, #0 SUB R1, R2 BN Less BZ Zero OVE R3, #+1 OVE R3, # 1 OVE R3, #0 HLT 28

Example of Assembly Language Programming under CISC architecture (continued) Example: Write a program that returns the number of 1 s of x Loop: Update: Stop: OVE R1, x OVE R2, #1 OVE R3, #0 OVE R4, #32 AND R2, R1 BZ Update INC R3 OVE R2, #1 ROR R1 DEC R4 BZ Stop JP Loop HLT 29