Top Banner
COMP 1321 COMP 1321 Digital Infrastructure Digital Infrastructure Richard Henson Richard Henson University of Worcester University of Worcester October October 2012 2012
29

COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Dec 13, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

COMP 1321 COMP 1321 Digital InfrastructureDigital Infrastructure

Richard HensonRichard Henson

University of WorcesterUniversity of Worcester

OctoberOctober 20122012

Page 2: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Week 2: CPUs and Week 2: CPUs and MotherboardsMotherboards

Page 3: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Problem for Processor design Data needs to be stored Memory consists of ‘cells’ (effectively

switches)Recorded digitally

» either a “0” or a “1”» no middle way

Page 4: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Binary Numbers Base 2… based on 0 and 1 To represent binary, need “on/off” switches

mechanical… too slowelectronic… Ok if fast enough

» early electronic switches large and needed a lot of energy

» Head of IBM (1950s) said that the world needed only four of these computers anyway (!)

» use of transistors made the computer more widespread

Page 5: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Number Theory: decimal representation of 2,314

bracket form:(2 x 103) + (3 x 102) + (1 x 101) + (4 x100 )most significant digit 2 least significant digit 4

2 3 1 4

Thousands Hundreds Tens units

10x10x10 10x10 10 1

103 102 101 100

Page 6: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Some definitions…

binary digit bit 0 or 1 byte: a group of 8 bits (nibble: a group of 4 bits) word: a group of bits of a fixed length

(actual length of a word is rather arbitrary)

Page 7: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Binary representation of the four bit word 1101

1 1 0 1 

2x2x2 2x2 2 1 

23 22 21 20

bracket form:  

(1 x 23) + (1 x 22) + (0 x 21) + (1 x20 )  

8 + 4 + 0 + 1

= 13 in denary (decimal)

Page 8: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Binary representation of the 8 bit word 1011 0101

27 26 25 24 23 22 21 20  

1 0 1 1 0 1 0 1 

128 + 0 + 32 + 16 + 0 + 4+ 0 + 1  

= 181

Q. How many different binary numbers can an 8 bit word hold?

A. 256 (= 28) ranging from 0000 0000 to 1111 1111

Page 9: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

The 16 bit number 0000 0000 0011 0101

(a) To what decimal number is it equal?

(b) What is the value of the most significant bit?

(c) How many different 16 bit binary numbers can be represented?

Page 10: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

The 16 bit number 0000 0000 0011 0101

(a) To what decimal number is it equal?

Answer: 32 + 16 + 0 + 4 + 0 + 1 = 53 (b) What is the value of the most

significant bit?

Answer: 0 (c) How many different 16 bit binary

numbers can be represented?

Answer: 216 = 65536 (which is 64 k)

Page 11: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Shorthand Rows of 1s and 0s can be very

confusing Easy to make mistakes Solution: divide into blocks of 4 digits

use the decimal numbers corresponding to each block

Problem: confusion with 10 or more Solution: use letters for 10 to 15

Page 12: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Hexadecimal notationDecimal Binary Hexadecimal 

0 0000 01 0001 12 0010 23 0011 34 0100 45 0101 56 0110 67 0111 78 1000 89 1001 9

Page 13: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Hexadecimal notation

Decimal Binary Hexadecimal 

10 1010 A

11 1011 B

12 1100 C

13 1101 D

14 1110 E

15 1111 F

Page 14: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Notation Useful to know what type of number

we are dealing with e.g. “110”use subscript at the end11010 = 110 (denary)1102 = 110 (binary) = 6 (denary)110H or 11016 = 110 (hexadecimal)

= 272 (denary) So now you know!

Page 15: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Now, let’s make a Computer

… at least the CPU …

Pentium 4

Pentium 3

Opteron

Ultra Sparc 1

21364Itanium 2 McKinley

Page 16: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.
Page 17: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

CPU

Memory

Keyboard

VDU

Computer Program (Code)

1 do this…

2 do that

3 now this

4 goto 1

Plus Data…

CPU with INPUT & OUTPUTCPU with INPUT & OUTPUT

Page 18: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Pentium

Data Cache Code Cache

Instruction Fetch

Instruction Decode

Execution Unit

Page 19: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Minimalist CPU

What is needed to build a CPU?

“Execution Unit”

ALU (Arithmetic Logic Unit)

Memory (to store intermediate data)

Input Output

A Good Name !

Page 20: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Arithmetic Logic Unit

Input A Input B

Output

ALU

(or Integer Execution Unit)

5

3 2

add 1

3 2

sub

Page 21: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

5

3 2

add

0

1

2

3

4

3

2

5

Processing Idea Nr. 1

Move data from memory

Move data into memory3.

2.

1.

Memory DRAM, Hard Disk ..

Move data in and out of data memory store

Page 22: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

5

3 2

add

0

1

2

3

4

3

2

5

Processing Idea Nr.2

IP

(Code Memory)

mov 3 in from memory

mov 2 in from memory

add the two numbers

mov the result to memory

Instruction Memory

Program

Move instructions into CPU from code memory

Page 23: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Registers

0

1

4

6 8

6

8

4

Registers are high-speed memory on the CPU chip

Parking places for data on the move

AX and BX are used for ALU operations

MAR is memory address register, here 4. So result, 6+8=14 will go into memory cell address 4

AX BX

MAR

Page 24: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

ip

Data Memory

Instruction

Memory

0

1

4

mar

Our computer so far …

Page 25: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Instruction

Memory

A couple of extra bits

Data Memory

0

1

4

Instruction Register

Memory Data Register 2

8

34

34

2

Data

Address

add ax,bx

1. Line of code goes in

2. Electrical bit signals come out

2.

1.

• Energize ax• Energize bx• Select ALU “add"

Page 26: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Moving data into Registers

Instruction

Memory

0

1

2

mar 3

4

mov ax , [1]

85

8

7

6

1

BXAXmov ax , [1] mov bx , [2]mov bx , [2] 7

For example …

Page 27: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Moving data into Memory

Instruction

Memory

0

1

2

mar 3

4

mov [3] , ax

85

8

7

6

1

BXAXmov [3] , axmov [0], bx

mov [0] , bx 7

For example …

8

7

Page 28: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

Adding Numbers

Instruction

Memory

0

1

2

mar 3

4

add ax , bx

85

7

6

1

BXAXAdd ax,bx

7

For example …

… this means ‘ add ax to bx,

put the answer in ax’8

8 7

15

Page 29: COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.

So THAT’S how it works!So THAT’S how it works!

Next week: the programming!Next week: the programming!