CSC 1 Introduction to Computer Science Week 1. Week 1: Fundamental Concepts What is computer...
-
Upload
verity-waters -
Category
Documents
-
view
232 -
download
3
Transcript of CSC 1 Introduction to Computer Science Week 1. Week 1: Fundamental Concepts What is computer...
CSC 1CSC 1Introduction to Computer Science Introduction to Computer Science
Week 1 Week 1
Week 1: Fundamental Concepts Week 1: Fundamental Concepts
What is computer science?What is computer science?What is in a computer (What is in a computer (von Neumann machine von Neumann machine
architecturearchitecture)?)?Types of computer systems.Types of computer systems.Programming basics.Programming basics.
What is Computer What is Computer Science?Science?
Computer Science Computer Science
Computer science studies information Computer science studies information processes both artificial and natural processes both artificial and natural [[P. J. P. J.
DenningDenning]. ].
Artificial: information processing systems and machines.Artificial: information processing systems and machines. Natural: information processes in: biology, medicine, Natural: information processes in: biology, medicine,
psychology, cognitive and behavior sciences, sociology, psychology, cognitive and behavior sciences, sociology, economics, chemistry, meteorology, neuroscience, economics, chemistry, meteorology, neuroscience, physics, forensics, linguistics, philosophy, ……… physics, forensics, linguistics, philosophy, ………
E. DijkstraE. Dijkstra
Computer science is no more about Computer science is no more about computers than astronomy is about computers than astronomy is about telescopes. telescopes.
Natural Information ProcessesNatural Information Processes
Biology and medicine. Computer models and algorithms to Biology and medicine. Computer models and algorithms to diagnose and treat disease (diagnose and treat disease (MRI, fMRI, CTMRI, fMRI, CT). Computer models to ). Computer models to track mutations of viruses. String algorithms for DNA track mutations of viruses. String algorithms for DNA sequencing. sequencing.
Economics. Computer models to forecast economic Economics. Computer models to forecast economic conditions.conditions.
Forensics. Computer models and databases to identify Forensics. Computer models and databases to identify evidence and discover forensic data.evidence and discover forensic data.
Psychology, cognitive and behavior sciences. Computer Psychology, cognitive and behavior sciences. Computer models are used to shed light on human brains and nervous models are used to shed light on human brains and nervous systems.systems.
Natural Information Processes Natural Information Processes (2)(2)
Linguistics. Computer based speech recognition. Linguistics. Computer based speech recognition. Machine translation. Machine translation.
Philosophy. Artificial intelligence, machine learning, and Philosophy. Artificial intelligence, machine learning, and heuristic programming in knowledge representation heuristic programming in knowledge representation and reasoning. and reasoning.
Body of Knowledge for the Artificial Body of Knowledge for the Artificial [P. J. Denning][P. J. Denning]
Algorithmic processes that describe and transform Algorithmic processes that describe and transform information: their theory, analysis, design, efficiency, information: their theory, analysis, design, efficiency, implementation, and application. implementation, and application.
Coordination and communication (Internet).Coordination and communication (Internet).
Structure and operation of computer systems, Structure and operation of computer systems, principles underlying computer system design and principles underlying computer system design and programming, effective methods for using computers programming, effective methods for using computers for information processing tasks, and theoretical for information processing tasks, and theoretical characterizations of their properties and limitations. characterizations of their properties and limitations.
System and Application System and Application [P. J. Denning][P. J. Denning]
Systems: structures, mechanisms and schemes for Systems: structures, mechanisms and schemes for processing information.processing information. Software systemsSoftware systems Hardware systems. Hardware systems.
Application: information processing tasks and their Application: information processing tasks and their related data representations.related data representations. Numerical applications: Numerical applications: weather forecast, global warming modeling, ……weather forecast, global warming modeling, ……
Non-numerical applications: Non-numerical applications: Second Life, robotics, social networks, protein Second Life, robotics, social networks, protein structure prediction, ……structure prediction, ……
Subareas Subareas [P. J. Denning][P. J. Denning]
Algorithms and data structures.Algorithms and data structures. Programming languages. Programming languages. Architecture.Architecture. Operating systems and networks.Operating systems and networks. Software engineering.Software engineering. Databases and information retrieval.Databases and information retrieval. Artificial intelligence and robotics.Artificial intelligence and robotics. Graphics.Graphics. Human computer interaction.Human computer interaction. Computational scienceComputational science Organizational informatics.Organizational informatics. Emerging areas such as bioinformatics.Emerging areas such as bioinformatics.
What is in a What is in a Computer?Computer?
von Neumann Machine Architecturevon Neumann Machine Architecture
von Neumann Machine Architecturevon Neumann Machine Architecture
http://www.software-engineer-training.com/category/computer-architecture-2/
John von Neumann, 1903-1957John von Neumann, 1903-1957
Salient FeaturesSalient Features
Stored program.Stored program.Separation of processing from storage.Separation of processing from storage.Predefined instruction set.Predefined instruction set.Instruction execution cycle.Instruction execution cycle.Shared buses.Shared buses.Sequential architecture.Sequential architecture.Control flow vs. data flow.Control flow vs. data flow.
Basic Functions of a Basic Functions of a ComputerComputer
• Input DataInput Data• Process DataProcess Data• Output DataOutput Data• Store DataStore Data
Input DataInput DataFeeding information into a computerFeeding information into a computer
Symbols – letters, words, numbers, etc. Symbols – letters, words, numbers, etc. Pictures (using a camera)Pictures (using a camera) Sounds (using a microphone)Sounds (using a microphone)
Common forms of Common forms of inputinput KeyboardKeyboard MouseMouse
Often involves converting Often involves converting analoganalog to to digitaldigital
Process DataProcess DataAnalyze data, or use it in a computation.Analyze data, or use it in a computation.Perform some action based on data.Perform some action based on data.Generate new data, or change existing data.Generate new data, or change existing data.Processing is done in the CPU.Processing is done in the CPU.Processing is managed by a computer program.Processing is managed by a computer program.
Basic Terms:Basic Terms: ProgramProgram – a sequence of instructions (with data) to – a sequence of instructions (with data) to
accomplish a certain taskaccomplish a certain task ProcessProcess – a program in execution – a program in execution ProcessorProcessor (CPU) - device where a program gets executed (CPU) - device where a program gets executed
Output DataOutput Data
Common forms of Common forms of outputoutput MonitorMonitor PrintersPrinters Speakers (music and Sound)Speakers (music and Sound)
Often involves converting digital signals to Often involves converting digital signals to analog signalsanalog signals
Store DataStore Data
• Save data on a device for later use.Save data on a device for later use.• Data is always stored in digital form.Data is always stored in digital form.• Common Forms:Common Forms:
MemoryMemory CD ROMCD ROM Hard DiskHard Disk Flash DiskFlash Disk Magnetic tapeMagnetic tape
Functions of a Functions of a ComputerComputer
Output Data
Input Data
Store Data
Process Data
Analog Digital
Functions of a Functions of a ComputerComputer
Computer Computer CategoriesCategories
Different Types of ComputersDifferent Types of Computers
Computer CategoriesComputer Categories
There used to be There used to be fourfour categories categories Personal computersPersonal computers Workstation computersWorkstation computers minicomputersminicomputers mainframe computersmainframe computers
Today, computers can be categorized byToday, computers can be categorized by functionfunction sizesize performanceperformance costcost
TodayToday’’s Computer s Computer CategoriesCategories
Personal computersPersonal computersHandheld computersHandheld computersConsole ComputersConsole ComputersMainframesMainframesSupercomputersSupercomputersWorkstationsWorkstationsServersServers
Personal ComputersPersonal Computers
““MicrocomputerMicrocomputer”” Also known as a PC or Also known as a PC or ““Personal Personal
ComputerComputer
Designed for everyday usersDesigned for everyday users Desktop computersDesktop computers Notebook or netbook computersNotebook or netbook computers Tablet computersTablet computers
Handheld ComputersHandheld Computers
Designed to be used while being heldDesigned to be used while being heldCalled a Called a PDA PDA (Personal Digital Assistant)(Personal Digital Assistant)A few examples:A few examples:
Apple iPodsApple iPods Cell phonesCell phones Palm & Handspring PDAsPalm & Handspring PDAs Blackberry Blackberry
Console ComputersConsole Computers
My game system is a computer?My game system is a computer? Has processorsHas processors Input data from joysticksInput data from joysticks Output data (graphics and sound)Output data (graphics and sound) Has internet connectionHas internet connection
Examples include:Examples include: Microsoft XBox 360Microsoft XBox 360 Sony Playstation 3Sony Playstation 3 Nintendo WiiNintendo Wii
NotebooksNotebooks
Similar to Personal ComputersSimilar to Personal Computers Hardware is differentHardware is different Functionality is often the sameFunctionality is often the same Slightly more expensiveSlightly more expensive
Also called a Also called a ““laptoplaptop””
““NetbookNetbook””:: Very smallVery small Minimal functionalityMinimal functionality Intended for web access while travelingIntended for web access while traveling
Mainframes & Mainframes & SupercomputersSupercomputers
Built for computing powerBuilt for computing power Can calculate complex data – fastCan calculate complex data – fast Excellent for complex simulationsExcellent for complex simulations
Used by federal research labs Used by federal research labs and large corporations (banks)and large corporations (banks)
Typically large – cabinet sizedTypically large – cabinet sizedExpensiveExpensive
Workstation ComputerWorkstation Computer
Computers designed for a Computers designed for a specific specific groupgroup of users of users ((Pixar StudioPixar Studio).).
The term The term ““workstationworkstation”” has two meaningshas two meanings Powerful desktop models Powerful desktop models Computer on a network Computer on a network
ServersServers
A A serverserver sends data or offers services to other sends data or offers services to other computers on a networkcomputers on a network typically they have typically they have lotslots of storage (SAN) of storage (SAN) run unattended – no usersrun unattended – no users any computer can be server – although not idealany computer can be server – although not ideal eBay, Google, Facebook, Myspace, Twitter, Amazon, ……eBay, Google, Facebook, Myspace, Twitter, Amazon, ……
• A A clientclient receives data or (service) from a serverreceives data or (service) from a server• Go to Riverside Hall 2011 to see someGo to Riverside Hall 2011 to see some
Programming Programming BasicsBasics
Programs, Coding, Engineers & MorePrograms, Coding, Engineers & More
Programming LanguagesProgramming Languages
LanguageLanguage series of symbols & words that form a meaningful patternseries of symbols & words that form a meaningful pattern This is true of natural languages such as English, This is true of natural languages such as English,
Spanish, Hindi, Arabic, etc...Spanish, Hindi, Arabic, etc...
ProgrammingProgramming language used to write programs to be executed in language used to write programs to be executed in
computerscomputers there are many different programming languagesthere are many different programming languages
Popular Programming LanguagesPopular Programming Languages
C++C++C#C#JavaJavaFortranFortranVisual BasicVisual BasicCOBOLCOBOL……………………
AlgorithmsAlgorithms
A sequence of steps for carrying out a taskA sequence of steps for carrying out a taskExamples:Examples:
tying your shoestying your shoes driving to Sac Statedriving to Sac State making a peanut butter and jelly sandwichmaking a peanut butter and jelly sandwich withdraw money at ATMwithdraw money at ATM
Capture Capture ““the essencethe essence”” in solving a problem in solving a problem can be implemented into a computer program using some can be implemented into a computer program using some
programming languageprogramming language
Procedural ProgrammingProcedural Programming
Traditional approach to programmingTraditional approach to programmingProgramsPrograms
a a sequencesequence of instructions (statements) of instructions (statements)statements run in order – from first to laststatements run in order – from first to lastrepetitionrepetition is performed with is performed with ““loopinglooping””decisionsdecisions are described as are described as ““if – then – elseif – then – else””
Flow ChartsFlow Charts
Graphically Representing AlgorithmsGraphically Representing Algorithms
Flow Chart OverviewFlow Chart Overview
Graphical representationGraphical representationeach step is a each step is a shape shape (box, circle, …)(box, circle, …)useful for conceptualizing an useful for conceptualizing an algorithmalgorithmeasy to understand and visualizeeasy to understand and visualize
Used to document how an algorithm was Used to document how an algorithm was designeddesigned
Read theKilometers
Calculate the Miles
Print theMiles
START
END
Input / Output
Process Data
Input / Output
Start / EndStart / End
Indicates the start and end of Indicates the start and end of an algorithman algorithm
Represented by a rectangle Represented by a rectangle with rounded sideswith rounded sides
There are typically two:There are typically two: one to start the flowchartone to start the flowchart one to end the flowchartone to end the flowchart
Input / OutputInput / Output
Indicates data being:Indicates data being:inputted into the computerinputted into the computeroutputted to the useroutputted to the user
Represented by a Represented by a parallelogramparallelogram
Flowcharts can have many Flowcharts can have many of this shapeof this shape
ProcessesProcesses
Indicates data:Indicates data:being being processedprocessedalso called "calculations"also called "calculations"
Represented by a rectangleRepresented by a rectangleThe most common shape The most common shape
in a flowchartin a flowchart
DecisionsDecisions
Indicates a conditional Indicates a conditional branchbranch describe a condition or a question describe a condition or a question Has more than one outgoing branch, Has more than one outgoing branch,
depending on the outcomes to the depending on the outcomes to the condition/questioncondition/question
Represented by a diamondRepresented by a diamond
Get distance Get distance ““dd””
d < 5 ?d < 5 ?
walkwalk drivedrive
yesyes nono
PseudocodePseudocode
Describing an Algorithm with wordsDescribing an Algorithm with words
What is Pseudocode?What is Pseudocode?
• Description of an algorithm's logic Description of an algorithm's logic simpler than spoken Englishsimpler than spoken English looks like a program, but easier to readlooks like a program, but easier to read
• It is often useful It is often useful to express some piece of the solutionto express some piece of the solution without having to worry about every detailwithout having to worry about every detail
Program: area of a circle
1.Get the value for the radius2.Calculate the area (pi x radius2)3.Output radius and area
Area of a CircleArea of a CirclePseudocodePseudocode
Program: decide between walk/drive
1. Compute distance to destination2. If distance is less than 5 then walk else drive
Distance program…Distance program…PseudocodePseudocode (compare with flowchart)(compare with flowchart)