Computer Science I CSCI-1100-01 Summer 2009 David E. Goldschmidt, Ph.D.

Slides:



Advertisements
Similar presentations
4/23/2015Engineering Problem Solving with C++ second edition, J. ingber 1 Engineering Problem Solving with C++, Etter/Ingber Chapter 1.
Advertisements

Overview of Computers & Programming Languages Chapter 1.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
Binary Representation Introduction to Computer Science and Programming I Chris Schmidt.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Computing Components 01/26/11. Announcements & Reminders Programs 1 due Friday, 9/2/11 What is my late policy? Proxy Codes for Labs  You should be able.
Introduction to Computers and Programming. Some definitions Algorithm: –A procedure for solving a problem –A sequence of discrete steps that defines such.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
Assembly Language for Intel-Based Computers, 4th Edition
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
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
Introduction to Computers and Programming. Some definitions Algorithm: Algorithm: A procedure for solving a problem A procedure for solving a problem.
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
© Janice Regan, CMPT 128, Jan CMPT 128: Introduction to Computing Science for Engineering Students Integer Data representation Addition and Multiplication.
Copyright Jim Martin Computers Inside and Out Dr Jim Martin
Topics Introduction Hardware and Software How Computers Store Data
How Computers Work Dr. John P. Abraham Professor UTPA.
CSU0014 Assembly Languages Homepage: Textbook: Kip R. Irvine, Assembly Language for Intel-Based Computers,
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Computer Science 111 Fundamentals of Programming I Number Systems.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Hudson Valley Community College CISS-110 – Programming & Logic I David Goldschmidt, Ph.D.
Computer Systems Organization CS 1428 Foundations of Computer Science.
CPU Internal memory I/O interface circuit System bus
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
The Central Processing Unit (CPU) and the Machine Cycle.
CSCI 211 Intro Computer Organization –Consists of gates for logic And Or Not –Processor –Memory –I/O interface.
CMSC 150 PROGRAM EXECUTION CS 150: Wed 1 Feb 2012.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
An Example Architecture. A Paper Computer - Woody Woody's characteristics Word size – 8 bits One word.
Computer Organization CS345 David Monismith Based upon notes by Dr. Bill Siever and notes from the Patternson and Hennessy Text.
Dale & Lewis Chapter 5 Computing components
Logic Design / Processor and Control Units Tony Diep.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Chapter 1 Getting Acquainted With Computers, Programs, and C++
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
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.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
Software Design and Development Storing Data Computing Science.
Software Engineering Algorithms, Compilers, & Lifecycle.
Chapter 1: Introduction to Computers and Programming
Software Development Environment
Engineering Problem Solving With C An Object Based Approach
Chapter 2 – Computer hardware
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Overview of Computers & Programming Languages
Chapter 1: Introduction to Computers and Programming
Computer Science 210 Computer Organization
Introduction to Computer Science
Fundamentals of Programming I Number Systems
Computer Electronic device Accepts data - input
Computer Electronic device Accepts data - input
Computers Inside and Out
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Computer Science I CSCI Summer 2009 David E. Goldschmidt, Ph.D.

Hardware

Central Processing Unit (CPU) Arithmetic Logic Unit Control Unit CPU Instruction (input)Result (output) e.g. addition, subtraction, logical AND, OR, NOT executes machine language programs

Memory A section of memory is called a byte. A section of two or four bytes is often called a word. Main memory can be visualized as a column or row of cells. 0x000 0x001 0x003 0x002 0x004 0x005 0x006 0x007 A byte is made up of 8 bits

Low-Level Languages Machine language program (executable file) LDA #47 STA $570 DEX JSR $817 CPX #0 BNE #14 Assembly language program Translation program (Assembler)

Compiling a C/C++ Program #include int main() { float x; cout << “... C/C++ program C/C++ Compiler Machine language program (object “.obj” file) Precompiled Libraries (e.g. iostream) C/C++ Linker Machine language program (executable “.exe” file)

Fetch-Decode-Execute Cycle Fetch The CPU’s control unit fetches, from main memory, the next instruction in the sequence of program instructions. Decode The instruction is encoded in the form of a number. The control unit decodes the instruction and generates an electronic signal. Execute The signal is routed to the appropriate component of the computer (such as the ALU, a disk drive, or some other device). The signal causes the component to perform an operation. The CPU performs the fetch-decode- execute cycle to “run” program instructions

Numbering Systems We count using our fingers.... Base 10: Computers count using binary digits or bits.... Base 2:

Base Conversion A byte is a grouping of 8 bits Convert an unsigned binary number ( ) to decimal (base 10): What about negative integers? base 10 value = unsigned byte ranges from 0 to 255

Two’s Complement Conversion from binary to decimal is identical, except the leftmost bit always has a negative weight base 10 value +++ = two’s complement byte ranges from -128 to 127

Base Conversion (again) Convert from base 10 to base 2: Find the largest power of 2 that’s less than or equal to the number you’re trying to convert Subtract it from base 10 number and repeat... For example:

Algorithms What is an algorithm? A solution to a problem A recipe A step-by-step set of English instructions that describes how inputs are processed to produce expected outputs Write an algorithm to change a light bulb Write an algorithm to get driving directions from Albany to Cape Cod

Algorithms Write an algorithm to sum integers 1 to 100 Write an algorithm to convert an unsigned byte (e.g ) from base 2 to base 10 Write an algorithm to convert a signed two’s complement byte (e.g ) from base 2 to base 10