what is a computer?

38
CCLi CCLi 1 What is a Computer? What is a Computer? Hardware: Software: IBM PC, Printer, Network Card Pentium 4, Monitor, Mouse, Scanner, RJ45, Wireless router Windows XP, MS Office: Word, Excel, PowerPoint, Access, Outlook; NetBeans, IE, Netscape,... IBM/370 30 years ago, if you knew this, you can easily earn $$$,$$$ a year Today, if you don't know these, you can hardly find a no- sweat-job...

Upload: gareth-cummings

Post on 30-Dec-2015

23 views

Category:

Documents


3 download

DESCRIPTION

What is a Computer?. Hardware:. IBM PC, Printer, Network Card Pentium 4, Monitor, Mouse, Scanner, RJ45, Wireless router. Software:. Windows XP, MS Office: Word, Excel, PowerPoint, Access, Outlook; NetBeans, IE, Netscape,... IBM/370. - PowerPoint PPT Presentation

TRANSCRIPT

CCLiCCLi 11

What is a What is a Computer?Computer?

Hardware:

Software:

IBM PC, Printer, Network CardPentium 4, Monitor, Mouse,Scanner, RJ45, Wireless router

Windows XP, MS Office: Word,Excel, PowerPoint, Access, Outlook;

NetBeans, IE, Netscape,...

IBM/370

30 years ago, if you knew this, you can easily earn $$$,$$$

a year

Today, if you don't know these, you can

hardly find a no-sweat-job...

CCLiCCLi 22

HardwarHardwaree

Input device Output device

Central Processor Unit: Internal StorageControl Unit

+Arithmetic-Logic Unit

(ALU)

CCLiCCLi 33

Hardware Software

Architecture Language

What is Computer Science?What is Computer Science?What are What are wewe studying? studying?

Theory

CCLiCCLi 44

What are they, really?What are they, really?

Computer! Computer!Computer!

CCLiCCLi 55

ComputerComputer -- --

What is machine?

A machine that can Compute!

What is Computation?

A computation is a sequence of procedures that manipulate data.

A machine is a device that follows a certain fixed causal rules.

CCLiCCLi 66

René Descartes (1596-1650)

Brains are Machines!!Brains are Machines!!

Image from http://www-groups.dcs.st-and.ac.uk/~history/PictDisplay/Descartes.html

Mind

Body Dualism: Mind-Body

CCLiCCLi 77

Let’s Let’s Compute!!Compute!!

“ Sir! Let’s sit down and compute!! ”

Gottfried W.V Leibniz

(1646-1716)

Image from http://sunsite.informatik.rwth-aachen.de/phil/filosofer/leibniz.html

CCLiCCLi 88

Dispute that can't be Dispute that can't be resolvedresolved

Image from http://turnbull.mcs.st-and.ac.uk/

Gottfried W.V Leibniz (1646-1716)

Isaac Newton (1643-1727 )

f(x) dx

CCLiCCLi 99

Real LifeReal Life

Are there any problems that can’t be

solved by any computation?

Ideal Life

There any tons of problems that can’t be solved by computers?

a pure world of forms with infinitecomputing power

CCLiCCLi 1010

Alan Turing Alan Turing (1912-1954)(1912-1954) – The Enigma– The Enigma

The man who invented the computer.

Image from http://ei.cs.vt.edu/~history/Turing.html

Turing Machine

CCLiCCLi 1111

Turing Turing Machine:Machine:

And, that is enough to beat any Super-Computer!!

1. A Tape (infinite)

2. A fixed finite set of symbols (0,1)

3. Four actions: (to do)

(1) read and (2) write symbols from/onto the tape, move the w/r head (3) back and (4) forth.

4. A finite transition table (what to do)

0 10 1 0

1

1) if ... move right..and go to (4)

2) if ... move left..3) if ... write 1....4) if .. ..................1002) ....

0

CCLiCCLi 1212

““Turing Machines are Turing Machines are

human that compute”human that compute” ““In logic nothing is In logic nothing is

accidental”accidental”

Image from http://www.ags.uci.edu/~bcarver/wgallery.html

Ludwig Wittgenstein (1889-1951)

The philosopher of the 20th century

CCLiCCLi 1313

Monroe 920 Desktop Calculator Monroe 920 Desktop Calculator made in 1969made in 1969

CCLiCCLi 1414

From 8008 to Pentium 4From 8008 to Pentium 4

8008 (Intel 1972)2500 Transistors

Pentium 4 (Intel 2000)42,000,000 Transistors

8080 (Intel 1975) 4500 Transistors

CCLiCCLi 1515

Moore's LawMoore's Law Image from http://www.hothardware.com

A computer is a vast collection of logical gates.

So, nothing is accidental in a computer.

CCLiCCLi 1616

Logical GatesLogical Gates 1: true0: false

AND operator

AA BB AndAnd

00 00 00

00 11 00

11 00 00

11 11 11

OR operator

AA BB OROR

00 00 00

00 11 11

11 00 11

11 11 11

NOT operator

AANONOTT

00 11

11 00

ANDA

B

NOT

ORA

B TTL gates1: 3.5 volts0: 0.2 volt

CCLiCCLi 1717

TTL 7400 GateTTL 7400 Gate

ANDNOT

ANDNOT

ANDNOT

ANDNOT

891011121314

7654321

Vcc

GND

CCLiCCLi 1818

CountingCounting12345678910

111213....19

20212223....29

90919293....99

0

100

0 1

1011 100

101110111 1000

1001101010111100110111101111

10000...

CCLiCCLi 1919

Adder (half Adder (half adder)adder)

11

+)+) 11

11 00

11

+)+) 00

11

00

+)+) 11

11

00

+)+) 00

00

AA

+)+) BB

cc SS

AA BB cSum

00 00 0 0

00 11 0 1

11 00 0 1

11 11 1 0

A

B

S

c

HalfAdder

CCLiCCLi 2020

Logical Gates for an Adder Logical Gates for an Adder (half (half adder)adder)

AA

+)+) BBcc SS

A B c S

0 0 0 0

0 1 0 1

1 0 0 1

1 1 1 0

AND

AND

NOT

B

A

S

c

1

1 11

11

1 1

1

1

0

Half-Adder

0

0

0

1

1 Ghz: 11095=200106

OR

CCLiCCLi 2121

Logical Gates and ClockLogical Gates and Clock

AND

AND

NOT

B

A

S

c

0

11

11

1

1

0

1

Half-Adder

0

1

400 MHz

4108/sec

0OR

CCLiCCLi 2222

Binary AdditionBinary Addition

11

00

10

10

10

01

11

11

10

01

00

10

01

11

10

00+)

carry

01

1 0

0

0

1

0

0

1

0

1

0

1

11 1010001

001111 101

CCLiCCLi 2323

Full Adder

CCii

AA

+)+) BB

CCoo SS

CCii AA BB CCoo SS

00 00 00 00 00

00 00 11 00 11

00 11 00 00 11

00 11 11 11 00

11 00 00 00 11

11 00 11 11 00

11 11 00 11 00

11 11 11 11 11

AB

S

Co

FullAdder

Ci

CCLiCCLi 2424

Logical Gates for a Full-Adder

CCii

AA

+)+) BB

CCoo SS

Ci A B Co S

0 0 0 0 0

0 0 1 0 1

0 1 0 0 1

0 1 1 1 0

1 0 0 0 1

1 0 1 1 0

1 1 0 1 0

1 1 1 1 1 A

B S

CoCi

•A full-adder can be constructed from half-adders.

half-adder

half-adder

0

1

1

0

1

S

1

0

c

S

c

0

1

0

1

1

1

1

0

A Full Adder

1OR

CCLiCCLi 2525

4 bits 4 bits AdderAdder

Full Adder

Full Adder

Full Adder

Full Adder

A

B 0

1 1 0 1

0 1 0

1 0 1 1

0

0 1 0

0 1 0

0

11 00 11 11

+)+) 00 00 11 00

11 11 00 11

CCLiCCLi 2626

Full-Adder and ClockFull-Adder and Clock

A

B S

Co

Cihalf-

adder

half-adder

c

s

c

s

1 3 3 1 1

For a 16 bits adder: 167+2=114

4108 114 3.5 106

OR

CCLiCCLi 2727

Leopold KroneckerLeopold Kronecker

(1823-1891)(1823-1891)

“God created the integers, all else is the work of man. “

Image from http://www-groups.dcs.st-and.ac.uk/ ~history/Mathematicians/Kronecker.html

CCLiCCLi 2828

Adder, that’s enough!Adder, that’s enough!

Full Adder

Full Adder

Full Adder

Full Adder

A

B 0

1 1 0 1

0 1 0

1 0 1 1

0

0 1 0

0 1 0

0

XXXXX Created full-adders, all else is the work of programmers

CCLiCCLi 2929

Conversion between number Conversion between number systemssystems

Base 10 Decimal

Our ordinal number system; a decimal number provides us a more accurate

perception about its quantity.

Base 2 BinaryThe way computers handle numbers.

Base 8 Octal

An easy way for us to memorize or say a binary string.

Base 16

Hexadecimal

A much easier way for us to memorize or

say a binary string.

o8 76517651..ge

HFA9..ge

2011111101010..ge

CCLiCCLi 3030

0123 1041081071033784

Weight

3 7 8 4

310 210 110 010

Remainder

4

8

7

0 3

103784 8107103 12

10378

1037

103

3

7103 1

Decimal Number: 3784

Least Significantdigit

Most Significantdigit

CCLiCCLi 3131

weight

27 26 25 24 23 22 21 20

1 1 0 0 1 0 0 1

110010012 = 127+ 126 + 123 + 120 = 201RemainderRemainder

201 2 =

126 + 125 + 1 22 = 100 1

100 2 =

125 + 124 + 1 21 = 50 0

50 2 = 124 + 123 + 1 20 = 25 0

25 2 = 123 + 122 = 12 1

12 2 = 122 + 121 = 6 0

6 2 = 121 + 1 20 = 3 0

3 2 = 1 20 = 1 1

1 2 = 0 1Binary number :

110010012

Least Significant bitMost Significant bit

CCLiCCLi 3232

weight

37 36 35 34 33 32 31 30

1 1 0 0 1 0 0 1

110010013 = 137+ 136 + 133 + 130 = 2944 Remainder

2944 3 =

136 + 135 + 1 32 = 9811

981 3 = 135 + 134 + 1 31 = 327 0

327 3 = 134 + 133 + 1 30 = 109 0

109 3 = 133 + 132 = 36 1

36 3 = 132 + 131 = 12 0

12 3 = 131 + 1 30 = 4 0

4 3 = 1 30 = 1 1

1 3 = 0 1

Trinary number : 110010013

CCLiCCLi 3333

weight

162 161 160

F A 9

FA9H = 15162 + 10161 + 9160 = 4009

Remainder

4009 16 =

15 161 + 10 160 = 250

9

250 16 = 15 160 = 15 10

15 16 = 0 15

Hexadecimal number : FA9HHex

Dec

0 0

1 1

2 2

3 3

4 4

5 5

6 6

7 7

8 8

9 9

A 10

B 11

C 12

D 13

E 14

F 15

CCLiCCLi 3434

Conversion between Hexadecimal, Octal, and Binary

Numbers Binary

Octal

000 0

001 1

010 2

011 3

100 4

101 5

110 6

111 7

Binary Hex

0000 0

0001 1

0010 2

0011 3

0100 4

0101 5

0110 6

0111 7

1000 8

1001 9

1010 A

1011 B

1100 C

1101 D

1110 E

1111 F

CCLiCCLi 3535

Binary Octalweight 28 27 26 25 24 23 22 21 20

1 0 1 0 0 1 0 1 1

= 128 + 027 + 126 + 025 + 024 + 123 + 022 + 121 + 120

= (122 + 021 + 120) 26 + (022 + 021 + 120) 23 + (022 + 121 + 120 ) 1 = (122 + 021 + 120) (23)2+ (022 + 021 + 120) (23)1

+ (022 + 121 + 120 ) (23)0 = 5 82 + 1 81 + 3 80

= 5138

CCLiCCLi 3636

Binary Octal(shortcut)

1 1 1 1 1 0 1 0 1 0 0 11

7 6 5 1

Least Significant bit

101100101010012 = 26251o

0 1 0 1 1 0 0 1 0 1 0 1 0 0 1

2 6 2 5 1

Least Significant bit

1111101010012 = 7651o

CCLiCCLi 3737

Binary Hexadecimal

weight 211 210 29 28 27 26 25 24 23 22 21 20

0 0 0 1 0 1 0 0 1 0 1 1

= 0211 + 0210 + 029 + 128 + 027 + 126 + 025 + 024

+ 123 + 022 + 121 + 120

= 14BH

= (023 + 022 + 021 + 120 ) (24)2+ (023 + 122

+ 021 + 020) 24 + (123 + 022 + 121 + 120 ) 1= 1 (16)2+ 4 16 + 11 160

CCLiCCLi 3838

Binary Hexadecimal (shortcut)

1 1 1 1 1 0 1 0 1 0 0 1

F A 9

Least Significant bit

101100101010012 = 2CA9H

0 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1

2 C A 9

Least Significant bit

1111101010012 = FA9H