SlideShare a Scribd company logo
1 of 12
Organisasi dan Arsitektur
Komputer
Ajeng Savitri Puspaningrum, M.Kom
Pertemuan 12
Computer Arithmetic (part
2)
Learning computer arithmetic
Learning integer representation
Integer Representation
Only have 0 & 1 to represent everything
Positive numbers stored in binary
e.g. 41=00101001
No minus sign
Sign-Magnitude
Two’s complement
Sign-Magnitude
Left most bit is sign bit
0 means positive
1 means negative
+18 = 00010010
 -18 = 10010010
Problems
Need to consider both sign and magnitude in arithmetic
Two representations of zero (+0 and -0)
Two’s Complement
+3 = 00000011
+2 = 00000010
+1 = 00000001
+0 = 00000000
 -1 = 11111111
 -2 = 11111110
 -3 = 11111101
Range of Numbers
8 bit 2s compliment
+127 = 01111111 = 27 -1
 -128 = 10000000 = -27
16 bit 2s compliment
+32767 = 011111111 11111111 = 215 - 1
 -32768 = 100000000 00000000 = -215
Benefits
One representation of zero
Arithmetic works easily (see later)
Negating is fairly easy
3 = 00000011
Boolean complement gives 11111100
Add 1 to LSB 11111101
* LSB : Least significant bit
Negation Special Case 1
0 = 00000000
Bitwise not 11111111
Add 1 to LSB +1
Result 1 00000000
Overflow is ignored, so:
- 0 = 0 
Negation Special Case 2
-128 = 10000000
bitwise not 01111111
Add 1 to LSB +1
Result 10000000
So:
-(-128) = -128
Monitor MSB (sign bit)
It should change during negation
Refference
Stalling, William, Computer Organization
and Architecture, 10th Edition, Pearson,
2015
Abdurohman, Maman, Organisasi dan
Arsitektur Komputer revisi ke-4, Penerbit
Informatika, 2017
Terima Kasih
ajeng.savitri@teknokrat.ac.id
https://teknokrat.ac.id/en/
https://spada.teknokrat.ac.id/

More Related Content

What's hot

2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
Wan Afirah
 
01.number systems
01.number systems01.number systems
01.number systems
rasha3
 
Binary Mathematics Classwork and Hw
Binary Mathematics Classwork and HwBinary Mathematics Classwork and Hw
Binary Mathematics Classwork and Hw
Joji Thompson
 

What's hot (19)

digital logic circuits, digital component
digital logic circuits, digital componentdigital logic circuits, digital component
digital logic circuits, digital component
 
Digital and Logic Design Chapter 1 binary_systems
Digital and Logic Design Chapter 1 binary_systemsDigital and Logic Design Chapter 1 binary_systems
Digital and Logic Design Chapter 1 binary_systems
 
Mba ebooks
Mba ebooksMba ebooks
Mba ebooks
 
Number System
Number SystemNumber System
Number System
 
Number system
Number systemNumber system
Number system
 
2.1 data represent on cpu
2.1 data represent on cpu2.1 data represent on cpu
2.1 data represent on cpu
 
IEEE floating point representation
 IEEE floating point representation IEEE floating point representation
IEEE floating point representation
 
Logic Design 2009
Logic Design 2009Logic Design 2009
Logic Design 2009
 
01.number systems
01.number systems01.number systems
01.number systems
 
Decimal to Binary Conversion
Decimal to Binary ConversionDecimal to Binary Conversion
Decimal to Binary Conversion
 
Number system
Number systemNumber system
Number system
 
Binary Arithmetic Operations
Binary Arithmetic OperationsBinary Arithmetic Operations
Binary Arithmetic Operations
 
Data representation and Arithmetic Algorithms
Data representation and Arithmetic AlgorithmsData representation and Arithmetic Algorithms
Data representation and Arithmetic Algorithms
 
Binary Mathematics Classwork and Hw
Binary Mathematics Classwork and HwBinary Mathematics Classwork and Hw
Binary Mathematics Classwork and Hw
 
Box multiplication copy
Box multiplication   copyBox multiplication   copy
Box multiplication copy
 
Numbersystemcont
NumbersystemcontNumbersystemcont
Numbersystemcont
 
Bolum1cozumler
Bolum1cozumlerBolum1cozumler
Bolum1cozumler
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Ccss.math.content.8.ee.c.8b sample question
Ccss.math.content.8.ee.c.8b   sample questionCcss.math.content.8.ee.c.8b   sample question
Ccss.math.content.8.ee.c.8b sample question
 

Similar to Computer Arithmetic (Part 2)

Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data Types
Nathan Yeung
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
gavhays
 
Lecture 1-431171839-lec2-BinaryArithmetic.ppt
Lecture 1-431171839-lec2-BinaryArithmetic.pptLecture 1-431171839-lec2-BinaryArithmetic.ppt
Lecture 1-431171839-lec2-BinaryArithmetic.ppt
AhmedWasiu
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
RavikumarR77
 
Alu1
Alu1Alu1
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
ssuser52a19e
 

Similar to Computer Arithmetic (Part 2) (20)

Data Representation.pptx
Data Representation.pptxData Representation.pptx
Data Representation.pptx
 
Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data Types
 
lec2_BinaryArithmetic.ppt
lec2_BinaryArithmetic.pptlec2_BinaryArithmetic.ppt
lec2_BinaryArithmetic.ppt
 
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
09 Arithmetic
09  Arithmetic09  Arithmetic
09 Arithmetic
 
Lecture 1-431171839-lec2-BinaryArithmetic.ppt
Lecture 1-431171839-lec2-BinaryArithmetic.pptLecture 1-431171839-lec2-BinaryArithmetic.ppt
Lecture 1-431171839-lec2-BinaryArithmetic.ppt
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Video lectures
Video lecturesVideo lectures
Video lectures
 
Alu1
Alu1Alu1
Alu1
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbers
 
Notes unit 2
Notes   unit 2Notes   unit 2
Notes unit 2
 
Integer represention
Integer representionInteger represention
Integer represention
 
Digital_Electronics_Basics.pdf
Digital_Electronics_Basics.pdfDigital_Electronics_Basics.pdf
Digital_Electronics_Basics.pdf
 
2's complement
2's complement2's complement
2's complement
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
Convertion of single precision
Convertion of single precisionConvertion of single precision
Convertion of single precision
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 
ch3a-binary-numbers.ppt
ch3a-binary-numbers.pptch3a-binary-numbers.ppt
ch3a-binary-numbers.ppt
 

More from Ajeng Savitri

More from Ajeng Savitri (20)

Software Testing Documentation
Software Testing DocumentationSoftware Testing Documentation
Software Testing Documentation
 
Software Productivity Measurement
Software Productivity MeasurementSoftware Productivity Measurement
Software Productivity Measurement
 
Debugging (Part 2)
Debugging (Part 2)Debugging (Part 2)
Debugging (Part 2)
 
Debugging
DebuggingDebugging
Debugging
 
Software Testing Strategy (Part 2)
Software Testing Strategy (Part 2)Software Testing Strategy (Part 2)
Software Testing Strategy (Part 2)
 
Software Testing Strategy
Software Testing StrategySoftware Testing Strategy
Software Testing Strategy
 
Object Oriented Testing
Object Oriented TestingObject Oriented Testing
Object Oriented Testing
 
Testing Technique (Part 2)
Testing Technique (Part 2)Testing Technique (Part 2)
Testing Technique (Part 2)
 
Testing Technique
Testing TechniqueTesting Technique
Testing Technique
 
Testing Plan
Testing PlanTesting Plan
Testing Plan
 
Methodology Selection Strategy
Methodology Selection Strategy Methodology Selection Strategy
Methodology Selection Strategy
 
Software Testing - Software Quality (Part 2)
Software Testing - Software Quality (Part 2)Software Testing - Software Quality (Part 2)
Software Testing - Software Quality (Part 2)
 
Software Testing - Software Quality
Software Testing - Software QualitySoftware Testing - Software Quality
Software Testing - Software Quality
 
Computer Evolution and Performance
Computer Evolution and PerformanceComputer Evolution and Performance
Computer Evolution and Performance
 
Software Testing - Introduction
Software Testing - IntroductionSoftware Testing - Introduction
Software Testing - Introduction
 
Sequence Diagram
Sequence DiagramSequence Diagram
Sequence Diagram
 
Activity Diagram
Activity DiagramActivity Diagram
Activity Diagram
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
Requirement Gathering
Requirement GatheringRequirement Gathering
Requirement Gathering
 
Business Value
Business ValueBusiness Value
Business Value
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 

Computer Arithmetic (Part 2)