Georgia Institute of Technology Speed part 1 Barb Ericson Georgia Institute of Technology May 2006.

Slides:



Advertisements
Similar presentations
Announcements You survived midterm 2! No Class / No Office hours Friday.
Advertisements

Speed CS A109. Big speed differences Many of the techniques we’ve learned take no time at all in other applications Select a figure in Word. –It’s automatically.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Lecture 1: Overview of Computers & Programming
1 Microprocessor History. 2 The date is the year that the processor was first introduced. Many processors are re- introduced at higher clock speeds for.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Introduction to Computer Systems
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
1 Lab Session-IV CSIT-120 Spring 2001 Lab 3 Revision and Exercises Rev: Precedence Rules Lab Exercise 4-A Machine Language Programming The “Micro” Machine.
Stored Program Concept: The Hardware View
Introduction to Computer Programming CSC 1401: Introduction to Programming with Java Lecture 2 Wanda M. Kunkle.
Chapter 1-C,D Computers and Digital Basics.
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Computer Systems CS208. Major Components of a Computer System Processor (CPU) Runs program instructions Main Memory Storage for running programs and current.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#1) By Dr. Syed Noman.
Assembly & Machine Languages
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
CS102 Introduction to Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2.
How Computers Work. A computer is a machine f or the storage and processing of information. Computers consist of hardware (what you can touch) and software.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Georgia Institute of Technology Student Computer Simulation Barbara Ericson Georgia Tech Sept 2005.
Topics Introduction Hardware and Software How Computers Store Data
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 1 Introduction to Computer Science.
Georgia Institute of Technology Introduction to Programming Part 2 Barb Ericson Georgia Institute of Technology May 2006.
XP Practical PC, 3e Chapter 16 1 Looking “Under the Hood”
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
The Study of Computer Science Chapter 0 Intro to Computer Science CS1510.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Computer Systems Organization CS 1428 Foundations of Computer Science.
What have mr aldred’s dirty clothes got to do with the cpu
Introduction to Computer Systems and the Java Programming Language.
CS 147 June 13, 2001 Levels of Programming Languages Svetlana Velyutina.
IT253: Computer Organization
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
Survey of Program Compilation and Execution Bangor High School Ali Shareef 2/28/06.
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.
Georgia Institute of Technology Speed part 4 Barb Ericson Georgia Institute of Technology May 2006.
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,
Lecture on Central Process Unit (CPU)
Georgia Institute of Technology Introduction to Programming Part 1 Barb Ericson Georgia Institute of Technology Aug 2005.
Computer Hardware & Processing Inside the Box CSC September 16, 2010.
Operating Systems A Biswas, Dept. of Information Technology.
Information Technology (IT). Information Technology – technology used to create, store, exchange, and use information in its various forms (business data,
Computer Basics.
The Study of Computer Science Chapter 0
Component 1.6.
Topics Introduction Hardware and Software How Computers Store Data
The Study of Computer Science Chapter 0
The Study of Computer Science
Computers: Hardware and Software
Introduction to Java, and DrJava part 1
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Programming Part 2
The Study of Computer Science
Introduction to Java, and DrJava
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Computers, Programs, and Programming Languages
Introduction to Java, and DrJava
Introduction to Java, and DrJava part 1
The Study of Computer Science Chapter 0
Presentation transcript:

Georgia Institute of Technology Speed part 1 Barb Ericson Georgia Institute of Technology May 2006

Georgia Institute of Technology Learning Goals Computing Concepts –An introduction to machine language –The difference between interpreted and compiled languages –To understand the categories of algorithms Included ones that can't be written –To make decisions about computer storage when optimizing for speed

Georgia Institute of Technology Questions Why is it faster to do image manipulations in Photoshop than in our Java programs? How fast can we get our programs to go? –Are there ways to make them faster? –Are there programs that can't be written? Does it always take this long to write programs? –Are there easier ways to do it? What does another programming language look like?

Georgia Institute of Technology What Computers Understand Computers don't really understand Java, C, Visual Basic, or any other high-level language –They understand a low-level language called machine language –Machine language is an assignment of computer operations to byte values So it looks like a series of numbers That stand for addition, subtraction, division, multiplication, storing, loading, and jumping

Georgia Institute of Technology Understanding Machine Language The computer doesn’t really understand machine language. The computer is just a machine, with lots of switches that make data flow this way or that way. Machine language is just a bunch of switch settings that cause the computer to do a bunch of other switch settings. We interpret a pattern of switches to be commands for addition, subtraction, loading, and storing. –In the end, it’s all about encoding. A byte of switches

Georgia Institute of Technology Assembler and Machine Language Machine language looks just like a bunch of numbers. Assembler language is a set of words that corresponds to the machine language. –It’s a one-to-one relationship. –A word of assembler equals one machine language instruction, typically. (Often, just a single byte.)

Georgia Institute of Technology There are Different Machine Languages Apple computers used CPU (processor) chips called G3 or G4. Computers running Microsoft Windows use Pentium processors. There are other processors called Alpha, LSI-11, and on and on. Each processor understands only its own machine language

Georgia Institute of Technology Assembler instructions Assembler instructions tell the computer to do things like: –Store numbers into particular memory locations or into special locations (registers) in the computer –Test numbers for equality, greater-than, or less-than –Add numbers together, or subtract them –Jump to another program instruction

Georgia Institute of Technology An Example Assembly Language Program LOAD #10,R0; Load register R0 with 10 LOAD #12,R1; Load register R1 with 12 SUM R0,R1; Add registers R0 and R1 STOR R1,#45; Store the result into memory You can picture memory as a long series of post office boxes in a mailroom. Each one has a number (like #45).

Georgia Institute of Technology Assembler -> Machine LOAD 10,R0; Load register R0 with 10 LOAD 12,R1; Load register R1 with 12 SUM R0,R1; Add register R0 and R1 STOR R1,#45; Store the result into ; memory location #45 Might appear in memory as just 12 bytes:

Georgia Institute of Technology Another Example LOAD R1,#65536; Get a character from keyboard TEST R1,#13; Is it an ASCII 13 (Enter)? JUMPTRUE #32768; If true, go to another part of the program CALL #16384; If false, call func. to process the new line Machine Language:

Georgia Institute of Technology Devices are also just memory A computer can interact with external devices –displays, microphones, and speakers The easiest way to understand it (and is often the actual way it’s implemented) is to think about external devices as corresponding to a memory location. –Store a 255 into location 65,542, and suddenly the red component of the pixel at 101,345 on your screen is set to maximum intensity. So simple loads and stores handle multimedia, too.

Georgia Institute of Technology Machine language is executed very quickly A mid-range laptop has a clock rate of 1.5 Gigahertz. What that means exactly is hard to explain, but let’s interpret it as processing 1.5 billion bytes per second. Those 12 bytes would execute inside the computer, then, in 12/1,500,000,000 th of a second!

Georgia Institute of Technology Applications are typically compiled Applications like Adobe Photoshop and Microsoft Word are compiled. –This means that they execute in the computer as pure machine language. –They execute at that level speed. However, Python and Java are interpreted. –They execute at a slower speed. –Why? It’s the difference between translating instructions and directly executing instructions.

Georgia Institute of Technology Exercise Read about assembly languages at Read about the history of assembly languages at ohn_Backus.htm ohn_Backus.htm Read about Admiral Grace Hopper at story.html story.html –What did she do to make programming easier?

Georgia Institute of Technology Summary Computers really only understand machine language –Assembler maps to machine language –Each processor type has its own machine language –In assembler you can load a register from a memory address, store a register value into a memory address, jump to another instruction, compare values in registers –Some languages are compiled into machine language And thus run quickly –Some languages are interpreted Have an extra step before they can run