Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Dale Roberts, Lecturer Information.

Slides:



Advertisements
Similar presentations
Machine Instructions Operations
Advertisements

Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
Machine Instructions Operations 1 ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson Slides4-1.ppt Modification date: March 18, 2015.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
CSE115: Introduction to Computer Science I
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
Chapter 2 Machine Language. Machine language The only language a computer can understand directly. Each type of computer has its own unique machine language.
The Analytical Engine Module 6 Program Translation.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
By Tien Phung CS 147 Dr. Sin-Min Lee. High-level Languages Assembly Languages Machine Languages.
Memory - Registers Instruction Sets
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
State Machines Used to Design Sequential Circuits.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2:
Programming a computer. What does programming a computer mean ? Programming a computer: Since a computer can only execute machine instructions (encoded.
1 Chapter-01 Introduction to Computers and C++ Programming.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Lecture 3. Diff b/w RAM and Registers Registers are used to hold data immediately applicable to the operation at hand Registers are used to hold data.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
Information Representation: Machine Instructions
Computer Systems Organization CS 1428 Foundations of Computer Science.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
Lecture 14 Today’s topics MARIE Architecture Registers Buses
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
1.4 Representation of data in computer systems Instructions.
Sahar Mosleh California State University San MarcosPage 1 Assembly language and Digital Circuit By Sahar Mosleh California State University San Marcos.
Register Transfer Languages (RTL)
Chapter 2 — Instructions: Language of the Computer — 1 Memory Operands Main memory used for composite data – Arrays, structures, dynamic data To apply.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
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.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Representation of Data - Instructions Start of the lesson: Open this PowerPoint from the A451 page – Representation of Data/ Instructions How confident.
Component 1.6.
Control Unit Lecture 6.
COMPUTER ARCHITECTURE & OPERATIONS I
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
Introduction to Programming
Morgan Kaufmann Publishers
Computer Organization and Design
The University of Adelaide, School of Computer Science
C++ Programming: From Problem Analysis to Program Design
The Processor and Machine Language
CS149D Elements of Computer Science
CSCI206 - Computer Organization & Programming
CSCE Fall 2013 Prof. Jennifer L. Welch.
Computer Architecture & Operations I
Chapter 1 Introduction.
The University of Adelaide, School of Computer Science
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
University of Gujrat Department of Computer Science
ECEG-3202 Computer Architecture and Organization
ECEG-3202 Computer Architecture and Organization
CSCE Fall 2012 Prof. Jennifer L. Welch.
Introduction to Microprocessor Programming
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Information Representation: Machine Instructions
Computer Architecture Assembly Language
Computer Operation 6/22/2019.
Presentation transcript:

Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Dale Roberts, Lecturer Information Representation: Machine Instructions Demo

Dale Roberts xComputer Applet xComputer applet – a java applet that simulates a simple model computer (which is also called xComputer). The model computer is discussed in Chapter 3 of The Most Complex Machine. The xComputer consists of a Central Processing Unit (CPU) and a main memory that holds 1024 sixteen-bit binary numbers. The CPU contains an Arithmetic-Logic Unit (ALU) for performing basic arithmetic and logical computations. It also contains eight registers, which hold binary numbers that are being used directly in the CPU's computations, a Control circuit, which is responsible for supervising the computations that the CPU performs, and a clock, which drives the whole operation of the computer by turning its single output wire on and off.

Dale Roberts xComputer Instructions xComputer uses 16 bits per instruction. 6 bits are dedicated to the opcode, leaving 10 bits for the operand. The type of information stored in the operand is dependent on the instruction being executed. A listing of xComputer opcodes can be found at The xComputer applet can be run from java-labs/labs/xComputerLab1.html. java-labs/labs/xComputerLab1.htmlhttp:// java-labs/labs/xComputerLab1.html xComputer uses 16 bits per instruction. 6 bits are dedicated to the opcode, leaving 10 bits for the operand. The type of information stored in the operand is dependent on the instruction being executed. A listing of xComputer opcodes can be found at The xComputer applet can be run from java-labs/labs/xComputerLab1.html. java-labs/labs/xComputerLab1.htmlhttp:// java-labs/labs/xComputerLab1.html

Dale Roberts Sample Opcodes CodeAssemblyNameExampleDescription ADDAdd-to-AC ADD 12 AC = AC + (12) SUBSubtract-from-AC SUB 12 AC = AC – (12) ANDLogical-AND-with-AC AND 12 Bitwise AND with (12) ORLogical-OR-with-AC OR 12 Bitwise OR with (12) NOTLogical-NOT-of-ACNOT Bitwise NOT of AC. Parm ignored SHLShift-AC-LeftSHL shift left 1 bit SHRShift-AC-RightSHR shift right 1 bit INCIncrement-ACINCAC DECDecrement-ACDECAC-- (12) refers to the contents of address 12

Dale Roberts Semantic Gap Machine languages: Native tongue of a particular kind of computer. Each instruction is a binary string. The code is used to indicate operations to be performed and the memory cells to be addressed. This form is the easiest form for computers to understand, but is the most difficult for a person to understand. Assembly languages: Again, specific to one type of computer. Uses descriptive names for operations and data, e.g. “LOAD value”, “ADD delta”, “Store value”. Assemblers translate this to machine language. Intermediate level. Somewhat descriptive, but basically follow the machine instructions. High-level languages: Write program instructions called statements that resemble a limited version of English. e.g. “value = value + delta”. Portable, meaning it can be used on different types of computers without modification. Compilers translate them to machine languages. Example are Fortran, Pascal, COBOL, C, C++, Basic, etc. Semantic gap between statements in a high-level language and machine/assembly language. Each high level statement may represent many hundreds of machine instructions. Compilers must bridge this gap. Complex machine instruction computer try to reduce this gap by implementing high-level language opcodes. This diminishes the semantic gap but makes the machine instructions more complex, and therefore makes the CPU circuitry more complex.

Dale Roberts Real-life Example: Pentium 4. The instruction set information for the Pentium 4 process can be found at ftp://download.intel.com/design/Pentium4/manuals/ pdf. ftp://download.intel.com/design/Pentium4/manuals/ pdf

Dale Roberts Pentium 4 ADD Description Adds the first operand (destination operand) and the second operand (source operand) and stores the result in the destination operand. The destination operand can be a register or a memory location; the source operand can be an immediate, a register, or a memory location. (However, two memory operands cannot be used in one instruction.) When an immediate value is used as an operand, it is sign-extended to the length of the destination operand format. The ADD instruction performs integer addition. It evaluates the result for both signed and unsigned integer operands and sets the OF and CF flags to indicate a carry (overflow) in the signed or unsigned result, respectively. The SF flag indicates the sign of the signed result. This instruction can be used with a LOCK prefix to allow the instruction to be executed atomically. Operation DEST ← DEST + SRC; So you can see that the instructions are a little more complicated in real life than in xComputer. But the same principles apply.

Dale Roberts Pentium 4 Add (cont)

Dale Roberts Acknowledgements Several graphics and terms were obtained from Jonathan Michael Auld Central Queensland University.Central Queensland University xComputer and its machine instructions were developed by David Eck.