Chapter 2.2 Machine Language.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Chapter 2 Data Manipulation Dr. Farzana Rahman Assistant Professor Department of Computer Science James Madison University 1 Some sldes are adapted from.
 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.
Computer Architecture and Data Manipulation Chapter 3.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Computer Science: An Overview Tenth Edition by J. Glenn Brookshear Chapter.
Computer Systems. Computer System Components Computer Networks.
Computer Organization Boolean Logic and the CPU i206 Fall 2010 John Chuang Some slides adapted from Marti Hearst, Brian Hayes, or Glenn Brookshear.
Processor Technology and Architecture
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
Data Manipulation Computer System consists of the following parts:
Memory - Registers Instruction Sets
Computer Processing CSCE 110 J. Michael Moore.
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
1 Sec (2.3) Program Execution. 2 In the CPU we have CU and ALU, in CU there are two special purpose registers: 1. Instruction Register 2. Program Counter.
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.
Instruction Set Architecture
Data Manipulation, Communication and Architecture Fall 2012.
Data manipulation, Part one Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
Ch. 2 Data Manipulation 4 The central processing unit. 4 The stored-program concept. 4 Program execution. 4 Other architectures. 4 Arithmetic/logic instructions.
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.
Chapter 2 Data Manipulation Yonsei University 1 st Semester, 2015 Sanghyun Park.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 2 Data Manipulation. © 2005 Pearson Addison-Wesley. All rights reserved 2-2 Chapter 2: Data Manipulation 2.1 Computer Architecture 2.2 Machine.
Data Manipulation CSC Overview  Computer Architecture  Machine Language  Computer Architecture  Machine Language.
Copyright © 2015 Pearson Education, Inc. Chapter 2: Data Manipulation.
Lecture 7: 9/17/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
MIPS Processor Chapter 12 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
COMPUTER SCIENCE Data Representation and Machine Concepts Section 2.2 Instructor: Lin Chen Sept 2013.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Data Manipulation Brookshear, J.G. (2012) Computer Science: an Overview.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Dale & Lewis Chapter 5 Computing components
Data Manipulation, part two Introduction to computer, 2 nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
Register Transfer Languages (RTL)
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 2: Data Manipulation
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
27 October 2015 Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
F453 Module 8: Low Level Languages 8.1: Use of Computer Architecture.
© 2015 Pearson Education Limited 2015 Quiz in last 15 minutes Midterm 1 is next Sunday Assignment 1 due today at 4pm Assignment 2 will be up today; due.
Immediate Addressing Mode
Chapter 2: Data Manipulation
Chapter 2: Data Manipulation
5 - How Computers Calculate - the ALU
The fetch-execute cycle
CS149D Elements of Computer Science
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Chapter 2: Data Manipulation
Chapter 2: Data Manipulation
Machine Language.
Program Execution.
October 29 Review for 2nd Exam Ask Questions! 4/26/2019
Information Representation: Machine Instructions
Chapter 2: Data Manipulation
CS 111 – Sept. 16 Machine language examples Instruction execution
Sec (2.3) Program Execution.
Presentation transcript:

Chapter 2.2 Machine Language

Machine Language To apply the stored-program concept, CPUs are designed to recognize instructions encoded as bit patterns. This collection of instructions along with the encoding system is called the machine language. An instruction expressed in this language is called a machine-level instruction or a machine instruction.

Machine language: definitions Machine instruction = an instruction coded as a bit pattern directly recognizable by the CPU Machine language = the set of all instructions recognized by a machine

Machine language philosophies Two philosophies of CPU architectures: Reduced Instruction Set Computing (RISC) Few, simple, efficient, and fast instructions Example: PowerPC from Apple/IBM/Motorola Complex Instruction Set Computing (CISC) Many, convenient, and powerful instructions Example: Pentium from Intel

Machine instruction types When discussing the instructions in a machine’s repertoire, it is helpful to recognize that they can be classified into three categories: Data Transfer group Arithmetic/Logic group Control group

Machine instruction types Data Transfer: copy data between CPU and main memory Arithmetic/Logic: use existing data values to compute a new data value Control: direct the execution of the program

Figure 2.2 Adding values stored in memory

Data Transfer part

Data Transfer Part A request to fill a general-purpose register with the contents of a memory cell is commonly referred to as a LOAD instruction A request to transfer the contents of a register to a memory cell is called a STORE instruction.

Data Transfer part LOAD STORE

ARITHMETIC / LOGIC GROUP It consists of the instructions that tells the control unit to request an activity within the arithmetic / logic unit.

It includes: Basic arithmetic operations Boolean operations AND OR XOR Shift or Rotate operations They are available within most arithmetic / logic units They allow the contents of registers to be moved to the right or the left within the register. Examples:

Control Group The control group consists of those instructions that direct the execution of the program rather than the manipulation of data.

Figure 2.2 Adding values stored in memory

Control group Step five in Fig 2.2 falls into this category.

Control This group contains many other instructions, such as the family of JUMP instructions used to direct the control unit to execute an instruction other than the next one in the list. Example : Fig 2.3 on page 85

Figure 2.3 Dividing values stored in memory

An Illustrative Machine Language Let us now consider how the instructions of a typical computer are encoded. The machine that we will use for our discussion is described in Appendix C and summarized in Fig 2.4. It has 16 general-purpose registers and 256 main memory cells. Each of the memory cells has a capacity of eight bits.

Figure 2.4: The architecture of the machine described in Appendix C

Parts of a machine instruction Op-code: specifies which machine operation to execute One per instruction Operand: more detailed information about this operation Number of operands varies depending on op-code

Figure 2.5 The composition of an instruction for the machine in Appendix C

Figure 2.6 Decoding the instruction 35A7

Figure 2.7 An encoded version of the instructions in Figure 2.2

Figure 2.2 Adding values stored in memory

Chapter 2.3 Program Execution

Program execution A computer follows a program stored in its memory by copying the instructions from memory into the control unit as needed.

Program execution Controlled by two special-purpose registers Program counter: address of next instruction Instruction register: current instruction

Program execution Steps performed by control unit Fetch Decode Execute

Machine cycle. The control unit performs its job by continually repeating an algorithm that guides it through a three-step process known as the machine cycle.

Figure 2.8 The machine cycle

Figure 2.9 Decoding the instruction B258

Figure 2. 10 The program from Figure 2 Figure 2.10 The program from Figure 2.7 stored in main memory ready for execution

Figure 2.11 Performing the fetch step of the machine cycle

Figure 2.11 Performing the fetch step of the machine cycle (cont’d)