unit 14 1 computer architecture: overview h hardware building blocks h boolean logic h the physics...

76
1 unit 14 Computer Architecture: Computer Architecture: overview overview Hardware building blocks Boolean logic The physics of semiconductors Data representation Historical overview basic programmin g concepts object oriented programmin g topics in computer science syllabus

Post on 21-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

1unit 14

Computer Architecture: overviewComputer Architecture: overview

Hardware building blocks Boolean logic The physics of semiconductors Data representation Historical overview

basic programming

concepts

object oriented programming

topics in computer science

syllabus

2unit 14

The The building blocksbuilding blocks of computers of computers

ALL information is represented as binary numbers

computation is done via boolean logic and gates

computers are essentially made of computer circuits, made of elementary units such as transistors

3unit 14

Binary numbersBinary numbers

binary decimal0 01 110 211 3100 4101 5110 6

4unit 14

Binary storage devices: propertiesBinary storage devices: properties

device has two stable energy states

states are separated by large energy barrier

state can be sensed non-destructively

device can be switched between states by applying

some energy

5unit 14

Binary storage devices: examplesBinary storage devices: examples

Mechanical light switch

magnetic core (memory 1955-1975): diameter

~0.5mm, weight ~grams

transistor: electronic solid state switch, fast and

small ~0.001mm

6unit 14

A computing deviceA computing device

chip (integrated circuit): a lot of interconnected electrical devices, printed photographically on a wafer of semiconductor material (silicon)

circuit board: a collection of inter-connected chips doing different things

photographic production makes it small, fast, replicable (mask) cheap

circuit board

Integrated circuit or chipDual in-line package (DIP)

I/O pins

~1cm

Individual transistors

)3-10M(

Communication channel (a bus)

8unit 14

Printed circuit boardPrinted circuit board

9unit 14

ICs on a printed circuit boardICs on a printed circuit board

10unit 14

OutlineOutline

Hardware building blocks Boolean logic The physics of semiconductors Data representation Historical overview

11unit 14

Binary numbers and Boolean logicBinary numbers and Boolean logic

Boolean algebra/logic: rules for manipulating values of true & false (George Boole 1815-1864)

basic operators: • * (AND)• + (OR)• (NOT)

boolean expressions can be described via “truth-tables”

12unit 14

Basic logical operationsBasic logical operations

arch/logapplets/gate

13unit 14

Boolean AlgebraBoolean Algebra

Manipulation Rules  A + B = B + A  A * B = B * A  (A + B) + C = A + (B + C)  (A * B) * C = A * (B * C)  A * (B + C) = (A * B) + (A * C)  A + (B * C) = (A + B) * (A + C)

Equivalence Rules  A = A        (double negative)

 A + A = A  A * A = A   A * A = 0  A + A = 1

14unit 14

DeMorgan rulesDeMorgan rules

_______   _    _  (A + B) = A * B

      and  _______   _   _  (A * B) = A + B

15unit 14

Logic function: example 1Logic function: example 1

a b output

0 0 1

0 1 1

1 0 1

1 1 0

16unit 14

Exmaple 2: XOR functionExmaple 2: XOR function

a b output

0 0 1

0 1 0

1 0 0

1 1 1

17unit 14

Binary arithmetic with logical operatorsBinary arithmetic with logical operators

half-adder: adds up 2 bits

full adder: adds up 2 binary numbers

arch/logapplets/full-adder

arch/logapplets/half-adder

18unit 14

Memory with logical operatorsMemory with logical operators

flip-flip

memory

arch/logapplets/flipflop

arch/logapplets/memory

19unit 14

GatesGates

Gate: an electronic device, transistors connected in parallel and/or in series

operates on binary inputs to produce binary output: {1/0,…,1/0} 1/0

Basic gates implement AND, OR, NOT, NAND, NOR

20unit 14

Computer circuitsComputer circuits

collection of gates

transform a set of binary inputs into a set of binary outputs (a mapping called computation)

+

a

b

c

d

inputs outputs

1

0

1

1 1

1

0

21unit 14

OutlineOutline

Hardware building blocks Boolean logic The physics of semiconductors data representation Historical overview

22unit 14

Electronics basic terminologyElectronics basic terminology

Charge: a characteristic of a unit of matter that expresses the extent to which it has more or fewer electrons than protons

Current: flow of electrical charge carriers, usually electrons or electron-deficient atoms (symbolized by ‘I’, measured in amperes)

Voltage: the potential difference in charge between two points (symbolized by ‘V’, measured in volt units)

Resistance: the resistivity that a substance offers to the flow of electric current (symbolized by ‘R’, measured in ohm (W))

Ohm’s law:

23unit 14

Electronics Terminology, moreElectronics Terminology, more

Conductor: any material, which allows electrical current to flow through it, e.g., most metals

Insulator: any material that does not allow electrical current to flow through it, e.g., glass, plastics

Semi-conductor: material which exhibits some natural electrical conducting ability, e.g., silicon and germanium

24unit 14

Electronics TerminologyElectronics Terminology

MaterialResistivityClassification

Copper1.7x10-8 mConductors

Aluminum2.8x10-8 m

Germanium0.65 mSemiconductors

Silicon2.0 x 103 m

Glass1.7 x 1011 mInsulators

Rubber1 x 1016 m

Conductors: below 10-5 m.

Semiconductor: range 10-5 to 108 m

Insulators: above 108 m.

25unit 14

Atomic structureAtomic structure

26unit 14

Atomic energy bandsAtomic energy bands

Valence shell

27unit 14

Energy bands and conductivityEnergy bands and conductivity

28unit 14

Energy bands: atoms in solidEnergy bands: atoms in solid

29unit 14

Atoms StructureAtoms Structure

30unit 14

Covalent BondsCovalent Bonds

31unit 14

Silicon CrystalSilicon Crystal

32unit 14

““Doping” semiconductorsDoping” semiconductors

N-type semiconductors have a significant number of free electrons • Silicon with phosphorus impurities

P-type semiconductors have a significant number of free electron holes• Silicon with boron impurities

33unit 14

N-type CurrentN-type Current

34unit 14

Current via electrons flowCurrent via electrons flow

35unit 14

P-type CurrentP-type Current

36unit 14

Current via Current via holes flowholes flow

37unit 14

The PN JunctionThe PN Junction

38unit 14

The PN Junction: forward BiasThe PN Junction: forward Bias

39unit 14

The PN Junction: reverse biasThe PN Junction: reverse bias

40unit 14

PN junction: current/voltage graphPN junction: current/voltage graph

41unit 14

33--type junctions: the transistortype junctions: the transistor

42unit 14

Varieties of transistorsVarieties of transistors

43unit 14

Transistor as an amplifierTransistor as an amplifier

44unit 14

Field Effect Transistors: JFETField Effect Transistors: JFET

45unit 14

Field Effect Transistors: MOSFETField Effect Transistors: MOSFET

46unit 14

Fabrication processFabrication process

47unit 14

Computing with transistors: inverterComputing with transistors: inverter

arch/buffalo/inverter

P-FET

N-FET

48unit 14

Inverter in SiliconInverter in Silicon

49unit 14

NAND gateNAND gate

50unit 14

NOR gateNOR gate

P-FETP-FET

51unit 14

OutlineOutline

Hardware building blocks Boolean logic The physics of semiconductors Data representation Historical overview

52unit 14

Internal Data RepresentationInternal Data Representation

Every piece of information stored on a computer is represented as binary values

So, what is represented by the following binary sequence?

01100001001010

One can't tell just from the bit sequence itself; we have to know how to interpret the binary value

53unit 14

Representing IntegersRepresenting Integers

There are four types of integers in Java, each uses a different number of bits for storing the value

Each has a sign bit: if it is 1, the number is negative; if it is 0, the number is positive

byte

short

int

long

s 7 bits

s 15 bits

s 31 bits

s 63 bits

±2·109 )billions(

±32K (thousands)

±128

)billions of billions(

54unit 14

Two's ComplementTwo's Complement

Integers are stored in signed two's complement format:• A positive value is a straightforward binary number• A negative value is represented by inverting all of

the bits of the corresponding positive value, then adding 1

• To "decode" a negative value, invert all of the bits and add 1

Using two's complement makes internal arithmetic processing easier

55unit 14

Two's Complement: exampleTwo's Complement: example

The number 25 is represented in 8 bits (byte) as00011001

To represent -25, first invert all of the bits11100110

then add 111100111

the sign bit has reversed, indicating a negative number

To decode -25, first note the negative sign; then invert all bits00011000

and add 100011001

56unit 14

Overflow and UnderflowOverflow and Underflow

Storing numeric values in a fixed storage size can lead to overflow and underflow problems

Overflow occurs when a number grows too large to fit in its allocated space

Underflow occurs when a number shrinks too small to fit in its allocated space

57unit 14

Representing Floating Point ValuesRepresenting Floating Point Values

A decimal floating point value can be represented as follows:

sign * mantissa * 10 exponent

where• sign is either 1 or -1

• mantissa is a positive value that represents the significant digits of the number

• exponent is a value that indicates how the decimal point is shifted relative to the mantissa

58unit 14

Representing Floating Point ValuesRepresenting Floating Point Values

For example, the number -843.977 is represented by

-1 * 843977 * 10 -3

Floating point numbers can be represented in binary the same way, except that the mantissa is a binary number and the base is 2 instead of 10

sign * mantissa * 2 exponent

In computers, floating point values are stored by storing each of these components in the space allotted

59unit 14

Representing CharactersRepresenting Characters

In jave, characters are represented using the Unicode coding scheme, which matches a unique number to each character to be represented

Storing the character is therefore as simple as storing the binary version of the number that represents it; for example, the character 'z' has the Unicode value 122, which is represented in 16 bits as

0000000001111010

60unit 14

Representing CharactersRepresenting Characters

Java lets you perform some arithmetic processing on characters

For example, because 'A' is stored as Unicode value 65, the statement

char c = 'A' + 5;

will store the character 'F' in c (Unicode value 70)

This relationship is occasionally helpful When treated as integers, char values are unsigned

61unit 14

OutlineOutline

Hardware building blocks Boolean logic The physics of semiconductors Data representation Historical overview

62unit 14

Brief historical overviewBrief historical overview:: Beginning - Mechanical calculatorsBeginning - Mechanical calculators

Examples:

• Pascaline 1642: addition, subtraction

• Leibnitz’s wheel 1694: add,sub,mul,div

no memory

not programmable

63unit 14

Programmable devicesProgrammable devices

Joseph Lacquard loom - 1801

punched card “Programmed” desired pattern of weaving

1 card per 1 row human expertise translated to machine readable

language

64unit 14

Charles BabbageCharles Babbage

“difference engine” (built in 1823)• mechanical “hardware”: cogs and gears• add, subs, mul, div - to 6 significant digits• solve polynomial equations

“Analytic engine” (designed in 1830’s)• mill: arithmetic manipulations (ALU?)• store: hold data (memory?)• operator: process punched cards (CU?)• output unit: results to punched card (I/O?)

65unit 14

Birth of IBMBirth of IBM

Herman Hollerith, worker for the US census office in 1890’s, designed programmable card processing machine:

• automatic read, score, sort

• data coded onto card with keypunch

• tabulator counts and scores, sorter

• programmable via wires and plugs

• small memory

66unit 14

Automatic information processingAutomatic information processing

Speed: census 1880 - 8 years, 1890 - 2 years

Scale: Computing-Tabulating-Recording company up to 1950’s, every major US corporation use keypunches, sorters and tabulators for data processing

became IBM

67unit 14

Mark IMark I

Harvard 1930’s by Howard Aiken electromechanical programmable computer:

relays, magnets, gears vacuum tubes store binary values (first use of

binary system) memory: 72 numbers speed: 23-digits multiplication in 4 seconds

68unit 14

WWII first electronic computersWWII first electronic computers

ENIAC 1946

ABC in University of Iowa (1940-43)

Colossus by Turing in England (1943)

Z1 in Germany

69unit 14

ENIAC, the first electronic computerENIAC, the first electronic computer

Eckert and Mauchly, University of Pennsylvania, November 1945

ENIAC's architecture resembles that of the Harvard Mark I, but its components are entirely electronic, incorporating 17,468 vacuum tubes

The machine weighs 30 tons, covers over 100 square meter of floor, and consumes 130 kilowatts of electricity; it uses vacuum tubes

70unit 14

ENIACENIAC

A card reader is available to input data values, and there is a card punch for output

The program is set up on a plugboard --- this is considered reasonable since the same or similar program would generally be used for weeks at a time

The ENIAC's clock speed is 100 kHz

71unit 14

More ENIACMore ENIAC

72unit 14

Stored program computerStored program computer

Proposed by von Neumann in 1946

instructions encoded as binary values and stored in memory, along with data

1950: EDVAC (UPenn) UNIVAC I (commercial), EDSAC (Cambridge Univ.)

73unit 14

EDVAC, "Electronic Discrete EDVAC, "Electronic Discrete Variable Automatic ComputerVariable Automatic Computer""

Oppenheimer and von Neumann

EDVAC was the first stored program computer

74unit 14

EDSAC, Electronic Delay Storage EDSAC, Electronic Delay Storage Automatic ComputerAutomatic Computer

Based on EDVAC report, first full-scale operational stored program computer, May 1949

Total of 256 35-bit words (or 512 17-bit words).

The clock speed of the EDSAC is 500 kHz; most instructions take about 1.5 s to execute.

Its I/O is by paper tape, and a set of constant registers is provided for booting

75unit 14

Modern era: computer evolutionModern era: computer evolution

1950-59 first generation: • processing and storage by vacuum tubes

• large (building size), slow, expensive, unreliable

• operated by trained personnel in specialized locations

1959-65 second generation: • transistors and magnetic cores make for reduced size (room size)

and cost, + increased reliability

• high level programming languages appear - Fortran and Cobol, first operating systems

1965-75 third generation: • integrated circuits etched onto silicon

• cheap, small (desk size) minicomputers

• software industry is born 1975-85 4th generation:

• microcomputers (complete system on a single circuit board) desktop size

• software explosion

• computer networks appear

• graphical user interfaces are born ...