Computer Organization 1

Slides:



Advertisements
Similar presentations
The 8051 Microcontroller and Embedded Systems
Advertisements

Computer Organization and Architecture
Processor System Architecture
Computer Organization and Architecture
Assembly Language for Intel-Based Computers Chapter 2: IA-32 Processor Architecture Kip Irvine.
Tanenbaum, Structured Computer Organization, Fifth Edition, (c) 2006 Pearson Education, Inc. All rights reserved The Instruction Set Architecture.
Informationsteknologi Friday, November 16, 2007Computer Architecture I - Class 111 Today’s class Instruction set architecture.
What is an instruction set?
ICS312 Set 3 Pentium Registers. Intel 8086 Family of Microprocessors All of the Intel chips from the 8086 to the latest pentium, have similar architectures.
Implementation of a Stored Program Computer
The ISA Level The Instruction Set Architecture (ISA) is positioned between the microarchtecture level and the operating system level.  Historically, this.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
Processor Organization and Architecture Module III.
Lecture 18 Last Lecture Today’s Topic Instruction formats
Lecture 17 Today’s Lecture –Instruction formats Little versus big endian Internal storage in the CPU: stacks vs. registers Number of operands and instruction.
4-1 Chapter 4 - The Instruction Set Architecture Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring.
The Instruction Set Architecture Level Dept. of Computer Science Virginia Commonwealth University.
Instruction Set Architecture
4-1 Chapter 4 - The Instruction Set Architecture Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of.
L/O/G/O The Instruction Set Chapter 9 CS.216 Computer Architecture and Organization.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
Fall 2012 Chapter 2: x86 Processor Architecture. Irvine, Kip R. Assembly Language for x86 Processors 6/e, Chapter Overview General Concepts IA-32.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
The ISA Level The Instruction Set Architecture (ISA) is positioned between the microarchtecture level and the operating system level.  Historically, this.
Module 3 Instruction Set Architecture (ISA): ISA Level Elements of Instructions Instructions Types Number of Addresses Registers Types of Operands.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
COMPUTER ARCHITECURE INSTRUCTION SET ARCHITECTURE.
Computer Architecture and Organization
Computer Architecture EKT 422
Computer Architecture Lecture 03 Fasih ur Rehman.
Computer Organization 1 Instruction Fetch and Execute.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
What is a program? A sequence of steps
CS61C L20 Datapath © UC Regents 1 Microprocessor James Tan Adapted from D. Patterson’s CS61C Copyright 2000.
Operand Addressing And Instruction Representation Tutorial 3.
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
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.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
A Closer Look at Instruction Set Architectures
Architecture Review Instruction Set Architecture
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
A Closer Look at Instruction Set Architectures: Expanding Opcodes
Processor Organization and Architecture
Introduction to Intel IA-32 and IA-64 Instruction Set Architectures
The Von Neumann Model Basic components Instruction processing
CS 301 Fall 2002 Computer Organization
Processor Organization and Architecture
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
ECEG-3202 Computer Architecture and Organization
Introduction to Microprocessor Programming
8051 ASSEMBLY LANGUAGE PROGRAMMING
CPU Structure CPU must:
Computer Operation 6/22/2019.
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

Computer Organization 1 Instruction Set Architecture

Instruction Set Architecture Different Types of Instruction: Move (Load and store) Memory to memory; memory to CPU register to register Arithmetic and Logic  Add; shift; Compare Branch change in direction of program flow   I/O   Miscellaneous Flag; Wait; Start; Stop    

Arithmetic and Logic Instructions AND one bit pattern with another OR one bit pattern with another NOR - means NOT OR - one bit pattern with another NAND – NOT AND Shift bit pattern Right/Left

AND and OR examples

NOT and NOR (NOT OR)

Shift instructions Logical shift: 0000 0000 0011 0001 eg Shift left 3 gives 0000 0001 1000 1000 ie copies zeros in to rightmost bits Arithmetic Shift: 1000 0000 1100 0011 eg Shift R2 Arithmetic 1000 0000 0011 0000 ie preserves sign bit

Instruction Set Architecture In general, a computer instruction consists of a function (Opcode) and one or more operands. For example, ADD x, y Add is the function or opcode; x and y are both operand addresses. Operand addresses may refer to memory or registers.  We will look at how earlier machines with much smaller memories and CPUs implemented Move and Arithmetic operations.

Instruction Set Architecture Earlier machines were often referred to by the number of operands allowed in an instruction. One-address, two-address and three-address computers were extant at different times.  Look at how this JAVA or C++ instruction could be implemented in each of these address modes: a = b * (c + d * e - f/g);

a = b * (c + d * e - f/g); Memory traffic has two components: the instruction itself must be fetched from memory, and then data values must be fetched from memory to be acted upon. After that, data values may have to be restored to memory when the computation is complete.   Assume that each opcode occupies one byte, and that each memory address takes 2 bytes (allowing for a 64k byte memory).

a = b * (c + d * e - f/g); Three-address mode  T1 and T2 below are temporary locations; we use (x) to mean 'the contents of location x’   mpy d, e, T1 // (d) * (e) -> T1 add c, T1, T1 // (c) + (T1) -> T1 div f, g, T2 // (g) / (f) -> T2 sub T2, T1, T1 mpy b, T1, a  That is, 5 instructions, each with 7 bytes (opcode and 3 2-byte addresses), have to be fetched. The program size is 35 bytes.

a = b * (c + d * e - f/g); Two-address mode Try this approach: mpy d,e //Result in e div g,f // result in f sub f,d // result in d etc Not a viable strategy - because contents of e, f and d are overwritten by the operations; e, f and d may be needed in other calculations, so we must make additional moves

a = b * (c + d * e - f/g); Two-address mode move d,a // (d) -> a mpy e,a // result -> a move f, T1 // (f) -> T1 div g, T1 // (T1)/ (g) -> T1 sub T1, a add c, a mpy b,a That is, 7 instructions in 2-address mode. The program size is 7 x (1 + 2 + 2) = 35 bytes.

a = b * (c + d * e - f/g); One-address mode One-address computer has an accumulator for intermediate results. load f // (f) -> acc div g // (acc) / (g) store T1 // (acc) -> T1 load d // (d) -> acc mpy e // (acc) * (e) -> acc add c sub T1 mpy b store a

a = b * (c + d * e - f/g); One-address mode …… sub T1 mpy b store a That is, 9 instructions for a one address mode. Each instruction is 3 bytes long, so program size is 27 bytes.  The one-address machine has the smallest program size. This goes some way to explaining the popularity of accumulator machines, given the high costs of both memory and registers.

a = b * (c + d * e - f/g); Stack mode This uses other memory access instructions called Push and Pop. All calculations are done on data on top of the stack, which is a LIFO type structure – Last In, First Out.

a = b * (c + d * e - f/g); Stack mode push b //push (b) on to the top level push c //push (c) on to top level; b now next level push d push e mpy // d * e -> top level add // c + d*e -> top level push f push g div // f/g ; result in top level sub // (top level) from (2nd level); result->top mpy // (top level) * b pop a //(top level) -> a

a = b * (c + d * e - f/g); Stack mode …….. div // f/g ; result in top level sub // (top level) from (2nd level); result->top mpy // (top level) * b pop a //(top level) -> a That is, 12 stack instructions; 5 zero address and 7 load and store.

Instruction Formats (1) Four common instruction formats: (a) Zero-address instruction. (b) One-address instruction (c) Two-address instruction. (d) Three-address instruction.

Instruction Formats (2) Some possible relationships between instruction and word length.

Assembly Language Instruction Formats 3-Address instruction Languages with instructions written in some or all of the above formats are called Assembly Languages (Low-level languages) and are near to the processor’s actual machine language.

Assembly Language Instruction Formats One Address Instruction One-and-a-half Address instruction Two Address Instruction Register to Register Instruction

OPCODES The opcodes in the previous slide are all fixed-length (8 bits, say); in modern machines, expanding opcodes are common SPARC and Pentium 4 are examples

The Pentium 4 Instruction Formats

The Pentium 4 Instruction Formats The Pentium 4 is designed to be backward compatible, so that instructions designed for the Intel 8088 can run on every generation since Can have up to 6 variable length fields, 5 of which are optional In general, for 2-operand instructions, if one operand is in memory, the other must be in a register. That is, Reg toReg, Memory to Reg, Reg to Memory are allowed, but not memory to memory

Overview of the Pentium 4 ISA Level The Pentium 4’s primary registers.

Pentium Registers EIP (Extended Instruction Pointer) is the Program Counter EFLAGS is the Program Status Word (PSW) ESP the stack pointer EAX is the main arithmetic register EDX is used for multiply and divide EAX and EDX hold 64-bit products and dividends CS to GS are Segment Registers – hungover from when the 8088 addressed 2^20 bytes using 16-bit addresses

The 8051 Instruction Formats

Intel 8051 Used in embedded systems such as traffic lights, washing machines Single chip holding CPU AND memory, device controllers 64KB for programs, (in ROM?) 64KB for data (in RAM?)

The UltraSPARC III Instruction Formats The original SPARC instruction formats.