COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

Instruction Set Design
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
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
1 Lecture 2: Review of Computer Organization Operating System Spring 2007.
Computer Organization and Architecture The CPU Structure.
Computer System Overview
1 Computer System Overview OS-1 Course AA
1 CSIT431 Introduction to Operating Systems Welcome to CSIT431 Introduction to Operating Systems In this course we learn about the design and structure.
Computer System Overview
RICARFENS AUGUSTIN JARED COELLO OSVALDO QUINONES Chapter 12 Processor Structure and Function.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
CH12 CPU Structure and Function
Processor Structure & Operations of an Accumulator Machine
Chapter 1 Computer System Overview Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Group 5 Tony Joseph Sergio Martinez Daniel Rultz Reginald Brandon Haas Emmanuel Sacristan Keith Bellville.
Computer Systems Overview. Page 2 W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware resources of one.
CPU Registers – Page 1 of 35CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: CPU Registers Reading: Stallings, Sections 10.3,
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
Chapter 1 Computer System Overview Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William.
CSCI 4717/5717 Computer Architecture
Edited By Miss Sarwat Iqbal (FUUAST) Last updated:21/1/13
Presented by: Sergio Ospina Qing Gao. Contents ♦ 12.1 Processor Organization ♦ 12.2 Register Organization ♦ 12.3 Instruction Cycle ♦ 12.4 Instruction.
Operating Systems and Networks AE4B33OSS Introduction.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 1 Computer System Overview.
Operating Systems Lecture No. 2. Basic Elements  At a top level, a computer consists of a processor, memory and I/ O Components.  These components are.
Low Level Programming Lecturer: Duncan Smeed Recap.
ECE 456 Computer Architecture
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 19 & 20 Instruction Formats PDP-8,PDP-10,PDP-11 & VAX Course Instructor: Engr. Aisha Danish.
Operating System Isfahan University of Technology Note: most of the slides used in this course are derived from those of the textbook (see slide 4)
Computer Architecture Lecture 03 Fasih ur Rehman.
Chapter 11 Instruction Sets: Addressing Modes and Formats Gabriel Baron Sydney Chow.
Computer Organization 1 Instruction Fetch and Execute.
Stored Program A stored-program digital computer is one that keeps its programmed instructions, as well as its data, in read-write,
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Lecture 1: Review of Computer Organization
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
PART 4: (1/2) Central Processing Unit (CPU) Basics CHAPTER 12: P ROCESSOR S TRUCTURE AND F UNCTION.
Processor Organization
1 Computer Architecture. 2 Basic Elements Processor Main Memory –volatile –referred to as real memory or primary memory I/O modules –secondary memory.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
Computer Systems Overview. Lecture 1/Page 2AE4B33OSS W. Stallings: Operating Systems: Internals and Design, ©2001 Operating System Exploits the hardware.
1 Computer System Overview Chapter 1. 2 Operating System Exploits the hardware resources of one or more processors Provides a set of services to system.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Chapter 1 Computer System Overview
Part of the Assembler Language Programmers Toolbox
William Stallings Computer Organization and Architecture 8th Edition
Processor Organization and Architecture
Computer Organization and ASSEMBLY LANGUAGE
Processor Organization and Architecture
Computer Architecture
Chapter 1 Computer System Overview
Computer System Overview
CPU Structure CPU must:
CPU Structure and Function
Chapter 11 Processor Structure and function
Presentation transcript:

COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish

CPU Structure  CPU must:  Fetch instructions  Interpret instructions  Fetch data  Process data  Write data

CPU With Systems Bus

CPU Internal Structure

Registers  CPU must have some working space (temporary storage) called registers  Number and function vary between processor designs  One of the major design decisions  Within the processor, there is a set of registers that function as a level of memory above main memory and cache in the hierarchy. The registers in the processor perform two roles:  User-visible registers: Enable the machine- or assembly language programmer to minimize main memory references by optimizing use of registers.  Control and status registers: Used by the control unit to control the operation of the processor and by privileged, operating system programs to control the execution of programs.  There is not a clean separation of registers into these two categories  On some machines the program counter is user visible (e.g., x86), but on many it is not.

User Visible Registers  A user-visible register is one that may be referenced by means of the machine language that the processor executes  Characterized in the following categories:  General Purpose  Data  Address  Condition Codes

General Purpose Registers (1)  General-purpose registers can be assigned to a variety of functions by the programmer  Sometimes their use within the instruction set is orthogonal to the operation  That is, any general-purpose register can contain the operand for any opcode.  This provides true general-purpose register use  Often, however, there are restrictions. For example, there may be dedicated registers for floating-point and stack operations  In some cases, general-purpose registers can be used for addressing functions (e.g., register indirect, displacement)  In other cases, there is a partial or clean separation between data registers and address registers.

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

General Purpose Registers (3)  Make them general purpose  Increase flexibility and programmer options  Increase instruction size & complexity  Make them specialized  Smaller (faster) instructions  Less flexibility

Data Registers  Data registers may be used only to hold data and cannot be employed in the calculation of an operand address

Address Registers  Address registers may themselves be somewhat general purpose, or they may be devoted to a particular addressing mode  Examples include the following:  Segment pointers: In a machine with segmented addressing, a segment register holds the address of the base of the segment  Index registers: These are used for indexed addressing and may be autoindexed  Stack pointer: If there is user-visible stack addressing, then typically there is a dedicated register that points to the top of the stack

Design Issues: How Many GP Registers?  Between  Fewer = more memory references  More does not reduce memory references and takes up processor real estate

Design Issues: 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;

Condition Code Registers  A final category of registers, which is at least partially visible to the user, holds condition codes (also referred to as flags)  Condition codes are bits set by the processor hardware as the result of operations  For example, an arithmetic operation may produce a positive, negative, zero, or overflow result  In addition to the result itself being stored in a register or memory, a condition code is also set

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

Control & Status Registers  There are a variety of processor registers that are employed to control the operation of the processor  Most of these, on most machines, are not visible to the user  Some of them may be visible to machine instructions executed in a control or operating system mode

Control & Status Registers Four registers are essential to instruction execution:  Program counter (PC): Contains the address of an instruction to be fetched  Instruction register (IR): Contains the instruction most recently fetched  Memory address register (MAR): Contains the address of a location in memory  Memory buffer register (MBR): Contains a word of data to be written to memory or the word most recently read

Control & Status Registers  Typically, the processor updates the PC after each instruction fetch so that the PC always points to the next instruction to be executed  The fetched instruction is loaded into an IR, where the opcode and operand specifiers are analyzed  Data are exchanged with memory using the MAR and MBR  In a bus-organized system, the MAR connects directly to the address bus, and the MBR connects directly to the data bus  User-visible registers, in turn, exchange data with the MBR.

Program Status Word  Many processor designs include a register or set of registers, often known as the program status word (PSW), that contain status information  The PSW typically contains condition codes plus other status information  Common fields or flags include the following:  Sign: Contains the sign bit of the result of the last arithmetic operation.  Zero: Set when the result is 0.  Carry: Set if an operation resulted in a carry (addition) into or borrow (subtraction) out of a high-order bit.  Equal: Set if a logical compare result is equality.  Overflow: Used to indicate arithmetic overflow.  Interrupt Enable/Disable: Used to enable or disable interrupts.  Supervisor: Indicates whether the processor is executing in supervisor or user mode. Certain privileged instructions can be executed only in supervisor mode, and certain areas of memory can be accessed only in supervisor mode.

Example Register Organizations