Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSC 110 – Intro to Computing Lecture 2: More Computing History & Binary Numbers.

Similar presentations


Presentation on theme: "CSC 110 – Intro to Computing Lecture 2: More Computing History & Binary Numbers."— Presentation transcript:

1 CSC 110 – Intro to Computing Lecture 2: More Computing History & Binary Numbers

2 Announcements A notetaker is still needed for this course. You can earn $50 for coming to class and taking good notes. Interested students should talk to me.

3 “Paperbook Computer” Use handouts for to guide your own note- taking Video will also be available from the library

4 1 st Generation of Software Earliest programs written in machine code  “Language” used by the computer itself  Written in binary (for modern Mac): 10000000001000000000000000000100 10000000010000000000000000001000 01111100011000010001001000010100  Could be a little difficult to use

5 1 st Generation of Software Assembly language quickly followed  Uses mnemonic codes and numbers  Translates directly to machines code  Example: lwz r1,4(r0) lwz r2,8(r0) add r3,r2,r1  Slightly better than machine code

6 1 st Generation of Software Why didn’t people immediately use assembly language?

7 2 nd Generation of Software Advances in technology enabled higher- level languages  FORTRAN, COBOL, Lisp continue to be used Code became much more readable: Lisp example: (setq a …) (setq b …) (setq c (+ a b)) Easier to move program from one machine to another

8 3 rd Generation of Software Keyboards and screens proliferate People on computer simultaneously Led to new uses of computers  Word processors  Databases  SPSS (statistical program)

9 4 th Generation of Software Languages designed to be easier to use BASIC: let a = … let b = … let c = a + b Applications developed for everyday users  Spreadsheets  Financial software  Desktop publishing

10 5 th Generation of Software Computers become ubiquitous  Increasing expectations of computer access  “Little knowledge” needed for use Applications take advantage of graphics, networks  “World Wide Web”  Graphics intensive games

11 Introduction to Numbers Natural numbers  Whole-numbers 0 and greater  E.g., 0, 10, 192, 34894589301202, 243423 Integers  All natural and negative numbers  E.g., 0, 12, -12, 2323234, -2323234, -129343

12 More Numbers Rational Numbers  Numbers equal to the ratio of two integers  E.g., 0, -345, 0.45, -0.329483, ⅓, 0.333333… For now, we focus on natural numbers

13 Base of a number We normally work in base 10 Computers typically work in base 2 What do we commonly use from a base 60 system?

14 Base of a number Base 10 (“decimal”) uses 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Base 2 (“binary”) uses 2 digits: 0, 1 Base 8 (“octal”) uses 8 digits: 0, 1, 2, 3, 4, 5, 6, 7 Base 16 (“hexadecimal”) uses 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B

15 Base 1 The simplest (and oldest) counting method is base 1 How would a base 1 system work?

16 Counting in Decimal How big is “13” or “2438”?  How do you know?  13 ==  2438 ==

17 Numerical Value Value of a number depends on the base  The value of “13” in base 10 13 = 3 * 10 0 = 3 +1 * 10 1 = 10  The value of “2438” in base 10 2438 =8 * 10 0 = 8 +3 * 10 1 = 30 +4 * 10 2 = 400 + 2 * 10 3 = 2000

18 Positional Notation Used to compute value for all numerical bases > 1 For base 10, values are computed by: d n * 10 n-1 + d n-1 * 10 n-2 + … + d 2 * 10 1 + d 1 * 10 0 Any guesses why we use the term “base”?

19 Binary Numbers Modern computers work in binary (base 2)  Some early machines used decimal (base 10) Positional notation for binary is similar to decimal What would 1010 equal?

20 The Prof. Cheats Need the base to know the value of “1010”!  1010 is a valid number in many bases What is the value of the binary 1010 in decimal? 1010 = 0 * 2 0 + 1 * 2 1 + 0 * 2 2 + 1 * 2 3 =0 * 1 + 1 * 2 + 0 * 4 + 1 * 8 = 0 + 2 + 0 + 8 = 10

21 Octal Base 8 is often used in computer science Values still computed via positional notation d n * 8 n-1 + d n-1 * 8 n-2 + … + d 2 * 8 1 + d 1 * 8 0 Why do programmers love Halloween? (Hint: What is the value of oct 31?)

22 For Next Lecture Have Chapters 1 & 2 finished Be ready to discuss:  Hexadecimal numbers  Converting from decimal to other bases  Arithmetic in bases other than 10


Download ppt "CSC 110 – Intro to Computing Lecture 2: More Computing History & Binary Numbers."

Similar presentations


Ads by Google