SYDE223 Tutorial 3: Introduction to Java Annie En-Shiun Lee January 19, 2010.
Computer Organization and Architecture Tutorial 5 Kenneth Lee.
-
date post
22-Dec-2015 -
Category
Documents
-
view
217 -
download
1
Transcript of Computer Organization and Architecture Tutorial 5 Kenneth Lee.
![Page 1: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/1.jpg)
Computer Organization and Architecture
Tutorial 5
Kenneth Lee
![Page 2: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/2.jpg)
![Page 3: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/3.jpg)
![Page 4: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/4.jpg)
![Page 5: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/5.jpg)
![Page 6: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/6.jpg)
+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)
![Page 7: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/7.jpg)
![Page 8: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/8.jpg)
![Page 9: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/9.jpg)
Boolean complement
![Page 10: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/10.jpg)
−8 = 1000 (twos complement, 4 bits)
The twos complement of 1000 is 1000 0111 + 1
1000
![Page 11: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/11.jpg)
![Page 12: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/12.jpg)
Definition of XOR:XOR(0,0)=0;XOR(1,1)=0;XOR(0,1)=1;XOR(1,0)=1;
![Page 13: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/13.jpg)
Example:Twos complement, 4 bits (-2~1)-2 -1 0 110 11 00 01
(1) 00 +01 01Carry into the leftmost:0; Carry out of the leftmost:0;XOR(0,0)=0; There is no overflow. (0+1=1)
(2) 01 +01 10Carry into the leftmost:1; Carry out of the leftmost:0;XOR(1,0)=1; There is a overflow. (1+1=−2)
![Page 14: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/14.jpg)
(3) 10 +11 101Carry into the leftmost:0; Carry out of the leftmost:1;XOR(0,1)=1; There is a overflow. (-2-1=1)
(4) 11 +11 110Carry into the leftmost:1; Carry out of the leftmost:1;XOR(1,1)=0; There is no overflow. (-1-1=-2)
![Page 15: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/15.jpg)
![Page 16: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/16.jpg)
![Page 17: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/17.jpg)
![Page 18: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/18.jpg)
![Page 19: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/19.jpg)
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 2n-1, but the max of a n-digit twos complement is 2n-1-1
![Page 20: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/20.jpg)
![Page 21: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/21.jpg)
![Page 22: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/22.jpg)
![Page 23: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/23.jpg)
![Page 24: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/24.jpg)
![Page 25: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/25.jpg)
![Page 26: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/26.jpg)
![Page 27: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/27.jpg)
a. Memory cycle time = 60 + 40 = 100 ns data rate = 1 bit/100 ns = 10,000,000 bits/s = 10 Mbpsb. 32*10 = 320 Mbps = 40 MB/s
![Page 28: Computer Organization and Architecture Tutorial 5 Kenneth Lee.](https://reader030.fdocuments.net/reader030/viewer/2022032523/56649d815503460f94a65611/html5/thumbnails/28.jpg)