Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2013."— Presentation transcript:

1 COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2013

2 Week 2: CPUs and Motherboards n n Objectives:   Convert between binary and hexadecimal numbers   Explain the role of the CPU   Explain the structure of typical CPU   Explain the positioning of components on a motherboard

3 Problem for Processor design n n Data needs to be stored n n Memory consists of ‘cells’ (effectively switches)   Recorded digitally » »either a “0” or a “1” » »no middle way

4 Binary Numbers n n Base 2… based on 0 and 1 n n To represent binary, need “on/off” switches   mechanical… possible but too slow » »first computer?   electronic… OK if changes fast enough » »early electronic switches (valves) 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 realistic

5 Digital Maths n Two important areas to know something about:  number systems to base 2, & 16 »binary (2) »hexadecimal (16)  Binary logic and Boolean algebra »Mathematically predictable effects of combining logic gates (transistors linked to behave “logically”)

6 Number Theory: decimal representation of 2,314 bracket form: (2 x 10 3 ) + (3 x 10 2 ) + (1 x 10 1 ) + (4 x10 0 ) most significant digit 2 least significant digit 4 2314 ThousandsHundredsTensunits 10x10x1010x10101 10 3 10 2 10 1 10 0

7 Some Definitions… n n binary digit bit 0 or 1 n n byte: a group of 8 bits n n (nibble: a group of 4 bits) n n word: a group of bits of a fixed length (actual length of a word is rather arbitrary)

8 Binary representation of the four bit word 1101 1 1 01 2x2x22x2 21 2 3 2 2 2 1 2 0 bracket form: (1 x 2 3 ) + (1 x 2 2 ) + (0 x 2 1 ) + (1 x2 0 ) 8 + 4 + 0 + 1 = 13 in denary (decimal)

9 Binary representation of the 8 bit word 1011 0101 2 7 2 6 2 5 2 4 2 3 2 2 2 1 2 0 10110101 128 + 0 + 32 + 16 + 0 + 4+ 0 + 1 = 181 Q. How many different binary numbers can an 8 bit word hold? A. 256 (= 2 8 ) ranging from 0000 0000 to 1111 1111

10 The 16 bit number 0000 0000 0011 0101 n n (a) To what decimal number is it equal? n n (b) What is the value of the most significant bit? n n (c) How many different 16 bit binary numbers can be represented?

11 The 16 bit number 0000 0000 0011 0101 n n (a) To what decimal number is it equal? Answer: 32 + 16 + 0 + 4 + 0 + 1 = 53 n n (b) What is the value of the most significant bit? Answer: 0 n n (c) How many different 16 bit binary numbers can be represented? Answer: 2 16 = 65536 (which is 64 k)

12 Shorthand n n Rows of 1s and 0s can be very confusing n n Easy to make mistakes n n Solution: divide into blocks of 4 digits use the decimal numbers corresponding to each block n n Problem: confusion with 10 or more n n Solution: use letters for 10 to 15

13 Hexadecimal notation DecimalBinaryHexadecimal 000000 100011 200102 300113 401004 501015 601106 701117 810008 910019

14 Hexadecimal notation DecimalBinaryHexadecimal 101010A 111011B 121100C 131101D 141110E 151111F

15 Notation n n Useful to know what type of number we are dealing with e.g. “110”   use subscript at the end   110 10 = 110 (denary)   110 2 = 110 (binary) = 6 (denary)   110 H or 110 16 = 110 (hexadecimal) = 272 (denary) n n So now you know!

16 Now, let’s make a Computer … or at least the CPU (millions of transistors) Pentium 4 Opteron Ultra Sparc 1 21364 Itanium 2 McKinley

17

18 CPU Memory Keyboard VDU Computer Program (Code) 1 do this… 2 do that 3 now this 4 goto 1 Plus Data… CPU with INPUT & OUTPUT

19 Pentium Data Cache Code Cache Instruction Fetch Instruction Decode Execution Unit

20 Minimalist CPU What do I needed to build a CPU? “Execution Unit” ALU (Arithmetic Logic Unit) Memory (to store intermediate data) Input Output A Good Name !

21 Arithmetic Logic Unit (ALU) Input AInput B Output (or Integer Execution Unit) 5 32 add 1 32 sub

22 5 32 add 0 1 2 3 4 3 2 5 Processing Idea Nr. 1 Move data from memory Move data into memory 3. 2. 1. Memory DRAM, Hard Disk.. Move data in and out of data memory store

23 5 32 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

24 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

25 ip Data Memory Instruction Memory 0 1 4 mar The computer so far …

26 Instruction Memory A couple of extra bits.. Data Memory 0 1 4 Instruction Register Memory Data Register 2 8 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"

27 Moving data into Registers Instruction Memory 0 1 2 mar 3 4 mov ax, [1] 8 5 8 7 6 1 BX AX mov ax, [1] mov bx, [2] 7 For example …

28 Moving data into Memory Instruction Memory 0 1 2 mar 3 4 mov [3], ax 8 5 8 7 6 1 BX AX mov [3], ax mov [0], bx 7 For example … 8 7

29 Adding Numbers Instruction Memory 0 1 2 mar 3 4 add ax, bx 8 5 7 6 1 BX AX Add ax,bx 7 For example … … this means ‘ add ax to bx, put the answer in ax’ 8 8 7 15

30 So THAT’S how it works! Next week: the programming!


Download ppt "COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2013."

Similar presentations


Ads by Google