Lecture 1 Slides - Hardware and Software

1 of 32

Hardware & Software

CS 110

1

2 of 32

Reminders

Today

  • What is a computer?
  • Hardware
  • Software

Friday

  • Programming in Text
  • Mini-Quiz 0 (completed by attending class)
  • Finishing up Exercise 0

2

3 of 32

Course Resources

edSTEM

  • Used to ask questions, get answers, and help others.
  • Can post PRIVATE or PUBLIC questions.
  • Peers can answer questions too!
  • Personal matters should go to me via email

3

Canvas

  • Literally everything else.
  • Where you can check deadlines and course schedule.
  • Submit assignments.
  • Find assignment details.
  • Find lecture slides and recordings.

4 of 32

Outline

  • What is a computer?
  • Hardware
  • Software

4

5 of 32

What is a computer?

5

6 of 32

6

  • ~1613. A person who makes calculations or computations; a calculator, a reckoner; spec. a person employed to make calculations in an observatory, in surveying, etc. Now chiefly hist.
  • ~1869. A device or machine for performing or facilitating calculation.
  • ~1945. An electronic device (or system of devices) which is used to store, manipulate, and communicate information, perform complex calculations...and is capable of receiving information (data) and of processing it in accordance with variable procedural instructions (programs or software).

From the Oxford English Dictionary

7 of 32

7

8 of 32

8

9 of 32

9

10 of 32

10

11 of 32

11

12 of 32

12

13 of 32

13

14 of 32

14

15 of 32

15

16 of 32

https://www.history.com/news/human-computers-women-at-nasa

17 of 32

17

What is a Computer?

Something or someone that interprets and processes instructions, according to a set of rules and conventions, in a consistent way.

Involves hardware and software working together

18 of 32

Outline

  • What is a computer?
  • Hardware
  • Software

18

19 of 32

HARDWARE

19

20 of 32

20

Central Processing Unit (CPU)

Arithmetic and Logic Unit

Control Unit

Temporary Memory(e.g. Cache, RAM)

Permanent Memory(e.g. thumb drives, hard drives)

Inputs�(e.g. keyboard, mouse, mic, webcam, sensor)

Outputs�(e.g. screen, speakers, printer)

HARDWARE�The Physical Side of Computing

21 of 32

Outline

  • What is a computer?
  • Hardware
  • Software

21

22 of 32

SOFTWARE

What is a program?

22

23 of 32

A set of instructions interpreted by an information processing agent

The following are properties of programs:

  • Must be interpreted by someone/thing that understands them
  • Relies on a set of formal conventions (i.e. a language) that the interpreting agent and the programmer both understand
  • A program executed by one agent (given the same inputs) should be identical to the same program executed by another agent
  • Order matters

Programming languages are designed to be concise & unambiguous

23

24 of 32

I never said they stole my cookie.

24

25 of 32

I never said they stole my cookie.

25

26 of 32

I never said they stole my cookie.

I never said they stole my cookie.

26

27 of 32

Programming Languages and Ambiguity

In spoken languages like English, there are situations where weirdness prevents us from understanding the meaning behind a sentence.

I never said they stole my cookie. — Someone else said it.

I never said they stole my cookie. — I didn't say it.

I never said they stole my cookie. — I only implied it.

I never said they stole my cookie. — I said someone did, not necessarily them.

I never said they stole my cookie. — I considered it borrowed.

I never said they stole my cookie. — Only that they stole a cookie, not necessarily my own.

I never said they stole my cookie. — They stole something of mine, not my cookie.

Computers can't deal (easily at least) with this ambiguity. So in a programming language, we limit ourselves to particular functions that are defined very specifically such that there is no ambiguity when you give the computer that command.

27

28 of 32

28

Directions

  • Preheat oven to 350 degrees F (175 degrees C).
  • Cream together the butter, white sugar, and brown sugar until smooth. Beat in the eggs one at a time, then stir in the vanilla. Dissolve baking soda in hot water. Add to batter along with salt. Stir in flour, chocolate chips, and nuts. Drop by large spoonfuls onto ungreased pans.
  • Bake for about 10 minutes in the preheated oven, or until edges are nicely browned.

Ingredients

1 cup butter, softened 2 eggs

1 cup white sugar 2 teaspoons vanilla extract

1 cup packed brown sugar 1 teaspoon baking soda

2 cups chocolate chips ...

29 of 32

29

Directions

  • Preheat oven to 350 degrees F (175 degrees C).
  • Cream together the butter, white sugar, and brown sugar until smooth. Beat in the eggs one at a time, then stir in the vanilla. Dissolve baking soda in hot water. Add to batter along with salt. Stir in flour, chocolate chips, and nuts. Drop by large spoonfuls onto ungreased pans.
  • Bake for about 10 minutes in the preheated oven, or until edges are nicely browned.

Ingredients

1 cup butter, softened 2 eggs

1 cup white sugar 2 teaspoons vanilla extract

1 cup packed brown sugar 1 teaspoon baking soda

2 cups chocolate chips ...

  • Who is the interpreter?
  • What are some of the formal conventions?
  • What is the order?
  • How much flexibility does the interpreter have?

30 of 32

Turtle activities!

On our course web page

30

31 of 32

Understanding the Words / Atoms of Programming

31

Python is made up of different kinds of “words”, which can be used to construct sentences and paragraphs (statements and code blocks). Some types of ‘words’ in Python include:

  • pieces of data like numbers, words, images, etc.
  • variables are containers that can hold data
  • operators are symbols that perform actions
  • functions are way of chunking programs
  • reserved words (special words in python)
  • modules

32 of 32

Reminders

  • Go ahead and take a look at Exercise 0 (due Friday at 11:59pm) and complete the first portion (Google Form Survey + Installation of Python)
  • We'll do the programming portion together in-class on Friday
  • Make sure to look at the Syllabus, particularly the Grading Policies section which says how you're evaluated and what sort of leniency the course has built-in!

32