SlideShare a Scribd company logo
1 of 8
ADDITION & SUBTRACTION
Mr. C.KARTHIKEYAN,
ASSISTANT PROFESSOR,
ECE , RMKCET
ADDITION & SUBTRACTION
Un Signed Arithmetic Signed Arithmetic
add
addi
sub
The MIPS recognizes or ignores overflow by two kinds of arithmetic instructions
addu
addui
subu
cause exceptions on overflow
do not cause exceptions on overflow
OVER FLOW?
No Over Flow Over Flow
Overflow occurs when the result from an operation cannot be represented with the available hardware
Operation Operand A Operand B
A + B > 0 < 0
A + B < 0 > 0
A – B > 0 > 0
A – B < 0 < 0
Eg: (+10) + (-6) = +4
(-10) + (+6) = -4
Eg: (+10) - (+6) = +4
(-10) - (-6) = -4
OVER FLOW?
Over Flow
Overflow occurs when the result from an operation cannot be represented with the available hardware
Addition
10000
+10 01010
+6 00110 (+)
Over Flow
10111
-5 1011
-4 1100 (+)
Over Flow
OVER FLOW?
Over Flow
Overflow occurs when the result from an operation cannot be represented with the available hardware
Subtraction
11100
+6 00110
-10 10110 (-)
Over Flow
0110
-6 1010
+4 0100 (-)
Over Flow
EXAMPLE
Assume 185 and 122 are unsigned 8-bit decimal integers. Calculate 185 – 122.
Is there over flow, under flow, or neither?
10111001
01111010 (-)
185
122
1
1
0
1 1
1
010
1
0 1
10
1
1
110
1
0
Neither Over Flow nor Under Flow
Operation Operand A Operand B
A + B > 0 < 0
A + B < 0 > 0
A – B > 0 > 0
A – B < 0 < 0
Computer Organization and Design by David A Patterson – Page no. 237
Condition for No Over Flow
EXAMPLE
Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude
format. Calculate 185 + 122. Is there over flow, under flow, or neither?
10111001
01111010 +122 (+)
185
122
1
1
0
0
1
1
0
Neither Over Flow nor Under Flow
-57
1
1
1
1
10
Operation Operand A Operand B
A + B > 0 < 0
A + B < 0 > 0
A – B > 0 > 0
A – B < 0 < 0
Computer Organization and Design by David A Patterson – Page no. 237
Condition for No Over Flow
EXAMPLE
Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude
format. Calculate 185 - 122. Is there over flow, under flow, or neither?
10111001
01111010 +122 (-)
185
122
1
1
1
1
1
1
0 Over Flow
-57
0
Computer Organization and Design by David A Patterson – Page no. 237

More Related Content

Similar to 2. Addition and Subtraction.pptx

Flying High With Data Analytics & Optimization - Aviation Industry By Korina ...
Flying High With Data Analytics & Optimization - Aviation Industry By Korina ...Flying High With Data Analytics & Optimization - Aviation Industry By Korina ...
Flying High With Data Analytics & Optimization - Aviation Industry By Korina ...Korina Mercado
 
Signed Addition And Subtraction
Signed Addition And SubtractionSigned Addition And Subtraction
Signed Addition And SubtractionKeyur Vadodariya
 
11. 8085 programming example iii
11. 8085 programming example iii11. 8085 programming example iii
11. 8085 programming example iiisandip das
 
Customer Experience Mastery make every interaction customer worthy
Customer Experience Mastery make every interaction customer worthyCustomer Experience Mastery make every interaction customer worthy
Customer Experience Mastery make every interaction customer worthyClient X Client
 
Data_Model_ofS4HANA_Finance_Data_1715175340.pdf
Data_Model_ofS4HANA_Finance_Data_1715175340.pdfData_Model_ofS4HANA_Finance_Data_1715175340.pdf
Data_Model_ofS4HANA_Finance_Data_1715175340.pdfBenVictor9
 
Chp4_C++_Control Structures-Part2_Iteration.pptx
Chp4_C++_Control Structures-Part2_Iteration.pptxChp4_C++_Control Structures-Part2_Iteration.pptx
Chp4_C++_Control Structures-Part2_Iteration.pptxssuser10ed71
 
The Current State of Table API in 2022
The Current State of Table API in 2022The Current State of Table API in 2022
The Current State of Table API in 2022Flink Forward
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mcaEdhole.com
 
c++ program using All data type and operators
c++ program using All data type and operators c++ program using All data type and operators
c++ program using All data type and operators AMUDHAJAY
 
Arithmetic for computers which talks about
Arithmetic for computers which talks aboutArithmetic for computers which talks about
Arithmetic for computers which talks abouteem303ds
 
dd_sampleslides.ppt
dd_sampleslides.pptdd_sampleslides.ppt
dd_sampleslides.pptwafawafa52
 
HBASE Performane Test
HBASE Performane TestHBASE Performane Test
HBASE Performane TestLouis liu
 
TC74VHCT04AFN PSpice Model (Free SPICE Model)
TC74VHCT04AFN PSpice Model  (Free SPICE Model)TC74VHCT04AFN PSpice Model  (Free SPICE Model)
TC74VHCT04AFN PSpice Model (Free SPICE Model)Tsuyoshi Horigome
 
how computers do math from patterson and hennessey book
how computers do math from patterson and hennessey bookhow computers do math from patterson and hennessey book
how computers do math from patterson and hennessey bookeem303ds
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in indiaEdhole.com
 
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterLab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterKatrina Little
 
Chp5 pic microcontroller instruction set copy
Chp5 pic microcontroller instruction set   copyChp5 pic microcontroller instruction set   copy
Chp5 pic microcontroller instruction set copymkazree
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registerswarda aziz
 

Similar to 2. Addition and Subtraction.pptx (20)

Ch_10.pptx.pdf
Ch_10.pptx.pdfCh_10.pptx.pdf
Ch_10.pptx.pdf
 
Flying High With Data Analytics & Optimization - Aviation Industry By Korina ...
Flying High With Data Analytics & Optimization - Aviation Industry By Korina ...Flying High With Data Analytics & Optimization - Aviation Industry By Korina ...
Flying High With Data Analytics & Optimization - Aviation Industry By Korina ...
 
Signed Addition And Subtraction
Signed Addition And SubtractionSigned Addition And Subtraction
Signed Addition And Subtraction
 
11. 8085 programming example iii
11. 8085 programming example iii11. 8085 programming example iii
11. 8085 programming example iii
 
Customer Experience Mastery make every interaction customer worthy
Customer Experience Mastery make every interaction customer worthyCustomer Experience Mastery make every interaction customer worthy
Customer Experience Mastery make every interaction customer worthy
 
Data_Model_ofS4HANA_Finance_Data_1715175340.pdf
Data_Model_ofS4HANA_Finance_Data_1715175340.pdfData_Model_ofS4HANA_Finance_Data_1715175340.pdf
Data_Model_ofS4HANA_Finance_Data_1715175340.pdf
 
Chp4_C++_Control Structures-Part2_Iteration.pptx
Chp4_C++_Control Structures-Part2_Iteration.pptxChp4_C++_Control Structures-Part2_Iteration.pptx
Chp4_C++_Control Structures-Part2_Iteration.pptx
 
The Current State of Table API in 2022
The Current State of Table API in 2022The Current State of Table API in 2022
The Current State of Table API in 2022
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mca
 
c++ program using All data type and operators
c++ program using All data type and operators c++ program using All data type and operators
c++ program using All data type and operators
 
Arithmetic for computers which talks about
Arithmetic for computers which talks aboutArithmetic for computers which talks about
Arithmetic for computers which talks about
 
dd_sampleslides.ppt
dd_sampleslides.pptdd_sampleslides.ppt
dd_sampleslides.ppt
 
HBASE Performane Test
HBASE Performane TestHBASE Performane Test
HBASE Performane Test
 
TC74VHCT04AFN PSpice Model (Free SPICE Model)
TC74VHCT04AFN PSpice Model  (Free SPICE Model)TC74VHCT04AFN PSpice Model  (Free SPICE Model)
TC74VHCT04AFN PSpice Model (Free SPICE Model)
 
how computers do math from patterson and hennessey book
how computers do math from patterson and hennessey bookhow computers do math from patterson and hennessey book
how computers do math from patterson and hennessey book
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence CounterLab 9 D-Flip Flops: Shift Register and Sequence Counter
Lab 9 D-Flip Flops: Shift Register and Sequence Counter
 
Extrato
ExtratoExtrato
Extrato
 
Chp5 pic microcontroller instruction set copy
Chp5 pic microcontroller instruction set   copyChp5 pic microcontroller instruction set   copy
Chp5 pic microcontroller instruction set copy
 
Chapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registersChapter 5The proessor status and the FLAGS registers
Chapter 5The proessor status and the FLAGS registers
 

More from KarthikeyanC53

3. Virtual Memory.pptx
3. Virtual Memory.pptx3. Virtual Memory.pptx
3. Virtual Memory.pptxKarthikeyanC53
 
1. Introduction to Memory.pptx
1. Introduction to Memory.pptx1. Introduction to Memory.pptx
1. Introduction to Memory.pptxKarthikeyanC53
 
4. Pipeline Hazards.pptx
4. Pipeline Hazards.pptx4. Pipeline Hazards.pptx
4. Pipeline Hazards.pptxKarthikeyanC53
 
3. Implementation of Pipelining in Datapath.pptx
3. Implementation of Pipelining in Datapath.pptx3. Implementation of Pipelining in Datapath.pptx
3. Implementation of Pipelining in Datapath.pptxKarthikeyanC53
 
2. Datapath Design with Control Unit.pptx
2. Datapath Design with Control Unit.pptx2. Datapath Design with Control Unit.pptx
2. Datapath Design with Control Unit.pptxKarthikeyanC53
 
1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptx1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptxKarthikeyanC53
 
Floating Point Multiplication.pptx
Floating Point Multiplication.pptxFloating Point Multiplication.pptx
Floating Point Multiplication.pptxKarthikeyanC53
 
Floating Point Addition.pptx
Floating Point Addition.pptxFloating Point Addition.pptx
Floating Point Addition.pptxKarthikeyanC53
 
Floating Point Represenataion.pptx
Floating Point Represenataion.pptxFloating Point Represenataion.pptx
Floating Point Represenataion.pptxKarthikeyanC53
 
Refined Version of Division.pptx
Refined Version of Division.pptxRefined Version of Division.pptx
Refined Version of Division.pptxKarthikeyanC53
 
Version 1 Division.pptx
Version 1 Division.pptxVersion 1 Division.pptx
Version 1 Division.pptxKarthikeyanC53
 
BOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptxBOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptxKarthikeyanC53
 
1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptx1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptxKarthikeyanC53
 
5. Addressing Modes.pptx
5. Addressing Modes.pptx5. Addressing Modes.pptx
5. Addressing Modes.pptxKarthikeyanC53
 
4.Instruction Formats.pptx
4.Instruction Formats.pptx4.Instruction Formats.pptx
4.Instruction Formats.pptxKarthikeyanC53
 
3. Instruction Set.pptx
3. Instruction Set.pptx3. Instruction Set.pptx
3. Instruction Set.pptxKarthikeyanC53
 

More from KarthikeyanC53 (20)

3. Virtual Memory.pptx
3. Virtual Memory.pptx3. Virtual Memory.pptx
3. Virtual Memory.pptx
 
2. Cache Mapping.pptx
2. Cache Mapping.pptx2. Cache Mapping.pptx
2. Cache Mapping.pptx
 
1. Introduction to Memory.pptx
1. Introduction to Memory.pptx1. Introduction to Memory.pptx
1. Introduction to Memory.pptx
 
6. ILP.pptx
6. ILP.pptx6. ILP.pptx
6. ILP.pptx
 
5. Exception.pptx
5. Exception.pptx5. Exception.pptx
5. Exception.pptx
 
4. Pipeline Hazards.pptx
4. Pipeline Hazards.pptx4. Pipeline Hazards.pptx
4. Pipeline Hazards.pptx
 
3. Implementation of Pipelining in Datapath.pptx
3. Implementation of Pipelining in Datapath.pptx3. Implementation of Pipelining in Datapath.pptx
3. Implementation of Pipelining in Datapath.pptx
 
2. Datapath Design with Control Unit.pptx
2. Datapath Design with Control Unit.pptx2. Datapath Design with Control Unit.pptx
2. Datapath Design with Control Unit.pptx
 
1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptx1. Introduction to Datapath Design.pptx
1. Introduction to Datapath Design.pptx
 
Floating Point Multiplication.pptx
Floating Point Multiplication.pptxFloating Point Multiplication.pptx
Floating Point Multiplication.pptx
 
Floating Point Addition.pptx
Floating Point Addition.pptxFloating Point Addition.pptx
Floating Point Addition.pptx
 
Floating Point Represenataion.pptx
Floating Point Represenataion.pptxFloating Point Represenataion.pptx
Floating Point Represenataion.pptx
 
Refined Version of Division.pptx
Refined Version of Division.pptxRefined Version of Division.pptx
Refined Version of Division.pptx
 
Version 1 Division.pptx
Version 1 Division.pptxVersion 1 Division.pptx
Version 1 Division.pptx
 
BOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptxBOOTH’s ALGORITHM Part 1.pptx
BOOTH’s ALGORITHM Part 1.pptx
 
1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptx1. Introduction to Arithmetic.pptx
1. Introduction to Arithmetic.pptx
 
6.Performance.pptx
6.Performance.pptx6.Performance.pptx
6.Performance.pptx
 
5. Addressing Modes.pptx
5. Addressing Modes.pptx5. Addressing Modes.pptx
5. Addressing Modes.pptx
 
4.Instruction Formats.pptx
4.Instruction Formats.pptx4.Instruction Formats.pptx
4.Instruction Formats.pptx
 
3. Instruction Set.pptx
3. Instruction Set.pptx3. Instruction Set.pptx
3. Instruction Set.pptx
 

Recently uploaded

An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxLimon Prince
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 

Recently uploaded (20)

An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 

2. Addition and Subtraction.pptx

  • 1. ADDITION & SUBTRACTION Mr. C.KARTHIKEYAN, ASSISTANT PROFESSOR, ECE , RMKCET
  • 2. ADDITION & SUBTRACTION Un Signed Arithmetic Signed Arithmetic add addi sub The MIPS recognizes or ignores overflow by two kinds of arithmetic instructions addu addui subu cause exceptions on overflow do not cause exceptions on overflow
  • 3. OVER FLOW? No Over Flow Over Flow Overflow occurs when the result from an operation cannot be represented with the available hardware Operation Operand A Operand B A + B > 0 < 0 A + B < 0 > 0 A – B > 0 > 0 A – B < 0 < 0 Eg: (+10) + (-6) = +4 (-10) + (+6) = -4 Eg: (+10) - (+6) = +4 (-10) - (-6) = -4
  • 4. OVER FLOW? Over Flow Overflow occurs when the result from an operation cannot be represented with the available hardware Addition 10000 +10 01010 +6 00110 (+) Over Flow 10111 -5 1011 -4 1100 (+) Over Flow
  • 5. OVER FLOW? Over Flow Overflow occurs when the result from an operation cannot be represented with the available hardware Subtraction 11100 +6 00110 -10 10110 (-) Over Flow 0110 -6 1010 +4 0100 (-) Over Flow
  • 6. EXAMPLE Assume 185 and 122 are unsigned 8-bit decimal integers. Calculate 185 – 122. Is there over flow, under flow, or neither? 10111001 01111010 (-) 185 122 1 1 0 1 1 1 010 1 0 1 10 1 1 110 1 0 Neither Over Flow nor Under Flow Operation Operand A Operand B A + B > 0 < 0 A + B < 0 > 0 A – B > 0 > 0 A – B < 0 < 0 Computer Organization and Design by David A Patterson – Page no. 237 Condition for No Over Flow
  • 7. EXAMPLE Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude format. Calculate 185 + 122. Is there over flow, under flow, or neither? 10111001 01111010 +122 (+) 185 122 1 1 0 0 1 1 0 Neither Over Flow nor Under Flow -57 1 1 1 1 10 Operation Operand A Operand B A + B > 0 < 0 A + B < 0 > 0 A – B > 0 > 0 A – B < 0 < 0 Computer Organization and Design by David A Patterson – Page no. 237 Condition for No Over Flow
  • 8. EXAMPLE Assume 185 and 122 are signed 8-bit decimal integers stored in sign-magnitude format. Calculate 185 - 122. Is there over flow, under flow, or neither? 10111001 01111010 +122 (-) 185 122 1 1 1 1 1 1 0 Over Flow -57 0 Computer Organization and Design by David A Patterson – Page no. 237