Computer Architecture Lecture 15 Fasih ur Rehman.
-
Upload
juniper-whitehead -
Category
Documents
-
view
230 -
download
0
Transcript of Computer Architecture Lecture 15 Fasih ur Rehman.
![Page 1: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/1.jpg)
Computer Architecture
Lecture 15Fasih ur Rehman
![Page 2: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/2.jpg)
Last Class
• Arithmetic– Representation– Signed numbers– Operations and their implementation
![Page 3: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/3.jpg)
Today’s Agenda
• Arithmetic operations
![Page 4: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/4.jpg)
Overflow (Examples)
![Page 5: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/5.jpg)
Overflow
• Overflow in case of addition can only occur when both the operands have same sign.
• Condition for Overflow• Overflow happens when (at MSB)
Carry in ≠ Carry out• Normally, overflow is referred to ‘V’ flag in status
register
![Page 6: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/6.jpg)
Addition/subtraction of signed numbers
si =ci +1 =
13
7+ Y
1
00010
1
1
00110
11
0
01101001
0
0
0
0
1
1
1
1
00001111
Example:
10= = 0
01 1
11 1 0 0
1
1 1 10
Legend for stage i
xi yi Carry-in ci Sum s i Carry-out ci+1
X
Z
+ 6 0+xiyisi
Carry-outci+1
Carry-inci
xiyicixiyicixiyicixiyici x i yi ciÅ Å=+ + +
yicixicixiyi+ +
![Page 7: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/7.jpg)
Logic for Single Stage
![Page 8: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/8.jpg)
n – bit Ripple Carry Adder
![Page 9: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/9.jpg)
Cascade for k n – bit Adders
![Page 10: Computer Architecture Lecture 15 Fasih ur Rehman.](https://reader036.fdocuments.us/reader036/viewer/2022082400/5697c0191a28abf838cce5fc/html5/thumbnails/10.jpg)
Summary
• Overflow• Addition• Adders