We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published bySantiago Caufield
Modified about 1 year ago
Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation
Dr. Ken Hoganson, © August 2014 Computer is all 0s and 1s, which is hard for humans. So we have created languages that are easier for us (humans) to work with. Human-friendly languages require computer time to translate into computer-executable programs. Ongoing trend since computer was created: make better human interfaces to the machine, using the ever increasing power of the computer to do the translation work “behind the scenes”. Thing GUI interfaces and virtual-reality interfaces. Language Translation
Dr. Ken Hoganson, © August 2014 Machine code – the bottom line in programming. Machine code instructions are divided into fields, and the instruction has a specified format. Simple example: Machine Code Just a taste
Dr. Ken Hoganson, © August 2014 This instruction has four fields: –Instruction type (two bits) –Operation code (6 bits) –Register operand 1 (4 bits) –Register operand 2 (4 bits) 16-bit (two-byte) instruction Machine Code
Dr. Ken Hoganson, © August 2014 Two bits for instruction type. How many types of instructions are possible within this format? Operation Code is 6 bits. How many types of operations are possible for a format? The register operands are 4 bits each. How many different registers can be indicated with 4 bits? (similar to addressing) Machine Code
Dr. Ken Hoganson, © August 2014 This instruction format is a Register-Register instruction. That means that it takes its inputs from two register operands. The operation is performed on those two data elements, and the result goes back into the register specified by the first register operand. Machine Code
Dr. Ken Hoganson, © August 2014 Machine code is not hard, just painful and slow to work with. –Register-Register instruction format is ‘00’ –Op Code to add two registers is ‘010000’ –Add contents of register 2 specify ‘0010’ –Add contents of register 4 specify ‘0100’ Complete instruction in 0s and 1s: Machine Code Instruction Do you remember where the result of the addition is stored?
Dr. Ken Hoganson, © August 2014 Working with 0s and 1s is hard – and humans are prone to making errors. Languages have been created to make programming easier. Assembly language is the lowest level language. –Uses mnemonics and abbreviations. Our add two register instruction: – Can be represented (1 to 1) with an assembly instruction: –ADR R2 R4 – AD d R egisters R2 and R4, result in R2 Assembly Language
Dr. Ken Hoganson, © August 2014 Assembly language is a big improvement over machine code. Assembly is translated by an assembler program to 0s and 1s that the computer can work with. More powerful (and human-readable) languages have been created (which must also be translated to 0s and 1s). These are called High Level Languages Basic, Fortran, C, C++, C#, R, etc. High-Level Languages
Dr. Ken Hoganson, © August 2014 Our add two register instruction: – In assembly language: –ADR R2 R4 – AD d R egisters R2 and R4, result in R2 In a high level language might look like: –Number1 = Number1 + Number2 –Better? High-Level Languages
Dr. Ken Hoganson, © August 2014 ADR R2 R4 High level language might look like: –Sum = Number1 + Number2 But this high-level language has another type of translation embedded : memory addressing –Number1, Number2, and SUM are data values stored in memory, not registers. –The values for Number1 and Number 2 must be first loaded from memory into registers. –Then the add operation can be performed –Then the result stored back to memory in SUM. Additional machine-level instructions needed to do this one high-level language instruction Many-to-1 translation
Dr. Ken Hoganson, © August 2014 High-level language instructions must be translated/converted to machine code before the computer can run them. This process requires a translation program: –Compiler –Interpreter –(Assembler was used for assembly language) Languages like C, C++, Cobol, Fortran and Pascal are all compiled languages. High-level Language Translation
Dr. Ken Hoganson, © August 2014 Compiler takes the high-level language program (as text) as its input. It produces the machine code version of the program as its output. It does not change the high-level program, the machine code program is a new file. Compiler
Dr. Ken Hoganson, © August 2014 Interpreter Some languages like BASIC and VisualBASIC are interpreted languages, not compiled. The Interpreter does not convert the entire program all at once. Instead, it converts instructions one at a time, and has the computer execute each instruction. Slower, because every time the program is run, it must be interpreted.
Dr. Ken Hoganson, © August 2014 A third and more recent way to translate high-level programs is with a Virtual Machine (or byte-code interpreter). Java is an example. Separates translation into two steps. –Convert the program to “byte-code” –The “byte-code” is then interpreted by a virtual machine. Virtual Machine
Dr. Ken Hoganson, © August 2014 The virtual machine/byte-code interpreter makes programs transportable and device- independent. Converted byte-code can move over the internet. Virtual Machine
Dr. Ken Hoganson, © August 2014 Each different processor/machine needs its own virtual machine, which will be different from CPU to CPU. Different because of different machine codes and operating systems. Virtual Machine
Dr. Ken Hoganson, © August 2014 A structured programming language (no objects or agents) With extensions for Big Data – functions and techniques for manipulating large data sets using parallel opportunities. An interpreted language, running on a Virtual Machine written in a language called “S”. S code is compiled, using a complier for the platform. The “R” interpreter is compiled “S” code. “R” is
Dr. Ken Hoganson, © August 2014 End Of Today’s Lecture. End of Lecture
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
1 Chapter-01 Introduction to Computers and C++ Programming.
Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Assembly & Machine Languages A Brief Overview Jonathan-Lee Jones.
Lecture 4: MIPS Instruction Set Reminders: –Homework #1 posted: due next Wed. –Midterm #1 scheduled Friday September 26 th, 2014 Location: TODD 430 –Midterm.
The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Computer Organization CT213 – Computing Systems Organization.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
1 Lecture-2 CS-120 Fall 2000 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
4-1 Chapter 4 - The Instruction Set Architecture Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring.
1 Lecture-2 CSIT-120 Spring 2001 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Representation of Data - Instructions Start of the lesson: Open this PowerPoint from the A451 page – Representation of Data/ Instructions How confident.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 6.
Software Engineering Algorithms, Compilers, & Lifecycle.
The Binary Machine Modern high-level programming languages are designed to make programming easier. On the other end, the low level, all modern digital.
4-1 Chapter 4 - The Instruction Set Architecture Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of.
High-level Languages. Assembly language benefits Hides details of hardware.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 4 Computer Software.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
1 Lab Session-IV CSIT-120 Fall 2000 Precedence Rules Machine Language Programming The “Micro” Machine The “Micro” Simulator The “Micro” Translator (Thanks.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
2.3) Example of program execution 1. instruction B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
1 The 8051 Microcontroller and Embedded Systems CHAPTER ASSEMBLY LANGUAGE PROGRAMMING.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
1 Programming & Programming Languages Overview l Machine operations and machine language. l Example of machine language. l Different types of processor.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
1 Lecture 1 Getting ready to program Hardware Model Software Model Programming Languages The C Language Software Engineering Programming.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that Receives input Stores and manipulates data Provides output.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Chapter 3 Software Two major types of software 1. Application Software - Programs designed for a specific purpose 2. System Software - Programs that manage.
ICS 102 Computer Programming University of Hail College of Computer Science & Engineering Computer Science and Software Engineering Department.
1 Lecture 2: MIPS Instruction Set Today’s topic: MIPS instructions Reminder: sign up for the mailing list cs3810 Reminder: set up your CADE accounts.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
Computer Languages Computer Languages Machine Language Machine Language Assembly Language Assembly Language High Level Language High Level Language.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word processor), it must be given the instructions.
Chapter 1-C,D Computers and Digital Basics. Digital Data Representation Chapter 1: Computers and Digital Basics 2 Data Representation Basics Representing.
What am I?. Translators Translators – Module Knowledge Areas Types of translators and their use Lexical analysis Syntax analysis Code generation and.
© 2017 SlidePlayer.com Inc. All rights reserved.