Computer Operations A computer is a programmable electronic device that can store, retrieve, and process data Data and instructions to manipulate the data.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Low-Level Programming Languages and Pseudocode
The 8051 Microcontroller and Embedded Systems
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Low-Level Programming Languages and Pseudocode Chapter 6.
Low-Level Programming Languages and Pseudocode Chapter 6.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Low-Level Programming Languages
Assembly Language Programming. CPU The CPU contains a Control Unit, Arithmetic Logic Unit (ALU) and a small number of memory locations called Registers.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Outline Chapter 1 Hardware, Software, Programming, Web surfing, … Chapter Goals –Describe the layers of a computer system –Describe the concept.
EET 2261 Unit 2 HCS12 Architecture
Computer Architecture
ECE 265 – LECTURE 9 PROGRAM DESIGN 8/12/ ECE265.
Assembly & Machine Languages
Chapter 1 An Overview of Computers and Programming Languages.
Low-Level Programming Languages and Pseudocode
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
CPS120: Introduction to Computer Science
Quiz # 2 Chapters 4, 5, & 6.
4-1 Chapter 4 - The Instruction Set Architecture Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring.
Instruction Set Architecture
GCSE Computing#BristolMet Session Objectives#11 MUST identify what program instructions consist of SHOULD describe how instructions are coded as bit patterns.
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Chapter 4 MARIE: An Introduction to a Simple Computer.
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapter 7 Low-Level Programming Languages. 2 Features in Pep/7 Figure 7.1 Pep/7’s architecture.
Chapter 7 Low-Level Programming Languages (slides modified by Erin Chambers)
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
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.
Chapter 7 Low-Level Programming Languages Nell Dale John Lewis.
Logic Design / Processor and Control Units Tony Diep.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
8086/8088 Instruction Set, Machine Codes and Addressing Modes.
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.
Department of Electronic & Electrical Engineering Lecture 2. PIC16F84A Architecture / Instructions Memory. Program/Data (Harvard) File Registers (Data).
Computer Organization Instructions Language of The Computer (MIPS) 2.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 1 An Overview of Computers and Programming Languages.
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.
Hello world !!! ASCII representation of hello.c.
Operating Systems A Biswas, Dept. of Information Technology.
CPS4200 System Programming Spring 1 Systems Programming Chapter 1 Background I.
Chapter 7: Low-Level Programming Languages Chapter 7 Low-Level Programming Languages Page 66 In order to execute instructions on a CPU, those instructions.
Low-Level Programming Languages, Pseudocode and Testing Chapter 6.
Writing an Assembly-language program MIPS assembly language using MARS: MIPS Assembler and Runtime Simulator CS-2710 Dr. Mark L. Hornick 1.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
THE sic mACHINE CSCI/CMPE 3334 David Egle.
Introduction to Assembly Language
Mobile Development Workshop
Topics Introduction Hardware and Software How Computers Store Data
Low Level Programming Languages
MARIE: An Introduction to a Simple Computer
MARIE: An Introduction to a Simple Computer
Chapter 4: Representing instructions
CPU has 6 special locations called registers
Introduction to Computer Systems
Chapter 4: Computer Architecture
ICT Programming Lesson 1:
Dr. Clincy Professor of CS
Presentation transcript:

Computer Operations A computer is a programmable electronic device that can store, retrieve, and process data Data and instructions to manipulate the data are logically the same and can be stored in the same place Store, retrieve, and process are actions that the computer can perform on data

Machine Language Machine language The instructions built into the hardware of a particular computer Initially, humans had no choice but to write programs in machine language because other programming languages had not yet been invented

Machine Language Every processor type has its own set of specific machine instructions The relationship between the processor and the instructions it can carry out is completely integrated Each machine-language instruction does only one very low-level task

Pep/7: A Virtual Computer Virtual computer A hypothetical machine designed to contain the important features of real computers that we want to illustrate Pep/7 designed by Stanley Warford has 32 machine-language instructions We are only going to examine a few of these instructions

Features in Pep/7 The memory unit is made up of 4,096 bytes Pep/7 Registers/Status Bits Covered The program counter (PC) (contains the address of the next instruction to be executed) The instruction register (IR) (contains a copy of the instruction being executed) The accumulator (A register) Status bit N (1 if A register is negative; 0 otherwise) Status bit Z (1 if the A register is 0; and 0 otherwise)

Features in Pep/7 Figure 7.1 Pep/7’s architecture

Instruction Format There are two parts to an instruction The 8-bit instruction specifier And optionally, the 16-bit operand specifier Figure 7.2 The Pep/7 instruction format

Instruction Format The instruction specifier is made up of several sections The operation code The register specifier The addressing-mode specifier

Instruction Format The operation code specifies which instruction is to be carried out The 1-bit register specifier is 0 if register A (the accumulator) is involved, which is the case in this chapter. The 2-bit addressing-mode specifier says how to interpret the operand part of the instruction

Instruction Format Figure 7.3 Difference between immediate-mode and direct-mode addressing

Some Sample Instructions Figure 7.3 Subset of Pep/7 instructions

A Program Example Let’s write "Hello" on the screen Page 200

Pep/7 Simulator A program that behaves just like the Pep/7 virtual machine behaves To run a program, we enter the hexadecimal code, byte by byte with blanks between each Page 202

Assembly Language Assembly languages A language that uses mnemonic codes to represent machine-language instructions The programmer uses these alphanumeric codes in place of binary digits A program called an assembler reads each of the instructions in mnemonic form and translates it into the machine-language equivalent

Pep/7 Assembly Language

Figure 7.5 Assembly Process

A New Program Page 213

Our Completed Program Page 214 7-22

Status Bits Status bits allow a program to make a choice. BRLT Set the PC to the operand, if N is 1 (A register is less than zero) BREQ Set the PC to operand, if Z is 1 (A register is equal to zero)

Testing Test plan A document that specifies how many times and with what data the program must be run in order to thoroughly test the program A code-coverage approach designs test cases to ensure that each statement in the program is executed. A data-coverage approach designs test cases to ensure that the limits of the allowable data are covered.

Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of abstraction and the determination of concrete algorithm steps Describe the important features of the Pep/7 virtual machine Distinguish between immediate mode addressing and direct addressing

Chapter Goals Convert a simple algorithm into a machine-language program Distinguish between machine language and assembly language Describe the steps in creating and running an assembly-language program Convert a simple algorithm into an assembly-language program

Chapter Goals Distinguish between instructions to the assembler and instructions to be translated Describe two approaches to testing Design and implement a test plan for a simple assembly-language program