CPU Structure CPU must:

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

Goal: Write Programs in Assembly
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
1 ECE462/562 ISA and Datapath Review Ali Akoglu. 2 Instruction Set Architecture A very important abstraction –interface between hardware and low-level.
Systems Architecture Lecture 5: MIPS Instruction Set
Chapter 2 Instructions: Language of the Computer
Chapter 2.
Computer Organization and Architecture
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Computer Organization and Architecture
Computer Organization and Architecture
Computer Organization and Architecture The CPU Structure.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
11/11/05ELEC CISC (Complex Instruction Set Computer) Veeraraghavan Ramamurthy ELEC 6200 Computer Architecture and Design Fall 2005.
CH12 CPU Structure and Function
MIPS assembly. Computer What’s in a computer? Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
CPU Registers – Page 1 of 35CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: CPU Registers Reading: Stallings, Sections 10.3,
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
CSCI 4717/5717 Computer Architecture
Edited By Miss Sarwat Iqbal (FUUAST) Last updated:21/1/13
ECE 456 Computer Architecture
Lecture 11: 10/1/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Csci 136 Computer Architecture II – Summary of MIPS ISA Xiuzhen Cheng
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
What is a program? A sequence of steps
PART 4: (1/2) Central Processing Unit (CPU) Basics CHAPTER 12: P ROCESSOR S TRUCTURE AND F UNCTION.
Ass. Prof. Dr Masri Ayob TK 2123 Lecture 14: Instruction Set Architecture Level (Level 2)
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
MIPS assembly. Computer  What’s in a computer?  Processor, memory, I/O devices (keyboard, mouse, LCD, video camera, speaker), disk, CD drive, …
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Computer Architecture & Operations I
Computer Architecture & Operations I
A Closer Look at Instruction Set Architectures
William Stallings Computer Organization and Architecture 8th Edition
Instruction Set Architecture
Architecture Review Instruction Set Architecture
A Closer Look at Instruction Set Architectures
Microcomputer Programming
Processor Organization and Architecture
Instruction Set Architectures
MIPS Assembly.
Instructions - Type and Format
CS170 Computer Organization and Architecture I
Computer Organization and ASSEMBLY LANGUAGE
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Systems Architecture Lecture 5: MIPS Instruction Set
MIPS assembly.
The University of Adelaide, School of Computer Science
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
ECEG-3202 Computer Architecture and Organization
UCSD ECE 111 Prof. Farinaz Koushanfar Fall 2018
Introduction to Microprocessor Programming
COMS 361 Computer Organization
What is Computer Architecture?
Computer Architecture
Review In last lecture, done with unsigned and signed number representation. Introduced how to represent real numbers in float format.
CPU Structure and Function
Chapter 11 Processor Structure and function
Systems Architecture I (CS ) Lecture 5: MIPS Instruction Set*
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

CPU Structure CPU must: Fetch instructions: The processor reads an instruction from memory. Interpret instructions: The instruction is decoded to determine what action is required. Fetch data: Reading data from memory or I/O. Process data: Performing required arithmetic or logical operations on data. Write data: writing data to memory or I/O. 22

Registers CPU must have some working space (temporary storage) Called registers. Number and function vary between processor designs One of the major design decisions Top level of memory hierarchy Categories: General Purpose Data Address Condition Codes 23

General Purpose Registers (1) May be true general purpose May be restricted May be used for data or addressing Data Accumulator Addressing Segment 25

General Purpose Registers (2) Make them general purpose Increase flexibility and programmer options Increase instruction size & complexity Make them specialized Smaller (faster) instructions Less flexibility Between 8 – 32 registers. Fewer = more memory references More does not reduce memory references 26

How big? Large enough to hold full address Large enough to hold full word Often possible to combine two data registers C programming double int a; long int a; 28

Condition Code Registers Sets of individual bits e.g. result of last operation was zero Can be read (implicitly) by programs e.g. Jump if zero Can not (usually) be set by programs 29

Control & Status Registers Program Counter: contains address of an instruction to be fetched. Instruction Decoding Register: contains the instruction most recently fetched. Memory Address Register: contains the address of a location in memory. Memory Buffer Register: contains a word of data to be written to memory or the word most recently read. 30

What is an “Architecture”? When we refer to “Architecture,” we often use it as an abbreviation for an instruction set architecture (ISA). The ISA is the interface between hardware and software. The architecture is a specification for what the processor will do, and how the software must communicate to the processor. Note that the “architecture” states only what will be done, but not how.

RISC The design goals and principles behind reduced instruction set computers (RISC) are: Smaller is faster Simplicity favors regularity Make the common case fast Regularity will basically apply to instruction sizes and instruction formats. RISC architectures have a fewer number of simple instructions than complex instruction set computer (CISC) architectures. Access to memory using Load and Store command only.

MIPS MIPS is a common RISC ISA. MIPS processors are in extensive use by NEC, Nintendo, Cisco, SGI, Sony, etc. MIPS has 32 integer registers. It uses only a limited number of addressing modes. MIPS has a fairly regular instruction encoding. All instructions are 32 bits long (4 bytes), and there are only three instruction formats

MIPS Arithmetic Instructions MIPS arithmetic instructions have three operands: add a, b, c This instruction takes the sum of registers b and c and puts the answer into register a. It is equivalent to the C code: a = b + c; What if we want to code the following? a = b + c + d; We need to do it in two steps: add a, a, d Note that multiple operands may refer to the same register

MIPS Registers and Memory In MIPS, the operands must be registers. 32 registers are provided each register stores a 32-bit value. The compilers associate variables with registers registers are referred to by names such as $s0 and $t1 we use the “s” registers for values that correspond to variables in our programs, and we use the “t” registers for temporary values (more on this later)

MIPS Registers and Memory 2 For example, consider this example from the text: f = (g + h) - (i + j); We choose registers to store the values of our variables: f in $s0, g in $s1, h in $s2, i in $s3, and j in $s4. We’ll also need to temporary values, which we will store in $t0 and $t1. The MIPS code: add $t0, $s1, $s2 add $t1, $s3, $s4 sub $s0, $t0, $t1

I-Type: