Chapter 10 Instruction Sets: Characteristics and Functions.

Slides:



Advertisements
Similar presentations
CH10 Instruction Sets: Characteristics and Functions
Advertisements

Machine Instructions Operations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
INSTRUCTION SET ARCHITECTURES
Instruction Set Architecture Classification According to the type of internal storage in a processor the basic types are Stack Accumulator General Purpose.
Microprocessors General Features To be Examined For Each Chip Jan 24 th, 2002.
Instruction Set Architecture & Design
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
CS2422 Assembly Language & System Programming November 28, 2006.
What is an instruction set?
1 RISC Machines l RISC system »instruction –standard, fixed instruction format –single-cycle execution of most instructions –memory access is available.
Implementation of a Stored Program Computer
CEG 320/520: Computer Organization and Assembly Language Programming1 CEG 320/520 Computer Organization and Assembly Language Programming.
Lecture 18 Last Lecture Today’s Topic Instruction formats
GROUP #4 CHAPTER 10 JOEL FRAGA JAIME J.OCON DEISY HERNANDEZ.
Machine Instruction Characteristics
Assembly Language Issues – Page 1CSCI 4717 – Computer Architecture CSCI 4717/5717 Computer Architecture Topic: Assembly Language Issues Reading: Stallings,
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Homework Problems 1. M1 runs the program P in 1.4 * 9 * ns or ns M2 runs the program P in 1.6*9800*10ns or ns Hence M2 is faster by.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
Chapter 2-2 Assembly Instructions Number Systems Number Systems Assembly Instructions Assembly Instructions Branch Branch Next Lecture Next Lecture  Addressing.
Module 3 Instruction Set Architecture (ISA): ISA Level Elements of Instructions Instructions Types Number of Addresses Registers Types of Operands.
Instruction Sets: Characteristics Functions Addressing Modes Formats Chapter7:
Computer Architecture and Organization
Computer Architecture EKT 422
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
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
Group # 3 Jorge Chavez Henry Diaz Janty Ghazi German Montenegro.
EKT 422/4 COMPUTER ARCHITECTURE SoME-0809-I 1 Chapter 3a Instruction Sets: Characteristics and Functions.
Ass. Prof. Dr Masri Ayob TK 2123 Lecture 14: Instruction Set Architecture Level (Level 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.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
İnformasiya texnologiyaları kafedrası Mövzu № 6. Maşın əmrlərinin xarakteristikaları. ( Maşın əmrlərinin arxitekturasının ümumi təsviri. Maşın əmrlərinin.
CSC 221 Computer Organization and Assembly Language Lecture 06: Machine Instruction Characteristics.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Computer Organization and ASSEMBLY LANGUAGE
Microprocessor Systems Design I
Architecture Review Instruction Set Architecture
Computer Organization and Assembly Language (COAL)
BIC 10503: COMPUTER ARCHITECTURE
Central Processing Unit
Computer Organization and ASSEMBLY LANGUAGE
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
William Stallings Computer Organization and Architecture 8 th Edition Chapter 10 (Chap 12 edition 9) Instruction Sets: Characteristics and Functions.
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
Introduction to Microprocessor Programming
Review In last lecture, done with unsigned and signed number representation. Introduced how to represent real numbers in float format.
COMPUTER ORGANIZATION AND ARCHITECTURE
Part I Data Representation and 8086 Microprocessors
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

Chapter 10 Instruction Sets: Characteristics and Functions

What is an Instruction Set? The complete collection of instructions that are understood by a CPU Machine Code Binary Usually represented by assembly codes

Elements of an Instruction Operation code (Op code) –Do this Source Operand reference –To this Result Operand reference –Put the answer here Next Instruction Reference –When you have done that, do this...

Where have all the Operands Gone? Long time passing…. (If you don’t understand, you’re too young!) Main memory (or virtual memory or cache) CPU register I/O device

Instruction Representation In machine code each instruction has a unique bit pattern For human consumption (well, programmers anyway) a symbolic representation is used –e.g. ADD, SUB, LOAD Operands can also be represented in this way –ADD A,B

Simple Instruction Format

Instruction Types Data processing –Arithmetic & Logic Instructions Data storage (main memory) –Memory Instructions Data movement (I/O) –I/O Instructions Program flow control –Test & Branch Instructions

Number of Addresses (a) 3 addresses –Operand 1, Operand 2, Result –a = b + c; –May be a forth - next instruction (usually implicit) –Not common –Needs very long words to hold everything

Number of Addresses (b) 2 addresses –One address doubles as operand and result –a = a + b –Reduces length of instruction –Requires some extra work Temporary storage to hold some results

Number of Addresses (c) 1 address –Implicit second address –Usually a register (accumulator) –Common on early machines

Number of Addresses (d) 0 (zero) addresses –All addresses implicit –Uses a stack –e.g. push a – push b – add – pop c –c = a + b

How Many Addresses More addresses –More complex (powerful?) instructions –More registers Inter-register operations are quicker –Fewer instructions per program Fewer addresses –Less complex (powerful?) instructions –More instructions per program –Faster fetch/execution of instructions

Design Decisions (1) Operation repertoire –How many ops? –What can they do? –How complex are they? Data types Instruction formats –Length of op code field –Number of addresses

Design Decisions (2) Registers –Number of CPU registers available –Which operations can be performed on which registers? Addressing modes (later…) RISC v CISC

Types of Operand Addresses Numbers –Integer/floating point Characters –ASCII etc. Logical Data –Bits or flags (Aside: Is there any difference between numbers and characters? Ask a C programmer!)

Addresses Addresses are a form of data. Sometimes, calculations must be performed on the operand reference in an instruction to determine the memory address. The various addressing modes that are defined in a given instruction set architecture define how machine language instructions in that architecture identify the operand (or operands) of each instruction. Addresses can be considered as unsigned integers.

Addressing Modes Different computer architectures vary greatly as to the number of addressing modes they provide. When there are only a few addressing modes, the particular addressing mode required is usually encoded within the instruction code. Examples of common addressing modes:  Immediate  Indexed  Memory deferred  Auto-increment  Scaled  Displacement

68HC11 Addressing Modes 68C11 Addressing Modes:  Immediate  Indexed  Inherent  Relative  Direct  Extended

6502 Addressing Modes  The 6502 processor provides several ways in which memory locations can be addressed. Some instructions support several different modes while others may only support one. In addition the two index registers can not always be used interchangeably. This makes the 6502 trickier to program well.

Numbers All machine languages include numeric data types. There is a limited latter between ordinary math numbers and stored computer numbers. There is a limit on the number of numbers represented on a machine and a limit on the precision of floating-point numbers. The programmer faces the consequences of rounding, overflow, and underflow.

Numerical Data  Three types of numerical data:  Integer or fixed point  Floating point  Decimal  There is a necessity to convert from decimal to binary on input and vice versa on output.  Packed decimal is often referred as BCD code. Each decimal is represented by a 4-bit code.  Ex:  0=0000  1=0001  5=0101  8=1000

Inefficiency This coding is sometimes rather inefficient because only 10 of 16 possible 4-bit values are used. To form numbers, 4-bit codes are put together usually in multiples of 8 bits. Ex: 246 = Negative numbers can be represented by including a 4-bit sign digit at either the left or right end of a string of packed decimal digits.

Characters  A common form of data is text or character strings.  Many codes have been devised by which characters are represented by a sequence of bits.  The most common character code used today is the American Standard Code for Information Interchange known as ASCII also referred to as the International Reference Alphabet (IRA).  Each character in this code is represented by a unique 7-bit pattern which creates 128 different characters.  Some characters are called “control” characters which control the printing of the characters on a page. Others are used for communication procedures.  IRA codes are almost always stored and transmitted using 8 bits per character. The 8 th can be a parity bit (odd or even) used for error detection.

ASCII Table This code conversions between 7-bit IRA and 4-bit packed decimal representation is the same as code as BCD code which facilitates conversions.

EBCDIC Table This code is used on IBM mainframes. It is an 8-bit code compatible with packed decimal. The codes through represent the digits 0 through 9.

Logical Data Logical Data can be seen as a word or address unit that can be considered to be an n-bit unit consisting of n 1-bit items of data having the value of 1 or 0. With this type of data, memory can be used most efficiently for storing an array of Boolean or binary data items. The “type” of a unit of data is determined by the operation being performed on it.  Boolean Logic

Pentium and PowerPC Data Types

Pentium Data Types Pentium refers to Intel's single-core x86 microprocessor based on the P5 fifth-generation micro architecture. The name Pentium was derived from the Greek “pente” which means 'five‘. The Pentium can deal with data types of 8 (byte),16(word),32(double-word), and 64(quad-word) bits in length. The least significant byte is stored in the lowest address. The Pentium supports an impressive array of specific data types that are recognized and operated on by particular instructions. Addressing is by 8 bit unit. A 32 bit double word is read at addresses divisible by 4.

Specific Data Types: General - arbitrary binary contents Integer - single binary value Ordinal - unsigned integer Unpacked BCD - One digit per byte Packed BCD - 2 BCD digits per byte Near Pointer - 32 bit offset within segment Bit field Byte String Floating Point

Power PC Data Types PowerPC is a RISC instruction set architecture created by the 1991 Apple–IBM–Motorola alliance, known as AIM. Originally intended for personal computers, PowerPC CPUs have since become popular embedded and high- performance processors. The PowerPC can deal with data types of 8 (byte), 16 (half- word), 32(word), and 64 (double-word) bits in length. The significant difference in the two processors are the fact that PowerPC can operate on big and little-endian, while the Pentium can only perform on little-endian. This means that the least significant byte is stored in the lowest or highest address.

Fixed-Point Processor Data Types Unsigned byte: Can be used for logical or integer arithmetic operations. Unsigned half-word: As for unsigned byte, but for 16-bit quantities. Signed half-word: Used for arithmetic operations. Unsigned word: Used for logical operations and as address pointer. Signed word: Used for arithmetic operations. Unsigned double-word: Used as an address pointer. Byte String: From 0 to 128 bytes in length.

Pentium Numeric Data Formats

RISC: or Reduced Instruction Set Computer. is a type of microprocessor architecture that utilizes a small, highly-optimized set of instructions, rather than a more specialized set of instructions often found in other types of architectures. There were two stages in history for the microprocessor. One using CISC or complex instruction set computer and the other is RISC. The latter architecture uses a smaller set of instructions. A simpler instruction set may offer the potential for higher speeds, reduced processor size, and reduced power consumption; a more complex one may optimize common operations, improve memory/cache efficiency.

Endian Type Endian: is the convention that two parties that wish to exchange information will use to send and receive this information when they need to cut the information down to pieces. In simple terms is the byte ordering to represent some of data. The most significant byte (MSB) value, which is 0x0A in our example, is stored at the memory location with the lowest address, the next byte value in significance, 0x0B, is stored at the following memory location and so on. This is akin to Left-to-Right reading order in hexadecimal.

The Data Types In computing, "word" is a term for the natural unit of data used by a particular computer design. A word is simply a fixed-sized group of bits that are handled together by the machine. The number of bits in a word (the word size or word length) is an important characteristic of a computer architecture. The size of a word is reflected in many aspects of a computer's structure and operation.

Types of Operation Data Transfer Arithmetic Logical Conversion I/O System Control Transfer of Control

Data Transfer Specify –Source –Destination –Amount of data May be different instructions for different movements –e.g. IBM 370 Or one instruction and different addresses

Arithmetic Add, Subtract, Multiply, Divide Signed Integer Floating point ? May include –Increment (a++) –Decrement (a--) –Negate (-a)

Shift and Rotate Operations InputOperationResult Logical right shift (3 bits) Logical left shift (3 bits) Arithmetic right shift (3 bits) Arithmetic left shift (3 bits) Right rotate (3 bits) Left rotate (3 bits) Load the word into a register. 2. AND with the value This masks out the character on the right. 3. Shift to the right eight times. This shifts the remaining character to the right half of the register. 4. Perform I/O. The I/O module reads the lower-order 8 bits from the data bus.

Logical Bitwise operations AND, OR, NOT Bitwise operators NOT for example The bitwise NOT, or complement, is a unary operation which performs logical negation on each bit, forming the ones' complement of the given binary value. Digits which were 0 become 1, and vice versa. For example: NOT 0111 = 1000 Conversion E.g. Binary to Decimal

Input/Output May be specific instructions May be done using data movement instructions (memory mapped) May be done by a separate controller (DMA)

Systems Control Privileged instructions CPU needs to be in specific state –Ring 0 on –Kernel mode For operating systems use

Transfer of Control Branch –e.g. branch to x if result is zero Skip –e.g. increment and skip if zero –ISZ Register1 –Branch xxxx –ADD A Subroutine call

Questions? What is an Address? o Any form of data. Is Indexed an addressing mode? o Yes. Do all microprocessors have the same addressing modes? o No. What is the inefficiency of BCD coding? o Only 10 of 16 possible 4-bit values are used Where is EBCDIC coding used? o It is used on IBM mainframes. What is Endianness? o Byte ordering that represent some kind of data.

Which three manufactures united to create the PowerPC processor? o Apple, IBM, and Motorola. What does the acronym is RISC stand for? o Reduced Instruction Set Computers What year did the AIM alliance occur? o 1991 What is a bitwise operation? o The operation of one or two bit patterns at the level of their individual bits Aside of the common arithmetic operations ( Add, Sub, Multiply, Div) what are four other possibilities? o Absolute, Negate, Increment, Decrement

What is the common practice name for the representation of machine instructions? Symbolic Representation The source and result operands can be in the areas of main/virtual memory, I/O device and what other area? CPU Register In one-address instructions, a second address is implicit which is a process register. What is the name of this register? Accumulator

References Wikipedia Wiki-Answers Computer Organization and Architecture: Designing for Performance, 7/E William Stallings

This has been a production of <> class This has been a production of class from. Ken Berry Jean Paul Larach Hugo Blanco