Basic Processor Structure/design

Slides:



Advertisements
Similar presentations
CPU Structure and Function
Advertisements

The CPU The Central Presentation Unit What is the CPU?
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Arithmetic Logic Unit (ALU)
PART 5: (2/2) Processor Internals CHAPTER 15: CONTROL UNIT OPERATION 1.
ARITHMETIC LOGIC SHIFT UNIT
Computer Organization and Architecture
Computer Organization and Architecture
Computer Organization and Architecture
The Computer Processor
Computer Organization and Architecture
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Top Level View of Computer Function and Interconnection.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
Computer Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
8085. Microcomputer Major components of the computer - the processor, the control unit, one or more memory ICs, one or more I/O ICs, and the clock Major.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
PART 4: (1/2) Central Processing Unit (CPU) Basics CHAPTER 12: P ROCESSOR S TRUCTURE AND F UNCTION.
Control Unit Operations Chapter10:. What is Control Unit (CU)?(1)  Part of a CPU or other device that directs its operation.  Tells the rest of the.
Chapter 10 Control Unit Operation “Controls the operation of the processor”
Structure and Role of a Processor
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
3.1.4 Hardware a. describe the function and purpose of the control unit, memory unit and ALU (arithmetic logic unit) as individual parts of a computer;
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Seminar On 8085 microprocessor
Basic Computer Organization and Design
Computer Organization
Control Unit Lecture 6.
William Stallings Computer Organization and Architecture 8th Edition
Stored program concept
Chapter 4 Objectives Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution.
Chap 7. Register Transfers and Datapaths
CHAPTER 4 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Micro-Operations A computer executes a program Fetch/execute cycle
William Stallings Computer Organization and Architecture
William Stallings Computer Organization and Architecture 7th Edition
Chapter 3 Top Level View of Computer Function and Interconnection
8085 Microprocessor Architecture
Chapter 15 Control Unit Operation
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Chapter 4 Objectives Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution.
CSCE 212 Chapter 5 The Processor: Datapath and Control
Instruction cycle Instruction: A command given to the microprocessor to perform an operation Program : A set of instructions given in a sequential.
Central Processing Unit
Computer Organization and ASSEMBLY LANGUAGE
ECEG-3202 Computer Architecture and Organization
Control Unit Introduction Types Comparison Control Memory
MARIE: An Introduction to a Simple Computer
William Stallings Computer Organization and Architecture 7th Edition
8085 Microprocessor Architecture
BIC 10503: COMPUTER ARCHITECTURE
Chapter 4 Objectives Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution.
Chapter 14 Control Unit Operation
William Stallings Computer Organization and Architecture 8th Edition
Chapter 14 Control Unit Operation
Computer Architecture
CPU Structure and Function
Chapter 11 Processor Structure and function
Information Representation: Machine Instructions
Computer Architecture Assembly Language
Computer Architecture
Computer Operation 6/22/2019.
COMPUTER ARCHITECTURE
Presentation transcript:

Basic Processor Structure/design

Here we see a very simple processor structure - such as might be found in a small 8-bit microprocessor. The various components are: ALU Arithmetic Logic Unit - this circuit takes two operands on the inputs (labelled A and B) and produces a result on the output (labelled Y). The operations will usually include, as a minimum: add, subtract and, or, not shift right, shift left ALUs in more complex processors will execute many more instructions. Register File A set of storage locations (registers) for storing temporary results. Early machines had just one register - usually termed an accumulator. Modern RISC processors will have at least 32 registers. Instruction Register The instruction currently being executed by the processor is stored here. Control Unit The control unit decodes the instruction in the instruction register and sets signals which control the operation of most other units of the processor. For example, the operation code(opcode) in the instruction will be used to determine the settings of control signals for the ALU which determine which operation (+,-,^,v,~,shift,etc) it performs. Clock The vast majority of processors are synchronous, that is, they use a clock signal to determine when to capture the next data word and perform an operation on it. In a globally synchronous processor, a common clock needs to be routed (connected) to every unit in the processor.

Program counter The program counter holds the memory address of the next instruction to be executed. It is updated every instruction cycle to point to the next instruction in the program. (Control for the management of branch instructions - which change the program counter by other than a simple increment - has been omitted from this diagram for clarity. Branching instructions and their effect on program execution and efficiency will be examined extensively later. Address Bus This bus is used to transfer addresses to memory and memory-mapped peripherals. It is driven by the processor acting as a bus master. Data Bus This bus carries data to and from the processor, memory and peripherals. It will be driven by the source of data, ie processor, memory or peripheral device. Multiplexed Bus Of necessity, high performance processors provide separate address and data buses. To limit device pin counts and bus complexity, some simple processors multiplex address and data onto the same bus: naturally this has an adverse affect on performance.

Internal Structure ALU Control Unit Address Bus B PC C D Data Bus E IR +1 C ALU D Data Bus E IR Control Unit ALU CTRL Bus FLAG A Source : Dr. Chathura de Silva, CSE, UoM

Sample Program 100: Load A,10 101: Load B,15 102: Add A,B 103 104 105 Program memory

Before execution of 1st fetch cycle A E D C B ALU Address Bus Control Unit IR FLAG 100 +1 Data Bus CTRL Bus Source: Dr. Chathura de Silva, CSE, UoM

After 1st fetch cycle … B 101 C D E Load A,10 FLAG A Address Bus +1 ALU Address Bus Control Unit Load A,10 FLAG 101 +1 Data Bus CTRL Bus

After 1st instruction cycle … 10 E D C B ALU Address Bus Control Unit Load A,10 FLAG 101 +1 Data Bus CTRL Bus

Sample Program (Cont.) 100: Load A,10 101: Load B,15 102: Add A,B

After 2nd instruction cycle … 10 E D C 15 ALU Address Bus Control Unit Load B,15 FLAG 102 +1 Data Bus CTRL Bus

Sample Program (Cont.) 100: Load A,10 101: Load B,15 102: Add A,B

After 3rd fetch cycle … 15 103 C D E ADD A,B FLAG 10 Address Bus +1 ALU Address Bus Control Unit ADD A,B FLAG 103 +1 Data Bus CTRL Bus

After 3rd instruction cycle … 25 E D C 15 ALU Address Bus Control Unit ADD A,B FLAG 103 +1 Data Bus CTRL Bus

Data Flow (Fetch Diagram)

Data Flow* (Instruction Fetch) PC contains address of next instruction Address moved to MAR Address placed on address bus Control unit requests memory read Result placed on data bus, copied to MBR, then to IR Meanwhile PC incremented by 1 * CPU dependent

Memory Address Register (MAR) Connected to address bus Specifies address for read or write operand Memory Buffer Register (MBR) Connected to data bus Holds data to write or last data read Program Counter (PC) Holds address of next instruction to be fetched Instruction Register (IR) Holds last instruction fetched

Exceptions and Interrupts Exceptions and interrupts are unexpected events that disrupt the normal flow of instruction execution. An exception is an unexpected event from within the processor. An interrupt is an unexpected event from outside the processor.

When an exception or interrupt occurs, the hardware begins executing code that performs an action in response to the exception. This action may involve killing a process, outputting a error message, communicating with an external device, or horribly crashing the entire computer system by initiating a "Blue Screen of Death" and halting the CPU. The instructions responsible for this action reside in the operating system kernel, and the code that performs this action is called the interrupt handler code. After the handler code is executed, it may be possible to continue execution after the instruction where the execution or interrupt occurred.

Exceptions: Types For your project, there are three events that will trigger an exception: arithmetic overflow, undefined instruction, and system call. Arithmetic overflow occurs during the execution of an add or sub instruction. If the result of the computation is too large or too small to hold in the result register, the Overflow output of the ALU will become high during the execute state. This event triggers an exception. Undefined instruction occurs when an unknown instruction is fetched. This exception is caused by an instruction in the IR that has an unknown opcode or an R-type instruction that has an unknown function code. System call occurs when the processor executes a syscall instruction. Syscall instructions are used to implement operating system services (functions).

exception handling example in c++

EXCEPTIONS 1. interrupts(रुकावट,बाधा,अवरोध) --initiated outside the instruction stream --arrive asynchronously (at no specific time) examples: I/O device status change I/O device error condition nternal error detection when should the interrupt be dealt with? as soon as possible 2. traps(जाल, फसाना ) --occur due to something in instruction stream --arrive synchronously (while instruction is executing) good test: if program was re-run, the trap would occur in precisely the same place in the code. bad opcode arithmetic overflow attempt to access privileged or unavailable memory