1a Computers, Problem Solving!

Size: px
Start display at page:

Download "1a Computers, Problem Solving!"

Transcription

1 1a Computers, Problem Solving!! 1E3! 1a Computers and Problem Solving 1 Objectives! n To introduce the architecture of a computer.! n To introduce the notion of a programming language.! n To explore computational problemsolving.! n Read Chapter 1 of the textbook.! 2 Computers and Problem Solving 2 1

2 Computer Hardware! n Central Processing Unit (CPU)! n Main memory (MM)! n Aka Random Access Memory (RAM)! n Temporary storage of data/programs! n Input/output devices! n Secondary storage! n Store information permanently! 2 Computers and Problem Solving 3 2

3 CPU (Central Processing Unit)! n CU (Control Unit):! n Fetches and decodes instructions! n Controls flow of information in and out of MM! n Controls operation of internal CPU components! n PC (program counter): points to next instruction to be executed! 2 Computers and Problem Solving 5 CPU (Central Processing Unit) (continued)! n IR (instruction register): holds instruction currently being executed! n ALU (arithmetic logic unit): carries out all arithmetic and logical operations! 2 Computers and Problem Solving 6 3

4 Main Memory! n Directly connected to the CPU! n All programs must be loaded into main memory before they can be executed! n All data must be brought into main memory before it can be manipulated! n When computer power is turned off, everything in main memory is lost! 2 Computers and Problem Solving 7 4

5 Software! n Software: Programs that do specific tasks! n System programs take control of the computer, such as an operating system! n Application programs perform a specific task! n Word processors! n Spreadsheets! n Games! 2 Computers and Problem Solving 9 Programs! n CPU executes programs! n Sequences of instructions! n CPU understands a small set of instructions! n MOVE 1002 R1! n Move the value in memory location 1002 to register R1! n MULT R1 R2! n Multiply the contents of R1 and R2! n And these assembly language instructions are coded in binary machine code! n ! ! 2 Computers and Problem Solving 10 5

6 Programs cont.! n We want to be able to write higher-level instructions like! n area = height * length;! n And get a compiler to turn it into machine code.! n See example in lecture.! 2 Computers and Problem Solving 11 A C++ Program! #include <iostream> using namespace std; int main() { cout << "My first C++ program." << endl; cout << "The sum of 2 and 3 = " << 5 << endl; cout << "7 + 8 = " << << endl; return 0; }!! Sample Run:! My first C++ program. The sum of 2 and 3 = = 15 2 Computers and Problem Solving 12 6

7 Processing a Program! n To execute a program written in a high-level language such as C++ n Use an editor to create a source program in C++ n Use the compiler to n Check that the program obeys the rules n Translate into machine language (object program) 2 Computers and Problem Solving 13 Processing a Program (continued)! n Linker:! Combines object program with other programs to create executable code! n Loader:! n Loads executable program into main memory! n The last step is to execute the program! 2 Computers and Problem Solving 14 7

8 Use Smultron Type into Terminal window: myprog.cpp make myprog./myprog This model allows a program to work with data previously stored in memory. (We haven t seen such a program yet.) 2 Computers and Problem Solving 16 8

9 prog.cpp make prog prog./prog 2 Computers and Problem Solving 17 Problem Solving! n Programming is a process of problem solving! n Problem solving techniques! n Analyze the problem! n Outline the problem requirements! n Design steps (algorithm) to solve the problem! n Algorithm:! n Step-by-step problem-solving process! n Solution achieved in finite amount of time! 2 Computers and Problem Solving 18 9

10 Problem Solving Process! n Step 1 - Analyze the problem! n Outline the problem and its requirements! n Design steps (algorithm) to solve the problem! n Step 2 - Implement the algorithm! n Implement the algorithm in code! n Verify that the algorithm works! n Step 3 - Maintenance! n Use and modify the program if the problem domain changes! 2 Computers and Problem Solving 19 make 10

11 Analyze the Problem! n Thoroughly understand the problem! n Understand problem requirements! n Does program require user interaction?! n Does program manipulate data?! n What is the output?! n If the problem is complex, divide it into subproblems! n Analyze each subproblem as above! 2 Computers and Problem Solving 21 Design an Algorithm! n If problem was broken into subproblems! n Design algorithms for each subproblem! n Check the correctness of algorithm! n Can test using sample data! n Some mathematical analysis might be required! 2 Computers and Problem Solving 22 11

12 Write the Code! n Once the algorithm is designed and correctness verified! n Write the equivalent code in high-level language! n Enter the program using text editor! 2 Computers and Problem Solving 23 Compile and Execute! n We ll be compiling our programs using make which takes care of details.! n Compiler may find errors in your use of the rules (syntax) of the language! n The final step is to execute the program! n Logic errors may show up then.! 2 Computers and Problem Solving 24 12

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction Chapter 1: An Overview of Computers and Programming Languages Objectives Objectives (cont d.) In this chapter, you will: Learn about different types of computers Explore hardware and software Learn about

More information

EKT 120/4 Computer Programming KOLEJ UNIVERSITI KEJURUTERAAN UTARA MALAYSIA

EKT 120/4 Computer Programming KOLEJ UNIVERSITI KEJURUTERAAN UTARA MALAYSIA EKT 120/4 Computer Programming KOLEJ UNIVERSITI KEJURUTERAAN UTARA MALAYSIA AZUWIR MOHD NOR ROOM: Pusat Pengajian CABIN C PHONE: (04) 979 8249 Email: azuwir@kukum.edu.my Office hours: make appoinment or

More information

Chapter 1 INTRODUCTION

Chapter 1 INTRODUCTION Chapter 1 INTRODUCTION A digital computer system consists of hardware and software: The hardware consists of the physical components of the system. The software is the collection of programs that a computer

More information

Introduction. Arizona State University 1

Introduction. Arizona State University 1 Introduction CSE100 Principles of Programming with C++, Fall 2018 (based off Chapter 1 slides by Pearson) Ryan Dougherty Arizona State University http://www.public.asu.edu/~redoughe/ Arizona State University

More information

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1

BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1 BITG 1113: Introduction To Computers And Programming Language LECTURE 1 LECTURE 1 1 Learning Outcomes At the end of this lecture, you should be able to: tell the purpose of computer programs. describe

More information

Chapter 1 Introduction to Computers and Programming

Chapter 1 Introduction to Computers and Programming Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming Copyright 2003 Scott/Jones Publishing Contents 1.1 Why Program? 1.2 Computer Systems: Hardware

More information

Chapter 1: Introduction to Computers and Programming

Chapter 1: Introduction to Computers and Programming Chapter 1: Introduction to Computers and Programming 1.1 Why Program? Why Program? Computer programmable machine designed to follow instructions Program instructions in computer memory to make it do something

More information

Chapter 1: Why Program? Computers and Programming. Why Program?

Chapter 1: Why Program? Computers and Programming. Why Program? Chapter 1: Introduction to Computers and Programming 1.1 Why Program? Why Program? Computer programmable machine designed to follow instructions Program instructions in computer memory to make it do something

More information

Week 0: Intro to Computers and Programming. 1.1 Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components

Week 0: Intro to Computers and Programming. 1.1 Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components Week 0: Intro to Computers and Programming Gaddis: Sections 1.1-3 and 2.1 CS 1428 Fall 2014 Jill Seaman 1.1 Why Program? Computer programmable machine designed to follow instructions Program instructions

More information

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York CSc 10200! Introduction to Computing Lecture 1 Edgardo Molina Fall 2013 City College of New York 1 Introduction to Computing Lectures: Tuesday and Thursday s (2-2:50 pm) Location: NAC 1/202 Recitation:

More information

1. Fundamental Concepts

1. Fundamental Concepts 1. Fundamental Concepts 1.1 What is a computer? A computer is a data processing machine which is operated automatically under the control of a list of instructions (called a program) stored in its main

More information

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor Lecture 13 - Introduction to the Central Processing Unit (CPU) Outcomes What is a CPU? How are instructions prepared by the CPU before execution? What registers and operations are involved in this preparation

More information

VARIABLES & ASSIGNMENTS

VARIABLES & ASSIGNMENTS Fall 2018 CS150 - Intro to CS I 1 VARIABLES & ASSIGNMENTS Sections 2.1, 2.2, 2.3, 2.4 Fall 2018 CS150 - Intro to CS I 2 Variables Named storage location for holding data named piece of memory You need

More information

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

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming Topics C H A P T E R 1 Introduction to Computers and Programming Introduction Hardware and Software How Computers Store Data Using Python Introduction Computers can be programmed Designed to do any job

More information

CC411: Introduction To Microprocessors

CC411: Introduction To Microprocessors CC411: Introduction To Microprocessors OBJECTIVES this chapter enables the student to: Use number { base 2, base 10, or base 16 }. Add and subtract binary/hex numbers. Represent any binary number in 2

More information

Programming Languages

Programming Languages Programming Languages Lecture 3 Section 1.3 Robb T. Koether Hampden-Sydney College Mon, Sep 2, 2013 Robb T. Koether (Hampden-Sydney College) Programming Languages Mon, Sep 2, 2013 1 / 25 1 Programming

More information

Programming Languages

Programming Languages Programming Languages Lecture 3 Robb T. Koether Hampden-Sydney College Fri, Aug 31, 2018 Robb T. Koether (Hampden-Sydney College) Programming Languages Fri, Aug 31, 2018 1 / 23 1 Programming Languages

More information

Chapter 1 Introduction to Computers and C++ Programming

Chapter 1 Introduction to Computers and C++ Programming Chapter 1 Introduction to Computers and C++ Programming 1 Outline 1.1 Introduction 1.2 What is a Computer? 1.3 Computer Organization 1.7 History of C and C++ 1.14 Basics of a Typical C++ Environment 1.20

More information

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program? Chapter 1: Introduction to Computers and Programming 1.1 Why Program? Why Program? Computer programmable machine designed to follow instructions Program instructions in computer memory to make it do something

More information

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

CS 241 Computer Programming. Introduction. Teacher Assistant. Hadeel Al-Ateeq CS 241 Computer Programming Introduction Teacher Assistant Hadeel Al-Ateeq 1 2 Course URL: http://241cs.wordpress.com/ Hadeel Al-Ateeq 3 Textbook HOW TO PROGRAM BY C++ DEITEL AND DEITEL, Seventh edition.

More information

Computer Architecture 2/26/01 Lecture #

Computer Architecture 2/26/01 Lecture # Computer Architecture 2/26/01 Lecture #9 16.070 On a previous lecture, we discussed the software development process and in particular, the development of a software architecture Recall the output of the

More information

Introduction to Programming

Introduction to Programming Introduction to Programming session 5 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2010 These slides are created using Deitel s slides Sahrif University of Technology Outlines

More information

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

Week 1 Introduction to Computer and Algorithm (Part1) UniMAP Sem II 11/12 DKT121: Basic Computer Programming 1 Week 1 Introduction to Computer and Algorithm (Part1) UniMAP Sem II 11/12 DKT121: Basic Computer Programming 1 General Information Contributes 3 units: 2 hours lectures 2 hours labs and tutorials Main

More information

Information Science 1

Information Science 1 Information Science 1 -Basic Concepts of Computers: Opera4on, Architecture, Memory- Week 02 College of Information Science and Engineering Ritsumeikan University Today s lecture outline l Recall the previous

More information

Lecture 01: Basic Structure of Computers

Lecture 01: Basic Structure of Computers CSCI2510 Computer Organization Lecture 01: Basic Structure of Computers Ming-Chang YANG mcyang@cse.cuhk.edu.hk Reading: Chap. 1.1~1.3 Outline Computer: Tools for the Information Age Basic Functional Units

More information

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Dec Hex Bin ORG ; ZERO. Introduction To Computing Dec Hex Bin 0 0 00000000 ORG ; ZERO Introduction To Computing OBJECTIVES this chapter enables the student to: Convert any number from base 2, base 10, or base 16 to any of the other two bases. Add and

More information

Fundamentals of Programming. Lecture 1: Introduction to C Programming

Fundamentals of Programming. Lecture 1: Introduction to C Programming 1 Fundamentals of Programming Lecture 1: Introduction to C Programming Instructor: Fatemeh Zamani f_zamani@ce.sharif.edu Sharif University of Technology Computer Engineering Department 2 Outline Grading

More information

Object Oriented Design

Object Oriented Design Object Oriented Design Lecture 2: Introduction to C++ Class and Object Objects are essentially reusable software components. There are date objects, time objects, audio objects, video objects, automobile

More information

Final Examination Semester 2 / Year 2005

Final Examination Semester 2 / Year 2005 Southern College Kolej Selatan 南方学院 Final Examination Semester 2 / Year 2005 COURSE : INTRODUCTION TO COMPUTING COURSE CODE : CSEG 1003 TIME : 2 1/2 HOURS DEPARTMENT : ELECTRICAL & ELECTRONIC ENGINEERING

More information

Basic Computer Programming for ISNE. Santi Phithakkitnukoon ผศ.ดร.ส นต พ ท กษ ก จน ก ร

Basic Computer Programming for ISNE. Santi Phithakkitnukoon ผศ.ดร.ส นต พ ท กษ ก จน ก ร 269102 Basic Computer Programming for ISNE Santi Phithakkitnukoon ผศ.ดร.ส นต พ ท กษ ก จน ก ร Syllabus Instructor: Asst. Prof. Dr. Santi Phithakkitnukoon ผศ.ดร.ส นต พ ท กษ ก จน ก ร (อ.เอ ม) Office room:

More information

o Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement

o Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement Last Time Let s all Repeat Together 10/3/05 CS150 Introduction to Computer Science 1 1 We covered o Counter and sentinel controlled loops o Formatting output Today we will o Type casting o Top-down, stepwise

More information

CHAPTER 1 Introduction to Computers and Java

CHAPTER 1 Introduction to Computers and Java CHAPTER 1 Introduction to Computers and Java Copyright 2016 Pearson Education, Inc., Hoboken NJ Chapter Topics Chapter 1 discusses the following main topics: Why Program? Computer Systems: Hardware and

More information

REVIEW. The C++ Programming Language. CS 151 Review #2

REVIEW. The C++ Programming Language. CS 151 Review #2 REVIEW The C++ Programming Language Computer programming courses generally concentrate on program design that can be applied to any number of programming languages on the market. It is imperative, however,

More information

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program?

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program? Intro to Programming & C++ Unit 1 Sections 1.1-4 and 2.1-10, 2.12-13, 2.15-17 CS 1428 Spring 2019 Jill Seaman 1.1 Why Program? Computer programmable machine designed to follow instructions Program a set

More information

Computer Programming. Dr. Fahad Computer Science Deptt.

Computer Programming. Dr. Fahad Computer Science Deptt. Computer Programming Dr. Fahad Computer Science Deptt. Course Description This course provides the fundamental programming concepts. The emphasis will be on problem solving rather than just learning the

More information

(0) introduction to the course. how to learn a programming language. (0) course structure

(0) introduction to the course. how to learn a programming language. (0) course structure topics: (0) introduction to the course (1) what is a computer? instructor: cis1.5 introduction to computing using c++ (robotics applications) spring 2008 lecture # I.1 introduction Prof Azhar, mqazhar@sci.brooklyn.cuny.edu

More information

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol.

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. 1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. B. Outputs to the console a floating point number f1 in scientific format

More information

CSI31 Introduction to Computer Programming I. Dr. Sharon Persinger Fall

CSI31 Introduction to Computer Programming I. Dr. Sharon Persinger Fall CSI31 Introduction to Computer Programming I Dr. Sharon Persinger Fall 2018 1 Overview Basic definitions: Computer Computer science Algorithm Programming language What is a computer? A modern computer

More information

DC57 COMPUTER ORGANIZATION JUNE 2013

DC57 COMPUTER ORGANIZATION JUNE 2013 Q2 (a) How do various factors like Hardware design, Instruction set, Compiler related to the performance of a computer? The most important measure of a computer is how quickly it can execute programs.

More information

Welcome to Computer Organization and Design Logic

Welcome to Computer Organization and Design Logic Welcome to Computer Organization and Design Logic CS 64: Computer Organization and Design Logic Lecture #1 Fall 2018 Ziad Matni, Ph.D. Dept. of Computer Science, UCSB A Word About Registration for CS64

More information

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS

Microprocessors I MICROCOMPUTERS AND MICROPROCESSORS Microprocessors I Outline of the Lecture Microcomputers and Microprocessors Evolution of Intel 80x86 Family Microprocessors Binary and Hexadecimal Number Systems MICROCOMPUTERS AND MICROPROCESSORS There

More information

Scientific Computing

Scientific Computing Scientific Computing Martin Lotz School of Mathematics The University of Manchester Lecture 1, September 22, 2014 Outline Course Overview Programming Basics The C++ Programming Language Outline Course

More information

C H A P T E R 1. Introduction to Computers and Programming

C H A P T E R 1. Introduction to Computers and Programming C H A P T E R 1 Introduction to Computers and Programming Topics Introduction Hardware and Software How Computers Store Data How a Program Works Using Python Computer Uses What do students use computers

More information

Lecture 1: Preliminaries

Lecture 1: Preliminaries Lecture 1: Preliminaries Edgardo Molina Department of Computer Science City College of New York August 30, 2011 Edgardo Molina (CS@CCNY) Lecture 1 August 30, 2011 1 / 44 Info and Schedule Course Info and

More information

Total 100. The American University in Cairo Computer Science & Engineering Department CSCE Instructor: Final Exam Fall 2014

Total 100. The American University in Cairo Computer Science & Engineering Department CSCE Instructor: Final Exam Fall 2014 The American University in Cairo Computer Science & Engineering Department CSCE 1001 Instructor: Final Exam Fall 2014 Last Name :... ID:... First Name:... Form I- Section No. ( ) EXAMINATION INSTRUCTIONS

More information

Welcome to Computer Organization and Design Logic CS 64: Computer Organization and Design Logic Lecture #1 Winter 2018

Welcome to Computer Organization and Design Logic CS 64: Computer Organization and Design Logic Lecture #1 Winter 2018 Welcome to Computer Organization and Design Logic CS 64: Computer Organization and Design Logic Lecture #1 Winter 2018 Ziad Matni Dept. of Computer Science, UCSB A Word About Registration for CS64 FOR

More information

Introduction to C++ Programming. Adhi Harmoko S, M.Komp

Introduction to C++ Programming. Adhi Harmoko S, M.Komp Introduction to C++ Programming Adhi Harmoko S, M.Komp Machine Languages, Assembly Languages, and High-level Languages Three types of programming languages Machine languages Strings of numbers giving machine

More information

From Pseudcode Algorithms directly to C++ programs

From Pseudcode Algorithms directly to C++ programs From Pseudcode Algorithms directly to C++ programs (Chapter 7) Part 1: Mapping Pseudo-code style to C++ style input, output, simple computation, lists, while loops, if statements a bit of grammar Part

More information

Review for COSC 120 8/31/2017. Review for COSC 120 Computer Systems. Review for COSC 120 Computer Structure

Review for COSC 120 8/31/2017. Review for COSC 120 Computer Systems. Review for COSC 120 Computer Structure Computer Systems Computer System Computer Structure C++ Environment Imperative vs. object-oriented programming in C++ Input / Output Primitive data types Software Banking System Compiler Music Player Text

More information

Chapter 1: Introduction to Computers and Java

Chapter 1: Introduction to Computers and Java Chapter 1: Introduction to Computers and Java Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 1 discusses the following main topics:

More information

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. 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 Chapter 1: Introduction to Computers and Java Starting Out with Java: From Control Structures through Objects Fifth Edition by Tony Gaddis Chapter Topics Chapter 1 discusses the following main topics:

More information

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit Lecture1: introduction Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit 1 1. History overview Computer systems have conventionally

More information

1) What of the following sets of values for A, B, C, and D would cause the string "one" to be printed?

1) What of the following sets of values for A, B, C, and D would cause the string one to be printed? Instructions: This homework assignment focuses primarily on some of the basic syntax and semantics of C++. The answers to the following questions can be determined from Chapters 6 and 7 of the lecture

More information

Introduction to Digital Logic

Introduction to Digital Logic Introduction to Digital Logic Lecture 5 Simple CPU Overview Instruction Set Software Process Software Program High Level Language Description if (x > ) x = x + y - z; a = b*x; Compiler JLEZ X,SKIP MOVE.W

More information

To become familiar with array manipulation, searching, and sorting.

To become familiar with array manipulation, searching, and sorting. ELECTRICAL AND COMPUTER ENGINEERING 06-88-211: COMPUTER AIDED ANALYSIS LABORATORY EXPERIMENT #2: INTRODUCTION TO ARRAYS SID: OBJECTIVE: SECTIONS: Total Mark (out of 20): To become familiar with array manipulation,

More information

CSCE 206: Structured Programming in C++

CSCE 206: Structured Programming in C++ CSCE 206: Structured Programming in C++ 2017 Spring Exam 1 Monday, February 13, 2017 Total - 100 Points B Instructions: Total of 11 pages, including this cover and the last page. Before starting the exam,

More information

CSCE 206: Structured Programming in C++

CSCE 206: Structured Programming in C++ CSCE 206: Structured Programming in C++ 2017 Spring Exam 1 Monday, February 13, 2017 Total - 100 Points A Instructions: Total of 11 pages, including this cover and the last page. Before starting the exam,

More information

C++ Support Classes (Data and Variables)

C++ Support Classes (Data and Variables) C++ Support Classes (Data and Variables) School of Mathematics 2018 Today s lecture Topics: Computers and Programs; Syntax and Structure of a Program; Data and Variables; Aims: Understand the idea of programming

More information

CS101 PLEDGED SPRING 2001

CS101 PLEDGED SPRING 2001 The following exam is pledged. All answers are to be given on the provided answer sheet. The test is closed book, closed note, and closed calculator. If you believe more than one answer is acceptable,

More information

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U C A N A D I A N I N T E R N A T I O N A L S C H O O L O F H O N G K O N G 5.1 Introduction 5.2 Components of a Computer System Algorithm The Von Neumann architecture is based on the following three characteristics:

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 2, 2016 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

Introduction to Computer Programming for Non-Majors

Introduction to Computer Programming for Non-Majors Introduction to Computer Programming for Non-Majors CSC 2301, Fall 2016 Chapter 1 Instructor: Long Ma The Department of Computer Science Objectives To understand the respective roles of hardware and software

More information

THE MICROPROCESSOR Von Neumann s Architecture Model

THE MICROPROCESSOR Von Neumann s Architecture Model THE ICROPROCESSOR Von Neumann s Architecture odel Input/Output unit Provides instructions and data emory unit Stores both instructions and data Arithmetic and logic unit Processes everything Control unit

More information

Sample Final Exam. 1) (24 points) Show what is printed by the following segments of code (assume all appropriate header files, etc.

Sample Final Exam. 1) (24 points) Show what is printed by the following segments of code (assume all appropriate header files, etc. Name: Sample Final Exam 1) (24 points) Show what is printed by the following segments of code (assume all appropriate header files, etc. are included): a) int start = 10, end = 21; while (start < end &&

More information

pointers + memory double x; string a; int x; main overhead int y; main overhead

pointers + memory double x; string a; int x; main overhead int y; main overhead pointers + memory computer have memory to store data. every program gets a piece of it to use as we create and use more variables, more space is allocated to a program memory int x; double x; string a;

More information

The American University in Cairo Computer Science & Engineering Department CSCE 106 Fundamentals of Computer Science

The American University in Cairo Computer Science & Engineering Department CSCE 106 Fundamentals of Computer Science The American University in Cairo Computer Science & Engineering Department CSCE 106 Fundamentals of Computer Science Instructor: Dr. Khalil Final Exam Fall 2013 Last Name :... ID:... First Name:... Form

More information

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

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017 Programming 1 Lecture 1 COP 3014 Fall 2017 August 28, 2017 Main Components of a computer CPU - Central Processing Unit: The brain of the computer. ISA - Instruction Set Architecture: the specific set of

More information

Introduction to Programming EC-105. Lecture 2

Introduction to Programming EC-105. Lecture 2 Introduction to Programming EC-105 Lecture 2 Input and Output A data stream is a sequence of data - Typically in the form of characters or numbers An input stream is data for the program to use - Typically

More information

COP 2000 Note Framework Chapter 5 - Repetition Page 1

COP 2000 Note Framework Chapter 5 - Repetition Page 1 COP 2000 Note Framework Chapter 5 - Repetition Page 1 The programming approach in which all problems are broken down using only three simple control structures, each of which has only one starting point

More information

FACTFILE: GCE DIGITAL TECHNOLOGY

FACTFILE: GCE DIGITAL TECHNOLOGY FACTFILE: GCE DIGITAL TECHNOLOGY AS2: FUNDAMENTALS OF DIGITAL TECHNOLOGY Hardware and Software Architecture 1 Learning Outcomes Students should be able to: describe the internal components of a computer

More information

A Review of Chapter 5 and. CSc 2010 Spring 2012 Instructor: Qian Hu

A Review of Chapter 5 and. CSc 2010 Spring 2012 Instructor: Qian Hu A Review of Chapter 5 and Chapter 6 Chapter 5 Computer Systems Organization Von Neumann Architecture 4 Components Memory Input/output ALU Control Unit Two major features Stored program concept Sequential

More information

CSC 126 FINAL EXAMINATION FINAL Spring 2012 B. Name (last, First) Instructor. Total Possible. Received

CSC 126 FINAL EXAMINATION FINAL Spring 2012 B. Name (last, First) Instructor. Total Possible. Received CSC 126 FINAL EXAMINATION FINAL Spring 2012 B Name (last, First) Instructor Question # Total Possible Total Received 1. 8 2. 8 3. 8 4. 14 5. 18 6. 10 7. 16 8. 18 TOTAL 100 Final Exam/ Page 2 1) (8 points)

More information

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements

Review: Exam 1. Your First C++ Program. Declaration Statements. Tells the compiler. Examples of declaration statements Review: Exam 1 9/20/06 CS150 Introduction to Computer Science 1 1 Your First C++ Program 1 //*********************************************************** 2 // File name: hello.cpp 3 // Author: Shereen Khoja

More information

By the end of this section you should: Understand what the variables are and why they are used. Use C++ built in data types to create program

By the end of this section you should: Understand what the variables are and why they are used. Use C++ built in data types to create program 1 By the end of this section you should: Understand what the variables are and why they are used. Use C++ built in data types to create program variables. Apply C++ syntax rules to declare variables, initialize

More information

Data Structures and Programming with C++

Data Structures and Programming with C++ Data Structures and Programming with C++ By Dr. Atul Dwivedi ETC, BIT, Durg UNIT-I B. E., V Semester Outline Objectives of the Course Syllabus Reference Books Introduction to programming languages Basic

More information

Computer Programming

Computer Programming Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty Department of Computer Science and Engineering Session: Structure of a Simple C++ Program Dr. Deepak B. Phatak & Dr. Supratik Chakraborty,

More information

C++11 threads -- a simpler interface than pthreads Examples largely taken from https://latedev.wordpress.com/ 013/02/24/investigating-c11-threads/

C++11 threads -- a simpler interface than pthreads Examples largely taken from https://latedev.wordpress.com/ 013/02/24/investigating-c11-threads/ C++11 threads -- a simpler interface than pthreads Examples largely taken from https://latedev.wordpress.com/ 013/02/24/investigating-c11-threads/ #include #include using namespace

More information

Why Is Repetition Needed?

Why Is Repetition Needed? Why Is Repetition Needed? Repetition allows efficient use of variables. It lets you process many values using a small number of variables. For example, to add five numbers: Inefficient way: Declare a variable

More information

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE Department of Computer and Mathematical Sciences CS 3401 Assembly Language 4 Lab 4: Introduction to MARIE Objectives: The main objective of this lab is to get you familiarized with MARIE a simple computer

More information

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng. CS 265 Computer Architecture Wei Lu, Ph.D., P.Eng. Part 3: von Neumann Architecture von Neumann Architecture Our goal: understand the basics of von Neumann architecture, including memory, control unit

More information

Week 2: Console I/O and Operators Arithmetic Operators. Integer Division. Arithmetic Operators. Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5.

Week 2: Console I/O and Operators Arithmetic Operators. Integer Division. Arithmetic Operators. Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5. Week 2: Console I/O and Operators Gaddis: Chapter 3 (2.14,3.1-6,3.9-10,5.1) CS 1428 Fall 2014 Jill Seaman 1 2.14 Arithmetic Operators An operator is a symbol that tells the computer to perform specific

More information

The American University in Cairo Computer Science & Engineering Department CSCE 106 Fundamentals of Computer Science. Instructor: Final Exam Fall 2011

The American University in Cairo Computer Science & Engineering Department CSCE 106 Fundamentals of Computer Science. Instructor: Final Exam Fall 2011 The American University in Cairo Computer Science & Engineering Department CSCE 106 Fundamentals of Computer Science Instructor: Final Exam Fall 2011 Last Name :... ID:... First Name:... Section No.: EXAMINATION

More information

CPSC 121: Models of Computation

CPSC 121: Models of Computation Instructor: Bob Woodham woodham@cs.ubc.ca Department of Computer Science University of British Columbia Lecture Notes 2009/2010, Section 203 Menu March 22, 2010 Topics: A Simple Computer High-level design

More information

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018

Fundamentals of Programming (Python) Basic Concepts. Ali Taheri Sharif University of Technology Spring 2018 Fundamentals of Programming (Python) Basic Concepts Ali Taheri Sharif University of Technology Outline 1. What is a Computer? 2. Computer System Organization 3. What is a Computer Program? 4. Programming

More information

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015 CS 31: Intro to Systems Digital Logic Kevin Webb Swarthmore College February 3, 2015 Reading Quiz Today Hardware basics Machine memory models Digital signals Logic gates Circuits: Borrow some paper if

More information

Computer Architecture (part 2)

Computer Architecture (part 2) Computer Architecture (part 2) Topics: Machine Organization Machine Cycle Program Execution Machine Language Types of Memory & Access 2 Chapter 5 The Von Neumann Architecture 1 Arithmetic Logic Unit (ALU)

More information

Computer Programming : C++

Computer Programming : C++ The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2003 Muath i.alnabris Computer Programming : C++ Experiment #1 Basics Contents Structure of a program

More information

Binary Arithmetic Intro to Assembly Language CS 64: Computer Organization and Design Logic Lecture #3

Binary Arithmetic Intro to Assembly Language CS 64: Computer Organization and Design Logic Lecture #3 Binary Arithmetic Intro to Assembly Language CS 64: Computer Organization and Design Logic Lecture #3 Ziad Matni Dept. of Computer Science, UCSB Adding this Class The class is full I will not be adding

More information

Intermediate Programming & Design (C++) Notation

Intermediate Programming & Design (C++) Notation Notation Byte = 8 bits (a sequence of 0 s and 1 s) To indicate larger amounts of storage, some prefixes taken from the metric system are used One kilobyte (KB) = 2 10 bytes = 1024 bytes 10 3 bytes One

More information

AS/A Level Computing Syllabus 2011

AS/A Level Computing Syllabus 2011 AS/A Level Computing Syllabus 2011 Section 3 - System Software Mechanisms - - Machine Architecture - - Database Theory - - Programming Paradigms - Chapter 3.3 Computer Architectures & Fetch-Execute Cycle

More information

Unit 7. 'while' Loops

Unit 7. 'while' Loops 1 Unit 7 'while' Loops 2 Control Structures We need ways of making decisions in our program To repeat code until we want it to stop To only execute certain code if a condition is true To execute one segment

More information

Computer Fundamentals

Computer Fundamentals Computer Fundamentals 1 Draw the block diagram of computer architecture and explain each block. Computer is made up of mainly four components, 1) Central processing unit (CPU) 2) Input section 3) Output

More information

Information Science 1

Information Science 1 Information Science 1 - Representa*on of Data in Memory- Week 03 College of Information Science and Engineering Ritsumeikan University Topics covered l Basic terms and concepts of The Structure of a Computer

More information

Faculty of Science, Engineering and Technology

Faculty of Science, Engineering and Technology Swinburne University of Technology Faculty of Science, Engineering and Technology ASSIGNMENT COVER SHEET Subject Code: COS30008 Subject Title: Data Structures and Patterns Assignment number and title:

More information

Fundamentals of Programming CS-110. Lecture 2

Fundamentals of Programming CS-110. Lecture 2 Fundamentals of Programming CS-110 Lecture 2 Last Lab // Example program #include using namespace std; int main() { cout

More information

Your First C++ Program. September 1, 2010

Your First C++ Program. September 1, 2010 Your First C++ Program September 1, 2010 Your First C++ Program //*********************************************************** // File name: hello.cpp // Author: Bob Smith // Date: 09/01/2010 // Purpose:

More information

Lecture 19: Computers. Pay no attention to the man behind the curtain.

Lecture 19: Computers. Pay no attention to the man behind the curtain. Lecture 19: Computers Pay no attention to the man behind the curtain. Samuel Wolfson // CSE 120, Winter 2018 Final Project Administrivia Show off all the cool skillz you've learned this quarter! Three

More information

Introduction to Computer Programming for Non-Majors CSC 2301, Fall The Department of Computer Science

Introduction to Computer Programming for Non-Majors CSC 2301, Fall The Department of Computer Science Introduction to Computer Programming for Non-Majors CSC 2301, Fall 2015 The Department of Computer Science CSC 2301 Welcome to Class CSC 2301! Introduction to Computer Programming for Non-Majors Who are

More information

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text About the course : In this digital world, embedded systems are more

More information

Exception with arguments

Exception with arguments Exception Handling Introduction : Fundamental Syntax for Exception Handling code : try catch throw Multiple exceptions Exception with arguments Introduction Exception: An abnormal condition that arises

More information