Memory - Registers Instruction Sets

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Microprocessors.
INSTRUCTION SET ARCHITECTURES
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Computer Organization and Architecture
Processor Function Topic 3.
Computer Organization and Architecture
Instruction Set Architecture & Design
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
Execution of an instruction
CHAPTER 7: The CPU and Memory
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
What is an instruction set?
CHAPTER 7: The CPU and Memory
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
1 TK6123: COMPUTER ORGANISATION & ARCHITECTURE Prepared By: Associate Prof. Dr Masri Ayob Lecture 6: CPU and Memory (1)
Processor Structure & Operations of an Accumulator Machine
Machine Instruction Characteristics
Information Representation: Machine Instructions
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
CPU with memory Compiled by IITG. Basic Hardware Components of a computer CPU (the brain, the thinking ) Memory ( active information) External Storage.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Chapter 4 The Von Neumann Model
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Execution of an instruction
Computer Architecture and Organization
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
Computer Architecture EKT 422
Computer Architecture Lecture 03 Fasih ur Rehman.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
Computer Organization 1 Instruction Fetch and Execute.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
System Unit Working of CPU. The CPU CPU The CPU CPU stands for central processing unit. it is brain of computer It is most important component of the.
Dale & Lewis Chapter 5 Computing components
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
Processor Organization
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Instruction Sets. Instruction set It is a list of all instructions that a processor can execute. It is a list of all instructions that a processor can.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
CHAPTER 7: The CPU and Memory
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
The Processor and Machine Language
CS149D Elements of Computer Science
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
Computer Instructions
Chapter 4 The Von Neumann Model
ECEG-3202 Computer Architecture and Organization
The Stored Program Computer
GCSE OCR 1 The CPU Computer Science J276 Unit 1
Basic components Instruction processing
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.
Chapter 10 Instruction Sets: Characteristics and Functions
Chapter 4 The Von Neumann Model
Presentation transcript:

Memory - Registers Instruction Sets Chapter 7 Memory - Registers Instruction Sets

CPU Components

Concept of Registers Definition: Small, permanent storage location within the CPU used (wired) for a specifically defined purpose Manipulated directly by the CPU Limited in size to bits or bytes (not MB like internal memory) Typically configured to hold data, an address, an instruction, a status flag, etc.

General Purpose Registers Sometimes considered part of the ALU Similar to Accumulator in LMC Hold data used in arithmetic/logical operations as well as the results Used to transfer data to and from memory Directly accessible by programmers

General Purpose Register Operations Load data from memory or another register Data in another register or memory can be added to or subtracted from the register with result remaining in register Data in register can be rotated or shifted left or right Special - Set to 0, invert bits, +/- 1

Program Counter Register Holds address of current instruction being executed Same as LC - Location Counter in LMC

Instruction Register (IR) Holds instruction currently being executed Not part of LMC - the Moron’s brain seemed to serve this purpose in LMC

Flag/Status Registers Flags (1-bit) registers signal exceptional/special conditions - arithmetic overflow, carry out, comparison result, ... Status Register - multiple flags in single register CPU sets status register as a result of conditions that arise during execution of instructions

MAR & MDR Memory Address Register (MAR) - holds the address of a memory location Memory Data (buffer) Register (MAD) - holds a data value being stored or retrieved from the memory location currently addressed by MAR

MDR, MAR, Memory

MAR-MDR Example

Memory Analogy

Individual Memory Cell Operation: CPU retrieves address and stores in MAR CPU simultaneously sets read or write line reflecting load or store operation CPU turns on switch via activation line Data is transferred between MDR and Memory

Memory Capacity Two factors determine the capacity of memory number of bits in the MAR K bits allow 2^k memory locations size of the address portion of the instruction 5 bits allows 32 locations 8 bits allows 256 locations 24 bits allows 16 MBytes 32 bits allows 4GBytes

CPU Fetch-Execute Cycle Load Instruction Transfer the address from the PC to the MAR Transfer the instruction to the IR Address portion of the instruction loaded in MAR Actual data copied into the accumulator PC incremented PC -> MAR MDR -> IR IR(address) -> MAR MDR -> A PC + 1 -> PC

Elements of Machine Instructions OPCODE Source OPERAND (address) Result OPERAND (address) Source Address Result Operand OPCODE

Addressing Addressing may reflect a reference to a memory location or to a register. Explicit address - the address (or its components) is present in the instruction Implicit address - the address is assumed, it is not in the instruction Most address references in today’s computers are explicit. What is the advantage of an IMPLICIT address?

Source/Destination Addresses Computer instructions generally specify at least two operands: a data source location and a data destination location In general, at least one of the addresses is a register address 1 address is required for in-place instructions (such as invert): 1 source/destination 2 addresses are required for move instructions (such as load): 1 source and 1 destination 3 addresses are required for arithmetic operations (such as add): 2 sources and 1 destination

3-Address Instructions Y = (A - B) / (C + D + E) Instruction Comment SUB Y, A, B Y A - B ADD T, D, E T D + E ADD T, T, C T T + C DIV Y, Y, T Y Y / T

2-Address Instructions Y = (A - B) / (C + D + E) Instruction Comment MOV Y, A Y A SUB Y, B Y Y - B MOV T, D T D ADD T, E T T + E ADD T, C T T + C DIV Y, T Y Y / T

Instruction Word Length Considerations Number of instructions - op code size to support reasonable set of instructions Number of addresses - address size to accommodate increasing amounts of memory

Simple 32-bit Instruction Amount of addressable memory is extremely limited. Today’s computers support 32-bit or 64-bit addresses.

Alternatives to Absolute Addressing Objective : to allow the addressing of large amounts of memory while maintaining a reasonably sized instruction word address field

BASE REGISTER ADDRESSING Instruction Base register OPCODE OPERANDS 3945 13 3945 + 13 3958 Actual (absolute) address in memory

Instruction Formats Variable Length Instructions

Instruction Formats Fixed Length Instructions

Instruction Types Data Transfer (Load, Store, Move, …) Register <-> Register Register <-> Memory Memory <-> Memory Load Byte Load Half-Word Load Double Word

Instruction Types Arithmetic Integer Add/Subtract/Multiply/Divide Floating Pt Add/Subtract/… Logical NOT, AND, OR Bit Manipulation Instructions Setting and Testing bits in a data word Program Control Branch on 0, ... Single operand manipulation instructions Incrementing/Decrementing by 1 Negating Setting to zero

Instruction Types Shift and Rotate

Instruction Types Jump Subroutine and Return

Subroutine Recursive Calls

Recursive Calls Stack Implementation

Stack Implementation