the study of computer science chapter 0 intro to computer science cs1510, section 2
TRANSCRIPT
![Page 1: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/1.jpg)
The Study of Computer Science
Chapter 0
Intro to Computer Science
CS1510, Section 2
![Page 2: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/2.jpg)
Questions
Syllabus? Yesterday’s lab? The website? The readings?
![Page 3: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/3.jpg)
Syllabus Review
What is the minimum percentage that you need to earn in order to move on to the next class?
How many exams will you have this semester?
When are programming assignments typically due?
![Page 4: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/4.jpg)
REVIEW : What is Computer Science? Computer science is a discipline that involves
the understanding and design of computers and computational processes.
![Page 5: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/5.jpg)
REVIEW : A Well-Educated Computer Scientist Should be Able to... Apply the fundamental concepts and
techniques of computation, algorithms, and computer design
…to a specific problem
![Page 6: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/6.jpg)
REVIEW: Our Goals
While a primary goal of this course is to learn to program (in Python), our goals include: increase our problem solving skills design good solutions to problems test (somehow) how well they are indeed
solutions to the problem provide the solution as a readable document
![Page 7: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/7.jpg)
But this is HARD!
I cannot precisely explain why it is hard, only that it is indeed hard. Your textbook uses an interesting analogy
![Page 8: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/8.jpg)
An Analogy
Let us say that you have signed up to study French poetry in the original language.
You have two problems: You don’t speak French You don’t know much about poetry
![Page 9: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/9.jpg)
How Does this Apply?
You have two related problems: the “syntax” of French is something you have to
learn the “semantics” of poetry is something you have
to learn
You have two problems you have to solve at the same time.
![Page 10: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/10.jpg)
Programming, Syntax and Semantics You have to learn the “syntax” of a particular
programming language many details about the language, how to debug
and use it You have to learn about “problem solving”
and how to put it down on “computer.” There probably is no better way. It’s hard!
![Page 11: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/11.jpg)
But we are getting a bit ahead of ourselves… We have been talking about programming
quite a bit What is programming?
The act of translating a sequence of general actions to a sequence of specific actions, in a specific language, and often for a specific computer.
BUT, before we can get too far with programming we have to talk briefly about the computer…
![Page 12: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/12.jpg)
What is a Computer? Kind of obvious, but a computer is
something that does computation. A device that performs (high-speed)
mathematical and/or logical operations or that assembles, stores, correlates, or otherwise processes information.
![Page 13: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/13.jpg)
What is a Computer?
What were the first computers?
![Page 14: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/14.jpg)
What is a Computer?
The first computers were people who performed difficult calculations by hand, for things like ballistic tables.
![Page 15: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/15.jpg)
What is a Computer?
Where was the first digital computer built?
![Page 16: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/16.jpg)
What is a Computer?
The first modern digital computer was invented where?
![Page 17: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/17.jpg)
Modern Computer Systems
Consist of two components: Hardware: physical devices required to execute
algorithms Software:
The instructions that tells the computer what to do Represented as programs in particular programming
languages
![Page 18: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/18.jpg)
Modern Computer Systems
Those parts of the system that you can hit with a hammer are called hardware; those program instructions that you can only curse at are called software. - Anonymous
![Page 19: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/19.jpg)
Hardware
Most computers consist of: central processing unit (CPU) storage/memory input/output (I/O) devices
![Page 20: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/20.jpg)
CPU – Brain of the Computer Coordinates all computer
operations Control Unit
Reads instructions from memory and decodes and executes them using the ALU
Arithmetic/Logic Unit (ALU) Does math and logic
calculations on numbers in registers
345
263Add register A to register B
608 Store the value in register C into memory location320843202
![Page 21: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/21.jpg)
Storage/Memory
“Comes with 3 GB of RAM”
![Page 22: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/22.jpg)
Visualizing Memory
X
75.62
…
STO 005
ADD 003
RTV 001
H
-26
0.005
354
-27.2
999
998
…
7
6
5
4
3
2
1
0
Memory is an ordered sequence of storage locations (memory cells)
Each memory cell has a unique address
Millions of these cells Every memory cell has some
contents although the contents may not be meaningful.
![Page 23: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/23.jpg)
Storage/Memory
The smallest unit of memory is a bit (Binary digIT)
A bit can be off (no voltage) or on (has voltage) which we interpret to be 0 or 1
Memory is organized into 8 bit contiguous groups called bytes. A megabyte is 1 million bytes. A gigabyte is 1 billion bytes.
![Page 24: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/24.jpg)
It’s All About the Switch
The basic component of most digital circuitry is nothing more complicated than a simple switch.
A switch’s function is pretty obvious, said in a number of different ways On or Off True or False 1 or 0
![Page 25: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/25.jpg)
Electronic Switch
Early computers used vacuum tubes as switches
Later, transistors were used as substitutes
![Page 26: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/26.jpg)
Visualizing Memory
X
75.62
…
STO 005
ADD 003
RTV 001
H
-26
0.005
354
-27.2
999
998
…
7
6
5
4
3
2
1
0
Thus, while we might visualize the computer with all sorts of data in the memory slots…
![Page 27: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/27.jpg)
Visualizing Memory
… It really consists of an arrangement of 1s and 0s
![Page 28: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/28.jpg)
Types of Memory
Registers Very high speed temporary storage areas for use in the CPU Used for calculations and comparisons
Cache High speed temporary storage for use with the CPU
Main Memory – Random-access Memory (RAM) High speed temporary storage Contains programs and data currently being used Often described in low numbers of Gigabytes (GB)
Secondary Memory - Disks Contains programs and data not currently being used Often described in Gigabytes (GB) or even Terabytes (TB)
![Page 29: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/29.jpg)
Why are there so many types of memory? The faster memory is the more it costs
So we reduce the cost by using small amounts of expensive memory (registers, cache, and RAM) and large amounts of cheaper memory (disks)
Why do we need cache? Processors are very fast and need quick access
to lots of data Cache provides quick access to data from RAM
![Page 30: The Study of Computer Science Chapter 0 Intro to Computer Science CS1510, Section 2](https://reader038.vdocuments.site/reader038/viewer/2022102617/56649de65503460f94adf2a5/html5/thumbnails/30.jpg)
Input/Output Devices
Allow for human/computer interaction Input devices include keyboard and mouse
Output devices include monitor and printer