1 Machine architecture Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Chapter 2.

Slides:



Advertisements
Similar presentations
The Fetch – Execute Cycle
Advertisements

Chapt.2 Machine Architecture Impact of languages –Support – faster, more secure Primitive Operations –e.g. nested subroutine calls »Subroutines implemented.
Machine cycle.
Central Processing Unit
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Basic Memory Management 1. Readings r Silbershatz et al: chapters
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
CSE115: Introduction to Computer Science I
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
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.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Instruction Set Architecture
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Computer Science 210 Computer Organization The von Neumann Architecture.
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Chapter 4 The Von Neumann Model
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
Fetch-execute cycle.
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.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Dale & Lewis Chapter 5 Computing components
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
1 Machine architecture Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Chapter 2.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Computer Organization Instructions Language of The Computer (MIPS) 2.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
CHAPTER 4 VARIABLES & BINDING SUNG-DONG KIM DEPT. OF COMPUTER ENGINEERING, HANSUNG UNIVERSITY.
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.
Abstract data types Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Languages and Compilers (SProg og Oversættere)
Chapter 4 Variables & Binding
CPU Organisation & Operation
A Closer Look at Instruction Set Architectures
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Chapter 4 The Von Neumann Model
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
The fetch-execute cycle
The Processor and Machine Language
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
CSCE Fall 2013 Prof. Jennifer L. Welch.
Topic 6 LC-3.
The Little Man Computer
PZ01C - Machine architecture
Abstract data types Programming Language Design and Implementation
Chapter 4 The Von Neumann Model
CSCE Fall 2012 Prof. Jennifer L. Welch.
Principles of Programming Languages
The Stored Program Computer
Program Execution.
Abstract data types Programming Language Design and Implementation
Basic components Instruction processing
Introduction to Computer Engineering
Computer Architecture
Introduction to Computer Engineering
Introduction to Computer Engineering
Algoritmos y Programacion
Chapter 4 The Von Neumann Model
Presentation transcript:

1 Machine architecture Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Chapter 2

2 Typical machine design Two cycles: Fetch cycle - get instruction Execute cycle - do operation

3 Typical machine execution Typical fetch cycle: (M(x) means contents of x) 1. M(IC)  MAR [Memory Address register] 2. IC +1  IC [Instruction Counter] 3. Read memory into MDR [Memory Data Register] 4. MDR  IR [Instruction Register for decoding] Typical execute cycle: (OP R,X, DISP is instruction) 1. IR decoded into OP R, EA –OP is operation code (e.g., 8 bits) –R is register (e.g., 4 bits registers) –EA is effective address (e.g., 20 bits) 2. M(X)+DISP  MAR (EA  MAR) 3. Read memory into MDR 4. M(R)  ALU; M(MDR)  ALU 5. Do operation OP in ALU; ALU  R For 500 MHZ: Each instruction 9-10 cycles (50 MIPS) By overlapping fetch and execute cycles, get MIPS

4 Typical machine translation For example in C: As we see later, memory for data in blocks of storage pointed to by a register: X = Y + Z could be translated as: load R1, R2, 28[Location of Y] add R1, R2, 40 [Location of Z] store R1, R2, 24[Location of X] Instruction format: Opcode register, index, offset load R1, R2, 24

5 Software architectures Previously Build program to use hardware efficiently. Often use of machine language for efficiency. Today No longer write directly in machine language. Use of layers of software. Concept of virtual machines. Each layer is a machine that provides functions for the next layer.

6 Virtual Machines Example: Web application

7 Binding and Binding Tme Binding : program element 에 속성 또는 수행에 필요한 요소를 연결하는 것 예 :: 변수  형 (type), 기억장소 (memory), 값, … Binding time : Binding 이 일어나는 시간 –Execution time (run time) :: 기억장소나 값 On entry to a subprogram or block :: C, C++ 의 형식인자와 실질 인자의 연결 At arbitrary points during execution ::: LIS, SMALLTALK, ML, Java –Translation time Bindings chosen by the programmer ::: 변수이름, 형, Bindings chosen by the translator ::: C 의 integer 크기, memory class 에 따른 기억위치, array 의 저장방법 ??? Bindings chosen by the loader (linker) ::: external 변수의 참조

8 Binding time (Cont.) Language Implementation time –One ’ s complement ? 2 ’ s complement – 연산자의 구현 방법, …. Language Definition time –Data structure types, statement forms,.. 예 ::: X=X+10 –X 의 형 translation time  C, C++, Java, Ada Run time  LISP, SMALLTALK, PERL –X 에 넣을 수 있는 값의 집합 –X 의 값 –10 의 표현 … 언어정의 시 (10  정수, ’ 10 ’ ), 언어구현 시 (10 의 표현 ) –‘ + ’ 의 의미 ‘ + ’  addition( 언어정의 시 ), overload 해결 (compile 시 ), 더하기가 구현 되는 방법 (implementation time), 실제연산 (execution time)

9 Binding time and languages C, C++, Ada, FORTRAN  translation time binding (early binding) LISP, ML, Perl, HTML  runtime binding (late binding) Binding and scope rule 숙제 2 장 연습문제 5 번 6 번