28-February-2007CMP 131 Introduction to Computers and Programming1 CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lecture.

Slides:



Advertisements
Similar presentations
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Advertisements

Lecture 1: Overview of Computers & Programming
An Overview of the Computer System
Using Computers CS French Chapter 1.
1 Hardware - devices for Input. 2 Hardware - devices for Input Processing.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
1 System Software “Background software”, manages the computer’s internal resources.
Topic 1: Introduction to Computers and Programming
1 The development of modern computer systems Early electronic computers Mainframes Time sharing Microcomputers Networked computing.
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
Computer Systems CS208. Major Components of a Computer System Processor (CPU) Runs program instructions Main Memory Storage for running programs and current.
Introduction to Computers Essential Understanding of Computers and Computer Operations.
CMSC 104, Version 9/01 1 Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The.
Information Technology Ms. Abeer Helwa. Computer Generations First Generation (Vacuum Tubes) -They relied on the machine language to perform operations.
CS102 Introduction to Computer Programming
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.
Chapter Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
Aug CMSC 104, LECT-021 Machine Architecture and Number Systems Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY.
UNIX Unbounded 5 th Edition Amir Afzal Chapter 1 First Things First.
Topics Introduction Hardware and Software How Computers Store Data
INTRODUCTION TO COMPUTING
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CISC105 General Computer Science Class 1 – 6/5/2006.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
1 nd Semester Module1 Introduction to Computer and Programming Thanawin Rakthanmanon Create by: Aphirak Jansang Computer.
Course ILT Basics of information technology Unit objectives Define “information technology” (IT), distinguish between hardware and software, and identify.
Machine Architecture CMSC 104, Section 4 Richard Chang 1.
COMPUTER ARCHITECTURE. Recommended Text 1Computer Organization and Architecture by William Stallings 2Structured Computer Organisation Andrew S. Tanenbaum.
Computer Architecture
6/4/ Key components of the computer Classification of computers based on Purposes Classification of computers based on Signals Classification of.
Computer Hardware Basic Computer Concepts Components of Data Processing  Data processing is a technique of collecting, manipulating and distributing.
Aug CMSC 104, LECT-021 Machine Architecture Some material in this presentation is borrowed form Adrian Ilie From The UNIVERSITY of NORTH CAROLINA.
Development of Computers. Hardware 1. Original concept: Charles Babbage 1840’s 2. 4 basic components of a computer system: input store mill output (Now:
Components of a Computer System
Computer Organization. The digital computer is a digital system that performs various computational tasks Digital computer use binary number system which.
Machine Architecture and Number Systems
Scott Marino MSMIS Kean University MSAS5104 Introduction to Programming with Data Structures and Algorithms Week 2 Scott Marino.
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.
CMSC Machine Architecture and Number Systems Topics Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Computer Programming (1) Code & No.: CS 102 CREDIT HOURS: 5 UNIT Lecture 3.0 hours/week Lab: 2.0 hour/on every week a. This course introduces the students.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
Hardware Information Created by Nasih 1. Hardware  The physical components of a computer system, including any peripheral equipment such as printers,
 A computer is an electronic device that receives data (input), processes data, stores data, and produces a result (output).  It performs only three.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Introduction to Programming. Key terms  CPU  I/O Devices  Main memory  Secondary memory  Operating system  User interface  Application  GUI 
Computer Architecture and Number Systems
BASIC PROGRAMMING C SCP1103 (02)
Computer Science II Chapter 1.
King Saud University- College OF Applied Studies
BASIC PROGRAMMING C SCP1103 (02)
Introduction to Programming
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
An Overview of the Computer System
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Machine Architecture and Number Systems
Machine Architecture and Number Systems
COMPUTER FUNDAMENTALS i
Notes from Last Class Office Hours: GL Accounts?
Computer components is a programmable machine that receives input, stores and manipulates data, and provides output in a useful format. Computer The computer.
Machine Architecture and Number Systems
Presentation transcript:

28-February-2007CMP 131 Introduction to Computers and Programming1 CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lecture 2

28-February-2007CMP 131 Introduction to Computers and Programming2 Outline of Topics Review briefly last class More details about hardware Software/Hardware interface –Data and program representation –Machine arithmetic

28-February-2007CMP 131 Introduction to Computers and Programming3 Last Class Course Description Logistics Assessments (Grading) Homework –First assignment will come out Monday

28-February-2007CMP 131 Introduction to Computers and Programming4 Last Class (2) Computers: What’s in them? –Hardware –Software Hardware devices Computers through time Hardware trends Hardware/software trends

28-February-2007CMP 131 Introduction to Computers and Programming5 Why Take This Course? Be more familiar with PCs Have a basic understanding of programming and the programming process Develop critical thinking & problem solving capabilities Learn other programming languages faster & easier

28-February-2007CMP 131 Introduction to Computers and Programming6 Why Pascal? One of the first structured programming languages It influenced the design of its successors –Modula 2, Oberon (by N.Wirth) –Modula2+, Modula3 (DEC, Olivetti) –Java –Not C or C++

28-February-2007CMP 131 Introduction to Computers and Programming7 Today’s Lecture Review of computers and hardware –Some more information More about software Programming languages –Low and high-level languages –Viewing programming through different languages Introduction to the Pascal IDE environment

28-February-2007CMP 131 Introduction to Computers and Programming8 Computer Systems Computers –Devices for performing computations at high speeds with great accuracy –A machine that can be programmed to manipulate symbols. Can perform complex & repetitive procedures quickly, precisely and reliably. Can quickly store and retrieve large amounts of data. Program –A set of instructions for a computer to follow, written in specific programming language

28-February-2007CMP 131 Introduction to Computers and Programming9 Computer Systems Hardware (HW) –Actual physical machines (equipment) that make up the computer Software (SW) –A collection of programs used by a computer –A set of instructions provided by the programmer that the computer follows. –Program instructions have to be stored in main memory before they can be executed.

28-February-2007CMP 131 Introduction to Computers and Programming10 Computer Systems Computer Categories: –Microcomputers (Personal computers / PCs) Used by a single person –Workstations: Largest microcomputers –Minicomputers: Can be used by many people simultaneously by using several terminals connected to the same CPU –Main frame computers: Faster & larger than minicomputers –Super computers: Most powerful mainframe computers Of which category is you computer at home??

28-February-2007CMP 131 Introduction to Computers and Programming11 Hardware (HW): Organization Computer HW usually consists of: –CPU –Main memory (RAM & ROM) –I/O Devices –Secondary Memory CPU & main memory are the heart of the computer Usually the CPU, main memory and secondary memory are housed in a single cabinet CPU Main Memory I/O Devices Secondary Memory

28-February-2007CMP 131 Introduction to Computers and Programming12 Hardware (HW): Central Processing Unit (CPU) Executes programs Performs calculations –Arithmetic Add, subtract, divide, multiply, … etc. –Logical Compare, test for true/false Controls & coordinates the other parts of the computer.

28-February-2007CMP 131 Introduction to Computers and Programming13 Hardware (HW): Memory Main (Primary) Memory: –Ordered sequence and specific number of memory locations (Bytes, words) that have unique addresses indicating their relative positions –Fast, expensive, short term memory –Holds intermediate results and serves as “scratch paper” –Needed to carry out program instructions –Types: RAM: Random Access Memory (vs. Sequential Access Memory) Volatile (i.e. contents disappear when the computer is switched off) Writable (except where forbidden by the software) ROM: Read Only Memory Non-volatile Also usually random access

28-February-2007CMP 131 Introduction to Computers and Programming14 Hardware (HW): Memory Secondary (auxiliary) memory –Used for keeping a permanent records of information –Holds programs and data between jobs –Keeps data or program files for later use –Slower, cheaper, long-term memory –Common forms Diskettes, magnetic tapes, hard disk, CD-ROM’s, DVD –Some types are removable

28-February-2007CMP 131 Introduction to Computers and Programming15 Hardware (HW) I/O (Input/Output) devices –Allow the user to communicate with the computer. –A single computer could be connected to more than one input or output device. –Examples: Input: Keyboard, mouse, scanner, voice Output: Screen, printer, voice

28-February-2007CMP 131 Introduction to Computers and Programming16 Hardware/Software Architectures Mainframe Era –1940’s-70’s: mainframe computer, minicomputers –Environments: Batch environments, batch processing –Files are basis for I/O: fixed formats, minimal device I/O –Error recovery –Lack of timing constraints Interactive environments –Terminal and file I/O: –Interactive error handling –Faster performance

28-February-2007CMP 131 Introduction to Computers and Programming17 Personal Computers Era –1978: the Apple II ran BASIC Educational use –1981: IBM released the first PC –1984: Macintosh –Window environments: OO models are ideal (Smalltalk) Must interact with many I/O devices (file I/O is less important) –Embedded systems Error handling Real-time response Distributed systems with concurrently running tasks

28-February-2007CMP 131 Introduction to Computers and Programming18 Networking Era: –LANs (Local Area Networks): client-server model Airline reservations, banking –Internet 70’s: ARPANET: telnet, FTP, SMTP protocols late 80’s: HTML and HTTP added –Issues and Effects: Static web pages with URLs for access URL = Uniform Resource Locator Dynamic web pages for e-commerce (Perl, JAVA, etc.) Security Performance (multiple clients) –Offloading work to client

28-February-2007CMP 131 Introduction to Computers and Programming19 Hardware/Software Concepts Computers manipulate instructions and data –Represented in similar ways –Used in different ways –Representation is binary (digital hardware is binary) Numbers vs. symbols –Computers represent everything as numbers –But numbers can represent symbols –Can perform “symbolic” computation Beginning of Artificial Intelligence

28-February-2007CMP 131 Introduction to Computers and Programming20 HW/SW Concepts: Data  What is it?  Numbers, characters, images, or other method of recording  Can be assessed by a human or (especially) input into a computer, stored and processed there, or transmitted on some digital channel.  Nearly always represent data in binary.  Has no meaning on its own.  When interpreted by data processing system it takes on meaning and becomes information.  Storage –Setting of individual bits to specific values, destroying its previous contents  Retrieval –Copying the contents of a particular memory cell to another storage area. –Original data remains unchanged

28-February-2007CMP 131 Introduction to Computers and Programming21 HW/SW Concepts: Representation Digit / Bit –Smallest unit of information/storage, sufficient to hold one bit –Can take one of two values (true/false, 1/0, or yes/no) –Corresponds to an input/output being on or off Byte –Smallest addressable unit of storage –Usually 8 bits –Typically holds one character –Can represent 256 different values

28-February-2007CMP 131 Introduction to Computers and Programming22 HW/SW Concepts: Representation Word –Fundamental unit of storage in a computer –Word size is one of its chief distinguishing characteristics of a computer –Typical size in modern computers: 32 bits (4 bytes) or 64 bits (8 bytes) –An instruction is usually one or more words long –A word can be used to hold a whole number of characters

28-February-2007CMP 131 Introduction to Computers and Programming23 Decimal Number System A base 10 system Each digit position can hold 10 values (0-9) Ex = 4*1 + 3 * * *1000 = 4* * * *10 3

28-February-2007CMP 131 Introduction to Computers and Programming24 Binary Number System A base 2 system Each digit position can hold 2 values (0-1) Ex Decimal conversion –Equals: 1* * * *2 3 –Equals: = 11 Maximum number of values in 4 bits: 16 –0 to 15 Maximum number of values in 8 bits: 256 –0 to 255 [or -128 to 127] –This is how much you can store in a byte

28-February-2007CMP 131 Introduction to Computers and Programming25 Binary Numbers

28-February-2007CMP 131 Introduction to Computers and Programming26 Binary Addition = = = = = = => 1 OVERFLOW!!!

28-February-2007CMP 131 Introduction to Computers and Programming27 Other Number Systems Hexadecimal: base 16 –Each digit can hold 16 values (0-9,A-F) –Ex: A02F –Decimal conversion? –Note: 1 hex digit = 4 binary digits Octal: base 8 –Each digit can hold 8 values (0 to 7) –Ex: 127 –Decimal conversion?

28-February-2007CMP 131 Introduction to Computers and Programming28 Logical Operations AND: –1 AND 1 = 1 –Everything else = 0 OR –0 AND 0 = 0 –Everything else = 1 XOR (Exclusive OR) –0 AND 1 = 1 –0 AND 0 = 0, 1 AND 1 = 0