Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Organization and Architecture Tutorial 5 Kenneth Lee.

Similar presentations


Presentation on theme: "Computer Organization and Architecture Tutorial 5 Kenneth Lee."— Presentation transcript:

1 Computer Organization and Architecture Tutorial 5 Kenneth Lee

2

3

4

5

6 +18 = 00010010 (sign magnitude, 8 bits) +18 =0000000000010010 (sign magnitude, 16 bits) −18 = 10010010 (sign magnitude, 8 bits) −18 =1000000000010010 (sign magnitude, 16 bits) +18 = 00010010 (twos complement, 8 bits) +18 =0000000000010010 (twos complement, 16 bits) −18 = 11101110 (twos complement, 8 bits) −18 =1111111111101110 (twos complement, 16 bits)

7

8

9 Boolean complement

10 −8 = 1000 (twos complement, 4 bits) The twos complement of 1000 is 1000 0111 + 1 1000

11

12 Definition of XOR: XOR(0,0)=0; XOR(1,1)=0; XOR(0,1)=1; XOR(1,0)=1;

13 Example: Twos complement, 4 bits (-2~1) -2 -1 0 1 1011 00 01 (1)00 +01 01 Carry into the leftmost:0; Carry out of the leftmost:0; XOR(0,0)=0; There is no overflow. (0+1=1) (2) 01 +01 10 Carry into the leftmost:1; Carry out of the leftmost:0; XOR(1,0)=1; There is a overflow. (1+1=−2)

14 (3) 10 +11 101 Carry into the leftmost:0; Carry out of the leftmost:1; XOR(0,1)=1; There is a overflow. (-2-1=1) (4) 11 +11 110 Carry into the leftmost:1; Carry out of the leftmost:1; XOR(1,1)=0; There is no overflow. (-1-1=-2)

15

16

17

18

19 Example: (1)1-digit numbers, base 10 9∙9=81 (2) 2-digit numbers, base 2 11∙11=1001 Notation: n-digit number base 2 is different with their twos complement! The max of a n-digit base 2 number is 2 n -1, but the max of a n-digit twos complement is 2 n-1 -1

20

21

22

23

24

25

26

27 a.Memory cycle time = 60 + 40 = 100 ns data rate = 1 bit/100 ns = 10,000,000 bits/s = 10 Mbps b.32*10 = 320 Mbps = 40 MB/s

28


Download ppt "Computer Organization and Architecture Tutorial 5 Kenneth Lee."

Similar presentations


Ads by Google