From: From:

Slides:



Advertisements
Similar presentations
RAM (cont.) 220 bytes of RAM (1 Mega-byte) 20 bits of address Address
Advertisements

Machine cycle.
Stored Program Architecture
Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
IT253: Computer Organization Lecture 6: Assembly Language and MIPS: Programming Tonga Institute of Higher Education.
Lecture 1: Overview of Computers & Programming
The Analytical Engine Module 6 Program Translation.
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Stored Program Concept: The Hardware View
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed.
Concept of Computer Programming November 2, 2011.
CPU Fetch/Execute Cycle
CSC 142 A 1 CSC 142 Introduction to Java [Reading: chapter 0]
Computer Organization
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
How Java Programs Work MIS 3023 Business Programming Concepts II The University of Tulsa Professor: Akhilesh Bajaj All slides in this presentation ©Akhilesh.
4-1 Chapter 4 - The Instruction Set Architecture Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring.
Computer Platforms Week 4: Assembly Language & Operating Systems.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Information Representation: Machine Instructions
Computer Systems Organization CS 1428 Foundations of Computer Science.
What have mr aldred’s dirty clothes got to do with the cpu
Stack Stack Pointer A stack is a means of storing data that works on a ‘Last in first out’ (LIFO) basis. It reverses the order that data arrives and is.
ITEC 352 Lecture 12 ISA(3). Review Buses Memory ALU Registers Process of compiling.
OPERATING SYSTEMS Goals of the course Definitions of operating systems Operating system goals What is not an operating system Computer architecture O/S.
Microcode Source: Digital Computer Electronics (Malvino and Brown)
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
Chapter 8: The Very Simple Computer
The Central Processing Unit (CPU) and the Machine Cycle.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
C o n f i d e n t i a l 1 Course: BCA Semester: III Subject Code : BC 0042 Subject Name: Operating Systems Unit number : 1 Unit Title: Overview of Operating.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
CMSC 150 PROGRAM EXECUTION CS 150: Wed 1 Feb 2012.
Computer Structure & Architecture 7b - CPU & Buses.
Instructions. Portability In addition to making hardware backward compatible, we have also made software portable. In describing software, “portable”
Survey of Program Compilation and Execution Bangor High School Ali Shareef 2/28/06.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
1.4 Representation of data in computer systems Instructions.
Central Processing Unit Part I Bayram Güzer. Central Processing Unit Central processing unit is a control center that converts data input to information.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
CompSci Today’s topics Machine Architecture The basic machine Basic programming Assembler programming Upcoming Language Translation Reading Great.
Getting ready. Why C? Design Features – Efficiency (C programs tend to be compact and to run quickly.) – Portability (C programs written on one system.
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Operating Systems.
Chapter 3 Getting Started. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To give an overview of the structure of a contemporary.
1 What we want: execute High Level Language (HLL) programs What we have: computer hardware (a glorified calculator)
Lesson Objectives A note about notes: Aims
Computer Science I CSC 135.
CSCE Fall 2013 Prof. Jennifer L. Welch.
MARIE: An Introduction to a Simple Computer
CSCE Fall 2012 Prof. Jennifer L. Welch.
Instructions.
Function of Operating Systems
Algoritmos y Programacion
Presentation transcript:

From:

From:

From

From:

The CPU Memory Registers Register 0Register 1Register 2Register 3Instruction RegisterInstr. Pointer (IP) Arithmetic/Logic Unit Control Unit (State Machine) Memory Access

Fetch/Execute Cycle At each tick of the clock –Read the Instruction pointer –Go to that address in RAM (Memory) –Fetch the contents of that location to the instruction register –Execute the instruction stored in the instruction register This instruction may require using the A/LU to operate on information in registers This instruction may involve information from registers, RAM, disk, CD, … This instruction may change the address in the instruction pointer. It it doesn’t, the instruction pointer is increased by 1 when the execution is done.

Simple Code Copy the value in Memory Location XXX to Register 0 Move the value in Memory Location YYY to Register 1 Add the Values in Registers 0 and 1 and store the result in Register 2 Copy the Value in Register 2 to Memory Location ZZZ

Simple Code Copy the value in Memory Location XXX to Register 0 mv XXX R0 Copy the value in Memory Location YYY to Register 1 mv YYY R1 Add the Values in Registers 0 and 1 (result is put in the accumulator) add R0 R1 Copy the Value in the accumulator to Register 2 cop acc R2 Copy the Value in Register 2 to Memory Location ZZZ sto R2 ZZZ

Simple Code (the actual code) mv XXX R0 mv YYY R1 add R0 R1 cop acc R2 sto R2 ZZZ Mneumonic (assembler) Machine level

Coding in Algebraic Fashion A, B, and C are integers; want to add A to B and store the result as C. C = A + B

Enhancements A programming language that can only do arithmetic operations is limited –Need to be able to process text as well as numbers –Need to be able to structure data –Need to be able to make decisions IF (a certain condition) do something ELSE do something else;

A very simple program int fact, i, n ; fact = 1; i = 1; loop: i = i+1; if (i > n) go to end: fact = fact * i; go to loop; end: ….

Next steps A compiler is a program that translates a program into machine language. A compiled program is then loaded into machine memory and executed.

Next steps (Code) A compiler is a program that translates a program into machine language. The compiler enforces code. A compiler will only compile programs that have a structure valid in the defined language. A compiled program is then loaded into machine memory and executed. The machine architecture defines a code in which the machine language of the program must be written. The machine architecture also determines a code (via the hardware) that tells which machine languages instructions are done most efficiently.

Historical context Machine language – the 1950’s First compilers –Fortran (1957), Algol (1958, 1960) Another example of code Higher level languages – Pascal, C (early 70’s) The present Further examples of code –Toolkits and Programming Environments (Visual Studio.NET from Microsoft) –Secure languages (Java from Sun Microsystems)

Toolkits To build a large program, programming has to begin at a higher level –String processing –User interface toolkits –Debugging tools –Shared libraries

Toolkits as code To build a large program, programming has to begin at a higher level –String processing Font libraries define how things are displayed –User interface toolkits The Microsoft/Apple Interface defines interaction –File/Edit/… menus –(Cut,Copy,Paste, Undo) –Debugging tools –Shared libraries If I write a library that can do most of the things you need to make one aspect of your program work, you will be inclined to use it rather than writing it yourself. Open source issues arise here.