The Analytical Engine Module 6 Program Translation.

Slides:



Advertisements
Similar presentations
Senem Kumova Metin Introduction to Programming CS 115 Introduction to Computing PART I : Computer Basics PART II: Introduction to Computing/Programming.
Advertisements

Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Chapter 2 Machine Language.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
ENGR2216 FORTRAN PROGRAMMING FOR ENGINEERS. Chapter 1 The computer CPU MEMORY INPUT/OUTPUT DEVICES DATA REPRESENTATION BINARY SYSTEM OCTAL & HEXADECIMAL.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
Chapter 2 Machine Language. Machine language The only language a computer can understand directly. Each type of computer has its own unique machine language.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and 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.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Program Translation Module 6. Mid-Term Results.
Ceng 230 Programming with C
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Chapter 17 Microprocessor Fundamentals William Kleitz Digital Electronics with VHDL, Quartus® II Version Copyright ©2006 by Pearson Education, Inc. Upper.
The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed.
CS102 Introduction to Computer Programming
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction to Programming Language CS105 Programming Language First-generation: Machine language Second-generation: Assembly language Third-generation:
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
CIS Computer Programming Logic
Chapter 1: Introduction to Computers and Programming.
Chapter 1. Introduction.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
AS Computing Introduction to Programming. What is a Computer Program? A list of instructions that a computer must work through, in a logical sequence,
Lesson 1b: Computer Systems and Program Development CPS118.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
Information Representation: Machine Instructions
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Computer Programming I. Today’s Lecture  Components of a computer  Program  Programming language  Binary representation.
Computer Systems Organization CS 1428 Foundations of Computer Science.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 2.
Introduction to Computer Systems and the Java Programming Language.
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
What is Programming? A program is a list of instructions that is executed by a computer to accomplish a particular task. Creating those instructions is.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
6. Program Translation CS100: The World of Computing John Dougherty Haverford College.
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.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
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,
CS 125 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk drive Software.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
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.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ read/write and clock inputs Sequence of control signal combinations.
Objective of the course Understanding the fundamentals of the compilation technique Assist you in writing you own compiler (or any part of compiler)
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
CSCI-235 Micro-Computer Applications
Microprocessor Systems Design I
The Processor and Machine Language
Computers: Hardware and Software
CSCE Fall 2013 Prof. Jennifer L. Welch.
CSCE 121: Simple Computer Model Spring 2015
CS105 Introduction to Computer Concepts Intro to programming
Low Level Programming Languages
CSCE Fall 2012 Prof. Jennifer L. Welch.
Principles of Programming Languages
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Information Representation: Machine Instructions
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

The Analytical Engine Module 6 Program Translation

The Binary Machine Computers store their programs and information in binary code. A program must be understandable to both the user and the machine.

The Binary Machine Translation from high-level language (English) to low-level language (binary) is accomplished through a program: – Compiler – Interpreter – Assembler High-level  Low-level Source code  Object code

The Binary Machine All computers have a hard-wired instruction set that is unique to a specific microprocessor. Therefore, compilers, interpreters, and assemblers must be written for a specific machine.

The Binary Machine An instruction is a unique set of binary patterns that cause the circuitry of the machine to behave in a certain way. These circuits are etched into the microprocessor chip.

Binary Representations Binary architecture – Bit – Binary Digit – Nibble(?) – 4 bits – Byte – 8 bits – Word – 2 bytes – 16 bits (at least)

Binary Representations Most modern desktop PCs and Macs measure their memory size in bytes. – 1 MB = 1 million bytes – 12 MB = 12 million bytes or 96 million bits! – 1 GB = 1 gigabyte or 1 billion bytes.

Binary Representations To a computer, binary digits can represent: – Simple binary code Integers = 2 Integers – = Real Numbers (32 bits) – sign(1 bit), Exponent (8) bits, Mantissa (23 bits)

Binary Representations To a computer, binary digits can represent: – Binary Coded Decimal Numbers (BCD) = 316 – Hexadecimal Numbers (Hex) = F53B

Binary Representations To a computer, binary digits can represent: – ASCII Code = “A” = “!” – Check ASCII table handout. – Adopted so computers could represent character (non-numeric) data.

Binary Representations Instruction Codes – Arbitrary – Ex. Is PIPPIN = LOD (Load accumulator) = STO (Store accumulator contents) – A 256-instruction set can be encoded in 8 bits. – Trend was to richer instruction sets. – Trend now to reduced instruction sets.

The Binary Machine Observe the demonstration of the PIPPEN machine carefully.

A Simple Computer RAM – Random Access Memory – Data – 8, 16, 32 bits – Instructions 8-bit instruction code 8-bit address PC – Program Counter – Keeps address of current instruction

A Simple Computer Accumulator – Special memory location that stores intermediate results of computations. IR – Instruction Register – Holds a copy of the current instruction to be executed. Decoder – takes a single input and transfers to multiple outputs.

A Simple Computer MUX – Multiplexor – Routes multiple inputs to a single output. ALU – Arithmetic Logic Unit – Performs mathematical operations on its input.

A Simple Computer Assembler – translates mne-monic represen- tations of instructions into binary code. (LOD, ADD, SUB, STO, etc.) Very fast Programmer is responsible for data storage One instruction – One operation correspondance

Language Implementation Scanning – breaking a string of characters into meaningful pieces called tokens. – W = X – Y ; Like breaking down a sentence into words.

Language Implementation Parsing – Arranging tokens into a sensible logical structure. – W = X + Y * Z; E1 = Y * Z E2 = X + E1 E2  W – Result is called a Parse Tree. Code Generation – generating one or more machine language instructions based on the Parse Tree.

Language Types Interpreted Languages – BASIC, LISP, JavaScript Program Line  Interpreter  Binary Code  Execution Next Line  Interpreter  Binary Code  Execution – Fairly slow Lines translated repeatedly One line may generate multiple instructions, some unnecessary – User does not need to know details of the machine. Programs run on any machine that has the interpreter.

Language Types Compiled Languages – COBOL, FORTRAN, C, C++, Java Entire program  Compiler  Binary Code  Execution – Fairly fast after compilation Better error detection. Object program can be stored and run repeatedly without recompilation. – User does not need to know details of the machine. Programs run on any machine that has a compiler.

Language Groups Imperative – fundamental unit is the procedure which is called by a main program. – Pascal, FORTRAN, Ada Functional – processes are defined in terms of functions with no main program. – LISP

Language Groups Declarative – Input/Output oriented; limited procedure/function support. – COBOL, Prolog Object-Oriented – processes controlled by “events” which communicate with “objects” via “messages”. – C++, Smalltalk, JavaScript, Java

Language Design Syntax & Semantics Data Types – Strongly Typed – Weakly Typed Data Structures – Arrays – Lists Decision statements – IF – IF – ELSE Control Statements – FOR – WHILE – WHILE – DO

Language Implementation Generating Code Observe the demon- stration carefully. Check the course web page and then complete Lab 6.3.

Language Generations First Generation – machine language Second Generation – assemblers Third Generation – interpreted and compiled languages. Fourth Generation – object-oriented languages

Language Implementation Symbols & Bits Observe the demon- stration carefully. Check the course web page for special instructions. Complete Lab 6.4.

The End Program Translation