Introduction to Computing CS A109. Course Objectives Goal is to teach computation in terms relevant to non-CS majors Students will be able to read, understand,

Slides:



Advertisements
Similar presentations
 2002 Prentice Hall Hardware Basics: Inside The Box Chapter 2.
Advertisements

Presentation by: Serena, Ann & Nicole
CS 102 Computers In Context (Multimedia)‏ 02 / 18 / 2009 Instructor: Michael Eckmann.
Main Memory Lecture 2 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Computer Hardware What goes on inside?. Deeper.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
1 CS150 Introduction to Computer Science 1 Professor: Chadd Williams
COMPUTER SYSTEM COMPONENTS ACTIVITY
Digital Information Technology
The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2.
CS 111 Introduction to Computing Introduction: Why study computer science at all?!? Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004;
Topics Introduction Hardware and Software How Computers Store Data
Computer Hardware and Software Chapter 1. Overview Brief History of Computers Hardware of a Computer Binary and Hexadecimal Numbers Compiling vs. Interpreting.
INTRODUCTION TO COMPUTING
Computer Systems Chapter 1 Pages Hardware-physical pieces Key hardware components in a computer system: The physical parts. – Central processing.
Overview of Computing. Computer Science What is computer science? The systematic study of computing systems and computation. Contains theories for understanding.
The Study of Computer Science Chapter 0 Intro to Computer Science CS1510.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Foundations of Computer Science Computing …it is all about Data Representation, Storage, Processing, and Communication of Data 10/4/20151CS 112 – Foundations.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Introduction to Programming Peggy Batchelor.
Business Computer Information Systems I.  Knowing how to use a computer is a basic skill necessary to succeed in business or to function effectively.
Computer Systems Organization CS 1428 Foundations of Computer Science.
CPS120: Introduction to Computer Science Introduction to Computers.
CS 102 Computers In Context (Multimedia)‏ 01 / 26 / 2009 Instructor: Michael Eckmann.
CS1315: Introduction to Media Computation Picture encoding and manipulation.
Introduction. What is the course about?  Concepts History History Data representation, logic Data representation, logic Hardware: CPU, memory, storage,
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
Chapter 1: Introduction to Computer Science and Media Computation.
Computer organization Practical 1. Administrative Issues The course requirements are: –To be nice and open minded –To pass the exam (there is a boolean.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
Scott Marino MSMIS Kean University MSAS5104 Introduction to Programming with Data Structures and Algorithms Week 2 Scott Marino.
Electronic Analog Computer Dr. Amin Danial Asham by.
BASIC COMPONENTS.  Central processing unit.  The most powerful microprocessor chip in your computer.
CS1315 Introduction to Media Computation Introduction: Why study computer science at all?!?
Chapter 2 Turning Data into Something You Can Use
Know what a computer is used for Understand the difference between hardware and software Be able to describe the way that data is stored in a computer.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
Technology Vocabulary Matthew L. Morris. A-D Application- A program or group of programs designed for end users. Data- Distinct pieces of information.
Hardware Introducing the Components of a Computer.
CHAPTER 1 COMPUTER SCIENCE II. HISTORY OF COMPUTERS (1.1) Eniac- one of the worlds first computers Used more electricity than an entire city block of.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
ASSEMBLY LANGUAGE PROGRAMMING. Course Objectives Identify the major component of a PC-based system, describe the steps involving in assembling, linking,
Hardware and Software By: Kyle Face. Hardware! Main computer hardware components Hardware refers to the physical components of a computer (What you can.
INTRODUCTION TO COMPUTERS. A computer system is an electronic device used to input data, process data, store data for later use and produce output in.
Computer Graphics HARDWARE. Computers  Computers are automatic, electronic machines that –accept data & instructions from a user (INPUT) –store the data.
Chapter 1: Introduction to Computer Science and Media Computation.
Computer basics.
Computer Science II Chapter 1.
An Overview of the Computer System
Chapter 1: An Overview of Computers and Programming Languages
Introduction to Programming Part 2
Topics Introduction Hardware and Software How Computers Store Data
Chapter 1: An Overview of Computers and Programming Languages
Chapter 1: Introduction to Computer Science and Media Computation
CS1315 Introduction to Media Computation
Computer Hardware Introduction.
Chapter 1: Introduction to Computer Science and Media Computation
Looking Inside the machine (Types of hardware, CPU, Memory)
CS1315 Introduction to Media Computation
An Overview of the Computer System
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Programming Part 2
The Study of Computer Science
Hardware Information Created by Nasih.
Chapter 1: Introduction to Computer Science and Media Computation
Dr. Clincy Professor of CS
Presentation transcript:

Introduction to Computing CS A109

Course Objectives Goal is to teach computation in terms relevant to non-CS majors Students will be able to read, understand, modify, and assemble from pieces programs that achieve useful communication tasks: Image manipulation, sound synthesis and editing, text (e.g., HTML) creation and manipulation, and digital video effects. –We will give you examples to use as a basis when you write your own programs Students will learn what computer science is about, especially data representations, algorithms, encodings, forms of programming. Students will learn useful computing skills, including graphing and database concepts

def negative(picture): for px in getPixels(picture): red=getRed(px) green=getGreen(px) blue=getBlue(px) negColor=makeColor(255-red,255-green,255-blue) setColor(px,negColor) def clearRed(picture): for pixel in getPixels(picture): setRed(pixel,0) def greyscale(picture): for p in getPixels(picture): redness=getRed(p) greenness=getGreen(p) blueness=getBlue(p) luminance=(redness+blueness+greenness)/3 setColor(p, makeColor(luminance,luminance,luminance))

def chromakey2(source,bg): for p in getPixels(source): if (getRed(p)+getGreen(p) < getBlue(p)): setColor(p,getColor(getPixel(bg,getX(p),getY(p)))) return source

Introduction and Brief History of Programming Hardware –Physical components that make up a computer Computer program or software –A self-contained set of instructions used to operate a computer to produce a specific result

How a computer works The part that does the adding and comparing is the Central Processing Unit (CPU). The CPU talks to the memory –Think of it as a sequence of millions of mailboxes, each one byte in size, each of which has a numeric address The hard disk provides 10 times or more storage than in memory (20 billion bytes versus 128 million bytes), but is millions of times slower The display is the monitor or LCD (or whatever)

Knowing About: Computer Hardware Computer hardware components –Memory unit Stores information in a logically consistent format –Each memory location has an address and data that can be stored there, imagine a long line of mailboxes starting at address 0 and going up to addresses in the billions Two types of memory: RAM and ROM –Random Access Memory, Read Only Memory (misnamed) –Central Processing Unit Directs and monitors the overall operation of the computer Performs addition, subtraction, other logical operations

Evolution of hardware –1950s: all hardware units were built using relays and vacuum tubes –1960s: introduction of transistors –mid-1960s: introduction of integrated circuits (ICs) –Present computers: use of microprocessors Knowing About: Computer Hardware (Continued)

What computers understand Its not really multimedia at all. –Its unimedia (Nicholas Negroponte) –Everything is 0s and 1s Computers are exceedingly stupid –The only data they understand is 0s and 1s –They can only do the most simple things with those 0s and 1s Move this value here Add, multiply, subtract, divide these values Compare these values, and if one is less than the other, go follow this step rather than that one.

Key Concept: Encodings But we can interpret these numbers any way we want. –We can encode information in those numbers Even the notion that the computer understands numbers is an interpretation –We encode the voltages on wires as 0s and 1s, eight of these defining a byte –Which we can, in turn, interpret as a decimal number

Layer the encodings as deep as you want One encoding, ASCII, defines an A as 65 –If theres a byte with a 65 in it, and we decide that its a string, POOF! Its an A! We can string together lots of these numbers together to make usable text –77, 97, 114, 107 is Mark –60, 97, 32, 104, 114, 101, 102, 61 is <a href= (HTML)

What do we mean by layered encodings? A number is just a number is just a number If you have to treat it as a letter, theres a piece of software that does it –For example, that associates 65 with the graphical representation for A If you have to treat it as part of an HTML document, theres a piece of software that does it –That understands that <A HREF= is the beginning of a link That part that knows HTML communicates with the part that knows that 65 is an A

Multimedia is unimedia But that same byte with a 65 in it might be interpreted as… –A very small piece of sound (e.g., 1/44100-th of a second) –The amount of redness in a single dot in a larger picture –The amount of redness in a single dot in a larger picture which is a single frame in a full-length motion picture

Software (recipes) defines and manipulates encodings Computer programs manage all these layers –How do you decide what a number should mean, and how you should organize your numbers to represent all the data you want? –Thats data structures If that sounds like a lot of data, it is –To represent all the dots on your screen probably takes more than 3,145,728 bytes –Each second of sound on a CD takes 44,100 bytes!!

Lets Hear It for Moores Law! Gordon Moore, one of the founders of Intel, made the claim that (essentially) computer power doubles for the same dollar every 18 months. This has held true for over 30 years –But soon we may be reaching limitations imposed by physics Go ahead! Make your computer do the same thing to every one of 3 million dots on your screen. It doesnt care! And it wont take much time either!

First-Generation and Second- Generation (Low-Level) Languages Low-level languages –First-generation and second-generation languages –Machine-dependent languages –The underlying representation the machine actually understands First-generation languages –Also referred to as machine languages –Consist of a sequence of instructions represented as binary numbers –E.g.: Code to ADD might be To add 1+0 and then 1+1 our program might look like this:

Second-generation languages –Also referred to as assembly languages –Abbreviated words are used to indicate operations –Allow the use of decimal numbers and labels to indicate the location of the data Assemblers –Programs that translate assembly language programs into machine language programs –Our add program now looks like: ADD 1,0 ADD 1,1 First-Generation and Second- Generation (Low-Level) Languages (Continued) Assembler

High-level languages –Third-generation and fourth-generation languages –Programs can be translated to run on a variety of computer types Third-generation languages –Procedure-oriented languages –Object-oriented languages Our Add program might now look like: sum = value1 + value2 Third-Generation and Fourth- Generation (High-Level) Languages Compiler

The Evolution of Programming Languages Third-Generation and Fourth- Generation (High-Level) Languages (Continued)

Computer Science and Media? What is computer science about? What computers really understand Media Computation: Why digitize media? –How can it possibly work? Its about communications and process

What computation is good for Computer science is the study of recipes Computer scientists study… –How the recipes are written (algorithms, software engineering) –The units used in the recipes (data structures, databases) –What can recipes be written for (systems, intelligent systems, theory) –How well the recipes work (human-computer interfaces)

Specialized Recipes Some people specialize in crepes or barbeque Computer scientists can also specialize on special kinds of recipes –Recipes that create pictures, sounds, movies, animations (graphics, computer music) Still others look at emergent properties of computer recipes –What happens when lots of recipes talk to one another (networking, non-linear systems) –Computer programs to study or simulate natural systems

Key concept: The COMPUTER does the recipe! Make it as hard, tedious, complex as you want! Crank through a million genomes? No problem! Find one person in a 30,000 person campus? Sure. Process a million dots on the screen or a bazillion sound samples? –Thats media computation Later on well see some problems that are computationally too expensive to solve even for the fastest computer today

Why digitize media? Digitizing media is encoding media into numbers –Real media is analogue (continuous) Images Sound –To digitize it, we break it into parts where we cant perceive the parts. By converting them, we can more easily manipulate them, store them, transmit them without error, etc.

How can it work to digitize media? Why does it work that we can break media into pieces and we dont perceive the breaks? We can only do it because human perception is limited. –We dont see the dots in the pictures, or the gaps in the sounds. We can make this happen because we know about physics (science of the physical world) and psychophysics (psychology of how we perceive the physical world)

Why should you study recipes? To understand better the recipe-way of thinking –Its influencing everything, from computational science to bioinformatics –Eventually, its going to become part of everyones notion of a liberal education –Thats the process argument –BTW, to work with and manage computer scientists AND…to communicate! –Writers, marketers, producers communicate through computation Well take these in opposite order

Computation for Communication All media are going digital Digital media are manipulated with software You are limited in your communication by what your software allows –What if you want to say something that Microsoft or Adobe or Apple doesnt let you say?

Programming is a communications skill If you want to say something that your tools dont allow, program it yourself If you want to understand what your tools can or cannot do, you need to understand what the programs are doing If you care about preparing media for the Web, for marketing, for print, for broadcast… then its worth your while to understand how the media are and can be manipulated. Knowledge is Power, Knowing how media work is powerful and freeing

Were not going to replace PhotoShop Nor ProAudio Tools, ImageMagick and the GIMP, and Java and Visual Basic But if you know what these things are doing, you have something that can help you learn new tools You are also learning general programming skills that can be applied to creating business applications, scientific applications, etc. –Our domain for this class just happens to be (primarily) media

Knowing about programming is knowing about process Alan Perlis –One of the founders of computer science –Argued in 1961 that Computer Science should be part of a liberal education: Everyone should learn to program. Perhaps computing is more critical to a liberal education than Calculus Calculus is about rates, and thats important to many. Computer science is about process, and thats important to everyone.

A Recipe is a Statement of Process A recipe defines how something is done –In a programming language that defines how the recipe is written When you learn the recipe that implements a Photoshop filter, you learn how Photoshop does what it does. And that is powerful.

Finally: Programming is about Communicating Process A program is the most concise statement possible to communicate a process –Thats why its important to scientists and others who want to specify how to do something understandably in the most precise words as possible

Python The programming language we will be using is called Python – –Python was invented by researchers across the Internet –Considered by many to be the best language to teach programming to beginners, but still powerful enough for real applications –Its used by companies like Google, Industrial Light & Magic, Nextel, and others The kind of Python were using is called Jython –Its Java-based Python More on Java later – Well be using a specific tool to make Python programming easier, called JES. –Invented by the authors of the textbook