Problem with Scanning an Infix Expression

Size: px
Start display at page:

Download "Problem with Scanning an Infix Expression"

Transcription

1 Operator Notation Consider the infix expression (X Y) + (W U), with parentheses added to make the evaluation order perfectly obvious. This is an arithmetic expression written in standard form, called infix form. There are two other forms, prefix and postfix, which are occasionally used in software. Infix form has the operator in between two operands, as in X + Y. It is what we are used to, but it is hard for computers to process. The two other forms are prefix and postfix. I give the LISP variant of prefix. Prefix: (+ ( X Y) ( W U) ) Postfix: XY WU + Implicit in each of these examples is the assumption that single letter variables are used. Each of the prefix and postfix is easier for a computer to interpret than is infix. The assumption is that the expression is scanned either left to right or right to left. Here, we arbitrarily scan left to right. We return to this expression, but first consider a much simpler expression.

2 Problem with Scanning an Infix Expression Suppose that we have a five symbol expression. We are scanning left to right. We assume: all variables are single alphabetic characters Each alphabetic characters is taken singly and represents a variable At the beginning we have five unknown symbols: We read the first character and find it to be a variable: We read the next character and find it to be an operator: Something is being added. X X + We read the next character and find it to be a variable: X + Y. Can we do the addition now? It depends on what the next character is. There are two basic possibilities: X + Y + Z X + Y Z In the first option, we can do the addition immediately, forming (X + Y) to which Z is later added. In the second option, we must wait and first do the multiplication to get (Y Z) to which X is added.

3 Scanning a Postfix Expression With the same assumptions, we scan a five symbol postfix expression. At the beginning we have five unknown symbols: We read the first character and find it to be a variable: Y We read the next character and find it also to be a variable: Y Z At this point we need an operator. We read the next character and find it to be an operator: Because this is postfix, the evaluator can immediately form the product term (Y Z) We read the next character and find it to be a variable: At this point, we need another operator. We have two operands: (Y Z) and X. Y Z Y Z X We read the last character and find it to be an operator: Y Z X + We do the addition and have the term (Y Z) + X.

4 The Stack Data Type Stacks are LIFO (Last In, First Out) data structures. Stacks are the data structure most naturally fit to evaluate expressions in postfix notation. The stack is best viewed as an abstract data type with specific methods, each of which has a well defined semantic (we can say exactly what it does). We can also consider the stack as having a top. Items are added to the stack top and then removed from the stack top. The position of the stack top is indicated by a stack pointer (SP). More on this later; it has two different definitions, each of which is valid. The stack data type has three necessary methods, and two optional methods. The mandatory methods are Push, Pop, and IsEmpty. The standard optional methods are Top, and IsFull. Note: When studying computer networks, we speak of a protocol stack, which has nothing to do with the ADT (Abstract Data Type) stack that we study today. We shall discuss the TCP/IP protocol stack later in this course.

5 Pushing Items onto the Stack Consider the sequence: Push (X), Push (Y), and Push (Z). This sequence adds three items to the stack, in the specified order. Push X Push Y Push Z After the third operation, Z is at the top of the stack and is the first to be removed when a Pop operation is performed. The SP (Stack Pointer) is a data item internal to the stack that indicates the location of the top of the stack. It is never made public by any proper stack implementation.

6 Evaluation of the Postfix Expression Y Z X + Postfix notation is also called RPN for Reverse Polish Notation. Rules: 1. Scan left to right. 2. Upon reading a variable, push it onto the stack. 3. Upon reading a dyadic operator, pop two variables from the stack, perform the operation, and push the result. We read the first character and find it to be a variable: Y We read the next character and find it also to be a variable: Y Z We read the next character and find it to be an operator: Y Z

7 Evaluation of the Postfix Expression Y Z X + Continues We read the next character and find it to be a variable: Y Z X We read the last character and find it to be an operator: Y Z X + After this, the stack will be popped and the value placed into some variable. This example just looked at the expression, without considering the assignment.

8 Stack Based (Zero Operand) Machine Evaluate the expression Z = (X Y) + (W U) which must be evaluated in its postfix (RPN) version: XY WU + Push Push Mult Push Push Mult Add Pop X Y W U Z X X Y X Y X Y W X Y W U X Y W U X Y +W U

9 More Explicit Evaluation: W = Y Z It might be good at this point to make explicit a point that many consider obvious. Suppose that before the evaluation above, W = 0, Y = 10, and Z = 15. The push pop code to execute this instruction will go as follows: PUSH Y // Value of Y is placed on the stack. PUSH Z MULT // Value of Z is placed onto the stack. // Pop the top two values, multiply them // and push the result onto the stack. POP W // Pop the value at stack top and place into W. At the start, here is what we have.

10 PUSH Y More Explicit Evaluation: Part 2 // Value of Y is placed on the stack. PUSH Z // Value of Z is placed onto the stack.

11 MULT More Explicit Evaluation: Part 3 // Pop the top two values, multiply them // and push the result onto the stack. POP W // Pop the value at stack top and place into W.

12 Practical Evaluation of Postfix Operators Here are some steps for manual evaluation. 1. Scan the postfix expression left to right. Find the first operator. 2. Determine how many operands that operator requires. Call it N. Select the previous N operands, apply to the operator. 3. Remove the operator and its operands from the expression. Replace these with the operands results. 4. Repeat Here is an example, using single digit numbers to start with * (6 5 +) 4 2 * (11) 4 2 * (11) (4 2 ) * (11) (2) * 22

13 Practical Evaluation of Prefix Operators Note: We assume Lisp notation, with full use of parentheses. 1. Scan the expression left to right. If the expression does not contain another parenthesized expression, evaluate it. Otherwise, attempt to evaluate its subexpression. Formally, this is viewed as a tree traversal. 2. Keep moving up until the last is evaluated. Here is an example. Again, it will start with single digit numbers in order to be more easily read. Evaluate the prefix expression: ( + ( * 4 2 ) ( 5 2 ) ( * ( + 6 4) (+ 1 1 ) ) ) (* 4 2) can be evaluated, so: ( + 8 ( 5 2 ) ( * ( + 6 4) (+ 1 1 ) ) ) ( 5 2) is defined as 5 2, so: ( ( * ( + 6 4) (+ 1 1 ) ) ) (+ 6 4) can be evaluated, so: ( ( * 10 (+ 1 1 ) ) ) (+ 1 1) can be evaluated, so: ( ( * 10 2 ) ) (* 10 2) can be evaluated, so: ( ) ( ) = 31, so: 31

14 Expression Tree for the Prefix Evaluation The expression is ( + ( * 4 2 ) ( 5 2 ) ( * ( + 6 4) (+ 1 1 ) ) ). Software to evaluate this prefix expression would first build this tree (not very hard to do) and then evaluate it. For example, the node (+ 6 4) would be replaced by 10, etc.

15 Expression Tree Evaluation

16 Single Accumulator Machine Evaluate the expression Z = (X Y) + (W U) This requires an extra storage location, which I call T for Temp. Load X // AC now has X Mult Y // AC now has (X Y) Store T // Now T = (X Y). AC still has (X Y) Load W // AC now has W Mult U // AC now has (W U) Add T // AC now has (X Y) + (W U) Store Z // And so does Z.

17 Multiple Register Machines Evaluate the expression Z = (X Y) + (W U) Standard CISC Approach (There are many variants of this one.) Load R1, X // R1 has X Mult R1, Y // R1 has (X Y) Load R2, W // R2 has W Mult R2, U // R2 has (W U) Add R1, R2 // R1 has (X Y) + (W U) Store R1, Z // And so does Z Load Store RISC Load R1, X // R1 has X Load R2, Y // R2 has Y Mult R1, R2 // R1 has (X Y) Load R2, W // R2 now has W Load R3, U // R3 has U Mult R2, R3 // R2 has (W U) Add R1, R2 // R1 has (X Y) + (W U) Store R1, Z // And so does Z.

18 Instruction Types There are basic instruction types that are commonly supported. 1. Data Movement (Better called Data Copy ) These copy bytes of data from a source to a destination. If X and Y are 32 bit real numbers, then the instruction Y = X makes a copy of the four bytes associated with X and places them in the address for Y. 2. Arithmetic The standard arithmetic operators are usually supported. If division is supported, one usually also has the mod and rem functions. On business oriented machines, decimal arithmetic is always supported. Graphics oriented machines usually support saturation arithmetic. Real number arithmetic is often not handled directly in the CPU, but by a coprocessor attached to it. Early on (Intel / 80487) this was a cost consideration. RISC machines follow this approach in order to keep the CPU simple. 3. Boolean Logic Here I differ from the book s description. Boolean instructions are often used for non Boolean purposes, such as bit manipulation. The real Boolean instructions are the conditional branches.

19 More Instruction Types 4. Bit Manipulation These use instructions that appear to be Boolean, but in fact operate differently. This is a distinction lost on many students, perhaps because it is rarely important. More on this in a moment. 5. Input / Output The computer must communicate with external devices, including permanent storage, printers and keyboards, process control devices (through dedicated I/O registers), etc. A few architectures have a dedicated input device and a dedicated output device. All commercial machines have addressable I/O devices; i.e., the CPU issues a device identifier that appears to be an address to select the device. From the CPU viewpoint, each I/O device is nothing more than a set of registers (control, status, and data) and some timing constraints. 6. Transfer of Control These alter the normal sequential execution of code. At the primitive machine language level, all we have is unconditional jumps, conditional jumps, and subroutine invocations. Higher level languages elaborate these features with structured constructs such as conditional statements, counted loops, and conditional loops.

20 More on Logical Instructions vs. Bitwise Instructions This is quite important in C, C++, and Java. Consider the standard implementation of Boolean values as 8 bit bytes. This is done for convenience in addressing by the CPU, as single bits are not addressable. Let A = C = B = D = Logical operators in C++ AND && Expression && Expression OR Expression Expression Bitwise operators in C++ AND & Expression & Expression OR Expression Expression XOR ^ Expression ^ Expression Logical Bitwise A && B = 0 (FALSE) A & B = A B = 1 (TRUE) A B = C && D = 1 (TRUE) C & D = C D = 1 (TRUE) C D = Source: The Annotated C++ Reference Manual (Sections ) Margaret Ellis and Bjarne Stroustrup, Addison Wesley, 1990.

21 A Context for Bitwise Operators For simplicity I consider a very old (late 1960 s) Line Printer, a predecessor to today s laser printer. We examine the Status/Control register for the LP 11. This register is called LPS for Line Printer Status in the literature. We have here two status bits and a control bit. Status bits Bit 15 Error If Error = 1, then there is a device error, such as power off, no paper in the printer, etc. Bit 7 Done If Done = 1, the printer is ready for the next line. Control bit Bit 6 IE If IE = 1, the printer is enabled to raise an interrupt whenever Done becomes 1 or Error becomes 1.

22 More on the LPS Register Why this arrangement of bits? The PDP 11, for which the LP 11 was used, did not support 8 bit arithmetic. A 16 bit integer was the smallest that the CPU would handle. Viewed as a 16 bit signed integer, we note that the error bit (Bit 15) is the sign bit. To test for an error, we just read the LPS into a register and test if it is negative. Testing the Done Bit Recall that the Done Bit is bit 7 and that is 0x0080. LPS E DI x LPS & 0x D If ( 0 = = (LPS & 0x0080) ) then the Line Printer is Not Done

23 Still More on the LPS Register Testing and Setting the Interrupt Enable Bit Recall that the Done Bit is bit 6 and that is 0x is 0xFFBF. Testing the Interrupt Enable Bit LPS E DI x LPS & 0x I If ( 0 = = (LPS & 0x0040) ) then the Line Printer Interrupt is disabled.

24 Yet More on the LPS Register Enabling Interrupts (Setting the I Bit) LPS E DI x LPS 0x0040 E D Setting LPS = LPS 0x0040 enables the interrupt and leaves the other bits unchanged. Disabling Interrupts (Clearing the I Bit) LPS E DI xFFBF LPS & 0xFFBF E D Setting LPS = LPS & 0xFFBF disables the interrupt and leaves the other bits unchanged.

25 Overview of Addressing Modes Many computer instructions involve memory, and must generate memory addresses. In this introduction, we shall discuss addressing modes in general terms. Later, we shall investigate examples specifically based on IA 32 code. All modes of addressing memory are based on an EA (Effective Address), which is the actual memory address issued by the control unit. First, we study some modes that do not address memory. Immediate Mode In this mode, there is no reference to memory. The argument is part of the instruction. The simplest example is the Boz 7 instruction HALT. There is no argument. In the IA 32 trap, int 21h, the hexadecimal value is part of the machine code. The machine language would have two bytes: 0xCC 21; the first byte is the opcode. Here is another example with decimal notation. MOV EAX, This sets the value in the EAX register to decimal Register Direct Here is a simple IA 32 example: MOV EAX, EBX. It moves the value in the EBX register into the EAX register. Memory is not referenced.

26 Calculating the Effective Address By definition of the term Effective Address, all memory references use that address when accessing memory. M[EA] denotes the contents of the effective address. Consider two basic operators: Load from memory and Store to memory Load Register from Memory: R M[EA] Store Register to Memory: M[EA] (R) Understanding addressing modes then becomes equivalent to understanding how to calculate the Effective Address. Each instruction referencing memory has fields (collections of bits) indicating how to compute the EA. In general, the only fields used are: the Address Field the Index Register this contains an address, which may be modified. this contains the register used as array index. If this field is 0, indexing is not used. the Indirect Bit this is used for Indirect and Indexed Indirect addressing. If this is 1, indirect addressing is used; otherwise not. Instructions that do not use an address field conventionally have that field set to 0.

27 Direct and Indirect Addressing Opcode Registers Mode Flags Address Field In each of direct and indirect addressing, the computation is simple: Just copy the address field itself. In direct addressing, the address field contains the address of the argument. In indirect addressing, the address field contains the address of a pointer to the argument. Put another way, the contents of the memory indicated by the address field contain the address of the argument. In subroutine linkage, argument passing by preference basically uses indirect addressing.

28 Direct and Indirect Addressing (Example) Consider the following address map as an example for our addressing modes. Z represents address 0x0A. Z == 0x0A and M[Z] = 5. Address A B C D E F Contents C 1E A 10 3 F E D 8 Direct Addressing LDR %R1, Z Effective Address: EA = Z Here EA = 0x0A. Effect: R1 M[Z] Here R1 M[0x0A] or R1 = 5. Indirect Addressing LDR %R1, *Z Effective Address: EA = M[Z] Here EA = M[0x0A] = 5 Effect: R1 M[EA] = M [ M[Z] ] Here R1 M[0x05] or R1 = 11. NOTE: These examples are based on the Boz 7 architecture, rather simpler than the IA 32. The Boz 7 is a didactic design by the author of these notes.

29 Indexed Addressing This is used to support array addressing in all computers. Languages such as C and C++ implement this directly using zero based arrays. In this mode, the contents of a general purpose register are used as an index. The contents of the register are added to the address field to form the effective address. EA = (Address Field) + (Register) Although we expect the index to be smaller than the value of the address, this may not always (or often) be the case. The contents of the address field should be considered as having a different data type from those of the register, which holds a signed integer.

30 Indexed Addressing (Example) LDR %R1, Z, 3 // Z indexed by the general purpose register R3. Z represents address 0x0A. Z == 0x0A and M[Z] = 5. (R3) = = 4 Address A B C D E F Contents C 1E A 10 3 F E D 8 Effective address: EA = Z + (%R3) Here EA = 0x0A + 4 = 0x0E Effect: R1 M[EA] = M[0x0E] or R1 = F In this, the most common, variant of indexed addressing we see Z as an array. The first five elements of the array are placed in memory as follows: Memory Map 0x0A 0x0B 0x0C 0x0D 0x0E Contents: Z[0] Z[1] Z[2] Z[3] Z[4]

31 Based Addressing This is quite similar to indexed addressing, so much so that it seems redundant. This mode arises from an entirely different consideration. Indexed addressing basically supports the use of arrays. Based addressing supports the Operating System in partitioning the user address space. User addresses are mapped into physical addresses that cannot conflict.

32 Indexed Indirect Addressing This is a combination of both modes. Question: Which is done first? Pre Indexed Indirect: The indexing is done first. We have an array of pointers. Post Indexed Indirect: The indirect is done first. We have a pointer to an array.

33 Indexed Indirect Addressing (Example) Let Z refer to address 0xA, so that M[Z] = = 0x05. Let (R3) = 0x07. Address A B C D E F Contents C 1E A 9 3 F E D 8 Pre Indexed Indirect: LDR %R1, *Z, 3 Effective address EA = M[ Z + (R3) ] = M[0xA + 0x7] = M[ 0x11] = 0x08. Effect Post Indexed Indirect: LDR %R1, *Z, 3 R1 M[ M[Z + (R3)] ] or R1 M[0x08] or R1 1E Effective address EA = M[Z] + (R3) = M[0x0A] + 0x07 = 0x05 + 0x07 = 0x0C. Effect R1 M[0x0C] or R1 0x09.

34 Double Indirect Addressing: Use 1 Suppose a common data structure that is used by a number of programs. In modern systems, this could be a DLL (Dynamic Linked Library) module. Each program contains a pointer to this structure, used to access that structure. Singly indirect addressing, in which the pointer is stored in every program, presents problems when the data block is moved by the memory manager. Every reference to that block must be found and adjusted. In doubly indirect addressing, all programs have a pointer to a data structure which itself is a pointer. When the data block is moved, only this one pointer must be adjusted. As an extra benefit, this intermediate pointer can be expanded to a data structure containing an ACL (Access Control List) and other descriptors for the data block.

35 Double Indirect Addressing: Use 2 The Operating System uses double indirection to activate a device driver associated with a given I/O device. For each type of I/O device, the O/S stores the address of a device vector, which contains the actual address of the software to handle the device. This arrangement allows the operating system and the device drivers to be developed independently. The only fixed location is the address of this device vector. When the driver software is loaded, the O/S places it in the memory location that is most convenient for the current configuration and copies that start address into the address part of the device vector. Double indirection is then used to call the driver. This is really a vectored interrupt mechanism, described more fully in a later chapter.

Problem with Scanning an Infix Expression

Problem with Scanning an Infix Expression Operator Notation Consider the infix expression (X Y) + (W U), with parentheses added to make the evaluation order perfectly obvious. This is an arithmetic expression written in standard form, called infix

More information

Address Modes effective address

Address Modes effective address Address Modes The MARIE supports only three addressing modes: immediate, direct, and indirect. We are now going to discuss addressing modes in general. Most computers support quite a few of these modes.

More information

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

UNIT-II. Part-2: CENTRAL PROCESSING UNIT Page1 UNIT-II Part-2: CENTRAL PROCESSING UNIT Stack Organization Instruction Formats Addressing Modes Data Transfer And Manipulation Program Control Reduced Instruction Set Computer (RISC) Introduction:

More information

Understand the factors involved in instruction set

Understand the factors involved in instruction set A Closer Look at Instruction Set Architectures Objectives Understand the factors involved in instruction set architecture design. Look at different instruction formats, operand types, and memory access

More information

Chapter 7A Overview of Instruction Set Architecture

Chapter 7A Overview of Instruction Set Architecture Overview of This is the first of three chapters in this textbook that correspond to Chapter 7, The Intel Pentium CPU, in the official text for this course, Computer Systems Architecture by Rob Williams.

More information

The MARIE Architecture

The MARIE Architecture The MARIE Machine Architecture that is Really Intuitive and Easy. We now define the ISA (Instruction Set Architecture) of the MARIE. This forms the functional specifications for the CPU. Basic specifications

More information

Overview. EE 4504 Computer Organization. Much of the computer s architecture / organization is hidden from a HLL programmer

Overview. EE 4504 Computer Organization. Much of the computer s architecture / organization is hidden from a HLL programmer Overview EE 4504 Computer Organization Section 7 The Instruction Set Much of the computer s architecture / organization is hidden from a HLL programmer In the abstract sense, the programmer should not

More information

Chapter 5. A Closer Look at Instruction Set Architectures. Chapter 5 Objectives. 5.1 Introduction. 5.2 Instruction Formats

Chapter 5. A Closer Look at Instruction Set Architectures. Chapter 5 Objectives. 5.1 Introduction. 5.2 Instruction Formats Chapter 5 Objectives Understand the factors involved in instruction set architecture design. Chapter 5 A Closer Look at Instruction Set Architectures Gain familiarity with memory addressing modes. Understand

More information

Subprograms, Subroutines, and Functions

Subprograms, Subroutines, and Functions Subprograms, Subroutines, and Functions Subprograms are also called subroutines, functions, procedures and methods. A function is just a subprogram that returns a value; say Y = SIN(X). In general, the

More information

Chapter 5. A Closer Look at Instruction Set Architectures

Chapter 5. A Closer Look at Instruction Set Architectures Chapter 5 A Closer Look at Instruction Set Architectures Chapter 5 Objectives Understand the factors involved in instruction set architecture design. Gain familiarity with memory addressing modes. Understand

More information

Chapter 5. A Closer Look at Instruction Set Architectures

Chapter 5. A Closer Look at Instruction Set Architectures Chapter 5 A Closer Look at Instruction Set Architectures Chapter 5 Objectives Understand the factors involved in instruction set architecture design. Gain familiarity with memory addressing modes. Understand

More information

Practical Malware Analysis

Practical Malware Analysis Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the

More information

Chapter 5. A Closer Look at Instruction Set Architectures

Chapter 5. A Closer Look at Instruction Set Architectures Chapter 5 A Closer Look at Instruction Set Architectures Chapter 5 Objectives Understand the factors involved in instruction set architecture design. Gain familiarity with memory addressing modes. Understand

More information

UNIT 3

UNIT 3 UNIT 3 Presentation Outline Sequence control with expressions Conditional Statements, Loops Exception Handling Subprogram definition and activation Simple and Recursive Subprogram Subprogram Environment

More information

COMPUTER ORGANIZATION & ARCHITECTURE

COMPUTER ORGANIZATION & ARCHITECTURE COMPUTER ORGANIZATION & ARCHITECTURE Instructions Sets Architecture Lesson 5a 1 What are Instruction Sets The complete collection of instructions that are understood by a CPU Can be considered as a functional

More information

Topics Power tends to corrupt; absolute power corrupts absolutely. Computer Organization CS Data Representation

Topics Power tends to corrupt; absolute power corrupts absolutely. Computer Organization CS Data Representation Computer Organization CS 231-01 Data Representation Dr. William H. Robinson November 12, 2004 Topics Power tends to corrupt; absolute power corrupts absolutely. Lord Acton British historian, late 19 th

More information

CHAPTER 5 A Closer Look at Instruction Set Architectures

CHAPTER 5 A Closer Look at Instruction Set Architectures CHAPTER 5 A Closer Look at Instruction Set Architectures 5.1 Introduction 199 5.2 Instruction Formats 199 5.2.1 Design Decisions for Instruction Sets 200 5.2.2 Little versus Big Endian 201 5.2.3 Internal

More information

CHAPTER 5 A Closer Look at Instruction Set Architectures

CHAPTER 5 A Closer Look at Instruction Set Architectures CHAPTER 5 A Closer Look at Instruction Set Architectures 5.1 Introduction 293 5.2 Instruction Formats 293 5.2.1 Design Decisions for Instruction Sets 294 5.2.2 Little versus Big Endian 295 5.2.3 Internal

More information

CHAPTER 5 A Closer Look at Instruction Set Architectures

CHAPTER 5 A Closer Look at Instruction Set Architectures CHAPTER 5 A Closer Look at Instruction Set Architectures 5.1 Introduction 5.2 Instruction Formats 5.2.1 Design Decisions for Instruction Sets 5.2.2 Little versus Big Endian 5.2.3 Internal Storage in the

More information

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store.

The von Neumann Architecture. IT 3123 Hardware and Software Concepts. The Instruction Cycle. Registers. LMC Executes a Store. IT 3123 Hardware and Software Concepts February 11 and Memory II Copyright 2005 by Bob Brown The von Neumann Architecture 00 01 02 03 PC IR Control Unit Command Memory ALU 96 97 98 99 Notice: This session

More information

Bits, Words, and Integers

Bits, Words, and Integers Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are

More information

Major and Minor States

Major and Minor States Major and Minor States We now consider the micro operations and control signals associated with the execution of each instruction in the ISA. The execution of each instruction is divided into three phases.

More information

Why Study Assembly Language?

Why Study Assembly Language? Why Study Assembly Language? This depends on the decade in which you studied assembly language. 1940 s You cannot study assembly language. It does not exist yet. 1950 s You study assembly language because,

More information

Chapter 5. A Closer Look at Instruction Set Architectures

Chapter 5. A Closer Look at Instruction Set Architectures Chapter 5 A Closer Look at Instruction Set Architectures Chapter 5 Objectives Understand the factors involved in instruction set architecture design. Gain familiarity with memory addressing modes. Understand

More information

Chapter 5. A Closer Look at Instruction Set Architectures. Chapter 5 Objectives. 5.1 Introduction. 5.2 Instruction Formats

Chapter 5. A Closer Look at Instruction Set Architectures. Chapter 5 Objectives. 5.1 Introduction. 5.2 Instruction Formats Chapter 5 Objectives Chapter 5 A Closer Look at Instruction Set Architectures Understand the factors involved in instruction set architecture design. Gain familiarity with memory addressing modes. Understand

More information

CDA 3103 Computer Organization Homework #7 Solution Set

CDA 3103 Computer Organization Homework #7 Solution Set CDA 3103 Computer Organization Homework #7 Solution Set 1 Problems 1. Write a MARIE assembly program for the following algorithm where the subroutine takes two numbers and returns their product. Your assembly

More information

CHAPTER 8: Central Processing Unit (CPU)

CHAPTER 8: Central Processing Unit (CPU) CS 224: Computer Organization S.KHABET CHAPTER 8: Central Processing Unit (CPU) Outline Introduction General Register Organization Stack Organization Instruction Formats Addressing Modes 1 Major Components

More information

Lecture V Toy Hardware and Operating System

Lecture V Toy Hardware and Operating System 2. THE Machine Lecture V Page 1 Lecture V Toy Hardware and Operating System 1. Introduction For use in our OS projects, we introduce THE Machine where THE is an acronym 1 for Toy HardwarE. We also introduce

More information

Chapter 14 Design of the Central Processing Unit

Chapter 14 Design of the Central Processing Unit Chapter 14 Design of the Central Processing Unit We now focus on the detailed design of the CPU (Central Processing Unit) of the Boz 7. The CPU has two major components: the Control Unit and the ALU (Arithmetic

More information

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss Grundlagen Microcontroller Processor Core Günther Gridling Bettina Weiss 1 Processor Core Architecture Instruction Set Lecture Overview 2 Processor Core Architecture Computes things > ALU (Arithmetic Logic

More information

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points]

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points] Review Questions 1 The DRAM problem [5 points] Suggest a solution 2 Big versus Little Endian Addressing [5 points] Consider the 32-bit hexadecimal number 0x21d3ea7d. 1. What is the binary representation

More information

SOEN228, Winter Revision 1.2 Date: October 25,

SOEN228, Winter Revision 1.2 Date: October 25, SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003 1 Contents Flags Mnemonics Basic I/O Exercises Overview of sample programs 2 Flag Register The flag register stores the condition flags that retain

More information

What Is It? Instruction Register Address Register Data Register

What Is It? Instruction Register Address Register Data Register What Is It? Consider the following set of 32 binary digits, written in blocks of four so that the example is not impossible to read. 0010 0110 0100 1100 1101 1001 1011 1111 How do we interpret this sequence

More information

STACKS. A stack is defined in terms of its behavior. The common operations associated with a stack are as follows:

STACKS. A stack is defined in terms of its behavior. The common operations associated with a stack are as follows: STACKS A stack is a linear data structure for collection of items, with the restriction that items can be added one at a time and can only be removed in the reverse order in which they were added. The

More information

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI Starting Chapter 2: CSCI 402: Computer Architectures Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI Contents 2.1 and 2.3 What is instruction?

More information

Full file at

Full file at Chapter Two DATA MANIPULATION Formatted Chapter Summary This chapter introduces the role of a computer's CPU. It describes the machine cycle and the various operations (or, and, exclusive or, add, shift,

More information

Some Applications of Stack. Spring Semester 2007 Programming and Data Structure 1

Some Applications of Stack. Spring Semester 2007 Programming and Data Structure 1 Some Applications of Stack Spring Semester 2007 Programming and Data Structure 1 Arithmetic Expressions Polish Notation Spring Semester 2007 Programming and Data Structure 2 What is Polish Notation? Conventionally,

More information

Special Section: Building Your Own Compiler

Special Section: Building Your Own Compiler cshtp6_19_datastructures_compiler.fm Page 1 Tuesday, February 14, 2017 10:31 AM 1 Chapter 19 Special Section: Building Your Own Compiler In Exercises8.31 8.33, we introduced Simpletron Machine Language

More information

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI

CSCI 402: Computer Architectures. Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI To study Chapter 2: CSCI 402: Computer Architectures Instructions: Language of the Computer (1) Fengguang Song Department of Computer & Information Science IUPUI Contents 2.1-2.3 Introduction to what is

More information

17. Instruction Sets: Characteristics and Functions

17. Instruction Sets: Characteristics and Functions 17. Instruction Sets: Characteristics and Functions Chapter 12 Spring 2016 CS430 - Computer Architecture 1 Introduction Section 12.1, 12.2, and 12.3 pp. 406-418 Computer Designer: Machine instruction set

More information

Real instruction set architectures. Part 2: a representative sample

Real instruction set architectures. Part 2: a representative sample Real instruction set architectures Part 2: a representative sample Some historical architectures VAX: Digital s line of midsize computers, dominant in academia in the 70s and 80s Characteristics: Variable-length

More information

Interfacing Compiler and Hardware. Computer Systems Architecture. Processor Types And Instruction Sets. What Instructions Should A Processor Offer?

Interfacing Compiler and Hardware. Computer Systems Architecture. Processor Types And Instruction Sets. What Instructions Should A Processor Offer? Interfacing Compiler and Hardware Computer Systems Architecture FORTRAN 90 program C++ program Processor Types And Sets FORTRAN 90 Compiler C++ Compiler set level Hardware 1 2 What s Should A Processor

More information

Chapter 2A Instructions: Language of the Computer

Chapter 2A Instructions: Language of the Computer Chapter 2A Instructions: Language of the Computer Copyright 2009 Elsevier, Inc. All rights reserved. Instruction Set The repertoire of instructions of a computer Different computers have different instruction

More information

Chapter 2 Instruction Set Architecture

Chapter 2 Instruction Set Architecture Chapter 2 Instruction Set Architecture Course Outcome (CO) - CO2 Describe the architecture and organization of computer systems Program Outcome (PO) PO1 Apply knowledge of mathematics, science and engineering

More information

CS311 Lecture: Other CPU Architectures: 0,1,2 and 3 address machines Last revised 10/05/07

CS311 Lecture: Other CPU Architectures: 0,1,2 and 3 address machines Last revised 10/05/07 CS311 Lecture: Other CPU Architectures: 0,1,2 and 3 address machines Last revised 10/05/07 I. Introduction - ------------ A. Recall that, at the start of the course, we drew a distinction between computer

More information

2. ADDRESSING METHODS

2. ADDRESSING METHODS 2 Addressing Methods STUDY MATERIALS ON COMPUTER ORGANIZATION (As per the curriculum of Third semester BSc Electronics of Mahatma Gandh Uniiversity) Compiled by Sam Kollannore U Lecturer in Electronics

More information

EN164: Design of Computing Systems Topic 03: Instruction Set Architecture Design

EN164: Design of Computing Systems Topic 03: Instruction Set Architecture Design EN164: Design of Computing Systems Topic 03: Instruction Set Architecture Design Professor Sherief Reda http://scale.engin.brown.edu Electrical Sciences and Computer Engineering School of Engineering Brown

More information

CSE2421 FINAL EXAM SPRING Name KEY. Instructions: Signature

CSE2421 FINAL EXAM SPRING Name KEY. Instructions: Signature CSE2421 FINAL EXAM SPRING 2013 Name KEY Instructions: This is a closed-book, closed-notes, closed-neighbor exam. Only a writing utensil is needed for this exam. No calculators allowed. If you need to go

More information

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd 19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd Will you walk a little faster? said a whiting to a snail, There s a porpoise close behind us, and he s treading

More information

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University

Introduction to the MIPS. Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Introduction to the MIPS Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University Introduction to the MIPS The Microprocessor without Interlocked Pipeline Stages

More information

IA-32 CSE 5302 Spring 2011 Ngoc Tam Tran

IA-32 CSE 5302 Spring 2011 Ngoc Tam Tran IA-32 CSE 5302 Spring 2011 Ngoc Tam Tran 3/3/2011 1 Overview IA-32(Intel Architecture 32-bit) CISC Architecture Many instructions sets 3/3/2011 2 Registers 16 basic program execution registers for use

More information

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set?

Instruction Set II. COMP 212 Computer Organization & Architecture. COMP 212 Fall Lecture 7. Instruction Set. Quiz. What is an Instruction Set? COMP 212 Computer Organization & Architecture Quiz COMP 212 Fall 2008 Lecture 7 Fill in your student number only, do NOT write down your name Open book, but NO calculator, NO discussions, Relax and have

More information

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015 Advanced Parallel Architecture Lesson 3 Annalisa Massini - 2014/2015 Von Neumann Architecture 2 Summary of the traditional computer architecture: Von Neumann architecture http://williamstallings.com/coa/coa7e.html

More information

Instruction Sets: Characteristics and Functions Addressing Modes

Instruction Sets: Characteristics and Functions Addressing Modes Instruction Sets: Characteristics and Functions Addressing Modes Chapters 10 and 11, William Stallings Computer Organization and Architecture 7 th Edition What is an Instruction Set? The complete collection

More information

Instruction content (2/2) Instruction content (1/2) The Instruction Set. Chapter 9. Each instruction must contain 4 basic pieces of information

Instruction content (2/2) Instruction content (1/2) The Instruction Set. Chapter 9. Each instruction must contain 4 basic pieces of information CS.216 Computer Architecture and Organization Chapter 9 The Instruction Set L/O/G/O www.themegallery.com Overview Much of the computer s architecture / organization is hidden from a HLL programmer In the

More information

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram: The CPU and Memory How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram: 1 Registers A register is a permanent storage location within

More information

In this chapter you ll learn:

In this chapter you ll learn: Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd Will you walk a little faster? said a whiting to a snail, There s a porpoise close behind us, and he s treading on

More information

Darshan Institute of Engineering & Technology for Diploma Studies Unit - 1

Darshan Institute of Engineering & Technology for Diploma Studies Unit - 1 Darshan Institute of Engineering & Technology for Diploma Studies Unit - 1 1. Draw and explain 4 bit binary arithmetic or adder circuit diagram. A binary parallel adder is digital function that produces

More information

(Refer Slide Time: 1:40)

(Refer Slide Time: 1:40) Computer Architecture Prof. Anshul Kumar Department of Computer Science and Engineering, Indian Institute of Technology, Delhi Lecture - 3 Instruction Set Architecture - 1 Today I will start discussion

More information

Compiler Construction D7011E

Compiler Construction D7011E Compiler Construction D7011E Lecture 8: Introduction to code generation Viktor Leijon Slides largely by Johan Nordlander with material generously provided by Mark P. Jones. 1 What is a Compiler? Compilers

More information

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation

Course Schedule. CS 221 Computer Architecture. Week 3: Plan. I. Hexadecimals and Character Representations. Hexadecimal Representation Course Schedule CS 221 Computer Architecture Week 3: Information Representation (2) Fall 2001 W1 Sep 11- Sep 14 Introduction W2 Sep 18- Sep 21 Information Representation (1) (Chapter 3) W3 Sep 25- Sep

More information

EC-801 Advanced Computer Architecture

EC-801 Advanced Computer Architecture EC-801 Advanced Computer Architecture Lecture 5 Instruction Set Architecture I Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC University Taxila!1 Instruction Set Architecture

More information

Chapter 4. MARIE: An Introduction to a Simple Computer

Chapter 4. MARIE: An Introduction to a Simple Computer Chapter 4 MARIE: An Introduction to a Simple Computer Chapter 4 Objectives Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution.

More information

Instruc=on Set Architecture

Instruc=on Set Architecture ECPE 170 Jeff Shafer University of the Pacific Instruc=on Set Architecture 2 Schedule Today and Wednesday Closer look at instruc=on sets Fri Quiz 4 (over Chapter 5, i.e. HW #11 and HW #12) 3 Endianness

More information

Computer Architecture Prof. Smruti Ranjan Sarangi Department of Computer Science and Engineering Indian Institute of Technology, Delhi

Computer Architecture Prof. Smruti Ranjan Sarangi Department of Computer Science and Engineering Indian Institute of Technology, Delhi Computer Architecture Prof. Smruti Ranjan Sarangi Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture - 11 X86 Assembly Language Part-II (Refer Slide Time: 00:25)

More information

Chapter 3 Machine Instructions & Programs. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 3 Machine Instructions & Programs. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Chapter 3 Machine Instructions & Programs Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Numbers, Arithmetic Operations, and Characters Memory Locations

More information

ISA and RISCV. CASS 2018 Lavanya Ramapantulu

ISA and RISCV. CASS 2018 Lavanya Ramapantulu ISA and RISCV CASS 2018 Lavanya Ramapantulu Program Program =?? Algorithm + Data Structures Niklaus Wirth Program (Abstraction) of processor/hardware that executes 3-Jul-18 CASS18 - ISA and RISCV 2 Program

More information

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

ASSEMBLY LANGUAGE MACHINE ORGANIZATION ASSEMBLY LANGUAGE MACHINE ORGANIZATION CHAPTER 3 1 Sub-topics The topic will cover: Microprocessor architecture CPU processing methods Pipelining Superscalar RISC Multiprocessing Instruction Cycle Instruction

More information

When an instruction is initially read from memory it goes to the Instruction register.

When an instruction is initially read from memory it goes to the Instruction register. CS 320 Ch. 12 Instruction Sets Computer instructions are written in mnemonics. Mnemonics typically have a 1 to 1 correspondence between a mnemonic and the machine code. Mnemonics are the assembly language

More information

1/30/2018. Conventions Provide Implicit Information. ECE 220: Computer Systems & Programming. Arithmetic with Trees is Unambiguous

1/30/2018. Conventions Provide Implicit Information. ECE 220: Computer Systems & Programming. Arithmetic with Trees is Unambiguous University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming The Stack Abstraction Conventions Provide Implicit Information What does

More information

Architectures. CHAPTER 5 Instruction Set 5.1 INTRODUCTION 5.2 INSTRUCTION FORMATS

Architectures. CHAPTER 5 Instruction Set 5.1 INTRODUCTION 5.2 INSTRUCTION FORMATS CHAPTER 5 Instruction Set Architectures 5.1 INTRODUCTION e saw in Chapter 4 that machine instructions consist of opcodes and Woperands. The opcodes specify the operations to be executed; the operands specify

More information

Linear Data Structure

Linear Data Structure Linear Data Structure Definition A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array Linked List Stacks Queues Operations on linear Data Structures Traversal

More information

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 4

CS24: INTRODUCTION TO COMPUTING SYSTEMS. Spring 2018 Lecture 4 CS24: INTRODUCTION TO COMPUTING SYSTEMS Spring 2018 Lecture 4 LAST TIME Enhanced our processor design in several ways Added branching support Allows programs where work is proportional to the input values

More information

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 10 Instruction Sets: Characteristics and Functions

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 10 Instruction Sets: Characteristics and Functions William Stallings Computer Organization and Architecture 8 th Edition Chapter 10 Instruction Sets: Characteristics and Functions Instruction Set = The complete collection of instructions that are recognized

More information

LECTURE 17. Expressions and Assignment

LECTURE 17. Expressions and Assignment LECTURE 17 Expressions and Assignment EXPRESSION SYNTAX An expression consists of An atomic object, e.g. number or variable. An operator (or function) applied to a collection of operands (or arguments)

More information

TYPES OF INTERRUPTS: -

TYPES OF INTERRUPTS: - There are 3 types of interrupts. TYPES OF INTERRUPTS: - External Interrupts. Internal Interrupts. Software interrupts. Hardware Interrupts (1) External interrupts come from I/O devices, from a timing device

More information

Older geometric based addressing is called CHS for cylinder-head-sector. This triple value uniquely identifies every sector.

Older geometric based addressing is called CHS for cylinder-head-sector. This triple value uniquely identifies every sector. Review: On Disk Structures At the most basic level, a HDD is a collection of individually addressable sectors or blocks that are physically distributed across the surface of the platters. Older geometric

More information

What is a Compiler? Compiler Construction SMD163. Why Translation is Needed: Know your Target: Lecture 8: Introduction to code generation

What is a Compiler? Compiler Construction SMD163. Why Translation is Needed: Know your Target: Lecture 8: Introduction to code generation Compiler Construction SMD163 Lecture 8: Introduction to code generation Viktor Leijon & Peter Jonsson with slides by Johan Nordlander Contains material generously provided by Mark P. Jones What is a Compiler?

More information

Name: CMSC 313 Fall 2001 Computer Organization & Assembly Language Programming Exam 1. Question Points I. /34 II. /30 III.

Name: CMSC 313 Fall 2001 Computer Organization & Assembly Language Programming Exam 1. Question Points I. /34 II. /30 III. CMSC 313 Fall 2001 Computer Organization & Assembly Language Programming Exam 1 Name: Question Points I. /34 II. /30 III. /36 TOTAL: /100 Instructions: 1. This is a closed-book, closed-notes exam. 2. You

More information

ECE232: Hardware Organization and Design

ECE232: Hardware Organization and Design ECE232: Hardware Organization and Design Lecture 4: Logic Operations and Introduction to Conditionals Adapted from Computer Organization and Design, Patterson & Hennessy, UCB Overview Previously examined

More information

CPU: SOFTWARE ARCHITECTURE INSTRUCTION SET (PART

CPU: SOFTWARE ARCHITECTURE INSTRUCTION SET (PART General Introduction CPU: SOFTWARE ARCHITECTURE INSTRUCTION SET (PART 1) General Introduction (1/5): On Instructions Instruction operate with data or with the flow of the program The following information

More information

An Overview of ISA (Instruction Set Architecture)

An Overview of ISA (Instruction Set Architecture) An Overview of ISA (Instruction Set Architecture) This lecture presents an overview of the ISA concept. 1. The definition of Instruction Set Architecture and an early example. 2. The historical and economic

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

CNIT 127: Exploit Development. Ch 1: Before you begin. Updated

CNIT 127: Exploit Development. Ch 1: Before you begin. Updated CNIT 127: Exploit Development Ch 1: Before you begin Updated 1-14-16 Basic Concepts Vulnerability A flaw in a system that allows an attacker to do something the designer did not intend, such as Denial

More information

09 STACK APPLICATION DATA STRUCTURES AND ALGORITHMS REVERSE POLISH NOTATION

09 STACK APPLICATION DATA STRUCTURES AND ALGORITHMS REVERSE POLISH NOTATION DATA STRUCTURES AND ALGORITHMS 09 STACK APPLICATION REVERSE POLISH NOTATION IMRAN IHSAN ASSISTANT PROFESSOR, AIR UNIVERSITY, ISLAMABAD WWW.IMRANIHSAN.COM LECTURES ADAPTED FROM: DANIEL KANE, NEIL RHODES

More information

Microcontrollers. Microcontroller

Microcontrollers. Microcontroller Microcontrollers Microcontroller A microprocessor on a single integrated circuit intended to operate as an embedded system. As well as a CPU, a microcontroller typically includes small amounts of RAM and

More information

COSC 6385 Computer Architecture. Instruction Set Architectures

COSC 6385 Computer Architecture. Instruction Set Architectures COSC 6385 Computer Architecture Instruction Set Architectures Spring 2012 Instruction Set Architecture (ISA) Definition on Wikipedia: Part of the Computer Architecture related to programming Defines set

More information

The Assembly Language of the Boz 5

The Assembly Language of the Boz 5 The Assembly Language of the Boz 5 The Boz 5 uses bits 31 27 of the IR as a five bit opcode. Of the possible 32 opcodes, only 26 are implemented. Op-Code Mnemonic Description 00000 HLT Halt the Computer

More information

COMP 250 Winter stacks Feb. 2, 2016

COMP 250 Winter stacks Feb. 2, 2016 Stack ADT You are familiar with stacks in your everyday life. You can have a stack of books on a table. You can have a stack of plates on a shelf. In computer science, a stack is an abstract data type

More information

Computer System Architecture

Computer System Architecture CSC 203 1.5 Computer System Architecture Department of Statistics and Computer Science University of Sri Jayewardenepura Addressing 2 Addressing Subject of specifying where the operands (addresses) are

More information

Chapter 04: Instruction Sets and the Processor organizations. Lesson 18: Stack-based processor Organisation

Chapter 04: Instruction Sets and the Processor organizations. Lesson 18: Stack-based processor Organisation Chapter 04: Instruction Sets and the Processor organizations Lesson 18: Stack-based processor Organisation 1 Objective To understand stack based processor organisation Instruction set of a stack organized

More information

Draw a diagram of an empty circular queue and describe it to the reader.

Draw a diagram of an empty circular queue and describe it to the reader. 1020_1030_testquestions.text Wed Sep 10 10:40:46 2014 1 1983/84 COSC1020/30 Tests >>> The following was given to students. >>> Students can have a good idea of test questions by examining and trying the

More information

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017

Chapter 2. Instruction Set. RISC vs. CISC Instruction set. The University of Adelaide, School of Computer Science 18 September 2017 COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface RISC-V Edition Chapter 2 Instructions: Language of the Computer These slides are based on the slides by the authors. The slides doesn t

More information

Tutorial Letter 103/3/2012 Computer Organization COS2621 Semesters 1 & 2

Tutorial Letter 103/3/2012 Computer Organization COS2621 Semesters 1 & 2 COS2621/103/3/2012 Tutorial Letter 103/3/2012 Computer Organization COS2621 Semesters 1 & 2 School of Computing Solutions to self tests Bar code 2 Self-test A Question 1 Alternative 1 Which one of the

More information

Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD /12/2014 Slide 1

Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD /12/2014 Slide 1 Dr. Ramesh K. Karne Department of Computer and Information Sciences, Towson University, Towson, MD 21252 rkarne@towson.edu 11/12/2014 Slide 1 Intel x86 Aseembly Language Assembly Language Assembly Language

More information

Expression Evaluation and Control Flow. Outline

Expression Evaluation and Control Flow. Outline Expression Evaluation and Control Flow In Text: Chapter 6 Outline Notation Operator Evaluation Order Operand Evaluation Order Overloaded operators Type conversions Short-circuit evaluation of conditions

More information

DEEPIKA KAMBOJ UNIT 2. What is Stack?

DEEPIKA KAMBOJ UNIT 2. What is Stack? What is Stack? UNIT 2 Stack is an important data structure which stores its elements in an ordered manner. You must have seen a pile of plates where one plate is placed on top of another. Now, when you

More information

The Instruction Set. Chapter 5

The Instruction Set. Chapter 5 The Instruction Set Architecture Level(ISA) Chapter 5 1 ISA Level The ISA level l is the interface between the compilers and the hardware. (ISA level code is what a compiler outputs) 2 Memory Models An

More information

Programming Model 2 A. Introduction

Programming Model 2 A. Introduction Programming Model 2 A. Introduction Objectives At the end of this lab you should be able to: Use direct and indirect addressing modes of accessing data in memory Create an iterative loop of instructions

More information

Instruc=on Set Architecture

Instruc=on Set Architecture ECPE 170 Jeff Shafer University of the Pacific Instruc=on Set Architecture 2 Schedule Today Closer look at instruc=on sets Thursday Brief discussion of real ISAs Quiz 4 (over Chapter 5, i.e. HW #10 and

More information