Computing and compilers

Similar documents
An Introduction to Python (TEJ3M & TEJ4M)

Chapter Twelve. Systems Design and Development

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

Computing Seminar Introduction Oct

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

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILERS

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

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

Introduction to Computer Programming Using FORTRAN 77

Prerequisites Using Microsoft Windows 10

Introduction to Computers and Java

Software Development. Integrated Software Environment

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

Week 1 Introduction to Computer and Algorithm (Part1) UniMAP Sem II 11/12 DKT121: Basic Computer Programming 1

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

1. Review of program specifications 2. Program design 3. Coding 4. Testing 5. Finalizing documentation

Introduction to Computers and Java

Outline. Program development cycle. Algorithms development and representation. Examples.

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

Unit E Step-by-Step: Programming with Python

CHAPTER 1 Introduction to Computers and Java

Introduction to Computers and Java

How to approach a computational problem

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

ST. MARY S COLLEGE FORM 4

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

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

Computer Principles and Components 1

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

Introduction to Computers and Java

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

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

Definition: A data structure is a way of organizing data in a computer so that it can be used efficiently.

Java and Software Design

Introduction to Computers and Java

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

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Eleventh Edition. Copyright 2015 Pearson Education, Inc.

Programming 1 - Honors

CS187 - Science Gateway Seminar for CS and Math

CSC 015: FUNDAMENTALS OF COMPUTER SCIENCE I

Introduction to Computers and Java

1. A folder inside a folder is called. a) Mini Directory b) Sub Directory c) Root Folder d) Child Folder e) None of these

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

C++ Programming Language Lecture 2 Problem Analysis and Solution Representation

LECTURE 3 ADMINISTRATION SECTION -A

Lesson 1. Introduction to Programming OBJECTIVES

A+ Certification. Course Description. Course Objectives. 9300; 5 Days, Instructor-led

Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT

COP 1220 Introduction to Programming in C++ Course Justification

Computing. Building Retention: What prior learning must be built upon/revisited and how will it be assessed? Term Cycle 1

COP 1170 Introduction to Computer Programming using Visual Basic

CS 177 Recitation. Week 1 Intro to Java

Intro to MS Visual C++ Debugging

Game keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen

Integrated Software Environment. Part 2

CSCE150A. Administrivia. Overview. Hardware. Software. Example. Program. Pseudocode. Flowchart. Control Structures. Hello World Program CSCE150A

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

Computer Science & Engineering 150A Problem Solving Using Computers

Introduction to Java Programming

C++ Programming Language Lecture 1 Introduction

Pseudo Code and Flow Charts. Chapter 1 Lesson 2

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

Working with JavaScript

Copyright 2005 Department of Computer & Information Science

Computer Fundamentals

An Overview of the BLITZ System

EXAMINING THE CODE. 1. Examining the Design and Code 2. Formal Review: 3. Coding Standards and Guidelines: 4. Generic Code Review Checklist:

Programming Languages and Program Development Life Cycle Fall Introduction to Information and Communication Technologies CSD 102

Summer 2003 Lecture 1 06/09/03

Which statement regarding computer programs is correct? Which statement best describes a computer program?

C Programming. A quick introduction for embedded systems. Dr. Alun Moon UNN/CEIS. September 2008

CS 370 The Pseudocode Programming Process D R. M I C H A E L J. R E A L E F A L L

PROBLEM SOLVING TECHNIQUES

Structured programming

Introduction. Arizona State University 1

Unit 1: Introduction to Algorithms

Chapter 6 Programming the LC-3

Compilers. Prerequisites

The Turing Environment

Advanced Operating Systems (CS 202)

COMPUTING SUBJECT KNOWLEDGE AUDIT

CodeHS: Arkansas Standards Alignment

Citrix Connectivity Help. Table of Contents

8. A is approximately one billion bytes a. Kilobyte b. Bit c. Gigabyte d. Megabyte 9. SMPT, FTP and DNS are applications of the layer a. Data link b.

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Embedded Software Development Tools Module No: CS/ES/36 Quadrant 1 e-text

Introduction to Computer Systems and Operating Systems

NUMBER OF TIMES COURSE MAY BE TAKEN FOR CREDIT: One

Compiling Regular Expressions COMP360

Model Answer paper Guru Ghasidas Vishwavidyalaya (Bilaspur ) B.COM(Third Semester) Examination, 2014 Fundamentals of Computers Paper Code: BC-307

Crossley Fields - Computing Vocabulary

Introduction to Software Development (ISD) David Weston and Igor Razgon

COMP 250. Lecture 36 MISC. - beyond COMP final exam comments

Creating Word Outlines from Compendium on a Mac

CS2112 Fall Assignment 4 Parsing and Fault Injection. Due: March 18, 2014 Overview draft due: March 14, 2014

Control Structures. Code can be purely arithmetic assignments. At some point we will need some kind of control or decision making process to occur

Programming Fundamentals

Software Lesson 2 Outline

Final Examination Semester 2 / Year 2005

Statistics Case Study 2000 M. J. Clancy and M. C. Linn

Transcription:

Computing and compilers Comp Sci 1570 to

Outline 1 2 3 4 5

Evaluate the difference between hardware and software Find out about the various types of software Get a high level understanding of how program code is transformed into working software applications

Outline 1 2 3 4 5

What is a computer program? A sequence of instructions that dictate the flow of electrical impulses in a computer system. Can perform useful tasks, solve high-level problems, play games. We can be oblivious to the lower-level activity Most programmers write software at this higher, more abstract level also. An accomplished computer programmer can develop sophisticated software with little or no interest or knowledge of the actual computer system upon which it runs. construction tools hide the lower-level details from programmers, allowing them to solve problems in higher-level terms.

What is a computer system? (only sometimes important to CS) (CS!)

Outline 1 2 3 4 5

Peripheral devices: Input/Output devices, Printers, Monitor, Speakers, Mic, The power supply, Internals: The motherboard with memory chips, The CPU (central processing unit), Hard drive, A lot of wires, etc What is a CPU?

What is a transistor?

Outline 1 2 3 4 5

What is software?

Outline 1 2 3 4 5

Machine code Computers understand language that consists of sets of instructions made of ones and zeros. This computer language is often called machine code. Programming a computer directly in machine language using only ones and zeros is very tedious and error prone.

Outline 1 2 3 4 5

languages To make programming easier, high level languages can be used. A computer can only understand machine language Humans wish to write in high level languages languages have to be re-written (translated) into machine language Done by special programs called compilers, interpreters, or assemblers

Outline 1 2 3 4 5

Interpreted versus languages

Outline 1 2 3 4 5

is a human readable high level language The higher-level language code is called source code. is designed to be a language Generated program is often highly efficient. Machine translated code is also called object code or an executable. A compiler translates your code into machine readable low level language The set of tools is sometimes known as the development tool-chain, whose core are a compiler and its linker.

Outline 1 2 3 4 5

Simplified steps of a compiler 1 Checking the syntax: Compiler will check that you are using the language () correctly If you make a mistake, the compiler will issue an error message. 2 Produce the executable file: Produces a file containing the machine code that the computer can execute. You run the executable. The target code may be the machine language for a particular platform or embedded device.

Parts of the development tool-chain Don t usually think about the pre-processor, compiler, and linker working as three separate programs (although they are): Pre-processor adds to or modifies the contents of the source file before the compiler begins processing the code. #include information about libraries Compiler translates C + + source code to machine code. Most C + + code is incapable of running by itself and needs some additional machine code to make a complete executable program. The missing machine code has been pre- and stored in a repository of code called a library. Linker combines the compiler-generated machine code with pre- library code or code from other sources to make a complete executable program.

Outline 1 2 3 4 5

and compilers

Allows the user to enter the program source code and save it to files. Increase programmer productivity by using colors to highlight language features. Syntax of a language refers to the way pieces of the language are arranged to make well-formed sentences. The tall boy runs quickly to the door. uses proper English syntax. Boy the tall runs door to quickly the. is not correct syntactically, though has correct words. Syntax-aware editors can use colors or other special annotations to alert programmers of syntax errors before the program is.

Outline 1 2 3 4 5

A debugger allows a programmer to more easily trace a program s execution in order to locate and correct errors in the program s implementation. With a debugger, a developer can simultaneously run a program and see which line in the source code is responsible for the program s current actions. The programmer can watch the values of variables and other program elements to see if their values change as expected. are valuable for locating errors (also called bugs) and repairing programs that contain errors. Learning to debug and troubleshoot on your own may be one of the most important skills of a good programmer.

Outline 1 2 3 4 5

A profiler collects statistics about a program s execution allowing developers to tune appropriate parts of the program to improve its overall performance. A profiler indicates how many times a portion of a program is executed during a particular run, and how long that portion takes to execute. also can be used for testing purposes to ensure all the code in a program is actually being used somewhere during testing. The main purpose of profiling is to find the parts of a program that can be improved to make the program run faster.

Outline 1 2 3 4 5

The whole process Someone has a problem They write a solution to the problem The compiler translates into machine code The program you write will demand memory space for variables, communication from and to the keyboard and monitor, and possibly other uses of peripherals. The OS will schedule the use of these resources of the computer. The CPU, RAM, disk drives, etc follow those instructions

Outline 1 2 3 4 5

What is a program? Sequence of instructions that specifies how to perform a computation. The instructions (or commands, or statements) look different in different programming languages, but there are a few basic functions that appear in just about every language: input: Get data from the keyboard, or a file, or some other device. output: Display data on the screen or send data to a file or other device. math: Perform basic mathematical operations like addition and multiplication. testing: Check for certain conditions and execute the appropriate sequence of statements. repetition: Perform some action repeatedly, usually with some variation.

Outline 1 2 3 4 5

The concepts of computer programming are logical and mathematical in nature. In theory, computer programs can be developed without the use of a computer. Programmers can describe a procedure using abstract symbols that correspond to the features of real-world programming languages but appear in no real-world programming language.

and computational problem solving Our goals this week include: learn how to break apart a big problem into several smaller problems Create a sequence of steps for automatically solving these problems Pattern these small solutions together in such a way that together, they automatically solve the large problem

What is an algorithm? Algorithm is a concise, correct step-by-step sequence of steps to solve a problem. And why do we care to discuss algorithms here? To be successful in writing programs, you need to write, or at least think, algorithms.

Outline 1 2 3 4 5

Step-by-step verbal outline of your code that you can gradually transcribe into programming language. Many programmers use it to plan out the function of an algorithm before setting themselves to the more technical task of coding. Informal guide, a tool for through program problems Shows how a computing algorithm should and could work. Intermediate step in programming, in between the initial planning stage and the stage of writing actual, executable code. Allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax.

Good pseudocode practices needs to be complete. It describe the entire logic of the algorithm so that implementation becomes a rote mechanical task of translating line by line into source code. In general, the vocabulary used in the pseudocode should be the vocabulary of the problem domain, not of the implementation domain.

What are the basic constructs of pseudocode? It has been proven that three basic constructs for flow of control are sufficient to implement any proper algorithm. 1 SEQUENCE is a linear progression where one task is performed sequentially after another. 2 WHILE is a loop (repetition) with a simple conditional test at its beginning. 3 IF-THEN-ELSE is a decision (selection) in which a choice is made between two alternative courses of action. Although these constructs are sufficient, it is often useful to include three more constructs: 1 REPEAT-UNTIL is a loop with a simple conditional test at the bottom. 2 CASE is a multiway branch (decision) based on the value of an expression. CASE is a generalization of IF-THEN-ELSE. 3 FOR is a counting loop.

Example problems How can we look up a word in a dictionary? How can we sort a stack of cards?

Wrapping it up