Computers in Engineering COMP 208. Computer Structure. Computer Architecture. Computer Structure Michael A. Hawker

Similar documents
CHAPTER 1 Introduction to Computers and Java

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

Programming 1 - Honors

Introduction to Java Programming

A Review of Chapter 5 and. CSc 2010 Spring 2012 Instructor: Qian Hu

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

COMP163. Introduction to Computer Programming. Introduction and Overview of the Hardware

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Chapter 1: The General Purpose Machine

Chapter 1: General Purpose Machine

Computer Basics 1/24/13. Computer Organization. Computer systems consist of hardware and software.

Computer Organization and Levels of Abstraction

Why Study Assembly Language?

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

Chapter 5: Computer Systems Organization

Chapter 5: Computer Systems Organization. Invitation to Computer Science, C++ Version, Third Edition

Computer Basics 1/6/16. Computer Organization. Computer systems consist of hardware and software.

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what

Software Development. Integrated Software Environment

Von Neumann architecture. The first computers used a single fixed program (like a numeric calculator).

Data Manipulation. Chih-Wei Tang ( 唐之瑋 ) Department of Communication Engineering National Central University JhongLi, Taiwan

Level 2: The Hardware World Chapters 4 and 5 (topics of other cs courses)

Administration Computers Software Algorithms Programming Languages

Computer Organization and Assembly Language. Lab Session 01

Chapter 1: Why Program? Computers and Programming. Why Program?

CPE300: Digital System Architecture and Design

Assembly Language: Overview!

Supplementary Test 1

COSC 122 Computer Fluency. Computer Organization. Dr. Ramon Lawrence University of British Columbia Okanagan

CSI31 Introduction to Computer Programming I. Dr. Sharon Persinger Fall

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018

C++ Programming Language Lecture 1 Introduction

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 11 Instruction Sets: Addressing Modes and Formats

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

Principles of Programming Languages. Lecture Outline

What is a programming language?

1) How many gigabytes make a terabyte? A) 10 B) 100 C) 1000 D) 1024 E) 512

Chapter 1 Introduction to Computers, Programs, and Java

COMP3221: Microprocessors and. and Embedded Systems. Instruction Set Architecture (ISA) What makes an ISA? #1: Memory Models. What makes an ISA?

C H A P T E R 1. Introduction to Computers and Programming

Computer Fundamentals

9/11/08 (c) 2008 Matthew J. Rutherford Class (c) 2008 Matthew J. Rutherford Class

0 Introduction: Computer systems and program development

Basic Concepts COE 205. Computer Organization and Assembly Language Dr. Aiman El-Maleh

Chapter 1: Introduction to Computers and Programming

II Esercitazione: S.O. & Fortran 90

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Computer Architecture 2/26/01 Lecture #

Java and Software Design

CS Prof J.P.Morrison

Introduction. Arizona State University 1

Introduction to MiniSim A Simple von Neumann Machine

A Bit of History. Program Mem Data Memory. CPU (Central Processing Unit) I/O (Input/Output) Von Neumann Architecture. CPU (Central Processing Unit)

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

Programming 1. Lecture 1 COP 3014 Fall August 28, 2018

Introduction. CS 2210 Compiler Design Wonsun Ahn

Computer Architecture and Assembly Language. Spring

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

Computer is an electronic machine that can receive, store, transform and output data of all kinds (image, text, numeric, graphics and sound).

Computer Organization and Levels of Abstraction

Why study Programming Language Concepts? Chapter One. Language Evaluation Criteria. Programming Domains. Readability Writability Reliability Cost

Computer Organization

Welcome to Computer Organization and Design Logic

Von Neumann Architecture

Engineering Problem Solving with C++, Etter/Ingber

Introduction to Computer Systems and Operating Systems

CIT 668: System Architecture

History of Compilers The term

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

Chapter 1. Preview. Reason for Studying OPL. Language Evaluation Criteria. Programming Domains

Compilers and Interpreters

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

COS 140: Foundations of Computer Science

Machine Architecture and Number Systems

CS 241 Computer Programming. Introduction. Teacher Assistant. Hadeel Al-Ateeq

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

8/16/12. Computer Organization. Architecture. Computer Organization. Computer Basics

Chapter 1. Hardware. Introduction to Computers and Programming. Chapter 1.2

Introduction. Computers, algorithms

Behind the Curtain. Introduce TA Friday 1 st lab! (1:30-3:30) (Do Prelab before) 1 st Problem set on Thurs. Comp 411 Fall /16/13

Computer System: An Overview

Crafting a Compiler with C (II) Compiler V. S. Interpreter

Compilation I. Hwansoo Han

W1005 Intro to CS and Programming in MATLAB. Brief History of Compu?ng. Fall 2014 Instructor: Ilia Vovsha. hip://

The Programming Process Summer 2010 Margaret Reid-Miller

Computer Technology & Abstraction

Assembly Language: Overview

Machine Architecture. or what s in the box? Lectures 2 & 3. Prof Leslie Smith. ITNP23 - Autumn 2014 Lectures 2&3, Slide 1

Why learn Computer Programming? Computer-based problem solving in Science and Engineering. Why learn Fortran? Elementary Computer Organization

Computing and compilers

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

Chapter 9. Introduction to High-Level Language Programming. INVITATION TO Computer Science

Computers in Engineering COMP 208. A Brief History. Mechanical Calculators. A Historic Perspective Michael A. Hawker

Computers in Engineering COMP 208

Problem Solving and Program Design - Chapter 1. Cory L. Strope

Transcription:

Computers in Engineering COMP 208 Computer Structure Michael A. Hawker Computer Structure We will briefly look at the structure of a modern computer That will help us understand some of the concepts that occur in Fortran and C Sept 6th, 2007 Computer Structure 2/27 Computer Architecture At the lowest level a computer is just a collection of switches that can be on or off (representing 1 and 0). The circuitry is organized into components that serve different functions such as decoding bit sequences, carrying out simple arithmetic operations, etc. Sept 6th, 2007 Computer Structure 3/27 1

Von Neumann Machines Modern computers are called Von Neumann Machines John Von Neumann is credited with the idea that programs can be encoded and stored in the memory just like data A control unit transfers instructions from the memory into registers so that a processing unit can execute them Sept 6th, 2007 Computer Structure 4/27 The 5 Classic Components Computer CPU Memory Control Registers Input Devices Output Devices Sept 6th, 2007 Computer Structure 5/27 The Intel Pentium Processor Schematic Layout Branch Control Data cache Instruction cache Bus Integer datapath Floatingpoint datapath Sept 6th, 2007 Computer Structure 6/27 2

The Von Neumann Model Programs and data are both stored in the main memory of the machine There is one CPU (Central Processing Unit) The CPU has a control unit that fetches program instructions from memory, decodes them and executes them Sept 6th, 2007 Computer Structure 7/27 The Von Neumann Model Data is loaded from memory into registers in the CPU The CPU contains circuitry to perform basic arithmetic operations and to compare values, placing the results into registers The values in the registers can be stored in main memory Sept 6th, 2007 Computer Structure 8/27 Input / Ouput Keyboard Printer Input Output PDA Digitizing pad Mouse Scanner PDA Sept 6th, 2007 Computer Structure 9/27 3

The Von Neumann Model Input devices (keyboard, pda, cell phone,...) allow us to place data (and programs) into memory Output devices allow us to display values stored in memory (on screen, pda, cell phone,...) Sept 6th, 2007 Computer Structure 10/27 Low Level Programming Programmers in the late 1940 s had to use binary numbers to encode the instructions and the data This was very time consuming and error prone so written mnemonic codes were created. Programs were written using these codes and then translated into binary by hand Soon programs were written to convert the coded symbols to binary and called assemblers The instruction names were called assembly language Sept 6th, 2007 Computer Structure 11/27 Assembly Language Low level language Simple instructions of the form op result, arg1, arg2 Machine dependent each processor has its own assembler Sept 6th, 2007 Computer Structure 12/27 4

Assembler Example We may want to evaluate the expression f = (g + h) (i + j) Assembly program (where all the names refer to registers) add t0, g, h add t1, i, j sub f, t0, t1 Load and Store instructions are part of the assembly language and allow transferring data values between memory and registers Sept 6th, 2007 Computer Structure 13/27 High Level Languages Programming in assembly language is still difficult and tedious Programs are very rigid and tied to specific machines High level languages provide a more natural mathematically based formalism for expressing algorithms Sept 6th, 2007 Computer Structure 14/27 High Level Languages Hide details of memory allocation Allow expressing complex operations together, not just one step at a time Provide a more natural way of programming Allow programs to be ported from one machine to another Sept 6th, 2007 Computer Structure 15/27 5

High Level Languages These languages make it easier to write programs but they are still very formal, precisely structure languages that follow very specific syntax rules In addition to learning how to formulate algorithms for the computer, we will have to learn the rules for these languages Sept 6th, 2007 Computer Structure 16/27 How Does This Work Programs written in a high level language are translated into assembly/machine level programs A program called a does this translation This program is stored in memory by a loader We can then execute the program Sept 6th, 2007 Computer Structure 17/27 The Translation Process Sept 6th, 2007 Computer Structure 18/27 6

Source Program A program written in a high level language (FORTRAN, C, C++, Ada) Created with a text editor in human readable form File name extension often says what language is used (a1.f90, a4.c, test.java) Sept 6th, 2007 Computer Structure 19/27 The Translation Process Sept 6th, 2007 Computer Structure 20/27 Compiler A program that analyses the source program and translates it into a form the computer can understand Result is not readable by humans Each high level language requires its own Sept 6th, 2007 Computer Structure 21/27 7

The Translation Process Sept 6th, 2007 Computer Structure 22/27 The Translation Process Sept 6th, 2007 Computer Structure 23/27 Linker/Loader The Linker combines the assembler code with other programs that were compiled another time or are standard programs available in libraries (sin, sqrt, etc) The Loader puts the complete program in memory and begins execution with the first instruction Sept 6th, 2007 Computer Structure 24/27 8

The Translation Process Sept 6th, 2007 Computer Structure 25/27 Native Code The final program built for the specific platform it was compiled on Will only work on the same type of machine (i.e. Windows, Mac, Linux, etc ) Not Portable Sept 6th, 2007 Computer Structure 26/27 JIT Just-in-time Compiler Some High Level Languages like Java or Python use a Just-in-time This allows code to be portable to different platforms It dynamically at runtime translates a program to the native machine code Usually the language will compile down to an intermediary bytecode as well. Sept 6th, 2007 Computer Structure 27/27 9