An Introduction to Computer Science CS 8: Introduction to Computer Science, Winter 2018 Lecture #2

Similar documents
An Introduction to Computer Science CS 8: Introduction to Computer Science Lecture #2

Chapter 1. The Big Picture

Computers in Engineering COMP 208. A Brief History. Mechanical Calculators. A Historic Perspective Michael A. Hawker

Computers in Engineering COMP 208

Welcome to COSC Introduction to Computer Science

Fundamentals of Python: First Programs. Chapter 1: Introduction Modifications by Mr. Dave Clausen

Describe the layers of a computer system

Early Calculating Tools

Introduc)on to C++ CS 16: Solving Problems with Computers I Lecture #2

The trusted, student-friendly online reference tool. Name: Date:

Copyright 2012 Pearson Education, Inc. Publishing as Prentice Hall

Welcome to COS151! 1.1

You Will Need Floppy Disks for your labs!

1: History, Generation & Classification. Shobhanjana Kalita, Dept. of CSE, Tezpur University

Part (01) Introduction to Computer

A Brief History of Computer Science

Algorithm: Program: Programming: Software: Hardware:

Computer History CSCE 101

Introduction to Computer Science. What is Computer Science?

COURSE OVERVIEW. Introduction to Computer Engineering 2015 Spring by Euiseong Seo

A (BRIEF) HISTORY OF COMPUTING. By Dane Paschal

COMS 1003 Fall Introduction to Computer Programming in C. History & Computer Organization. September 15 th

CS140 Lecture 09a: Brief History of Computing

A Brief History of Computer Science. David Greenstein Monta Vista High School, Cupertino, CA

Overview of a computer

PROGRAMMING LANGUAGE PARADIGMS & THE MAIN PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING

Welcome to Solving Problems with Computers I

CSCI170 Lecture 1: Analysis of Programming Languages. John Magee 1 September 2011 Some material copyright Jones and Bartlett

The Generations of Computers

Computer Basics. Computer Technology

Welcome to Computer Organization and Design Logic

Chapter 1: An Introduction to Computer Science. Invitation to Computer Science, C++ Version, 6-th Edition

(History of Computers) Lecture # 03 By: M.Nadeem Akhtar. Lecturer. URL:

CS101 Lecture 29: Brief History of Computing

A little bit of history. Jordi Cortadella Department of Computer Science

MICROPROCESSOR SYSTEM DESIGN

In this chapter, you will learn about: The definition of computer science. Algorithms. Invitation to Computer Science, C++ Version, Third Edition

Computer Organization CS 206T

HISTORY OF COMPUTING

Computer Systems. Hardware, Software and Layers of Abstraction

Mechanization. A little bit of history. Mechanization. The old dream of mechanical computing. Jordi Cortadella Department of Computer Science

I1100 Introduction to Computer Science Semester: 1 Academic Year: 2018/2019 Credits: 3 (30 hours) Dr. Antoun Yaacoub

Chapter 01. Introduction 2018/9/17. Chapter Goals. Computing Systems. Computing Systems. Layers of a Computing System. Abstraction

HISTORY OF CALCULATION. Evolution of Computation

Great Inventions written by Bob Barton

EVOLUTION OF COMPUTERS. In the early years, before the computer was invented, there are several inventions of counting machines.

COMP 102: Computers and Computing Lecture 1: Introduction!

HISTORY OF COMPUTERS HISTORY OF COMPUTERS. Mesleki İngilizce - Technical English. Punch Card. Digital Data. II Prof. Dr. Nizamettin AYDIN.

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

Fundamentals of Digital Computers The mechanical computer age began with the advent of the abacus in 500 B.C by Babylonians. The abacus, which was

CSC 221: Computer Programming I. Fall 2004

Chronological History of the Pre-Computer Developments

Evolution of the Computer

Part 1: Computer and Information Literacy

History of Modern Computing Lesson 1

CSC 221: Introduction to Programming. Fall 2011

History of Computing. Slides from NYU and Georgia Tech

ALGORITHMS AND PROGRAMMING

CS 1 Notes 1 - Early Computing and 2 - Electronic Computing

Chapter 1 History & Hardware

The History of Computers. How did this all get started?

UNIT 1. Variables Binary Math

What You Will Learn Today

Basic Data Types and Operators CS 8: Introduction to Computer Science, Winter 2019 Lecture #2

4. History of computers and applications

Unit 4: Emerging Technologies. A History of Personal Computing by Mrs. Ogletree

Chapter 2 HISTORICAL DEVELOPMENT OF COMPUTERS

Let s begin with the very beginning...

Introduction To Computers. About the Course

SSRVM Content Creation Template

HST250 (section 740) Exam #1 Wednesday, February 10, 2010

Licensed to: ichapters User

CS2110 CONCLUSION Spring 2018

History 5/8/18 CONCLUSION. Punch cards

History of Computers. What Is A Computer? Egyptian Numbers. Ancient Tools for Computation. Introduction to Computers

CSC 221: Introduction to Programming. Fall 2018

CS 105 Review Questions #3

Computer science First Class Lecture 1

Processor: Faster and Faster

Computer Systems. Computer Systems. Wolfgang Schreiner Research Institute for Symbolic Computation (RISC-Linz) Johannes Kepler University

CHAPTER 1 Introduction

CHAPTER 1: Computers and Systems

CSSE232 Computer Architecture. Introduc5on

ENIAC: The first electronic computer

Artificial Intelligence in the World. Prof. Levy Fromm Institute Spring Session, 2017

CS1100 Introduction to Programming

ENIAC - background. ENIAC - details. Structure of von Nuemann machine. von Neumann/Turing Computer Architecture

Chapter 1: Introduction to Computers

Lyman Briggs Lecture Series. Group Question. Discussion Questions. Definition of Computer. Definition of Modern Computer. Definition of a Computer

Chapter 1: Introduction to Computers. In this chapter you will learn about:

Computer Architecture. Prologue. Topics Computer Architecture. Computer Organization. Organization vs. Architecture. History of Computers

Note: Though solved with care, not responsible for the accuracy.

A Short History of Computing 09/03/13


Chapter One. Introduction to Computer System. Definition Objectives Types according to their size Internet

A Short History of Computers

time step first instruction second instruction

Notes By: Shailesh Bdr. Pandey, TA, Computer Engineering Department, Nepal Engineering College

Monday, January 27, 2014

Learning Objectives. In this chapter you will learn about:

Transcription:

An Introduction to Computer Science CS 8: Introduction to Computer Science, Winter 2018 Lecture #2 Ziad Matni Dept. of Computer Science, UCSB

A Word About Registration for CS8 FOR THOSE OF YOU NOT YET REGISTERED: If you are not on the waitlist, you will not get into this class I will be going by the waitlist as I decide to let people in the class There are a few spots opening up I will let you know between today and Wednesday about getting in 1/22/18 Matni, CS8, Wi18 2

Administrative You must register on Piazza https://piazza.com/ucsb/winter2018/cs8 You will not get my class announcements otherwise! I m not using GauchoSpace Remember: Lab0 is due on Wednesday! Use the Turnin service as shown in lab on Tue. Class webpage: https://ucsb-cs8-matni-w18.github.io 1/22/18 Matni, CS8, Wi18 3

Switching About In The Labs is frowned upon L Please stick to the lab time that you have per your registration The labs are pretty full and at capacity IF YOU WANT TO SWITCH LAB SECTIONS, YOU MUST: 1. Find a person in the other lab to switch with you 2. Get the OK from BOTH T.A.s 1/22/18 Matni, CS8, Wi18 4

What is this Computer you speak of? Let s define a computer Computer (n.): a computing device A device that can be instructed to carry out an arbitrary set of arithmetic or logical operations automatically Algorithms! 1/22/18 Matni, CS8, Wi18 5

Computers = Computing Devices Compute (v) To make sense of ; to calculate or reckon What was the first computing tool ever? Likely invented around when humans fell out of the trees 1/22/18 Matni, CS8, Wi18 6

Using Abstraction is Key to Using Computers (or any Complex Machine) Abstraction: (n) A mental model that removes complex details Do you need to know this? ç ç ç To know how to do this? ç ç ç 1/22/18 Images from jblearning.com 7

Algorithm A step-by-step logical procedure to solve a problem Like a very precise recipe! Named after famed 9th-century Persian mathematician Al-Khawarizmi who put a name to the practice and published a lot on it 1/22/18 Matni, CS8, Wi18 8

Examples of Everyday Use of Algorithms Problem to Solve: What coat, if any, should I wear today? Algorithm: 1. Measure the outdoor temperature, T. 2. If T 62F then wear my blue coat. 1. If blue coat is dirty (dirt level 7), wear my brown coat instead 2. If it s also raining (Now raining = True), wear my black poncho instead 3. If T 62F then don t wear a coat 1. Plan on buying ice-cream for lunch! 1/22/18 Matni, CS8, Wi18 9

And Now, With More Detail a) Define outcomes: 1. wear blue coat, 2. wear brown coat, 3. wear black poncho, 4. wear nothing and get ice-cream for lunch! b) Get measures/values for T, Dirt_Level, Now_Rain 1. Measure the outdoor temperature, T. 2. If T 62F then wear my blue coat. 1. If blue coat is dirty (dirt level 7), wear my brown coat instead 2. If it s also raining (Now raining = True), wear my black poncho instead 3. If T 62F then don t wear a coat 1. Plan on buying ice-cream for lunch! c) If ( (T < 62) AND (Dirt_Level < 7) ) then (outcome = 1) d) If ( (T < 62) AND (Dirt_Level 7) ) then (outcome = 2) e) If ( (T < 62) AND (Now_Rain = True) ) then (outcome = 3) Otherwise (outcome = 4) f) The End b) Define conditions: 1. T < 62 or not 2. Dirt_Level < 7 or not 3. Now_Rain = True or not 1/22/18 Matni, CS8, Wi18 10

And Now, With Language Measure(T) Get(Dirt_Level) Assess(Now_Raining) if (T < 62) AND (Dirt_Level < 7) then Outcome = 1 if (T < 62) AND (Dirt_Level >= 7) then Outcome = 2 if (T < 62) AND (Now_Raining = True) then Outcome = 3 else Outcome = 4 End Program 1. Measure the outdoor temperature, T. 2. If T 62F then wear my blue coat. 1. If blue coat is dirty (dirt level 7), wear my brown coat instead 2. If it s also raining (Now raining = True), wear my black poncho instead 3. If T 62F then don t wear a coat 1. Plan on buying ice-cream for lunch! that has specific form and syntax (like any language would!) This is often called pseudo-code and is the pre-cursor to writing a program in a specific computer language 1/22/18 Matni, CS8, Wi18 11

What is Computer Science? The study of : 1. The designs and uses of computers as useful tools in our daily lives 2. The use of algorithms to solve problems mostly around the creation, processing, interpreting, communication, etc of information 1/22/18 Matni, CS8, Wi18 12

Some Historical Background 1/22/18 Matni, CS8, Wi18 13

The First Modern Computing Devices (As a Novelty or For Specific Commercial Purposes) B. Pascal (1623 1662) Blaise Pascal Mechanical device that could add, subtract, divide & multiply using gears Pascaline : a calculating machine (1652) J. Jacquard (1752 1834) Joseph Jacquard Jacquard s Loom, used punched cards to describe patterns Jacquard Loom (invented 1801) 1/22/18 Matni, CS8, Wi18 14 Images from Wikimedia.org

Computing Devices for General Purposes (For Serious Math and Engineering Purposes) Charles Babbage Analytical Engine could calculate polynomial functions and differentials Calculated results, but also stored intermediate findings (i.e. precursor to computer memory) Father of Computer Engineering C. Babbage (1791 1871) Ada Byron Lovelace Worked with Babbage and foresaw computers doing much more than calculating numbers Loops and Conditional Branching Mother of Computer Programming Part of Babbage s Analytical Engine 1/22/18 15 Images from Wikimedia.org A. Byron Lovelace (1815 1852)

Punched Card Data Processors Herman Hollerith Developed a mechanical tabulator in the early 1900s and used it very successfully to do the census for the US government His Tabulating Machine Company (with 3 others) became International Business Machines Corp. (IBM) in 1911 H. Hollerith (1860 1929) But these were all mostly single-purpose calculating machines 1/22/18 Images from Wikimedia.org IBM punched card Accounting Machines, pictured in 1936. Matni, CS8, Wi18 16

The Modern Digital Computer Alan Turing (UK) Theorized the possibility of computing machines capable of performing any conceivable mathematical computation as long as this was representable as an algorithm Called Turing Machines (1936) Lead the effort to create a machine to successfully decipher the German Enigma Code during World War II As seen in the movie The Imitation Game A. Turing (1912 1954) 1/22/18 Matni, CS8, Wi18 17

Turing s Legacy Turing Machine : An abstract model Calculating machine that can read in symbols on a medium and writes out results on another, based on a table of instructions What we call computers today owe a lot to this concept The REAL A. Turing (1912 1954) The Turing Test : Asks Can Machines Think? A test to see if a machine can exhibit intelligent behavior like a human Example: CAPTCHA Completely Automated Public Turing test to tell Computers and Humans Apart The Turing Award Called the Nobel Prize for computing For contributions of lasting and major technical importance to the computer field https://en.wikipedia.org/wiki/turing_award 1/22/18 Matni, CS8, Wi18 18

The ENIAC electronic numerical integrator and computer 1945 100 feet long, by 10 feet high, by 3 feet deep (took up a whole big room) Weighed 30 tons! Used by the military to calculate trajectories (for bombs) Could compute in 30 seconds instead of 40 hours Slowly replaced human computers 1/22/18 Matni, CS8, Wi18 19

Computers Since the Mid-20 th Century John Von Neumann (1903-1957) His computer architecture is what we still use today The invention of high-level computer languages and compilers (1950s & 1960s) Up until then, operators fed these machines 1 s and 0 s for their instructions Required very abstract thinking and re-arrangement of the computer architecture Grace Hopper (1906-1992) Inventor of the first high-level computer language & compiler Konrad Zuse (1910-1995) Built the first modern computer with high-level programming Computer instructions became more English-language friendly: Computers became practical to use This needed translator programs (or compilers) to be the gobetweens for the high-level languages and the machines 1/22/18 Matni, CS8, Wi18 Katherine Johnson (1918 - ) NASA Computer

The Age of the Transistor Transistors (1947) are semi-conducting electronic elements Replace bulky vacuum tubes for switching functions Could now create faster AND smaller computer machines The basis for all modern digital technology Transistors: The lynchpins of modern technology Kept shrinking in size while getting cheaper to produce We still talk about Moore s Law as the concept behind computers progress: the number of transistors in a dense integrated circuit doubles approximately every two years 1/22/18 Matni, CS8, Wi18 21

The Age of The Personal Computer Commercialization of personal computers (1970s and 1980s) Made the machines a lot smaller and cheaper Apple I and II, Macintosh (Apple), PC (IBM) Lots of software created to help run the hardware for everyday uses (Microsoft s DOS and Windows, Lotus 123, etc ) 1/22/18 Matni, CS8, Wi18 22

The Individual Computer Gives Way to the Networked Computer Invention of computer networking protocols Ethernet and TCP/IP (1980s) Invention of the hyper-text document (and hence the WWW) in early 1990s by Berners-Lee and others Deployment of ARPANET in the 1970s/80s (predecessor of the Internet) At first, mostly just for university research use and the military Once released to the public in the early 90s, it enabled us to swap pictures of cats and world was never the same Tim Berners-Lee (1955 - ) Inventor of the hyper-text doc and WWW 1/22/18 Matni, CS8, Wi18 23

Computer Systems Hardware The physical computer CPU, Memory ICs, Printed circuit boards Plastic housing, cables, etc Software The instructions and the data fed to/generated by the computer Programs and applications Operating systems 1/22/18 Matni, CS8, Wi18 24

What is Programming? Instructing a computer what to do Programs a.k.a. Software Includes operating system, utilities, applications, Computer just sits there until instructions fed to CPU Machine language basic CPU instructions Completely numeric (as binary numbers) i.e., computer readable Specific to particular computer types not portable 1/22/18 Matni, CS8, Wi18 25

High-Level Computer Languages A way to program computers using human-like language Easier to write/read (than 1s and 0s ): e.g. result = (first + second) instead of 10011110101010110110 Translated to machine language by compiler programs Advantage: the same H-LL Program can be used on different machines! HLL e.g. Python Your program via compiler Assembly Language via assembler Machine Language directly to CPU Central Processing Unit 1/22/18 Matni, CS8, Wi18 26

High-Level Language Paradigms Procedural languages focus is on functions and process FORTRAN (by IBM, 1957) first commercially used high level language Easy to learn spawned thousands of new programmers 1970s: Golden Age of Programmers: C, PASCAL, BASIC Even easier to learn/use went into use well into 1990s Object-oriented languages focus on objects C++ (early 1980s),, Java (1996) Idea is to build objects then let them perform tasks Multi-paradigm languages combined features e.g., Python (invented 1991 and still evolving) 1/22/18 Matni, CS8, Wi18 27

~1991 2018 Derived from ABC a language designed for learning how to program Python designed by Guido van Rossum (an ABC designer) to be a more general purpose language than ABC Python is Open Sourced since it s first version (1991) So it is free! Has a huge community of volunteer developers Guido still the BDFL (Benevolent Dictator for Life) BDFL Guido (1956 - ) Lots of handy modules ready to use at http://docs.python.org/ More on modules later 1/22/18 Matni, CS8, Wi18 28

The Python Interpreter A program that performs three steps over and over and until exit() happens 1) It reads Python instruction statements From a standard input (a.k.a. stdin --- usually a keyboard) Or from another file (usually a text file ending in.py) 2) It executes Python commands 3) It shows results (outcomes) of commands, if any 1/22/18 Let s Fire It Up And Try Some Arithmetic Matni, CS8, Wi18 With It! (demo time!) 29

YOUR TO-DOs q Sign up on Piazza if you haven t done so q https://piazza.com/ucsb/winter2018/cs8 q Read the rest of Chapter 1 q Get your textbook!!! q q q q Homework: q Do Homework0 (turn it in in LAB on Tuesday 1/23) q Do Homework1 (due next Monday 1/29) Lab: q Read Lab0 and prepare for it q Go to lab on Tuesday 1/23 and do it! Solve world hunger yet? Global warming? Eat at least half of your vegetables 1/22/18 Matni, CS8, Wi18 30

1/22/18 Matni, CS8, Wi18 31