Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.

Slides:



Advertisements
Similar presentations
Chapt.2 Machine Architecture Impact of languages –Support – faster, more secure Primitive Operations –e.g. nested subroutine calls »Subroutines implemented.
Advertisements

Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Systems Software.
CompSci A Peek at the Lower Levels  It is good to have a sense of what happens at the hardware level  Not required for this course  It may.
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
COSC 120 Computer Programming
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
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.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Computer System Overview
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
State Machines Timing Computer Bus Computer Performance Instruction Set Architectures RISC / CISC Machines.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Topic 1: Introduction to Computers and Programming
CS102 Introduction to Computer Programming
AKT211 – CAO 01 - Introduction to Computer Organization and Architecture Ghifar Parahyangan Catholic University August 22, 2011 Ghifar Parahyangan Catholic.
Computer Architecture and Organization
Chapter 1 An Overview of Computers and Programming Languages.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
Intro to Computer Systems Summer 2014 COMP 2130 Introduction to Computer Systems Computing Science Thompson Rivers University.
CISC105 General Computer Science Class 1 – 6/5/2006.
Computer Architecture and Organization Introduction.
What is a Computer? An, electrical machine, that can be programmed to accept data (input), process it into useful information (output) and store it away.
Cosc 2150: Computer Organization
Chapter 1 Introduction. Architecture & Organization 1 Architecture is those attributes visible to the programmer —Instruction set, number of bits used.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
The Central Processing Unit (CPU) and the Machine Cycle.
OOP with Java, David J. Barnes Bits, Bytes, and Java1 The Challenge Writing programs well is a challenge. –From coder to software engineer. We want programs.
Computer Architecture And Organization UNIT-II General System Architecture.
Computer Organization & Assembly Language © by DR. M. Amer.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
1 Control Unit Operation and Microprogramming Chap 16 & 17 of CO&A Dr. Farag.
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.
ECEG-3202 Computer Architecture and Organization Chapter 3 Top Level View of Computer Function and Interconnection.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Computer Architecture 2 nd year (computer and Information Sc.)
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Computer Organization. The digital computer is a digital system that performs various computational tasks Digital computer use binary number system which.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
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,
CompSci Today’s topics Machine Architecture The basic machine Basic programming Assembler programming Upcoming Language Translation Reading Great.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Chapter 1 An Overview of Computers and Programming Languages.
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.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Operating Systems A Biswas, Dept. of Information Technology.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Computer Organization and Architecture Lecture 1 : Introduction
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Ghifar Parahyangan Catholic University August 22, 2011
Principles of Programming Languages
Introduction to Computer Programming
Introduction to Computer Systems
point when a program element is bound to a characteristic or property
A Top-Level View Of Computer Function And Interconnection
Chapter 4 The Von Neumann Model
Presentation transcript:

Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers

The Operation of a Computer Computer: An integrated set of algorithms and data structures capable of storing and executing programs.

Components Data - types of elementary data items and data structures to be manipulated Primitive Operations - operations to manipulate data Sequence Control - mechanisms for controlling the sequence of operations

Components Data Access - mechanisms to supply data to the operations Storage Management - mechanisms for memory allocation Operating Environment - I/O mechanisms (i.e. communication)

Implementation of the components Hardware Firmware Software

Hardware CPU (Central processing Unit) Control Unit Arithmetic Logical Unit Inboard memory registers cache memory main memory I/O devices - keyboard, mouse, disk drives, etc Outboard storage - disks, CDs

Hardware-level operations Fetch-execute cycle: Processor fetches an instruction from memory. Processor executes the fetched instruction Instruction cycle - processing that is required for a single instruction

Fetch-execute cycle Program counter- contains the address of the next instruction to be executed The fetched instruction is loaded into Instruction Register Program counter is incremented after fetching Processor interprets the bits stored in the IR and performs the required action

Firmware A set of machine-language instructions implemented by programs, called microprograms, stored in programmable read-only memory in the computer (PROM).

Firmware Example: The language in problem #4, p.42 consists of very low-level instructions. It would be implemented in hardware (hardwired). The instruction a = a + b could be implemented in firmware.

Firmware Advantages flexibility - by replacing the PROM component we can increase the set of machine instructions. e.g. we can implement vector multiplication as a machine operation. less cost of the hardware - the simpler the instructions, the easier to hardwire them.

Software Translators and virtual architectures High-level language  machine language Translation (Compilation) Interpretation

Translation Input: high-level language program Output: machine language code Types of translation (high to low-level): Preprocessor Compiler Assembler Loader (usually part of the operating system) Advantages: efficient executables

Interpretation The program is not translated to machine language code. Instead, it is executed by another program. Example: Prolog interpreter written in C++

Interpretation Advantages of interpretation: - easy to be implemented - easy to debug - portability - flexibility - easy to modify the interpreter Disadvantages: slow execution

Virtual machines Program: data + operations on these data Computer: implementation of data structures + implementation of operations

Hardware, Firmware, and Software computer Hardware computer: elementary data items, very simple operations Firmware computer: elementary data items, machine language instructions (we may have specialized processors e.g. vector multiplication) Software computer : Each programming environment defines a specific software computer.

Hierarchy of virtual machines Basic Hierarchy: Software Firmware Hardware Software sub-hierarchy - depends on how a given programming environment is implemented

Example Java Applets Java virtual machine - used to implement the Java applets C virtual machine - used to implement Java Operating system- used to implement C Firmware- used to implement machine language Hardware- used to implement firmware microprograms

Binding and Binding Times Binding - fixing a feature to have a specific value among a set of possible values. E.G. - your program may be named in different ways, when you choose a particular name, then you have done a binding.

Binding occurs at language definition language implementation translation execution

Binding At language definition - available data types and language structures, e.g in C++ the assignment statement is =, while in Pascal it is := At language implementation - concerns representation of numbers and arithmetic operations

Binding At translation - Chosen by the programmer - variable types and assignments Chosen by the compiler - relative locations of variables and arrays Chosen by the loader - absolute locations

Binding At execution - Memory contents On entry to a subprogram (copying arguments to parameter locations) At arbitrary points (when executing assignment statements) Recursive programs Dynamic libraries

Importance of binding times If done at translation time - efficiency is gained If done at execution time - flexibility is gained. Example: Consider X = X+10 Discuss what happens at each stage listed above.