 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform: 0001 0011 0011 1011 1101 0111.

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.
Computer Architecture and Data Manipulation Chapter 3.
Snick  snack A Working Computer Slides based on work by Bob Woodham and others.
CSE115: Introduction to Computer Science I
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
TK 2633 Microprocessor & Interfacing
1 Foundations of Software Design Lecture 3: How Computers Work Marti Hearst Fall 2002.
Low-Level Programming Languages
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Memory - Registers Instruction Sets
Computer Processing CSCE 110 J. Michael Moore.
Stored Program Concept: The Hardware View
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Computer Structure.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
A-Level Computing#BristolMet Session Objectives#5 MUST identify different buses and registers used in a CPU SHOULD describe the use of buses to send information.
The CPU The Central Presentation Unit Main Memory and Addresses Address bus and Address Space Data Bus Control Bus The Instructions set Mnemonics Opcodes.
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
Instruction Set Architecture
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
1 Programming in Machine Language SCSC 311 Spring 2011.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Data manipulation, Part one Introduction to computer, 2nd semester, 2010/2011 Mr.Nael Aburas Faculty of Information.
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
Implementation of a Stored Program Computer ITCS 3181 Logic and Computer Systems 2014 B. Wilkinson Slides2.ppt Modification date: Oct 16,
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
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.
Computer Operations A computer is a programmable electronic device that can store, retrieve, and process data Data and instructions to manipulate the data.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
1 i206: Lecture 4: The CPU, Instruction Sets, and How Computers Work Marti Hearst Spring 2012.
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.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall
System Unit Working of CPU. The CPU CPU The CPU CPU stands for central processing unit. it is brain of computer It is most important component of the.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
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.
An Adder A Subtractor. A and B are the inputs of the adder/ subtractor R is the output of the adder/ subtractor F is the control to tell it to add or.
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Microprocessor Fundamentals Week 2 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations.
Computer Basics.
Programming in Machine Language
Computer Architecture
The Processor and Machine Language
CSCE Fall 2013 Prof. Jennifer L. Welch.
MIPS Processor.
CSCE 121: Simple Computer Model Spring 2015
MARIE: An Introduction to a Simple Computer
MARIE: An Introduction to a Simple Computer
CSCE Fall 2012 Prof. Jennifer L. Welch.
Introduction to Microprocessor Programming
Black Boxes and Abstraction or A quick run through how computers work
ECE 352 Digital System Fundamentals
Computer Systems An Introducton.
Algoritmos y Programacion
Presentation transcript:

 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:  Because these are the only instructions a computer actually can understand and perform, at some point every program a computer runs must be converted to machine instructions.

 Opcode (first few bits), say what general task is to be done - something like “store a number” or “add two numbers”.  Operands (the rest of the instruction) the extra information needed to understand the instruction - things like where to store the number or which two numbers to add.

 The figure below shows how an imaginary computer might interpret an instruction. The first 4 bits are the opcode - in this case we are assuming 0001 means “add two values”. The next 6 bits specify the memory address of the first number we are adding and the last 6 bits specify the memory address of the second number.  How a computer might interpret the instruction

 Computers usually support only a small number of machine code instructions; a few dozen to a few hundred very simple instructions like “add two numbers” or “store a value to memory”.  The list of available instruction and the format for specifying them make up a machine language.

 a human readable direct translation of machine language  instead of writing “ ” to say “store the current value to memory location 13” in machine language, in assembly you could write something like “STORE 13”.

Although assembly is much easier to read than machine code, you probably noticed that it is still very low level. A job as simple as “add 2 and 5” took many instructions to express. For this reason, most programmers do not work in assembly most of the time.

 invented to abstract away the details of machine code and help programmers to concentrate on problem solving  C++, Java or Python (FORTRAN one of first)  Programs written in a high level languages must be converted into machine code to run.  This is either done ahead of time by converting a whole program to machine code with a compiler program (compiling the code), or line by line as the program runs by an interpreter

 add two values that are stored in the main memory and place the sum back in the main memory.  Suppose 02 and 08 are the values of the bytes stored in the main memory cells with addresses F0 and F1

 English words to describe instructions 1. Load the value of the memory cell with address F0 into register Load the value of the memory cell with address F1 into register Add the values in register 0 and register 1 and place the result in register Store the value of register 2 into the memory cell with address F2. 5. Halt execution

1 RXY LOAD bit pattern found in memory cell XY into register R. 2 RXY LOAD the bit pattern XY into register with address R. 3 RXY STORE the bit pattern found in the register R in memory cell XY. 4 0RS MOVE (copy) bit pattern from register R to register S. 5 RST ADD integers in registers S and T (two’s complement form) and place result in register R. 6 RST ADD floating-point numbers in registers S and T and place result in register R. 7 RST Combine bit pattern in register S and register T using the OR operator and place result in register R. 8 RST Combine bit pattern in register S and register T using the AND operator and place result in register R. 9 RST Combine bit pattern in register S and register T using the EXCLUSIVE OR operator and place result in register R. A R0X ROTATE bit pattern in register R to the right X times. B RXY JUMP to instruction located in memory cell XY IF the bit pattern in register R is EQUAL to bit pattern in register 0; otherwise continue to next instruction. C 000 HALT the program’s execution. D RXY JUMP to instruction XY IF the bit pattern in register R is LESS THAN ZERO; otherwise continue to next instruction. E 0RS NOT—negate each bit in pattern found in register S and put resulting bit pattern in register R.

1. Load the value of the memory cell with address F0 into register 0. (10F0) 2. Load the value of the memory cell with address F1 into register 1. (11F1) 3. Add the values in register 0 and register 1 and place the result in register 2. (5201) 4. Store the value of register 2 into the memory cell with address F2. (32F2) 5. Halt Execution (C000) 10F0 11F F2 C000

10F0 11F F2 C000

10F0 11F F2 C000 Load the value of the memory cell with address F0 into register 0.

10F0 11F F2 C000 Load the value of the memory cell with address F1 into register 1.

10F0 11F F2 C000 Add the values in register 0 and register 1 and place the result in register 2.

10F0 11F F2 C000 Store the value of register 2 into the memory cell with address F2.

10F0 11F F2 C000 Halt execution

 General Purpose Registers: these components are general use memory storage in the CPU that can be accessed very fast (as compared to RAM); they are created from combining latches with a decoder. The latches create circuitry that can remember while the decoder creates a way for individual memory locations to be selected.  Special Purpose Registers: these components are dedicated memory storage in the CPU that can be accessed very fast. Three SP registers are shown: the Instruction Register (IR), the Program Counter (PC), and the Accumulator.  Buses: these components are the information highway for the CPU. Buses are bundles of tiny wires that carry data between components. The three most important buses are the address, the data, and the control buses.  ALU: this component is the number cruncher of the CPU. The Arithmetic / Logic Unit performs all the mathematical calculations of the CPU. It is composed of complex circuitry similar to the adder presented in the previous lesson. The ALU, however, can add, subtract, multiply, divide, and perform a host of other calculations on binary numbers.  Control Unit: this component is responsible for directing the flow of instructions and data within the CPU. The Control Unit is actually built of many other selection circuits such as decoders and multiplexors. In the diagram above, the Decoder and the Multiplexor compose the Control Unit.