CTEC1414 Lecture 2

29
Hardware 2 Basic Architecture Dr John Cowell phones off (please)

description

phones off (please). CTEC1414 Lecture 2. Hardware 2 Basic Architecture Dr John Cowell. Overview. Representing data bits, bytes, words, prefixes binary, hex, ASCII, floating point Von Neumann architecture processor: ALU and CU RAM and ROM FPU Processor types CISC and RISC examples - PowerPoint PPT Presentation

Transcript of CTEC1414 Lecture 2

Page 1: CTEC1414 Lecture 2

Hardware 2Basic Architecture

Dr John Cowell

phones off (please)

Page 2: CTEC1414 Lecture 2

OverviewRepresenting data

bits, bytes, words, prefixesbinary, hex, ASCII, floating point

Von Neumann architectureprocessor: ALU and CURAM and ROMFPU

Processor typesCISC and RISC

examplesdedicated

© De Montfort University, 2010 CTEC1414-2 2

Page 3: CTEC1414 Lecture 2
Page 4: CTEC1414 Lecture 2

TerminologyComputers work in binary

bit binary digit, ‘0’ or ‘1’ easy to represent as magnetic fields, light/electrical pulses, etc.

byte a group of 8 bits n.b. nibble = 4 bits (a small byte!)

word a group of bits that can be manipulated by the processor as a

single unit almost always it is a whole number of 8-bit bytes e.g. 32 bit processor has a word length of 32 bits

© De Montfort University, 2010 CTEC1414-2 4

Page 5: CTEC1414 Lecture 2

PrefixesDealing with single bytes is clumsy

memory capacities are currently in billions of bytesdisk capacities are in billions or trillions of bytes

PrefixesKb = Kilobyte = 1024 bytes = 1024 8 bits = 210

approximately one thousandMb = Megabyte = 1024 Kb = (1024)2 bytes = 220

approximately one millionGb = Gigabyte = 1024 Mb = (1024)3 bytes = 230

approximately one billionTb = Terabyte = 1024 Gb =(1024)4 bytes = 240

approximately one trillion (thousand-billion)Pb = Petabyte = 1024 Tb = (1024)5 bytes = 250

approximately one thousand trillion

© De Montfort University, 2010 CTEC1414-2 5

Page 6: CTEC1414 Lecture 2

Number BasesComputers use base 2 - binary

humans don’t! humans use base 10, 12, 60, etc.

binary is difficult (for humans) to read and understand

Base 16 (hexadecimal) and base 8 (octal) are used as they are easier for usthey are used as a shorthand for binaryboth of these are easy to convert to and from binaryoctal is not used very much anymore

Note: the base is also known as the radix

© De Montfort University, 2010 CTEC1414-2 6

Page 7: CTEC1414 Lecture 2

Binary SystemCounting in binary

© De Montfort University, 2010 CTEC1414-2 7

uses powers of 2, i.e.20 = 121 = 222 = 423 = 824 = 1625 = 3226 = 6427 = 128

0 = 01 = 1

10 = 211 = 3

100 = 4101 = 5110 = 6111 = 7

1000 = 81001 = 91010 =101011 =111100 =121101 =131110 =141111 =15

Page 8: CTEC1414 Lecture 2

HexadecimalUses characters 0 - 9, then A - F for numbers 10

to 15

© De Montfort University, 2010 CTEC1414-2 8

uses powers of 16:160 = 1161 = 16162 = 256163 = 4,096164 = 65,536165 = 1,048,576

0 = 01 = 12 = 23 = 34 = 45 = 56 = 67 = 7

8 = 89 = 9A =10B =11C =12D =13E =14F =15

Page 9: CTEC1414 Lecture 2

The ASCII Code SetIf computers only work in binary, how do they

represent letters and other characters?a coding scheme was invented

American Standard Code for Information Interchangecharacters are represented as values from 0 to 127

this value range can be converted to 7 digit binary codesMost modern representation of characters use ASCII

as their base.0 to 31 are used for control codes, e.g. CR = 13‘A’ is 65 (1000001)‘a’ is 97 (1100001)‘1’ is 49 (0110001)

The modern approach is to use a Unicode or ISO standard. For representing any character.

© De Montfort University, 2010 CTEC1414-2 9

Page 10: CTEC1414 Lecture 2

Unicode standardsThe Unicode Consortium- non profit making organisation made

up of company experts.Unicode – a standard for expressing text.

Covers 93 scripts (arabic, amharic, kanji etc...)> 109,000 characters.

Latin Script encodings include: UTF-8 — an 8-bit variable-width encoding which maximizes

compatibility with ASCII. UTF-EBCDIC — an 8-bit variable-width encoding, which maximizes

compatibility with EBCDIC. (not part of The Unicode Standard) UTF-16 — a 16-bit, variable-width encoding UTF-32 — a 32-bit, fixed-width encoding

© De Montfort University, 2010 CTEC1414-2 10

Page 11: CTEC1414 Lecture 2

Real NumbersIf computers only work in binary, how do they

represent real numbers?the truth is they don’t.again, a special coding scheme was invented to

represent numbers such as 3.141592654, 2.9979 108, 6.626 10-34

A number is split into two partsone part describes the number itself (the mantissa)another describes where the decimal point appears

(the exponent)Again, different coding schemes are possible

fortunately, the ANSI/IEEE 754 is almost universal now

© De Montfort University, 2010 CTEC1414-2 11

Page 12: CTEC1414 Lecture 2
Page 13: CTEC1414 Lecture 2

Von Neumann ArchitectureJohn von Neumann was a mathematician who co-

authored a report in 1946 on computer constructionThe main principles were

information is stored on a slow-to-access storage medium (hard disk) stored as numerical binary digits information can be interpreted as either instructions or data

worked on in a fast-access, volatile memory (RAM) each cell in memory has a unique numerical address

a processor manipulates the data according to pre-specified (built-in) operations

© De Montfort University, 2010 CTEC1414-2 13

Page 14: CTEC1414 Lecture 2

Instructions and DataA program comprises instructions (machine code)

and dataan instruction has several components:

function code, operand address(es)is one of several types:

arithmetic / logic operation, control transfer, load / store input / output, memory reference, processor reference

An instruction is brought from the RAM to the processor and is executeddata may be altered as a resultA new instruction is made ready for execution

© De Montfort University, 2010 CTEC1414-2 14

Page 15: CTEC1414 Lecture 2

Machine CodeComputers only understand instructions written

in machine code.Every type of processor understands different

machine code.Application software called a compiler translate

a program written in a high level language such as C++, C#, Visual Basic etc... Into machine code

Programs written in different languages can be converted into the same machine language.

© De Montfort University, 2010 CTEC1414-2 15

Page 16: CTEC1414 Lecture 2

Recall - CPU Components

© De Montfort University, 2010 CTEC1414-2 16

notice that all information enters and leaves the CPU via the RAM

CPU

InputDevices

CommunicationDevicesBacking Storage

OutputDevices

controlunit

arithmetic & logic unit

RAM

(micro-)processor

Page 17: CTEC1414 Lecture 2

ProcessorThe ‘brain’ or ‘heart’ of a computer which

interfaces with main memorycontrols each operation through the control unitperforms arithmetic and logical comparison

operations in the arithmetic / logic unitThe processor contains several registers and

buffers for temporary storage to holdthe instruction that is currently being executeddata that is currently being operated on

© De Montfort University, 2010 CTEC1414-2 17

Page 18: CTEC1414 Lecture 2

Control UnitControls or manages the operations of the

processor, includingtransmission of program from backing storage to

RAMactivation of input / output devices

Fetches the current instruction from memoryInterprets or decodes the instruction

loads any data required into internal register(s)Determines the address (memory location) of the

next instruction to be executedcontrols the sequencing of instructions

© De Montfort University, 2010 CTEC1414-2 18

Page 19: CTEC1414 Lecture 2

Arithmetic Logic UnitCarries out operations on data

data can be processed arithmetically added, subtracted, multiplied, divided, etc.

data can be logically compared greater than, less than, equal to, etc.

Operations are carried out on data held in temporary storage registers

Results are stored in special accumulator register(s)Most ALU’s deal with fairly simple operations on

integer (whole) binary data

© De Montfort University, 2010 CTEC1414-2 19

Page 20: CTEC1414 Lecture 2

RAM and ROMThere are two types of main (primary) memory

RAM and ROMRandom Access Memory

temporary (volatile) storage of instructions and dataall input / output passes through the main system RAMperipheral device interface cards, e.g. graphics and

sound, may have their own RAM on boardRead Only Memory

‘permanent’ (non-volatile) storage retains contents when power is turned off

stores firmware that controls the system (e.g. BIOS - Basic Input/Output System)

© De Montfort University, 2010 CTEC1414-2 20

Page 21: CTEC1414 Lecture 2

Floating Point UnitMost modern processors include a third sub-

component, the floating point unit (FPU)used to be held on a separate chip

known as a maths co-processor, e.g. 80387, 80487, etc.embedded in Pentium and subsequent processors

A FPU specialises in floating point mathsoperations such as add, subtract, multiply, divide

work directly on floating point numbersbuilt-in functions such as sin(), log(), etc.less instructions and faster than conventional ALU

© De Montfort University, 2010 CTEC1414-2 21

Page 22: CTEC1414 Lecture 2
Page 23: CTEC1414 Lecture 2

Processor TypesThere are many different manufacturers of

microprocessors, often incompatibleIntel

8080, 8088, 80186, 80286, 80386, 80486 Pentium, etc.

AMD make Intel compatible processors for PCs

Motorola 68xxx family used in Apples

IBM, Zilog, Cyrix (owned by VIA) specialist companies making dedicated processors

© De Montfort University, 2010 CTEC1414-2 23

Page 24: CTEC1414 Lecture 2

CISCIt was originally assumed that in order to make a

microprocessor better (quicker, more powerful), it was necessary to add more and more instructionsComplex Instruction Set Computer

A CISC microprocessor has a large instruction set, with many complex instructionsIntel

Pentium

© De Montfort University, 2010 CTEC1414-2 24

Page 25: CTEC1414 Lecture 2

RISCMost programs only use a few instructions

optimise the processor for these ‘key’ instructionsReduced Instruction Set Computer

RISCvery fast, due to fewer instructionsless transistors, so simpler & cheaper to

manufacturebut, software has to work harder to make up the

‘missing’ instructionsexamples

DEC alpha AXP, Sun (Ultra)Sparc, Motorola 60x, IBM RISC6000

© De Montfort University, 2010 CTEC1414-2 25

Page 26: CTEC1414 Lecture 2

Dual and Quad CoreIntel & AMD have

abandoned development of ever faster processors

Both companies have adopted dual or quad core processor architecture

Two, four or eight microprocessor cores are created on a single chip

The cores share internal memory (cache) the connection to the rest

of the computer

© De Montfort University, 2010 CTEC1414-2 26

Page 27: CTEC1414 Lecture 2

Balanced CoresThe work of the cores

needs to be carefully balancedfor energy and

processing efficiency

The picture is from http://www.intel.com/technology/computing/dual-core/

It shows an Intel Pentium Extreme Processor

© De Montfort University, 2010 CTEC1414-2 27

Page 28: CTEC1414 Lecture 2

DedicatedAlso known as single use systemsProcessors designed to perform a specific taskFound in

many household appliancescars, watches, cameras, etc.digital signal processing

graphics, sound, etc.

Network switches, e.g. Cyrix

Also widely used in industry in control systems

© De Montfort University, 2010 CTEC1414-2 28

Page 29: CTEC1414 Lecture 2

SummaryRepresenting data

bits, bytes, words, prefixesbinary, hex, ASCII, floating point

Von Neumann architectureprocessor: ALU and CURAM and ROMFPU

Processor typesCISC and RISC

ExamplesDual Core dedicated

© De Montfort University, 2010 CTEC1414-2 29