Computer Science Theory & Introduction Week 1 Lecture Material – F'13 Revision Doug Hogan Penn State University CMPSC 201 – C++ Programming for Engineers.

Slides:



Advertisements
Similar presentations
Lecture 1: Overview of Computers & Programming
Advertisements

 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
FIRST COURSE Essential Computer Concepts. New Perspectives on Microsoft Office 2007: Windows XP Edition 2 Objectives Compare the types of computers Describe.
Hardware. Basic Computer System Central Processing Unit Input Devices Output Devices Backing Storage Devices.
Computer Hardware Introduction. Computer System Components Input Keyboard, Mouse, Camera, Touch Pad Processing CPU Output Monitor, Printer Storage Floppy,
Computer Architecture. Central Processing Unit (CPU)- micro processor The Personal Computer.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Ceng 230 Programming with C
1 Introduction to Computers Prof. Sokol Computer and Information Science Brooklyn College.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
COMP Computer Basics Yi Hong May 13, 2015.
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.
Essential Computer Concepts. XP New Perspectives on Microsoft Office 2007: Windows XP Edition2 What Is a Computer? A computer is an electronic device.
Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer.
Chapter Introduction to Computers and Programming 1.
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
1 Lecture 2 : Computer System and Programming. Computer? a programmable machine that  Receives input  Stores and manipulates data  Provides output.
Week 1 Lecture Material Penn State University CMPSC 201 – C++ Programming for Engineers Original class notes from Dough Hogan,
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
CSCI 125 & 161 Lecture 2 Martin van Bommel. Hardware vs Software Hardware - physical components you can see and touch –e.g. processor, keyboard, disk.
1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting.
Chapter Two Hardware Basics: Inside the Box. ©1999 Addison Wesley Longman2.2 Chapter Outline What Computers Do A Bit About Bits The Computer’s Core: CPU.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
MAC OS – Unit A Page: 10-11, Investigating Data Processing Understanding Memory.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Copyright © 2003 by Prentice Hall Module 5 Central Processing Unit 1. Binary representation of data 2. The components of the CPU 3. CPU and Instruction.
1 Introduction to Computers Lect 1 Won’t tell you much you don’t know. (Misleading– the course gets more conceptual as we create webpages.) Will go into.
Computer Parts. Two Basic Parts Hardware & Software.
Computer Science Theory & Introduction Week 1 Lecture Material Doug Hogan Penn State University CMPSC 201 – C++ Programming for Engineers.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
 Bits & Bytes Bits & Bytes  Units of data Units of data  Storage devices Storage devices  Storage Types Storage Types  Secondary Storage Secondary.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Computer Organization & Assembly Language © by DR. M. Amer.
CSCI-100 Introduction to Computing Hardware Part I.
1 st Semester Introduction to Computer and Programming Computer Engineering Department Kasetsart University, Bangkok, THAILAND.
GCSE ICT Storing data - Internal memory, backing storage, and measuring memory.
Beginning Snapshots Chapter 0. C++ An Introduction to Computing, 3rd ed. 2 Objectives Give an overview of computer science Show its breadth Provide context.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
The Computer System CS 103: Computers and Application Software.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
Some Computer Science Conceptual Background Material Doug Hogan This version for UIC Spring 2016 CS 107.
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.
Introduction to Computers Lecture 1.1 Doug Hogan, Penn State University CMPSC 100 – Computer Fundamentals and Applications.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Introduction to Programming. Key terms  CPU  I/O Devices  Main memory  Secondary memory  Operating system  User interface  Application  GUI 
An Overview of the Computer System
Chapter 1: An Overview of Computers and Programming Languages
UNDERSTANDING YOUR COMPUTER
UNIT 9 Computer architecture
Overview of Computers and Programming Chapter 1
Storage Hardware This icon indicates the slide contains activities created in Flash. These activities are not editable. For more detailed instructions,
Microprocessor Systems Design I
Computer System and Programming
Computer Hardware Introduction.
Introduction to Computers
Introduction to Computers
Looking Inside the machine (Types of hardware, CPU, Memory)
An Overview of the Computer System
How do computers work? Storage.
Introduction to Computers
Chapter 3 Hardware and software 1.
Chapter 3 Hardware and software 1.
From Problems to Algorithms to Programs
ICS103 Programming in C 1: Overview of Computers And Programming
Presentation transcript:

Computer Science Theory & Introduction Week 1 Lecture Material – F'13 Revision Doug Hogan Penn State University CMPSC 201 – C++ Programming for Engineers CMPSC FORTRAN Programming for Engineers

Hardware vs. Software Hardware essentially, things you can touch input, output, storage devices memory Software essentially, what the computer knows data, 0s and 1s programs (this is a software course)

Categories of Memory Read-only memory (ROM) can only read data Random-access memory (RAM) can read and write information primary storage - computer’s main memory volatile

Sequential Access vs. Random Access Memory Sequential Access: must access each location in memory in order Random Access: can access memory locations using addresses, in any order Speed implications? Track 1 Track 2

Measuring Memory base unit: 1 bit = binary digit, 0 or 1 8 bits = 1 byte (B) 1000 bytes ≈ 1 kilobyte (KB) 1000 KB ≈ 1,000,000 B ≈ 1 megabyte (MB) 1000 MB ≈ 1,000,000,000 B ≈ 1 gigabyte (GB) 1000 GB ≈ 1,000,000,000,000 B ≈ 1 terabyte (TB)

Storage Device Capacities Floppy disk (the old 3.5” ones) 1.44 MB Compact disc (CD) MB Digital Versatile/Video Disc (DVD) 4.7 GB Hard disks, flash drives typically sizes in GB

Software Overview System software Controls basic operations of computer The operating system manages memory, files, application software File management tasks – deleting, etc.

Software Overview Application software Not essential to system running Enables you to perform specific tasks Ex: Office software Web browsers Media players Games

Algorithms and Languages An algorithm is a set of instructions to solve a problem. Think recipes. Many algorithms may solve the same problem. How do we choose? We use a programming language to explain our algorithms to computer and write programs.

Programming Paradigms/Models Imperative Programming: specify steps to solve problem, use methods, methods could get long Object-Oriented Programming (OOP): create objects to model real-world phenomena, send messages to objects, typically shorter methods Event-Driven Programming: create methods that respond to events like mouse clicks, key presses, etc. Others: Functional, logic, etc.

Compiled vs. Interpreted Languages Interpreted Language Requires software called an interpreter to run the code Code is checked for errors as it runs (erroneous code: do the best we can…) Examples: HTML, JavaScript, PHP Compiled Language Requires software called a compiler to run the code Code must be compiled into an executable before running (and thus error- free) Examples: C, C++, Pascal, Fortran, BASIC

Compiling Process Source Code (C++, Fortran, …) Object Code Executable Program Object Code from Libraries compilerlinker

Errors Syntax Errors Misuse of the language, much like using incorrect punctuation in English Compiler reports; program won’t run until they’re resolved Logic Errors Program doesn’t solve the problem at hand correctly Runtime Errors Errors that occur while the program is running, e.g. problems accessing memory and files, divide by zero

Abstraction Poll: Who can use a CD player? Who can explain how a CD player works? Who can drive a car? Who is an auto mechanic? Abstraction Principle of ignoring details that allows us to use complex devices Focus on the WHAT, not the HOW Fundamental to CS Other examples?

Levels of Abstraction 0. Digital Logic 1. Microprocessor 2. Machine Language 3. Operating System 4. Assembly Language 5. High-Level Language 6. Application Software

Binary Numbers Use two symbols: 0 and 1 Base 2 Compare with decimal number system Uses symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Base 10 At the lowest level of abstraction, everything in a computer is expressed in binary.

Binary Numbers, ctd Places: Decimal: 1s, 10s, 100s, etc. Binary, 1s, 2s, 4s, 8s, etc. Conversion between decimal and binary is done by multiplying or adding by powers of 2. “There are 10 kinds of people in the world…”

Other Number Systems Any positive integer could be the base of a number system. (Big topic in number theory.) Others used in computer science: Octal: Base 8 Hexadecimal: Base 16 New symbols A, B, C, D, E, F

ASCII Every character on a computer -- letters, digits, symbols, etc. -- is represented by a numeric code behind the scenes. This system of codes is called ASCII, short for American Standard Code for Information Interchange. We’ll learn more in lab…

# Transistors on a Processor ProcessorDateNumber of Transistors , , , , , , DX19891,180,000 Pentium19933,100,000 Pentium II19977,500,000 Pentium III199924,000,000 Pentium ,000,000 Data for Intel processors: Data from Section 4.1 of : Yates, Daniel S., and David S. Moore and Daren S. Starnes. The Practice of Statistics. 2nd Ed. New York: Freeman, 2003.

A Graphical View Graph from Intel's web site ( Retrieved 9/24/2006http:// Pay attention to the units on the axes…

Moore’s Law Prediction from Gordon Moore of Intel in Implication: The speed of processors doubles roughly every 12 to 18 months. Exponential relationship in the data. For the curious: the regression equation from the data two slides back is Can this go on forever?