SlideShare a Scribd company logo
CS304PC:Computer Organization
and Architecture (R18 II(I sem))
Department of computer science and engineering
(AI/ML)
Session 22
by
Asst.Prof.M.Gokilavani
VITS
2/18/2023 Department of CSE (AI/ML) 1
TEXTBOOK:
• 1. Computer System Architecture – M. Moris Mano, Third Edition,
Pearson/PHI.
REFERENCES:
• Computer Organization – Car Hamacher, Zvonks Vranesic, Safea
Zaky, Vth Edition, McGraw Hill.
• Computer Organization and Architecture – William Stallings Sixth
Edition, Pearson/PHI.
• Structured Computer Organization – Andrew S. Tanenbaum, 4th
Edition, PHI/Pearson.
2/18/2023 Department of CSE (AI/ML) 2
Unit III
Data Representation: Data types ,Complements, fixed point
Representations, Floating point representation.
Computer Arithmetic: Addition and subtraction,
multiplication Algorithms, Division Algorithms, Floating-point
Arithmetic operations, Decimal Arithmetic unit, Decimal
Arithmetic operations.
2/18/2023 Department of CSE (AI/ML) 3
Topics covered in session 22
2/18/2023 Department of CSE (AI/ML) 4
• Addition and subtraction
• Multiplication Algorithms
• Division Algorithms
• Floating-point Arithmetic operations
• Decimal Arithmetic unit
• Decimal Arithmetic operations.
Floating-point Arithmetic operations
• Floating point arithmetic
• Representation of floating point arithmetic
• Operations
• Normalization
• Pit-Falls of floating point arithmetic
2/18/2023 Department of CSE (AI/ML) 5
Floating-point Arithmetic operations
There are two types of arithmetic operations :-
• Integer Arithmetic
• Real – floating point arithmetic
• Integer Arithmetic :- deals with integer operands.
• i.e. - num without fractional parts
• Real Arithmetic :- use number with fractional parts as operands and is
use.
• Real no. = mantissa * 10^exponent
2/18/2023 Department of CSE (AI/ML) 6
COMPUTER REPRESENTATION OF FLOATING
POINT NUMBERS
• In the CPU, a 32-bit floating point number is represented using IEEE
standard format as follows:
S | EXPONENT | MANTISSA
• where S is one bit, the EXPONENT is 8 bits, and the MANTISSA is 23 bits.
• The mantissa
• Represents the leading significant bits in the number.
• It is made less than 1 and greater than or equal to 0.1.
• The exponent
• is used to adjust the position of the binary point (as opposed to a
"decimal" point).
• In power of 10 and multiplies with mantissa
2/18/2023 Department of CSE (AI/ML) 7
Normalization
• Mantissa and Exponent have their own independent signs.
• While storing no. of the leading digit in the mantissa, mantissa is
always made non- zero by appropriately shifting it and adjusting the
value of the exponent.
• The shifting of mantissa to the left till its most significant digit is non-
zero is called normalization.
Example:
• 350->normalized
• 00035-> not normalized.
• Can be normalized by shifting it 3 positions to the left and discarding the
leading zeros.(10^3)
• Zero cannot be normalized bcoz it does not have a nonzero digit. –
Denoted by all zeros at mantissa and exponent.
2/18/2023 Department of CSE (AI/ML) 8
Arithmetic operations with normalized floating
point numbers
• Addition
• Subtraction
• Multiplication
• Division
2/18/2023 Department of CSE (AI/ML) 9
Basic Considerations
• Operations on fp numbers requires complex hardware and takes more time.
• Addition or subtraction requires:
• Alignment of radix point(exponents must be equal).
• Done by shifting mantissa and adjust exponent accordingly.
• Example: 0.5372400*10^2+ 0.1580000*10^-1
• Either shift the 1st no 3 positions to the left or shift the 2nd by 3 position to
the right.
• 2nd method is more preferable.
• Normalized addition will cause an overflow and can be corrected by
shifting the sum once to the right and incrementing the exponent.
2/18/2023 Department of CSE (AI/ML) 10
• Underflow
• Floating point number has a 0 in the MSB of the mantissa.
• Shift the mantissa to the left and decrement the exponent(normalization)
• Multiplication and division does not require alignment.
• Result(multiply mantissa and add the exponent for multiplication).
• Divide the mantissa and subtract the exponent for division.
• The operation performed with exponent are:
• Compare &increment(align mantissa)
• Add &subtract(multiplication and division)
• Decrement ( normalization )
• Exponent representation
• Signed magnitude
• Signed 2’s complement
• Signed 1’s complement
• Biased exponent
2/18/2023 Department of CSE (AI/ML) 11
• In biased exponent
• Sign bit is not taken as separate entity.
• Is a +ve number that is added to each exponent as the floating point number is
formed.
• Internally all exponents are +ve.
• The bias, is subtracted from the field to get the true exponent value.
• Bias=(2k-1-1), where k is the number of bits in the binary exponent.
• Advantages
• They contain only positive numbers(easy to compare)
• The smallest possible biased exponent contains all zeros
2/18/2023 Department of CSE (AI/ML) 12
2/18/2023 Department of CSE (AI/ML) 13
2/18/2023 Department of CSE (AI/ML) 14
Register Configuration
• The same registers & adders are in the case of fixed point arithmetic
are used for processing mantissa.
• Differs the way in which exponents are handled.
2/18/2023 Department of CSE (AI/ML) 15
2/18/2023 Department of CSE (AI/ML) 16
• BR,AC,QR(divided into 2 parts).
• Mantissa is stored in B,A and Q registers
• Exponent in b,a,q registers.
• Mantissa in signed magnitude in A and sign in As and MSB in A1.
• Biased exponent in a.
• A1->1 if the no. Has to be normalized
• Similarly for other registers
• 2Parallel adders
• 1 ,Adds two mantissas and sum stores in A, Carry to E.
• 2nd adds the exponents(don’t have distinct sign bit, but taken as +ve).
• Exponent overflow is neglected.
• Exponents are connected to comparator that provides 3 binary outputs to indicate their
relative magnitude.
• The number in the mantissa is taken as a fraction, so binary point resides to the left of the
magnitude part.
• Numbers are normalized both during initial and after the operation.
A floating operation may produce :
2/18/2023 Department of CSE (AI/ML) 17
Addition and Subtraction
1. Check for zeros.
2. Align the mantissas.
3. Add or subtract the mantissas.
4. Normalize the result.
2/18/2023 Department of CSE (AI/ML) 18
2/18/2023 Department of CSE (AI/ML) 19
Multiplication
• Multiply the mantissas and add the exponents.
• No comparison of exponents or alignment of mantissas is necessary.
• Four components:
1. Check for zeros.
2. Add the exponents.
3. Multiply the mantissas.
4. Normalize the product.
2/18/2023 Department of CSE (AI/ML) 20
2/18/2023 Department of CSE (AI/ML) 21
Division
• Floating-point division requires that the exponents be subtracted and
the mantissas divided.
• The mantissa division is done as in fixed-point except that the
dividend has a single-precision mantissa that is placed in the AC.
• Check for zeros.
• Initialize registers and evaluate the sign
• Align the dividend(divide overflow check in fixp).
• Subtract the exponents.
• Divide the mantissas.
2/18/2023 Department of CSE (AI/ML) 22
2/18/2023 Department of CSE (AI/ML) 23
Topics to be covered in next session 23
• Decimal Arithmetic unit and Operation
2/18/2023 Department of CSE (AI/ML) 24
Thank you!!!

More Related Content

Similar to CS304PC:Computer Organization and Architecture session 22 floating point arithmetic operations.pptx

CS304PC:Computer Organization and Architecture Session 23 Decimal Arithmetic ...
CS304PC:Computer Organization and Architecture Session 23 Decimal Arithmetic ...CS304PC:Computer Organization and Architecture Session 23 Decimal Arithmetic ...
CS304PC:Computer Organization and Architecture Session 23 Decimal Arithmetic ...
Asst.prof M.Gokilavani
 
CS304PC:Computer Organization and Architecture session 18 floating point rese...
CS304PC:Computer Organization and Architecture session 18 floating point rese...CS304PC:Computer Organization and Architecture session 18 floating point rese...
CS304PC:Computer Organization and Architecture session 18 floating point rese...
Asst.prof M.Gokilavani
 
Unit 2 Arithmetic
Unit 2 ArithmeticUnit 2 Arithmetic
Unit 2 Arithmetic
Balaji Vignesh
 
CS304PC:Computer Organization and Architecture Session 21 Division Algorithm....
CS304PC:Computer Organization and Architecture Session 21 Division Algorithm....CS304PC:Computer Organization and Architecture Session 21 Division Algorithm....
CS304PC:Computer Organization and Architecture Session 21 Division Algorithm....
Asst.prof M.Gokilavani
 
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
JEEVANANTHAMG6
 
index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...
mayurjagdale4
 
Bu33436438
Bu33436438Bu33436438
Bu33436438
IJERA Editor
 
Bu33436438
Bu33436438Bu33436438
Bu33436438
IJERA Editor
 
Computer Organization and Architecture Overview
Computer Organization and Architecture OverviewComputer Organization and Architecture Overview
Computer Organization and Architecture Overview
Dhaval Bagal
 
Computer Architecture refers to those attributes of a system that have a dire...
Computer Architecture refers to those attributes of a system that have a dire...Computer Architecture refers to those attributes of a system that have a dire...
Computer Architecture refers to those attributes of a system that have a dire...
mayurjagdale4
 
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfCS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
Asst.prof M.Gokilavani
 
Computer arithmetics (computer organisation & arithmetics) ppt
Computer arithmetics (computer organisation & arithmetics) pptComputer arithmetics (computer organisation & arithmetics) ppt
Computer arithmetics (computer organisation & arithmetics) ppt
SuryaKumarSahani
 
Sc
ScSc
CS304PC:Computer Organization and Architecture Session 3 micro operations.pptx
CS304PC:Computer Organization and Architecture Session 3 micro operations.pptxCS304PC:Computer Organization and Architecture Session 3 micro operations.pptx
CS304PC:Computer Organization and Architecture Session 3 micro operations.pptx
Asst.prof M.Gokilavani
 
computer arithmetic’s (fixed and floating point)
computer arithmetic’s (fixed and floating point)computer arithmetic’s (fixed and floating point)
computer arithmetic’s (fixed and floating point)
DipakMahurkar1
 
Chapter 9.pdf
Chapter 9.pdfChapter 9.pdf
Chapter 9.pdf
sarojthapa35
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
arunachalamr16
 
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
MtikuTadesse
 
data type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de ladata type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de la
LEOFAKE
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
PeriyanayagiS
 

Similar to CS304PC:Computer Organization and Architecture session 22 floating point arithmetic operations.pptx (20)

CS304PC:Computer Organization and Architecture Session 23 Decimal Arithmetic ...
CS304PC:Computer Organization and Architecture Session 23 Decimal Arithmetic ...CS304PC:Computer Organization and Architecture Session 23 Decimal Arithmetic ...
CS304PC:Computer Organization and Architecture Session 23 Decimal Arithmetic ...
 
CS304PC:Computer Organization and Architecture session 18 floating point rese...
CS304PC:Computer Organization and Architecture session 18 floating point rese...CS304PC:Computer Organization and Architecture session 18 floating point rese...
CS304PC:Computer Organization and Architecture session 18 floating point rese...
 
Unit 2 Arithmetic
Unit 2 ArithmeticUnit 2 Arithmetic
Unit 2 Arithmetic
 
CS304PC:Computer Organization and Architecture Session 21 Division Algorithm....
CS304PC:Computer Organization and Architecture Session 21 Division Algorithm....CS304PC:Computer Organization and Architecture Session 21 Division Algorithm....
CS304PC:Computer Organization and Architecture Session 21 Division Algorithm....
 
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
1. Arithmetic Operations - Addition and subtraction of signed numbers.pptx
 
index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...
 
Bu33436438
Bu33436438Bu33436438
Bu33436438
 
Bu33436438
Bu33436438Bu33436438
Bu33436438
 
Computer Organization and Architecture Overview
Computer Organization and Architecture OverviewComputer Organization and Architecture Overview
Computer Organization and Architecture Overview
 
Computer Architecture refers to those attributes of a system that have a dire...
Computer Architecture refers to those attributes of a system that have a dire...Computer Architecture refers to those attributes of a system that have a dire...
Computer Architecture refers to those attributes of a system that have a dire...
 
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdfCS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
 
Computer arithmetics (computer organisation & arithmetics) ppt
Computer arithmetics (computer organisation & arithmetics) pptComputer arithmetics (computer organisation & arithmetics) ppt
Computer arithmetics (computer organisation & arithmetics) ppt
 
Sc
ScSc
Sc
 
CS304PC:Computer Organization and Architecture Session 3 micro operations.pptx
CS304PC:Computer Organization and Architecture Session 3 micro operations.pptxCS304PC:Computer Organization and Architecture Session 3 micro operations.pptx
CS304PC:Computer Organization and Architecture Session 3 micro operations.pptx
 
computer arithmetic’s (fixed and floating point)
computer arithmetic’s (fixed and floating point)computer arithmetic’s (fixed and floating point)
computer arithmetic’s (fixed and floating point)
 
Chapter 9.pdf
Chapter 9.pdfChapter 9.pdf
Chapter 9.pdf
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
 
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
2 Computer Arithmetic_hhbyhbjhhjjjjjb41.pptx
 
data type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de ladata type.pptxddddswwyertr hai na ki extend kr de la
data type.pptxddddswwyertr hai na ki extend kr de la
 
Finite word length effects
Finite word length effectsFinite word length effects
Finite word length effects
 

More from Asst.prof M.Gokilavani

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
Asst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
Asst.prof M.Gokilavani
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
Asst.prof M.Gokilavani
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
Asst.prof M.Gokilavani
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
Asst.prof M.Gokilavani
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
Asst.prof M.Gokilavani
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
Asst.prof M.Gokilavani
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
Asst.prof M.Gokilavani
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
Asst.prof M.Gokilavani
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
Asst.prof M.Gokilavani
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
Asst.prof M.Gokilavani
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
Asst.prof M.Gokilavani
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptx
Asst.prof M.Gokilavani
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
Asst.prof M.Gokilavani
 

More from Asst.prof M.Gokilavani (20)

CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
IT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdfIT8073_Information Security_UNIT I _.pdf
IT8073_Information Security_UNIT I _.pdf
 
IT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notesIT8073 _Information Security _UNIT I Full notes
IT8073 _Information Security _UNIT I Full notes
 
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdfGE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
GE3151 PSPP UNIT IV QUESTION BANK.docx.pdf
 
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdfGE3151 PSPP UNIT III QUESTION BANK.docx.pdf
GE3151 PSPP UNIT III QUESTION BANK.docx.pdf
 
GE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdfGE3151 UNIT II Study material .pdf
GE3151 UNIT II Study material .pdf
 
GE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdfGE3151 PSPP All unit question bank.pdf
GE3151 PSPP All unit question bank.pdf
 
GE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _NotesGE3151_PSPP_All unit _Notes
GE3151_PSPP_All unit _Notes
 
GE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_NotesGE3151_PSPP_UNIT_5_Notes
GE3151_PSPP_UNIT_5_Notes
 
GE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_NotesGE3151_PSPP_UNIT_4_Notes
GE3151_PSPP_UNIT_4_Notes
 
GE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_NotesGE3151_PSPP_UNIT_3_Notes
GE3151_PSPP_UNIT_3_Notes
 
GE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_NotesGE3151_PSPP_UNIT_2_Notes
GE3151_PSPP_UNIT_2_Notes
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdfAI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
AI3391 Artificial intelligence Session 29 Forward and backward chaining.pdf
 
AI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptxAI3391 Artificial intelligence Session 28 Resolution.pptx
AI3391 Artificial intelligence Session 28 Resolution.pptx
 
AI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptxAI3391 Artificial intelligence session 27 inference and unification.pptx
AI3391 Artificial intelligence session 27 inference and unification.pptx
 
AI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptxAI3391 Artificial Intelligence Session 26 First order logic.pptx
AI3391 Artificial Intelligence Session 26 First order logic.pptx
 

Recently uploaded

Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
RicletoEspinosa1
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
obonagu
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 

Recently uploaded (20)

Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
AIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdfAIR POLLUTION lecture EnE203 updated.pdf
AIR POLLUTION lecture EnE203 updated.pdf
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 

CS304PC:Computer Organization and Architecture session 22 floating point arithmetic operations.pptx

  • 1. CS304PC:Computer Organization and Architecture (R18 II(I sem)) Department of computer science and engineering (AI/ML) Session 22 by Asst.Prof.M.Gokilavani VITS 2/18/2023 Department of CSE (AI/ML) 1
  • 2. TEXTBOOK: • 1. Computer System Architecture – M. Moris Mano, Third Edition, Pearson/PHI. REFERENCES: • Computer Organization – Car Hamacher, Zvonks Vranesic, Safea Zaky, Vth Edition, McGraw Hill. • Computer Organization and Architecture – William Stallings Sixth Edition, Pearson/PHI. • Structured Computer Organization – Andrew S. Tanenbaum, 4th Edition, PHI/Pearson. 2/18/2023 Department of CSE (AI/ML) 2
  • 3. Unit III Data Representation: Data types ,Complements, fixed point Representations, Floating point representation. Computer Arithmetic: Addition and subtraction, multiplication Algorithms, Division Algorithms, Floating-point Arithmetic operations, Decimal Arithmetic unit, Decimal Arithmetic operations. 2/18/2023 Department of CSE (AI/ML) 3
  • 4. Topics covered in session 22 2/18/2023 Department of CSE (AI/ML) 4 • Addition and subtraction • Multiplication Algorithms • Division Algorithms • Floating-point Arithmetic operations • Decimal Arithmetic unit • Decimal Arithmetic operations.
  • 5. Floating-point Arithmetic operations • Floating point arithmetic • Representation of floating point arithmetic • Operations • Normalization • Pit-Falls of floating point arithmetic 2/18/2023 Department of CSE (AI/ML) 5
  • 6. Floating-point Arithmetic operations There are two types of arithmetic operations :- • Integer Arithmetic • Real – floating point arithmetic • Integer Arithmetic :- deals with integer operands. • i.e. - num without fractional parts • Real Arithmetic :- use number with fractional parts as operands and is use. • Real no. = mantissa * 10^exponent 2/18/2023 Department of CSE (AI/ML) 6
  • 7. COMPUTER REPRESENTATION OF FLOATING POINT NUMBERS • In the CPU, a 32-bit floating point number is represented using IEEE standard format as follows: S | EXPONENT | MANTISSA • where S is one bit, the EXPONENT is 8 bits, and the MANTISSA is 23 bits. • The mantissa • Represents the leading significant bits in the number. • It is made less than 1 and greater than or equal to 0.1. • The exponent • is used to adjust the position of the binary point (as opposed to a "decimal" point). • In power of 10 and multiplies with mantissa 2/18/2023 Department of CSE (AI/ML) 7
  • 8. Normalization • Mantissa and Exponent have their own independent signs. • While storing no. of the leading digit in the mantissa, mantissa is always made non- zero by appropriately shifting it and adjusting the value of the exponent. • The shifting of mantissa to the left till its most significant digit is non- zero is called normalization. Example: • 350->normalized • 00035-> not normalized. • Can be normalized by shifting it 3 positions to the left and discarding the leading zeros.(10^3) • Zero cannot be normalized bcoz it does not have a nonzero digit. – Denoted by all zeros at mantissa and exponent. 2/18/2023 Department of CSE (AI/ML) 8
  • 9. Arithmetic operations with normalized floating point numbers • Addition • Subtraction • Multiplication • Division 2/18/2023 Department of CSE (AI/ML) 9
  • 10. Basic Considerations • Operations on fp numbers requires complex hardware and takes more time. • Addition or subtraction requires: • Alignment of radix point(exponents must be equal). • Done by shifting mantissa and adjust exponent accordingly. • Example: 0.5372400*10^2+ 0.1580000*10^-1 • Either shift the 1st no 3 positions to the left or shift the 2nd by 3 position to the right. • 2nd method is more preferable. • Normalized addition will cause an overflow and can be corrected by shifting the sum once to the right and incrementing the exponent. 2/18/2023 Department of CSE (AI/ML) 10
  • 11. • Underflow • Floating point number has a 0 in the MSB of the mantissa. • Shift the mantissa to the left and decrement the exponent(normalization) • Multiplication and division does not require alignment. • Result(multiply mantissa and add the exponent for multiplication). • Divide the mantissa and subtract the exponent for division. • The operation performed with exponent are: • Compare &increment(align mantissa) • Add &subtract(multiplication and division) • Decrement ( normalization ) • Exponent representation • Signed magnitude • Signed 2’s complement • Signed 1’s complement • Biased exponent 2/18/2023 Department of CSE (AI/ML) 11
  • 12. • In biased exponent • Sign bit is not taken as separate entity. • Is a +ve number that is added to each exponent as the floating point number is formed. • Internally all exponents are +ve. • The bias, is subtracted from the field to get the true exponent value. • Bias=(2k-1-1), where k is the number of bits in the binary exponent. • Advantages • They contain only positive numbers(easy to compare) • The smallest possible biased exponent contains all zeros 2/18/2023 Department of CSE (AI/ML) 12
  • 13. 2/18/2023 Department of CSE (AI/ML) 13
  • 14. 2/18/2023 Department of CSE (AI/ML) 14
  • 15. Register Configuration • The same registers & adders are in the case of fixed point arithmetic are used for processing mantissa. • Differs the way in which exponents are handled. 2/18/2023 Department of CSE (AI/ML) 15
  • 16. 2/18/2023 Department of CSE (AI/ML) 16 • BR,AC,QR(divided into 2 parts). • Mantissa is stored in B,A and Q registers • Exponent in b,a,q registers. • Mantissa in signed magnitude in A and sign in As and MSB in A1. • Biased exponent in a. • A1->1 if the no. Has to be normalized • Similarly for other registers • 2Parallel adders • 1 ,Adds two mantissas and sum stores in A, Carry to E. • 2nd adds the exponents(don’t have distinct sign bit, but taken as +ve). • Exponent overflow is neglected. • Exponents are connected to comparator that provides 3 binary outputs to indicate their relative magnitude. • The number in the mantissa is taken as a fraction, so binary point resides to the left of the magnitude part. • Numbers are normalized both during initial and after the operation.
  • 17. A floating operation may produce : 2/18/2023 Department of CSE (AI/ML) 17
  • 18. Addition and Subtraction 1. Check for zeros. 2. Align the mantissas. 3. Add or subtract the mantissas. 4. Normalize the result. 2/18/2023 Department of CSE (AI/ML) 18
  • 19. 2/18/2023 Department of CSE (AI/ML) 19
  • 20. Multiplication • Multiply the mantissas and add the exponents. • No comparison of exponents or alignment of mantissas is necessary. • Four components: 1. Check for zeros. 2. Add the exponents. 3. Multiply the mantissas. 4. Normalize the product. 2/18/2023 Department of CSE (AI/ML) 20
  • 21. 2/18/2023 Department of CSE (AI/ML) 21
  • 22. Division • Floating-point division requires that the exponents be subtracted and the mantissas divided. • The mantissa division is done as in fixed-point except that the dividend has a single-precision mantissa that is placed in the AC. • Check for zeros. • Initialize registers and evaluate the sign • Align the dividend(divide overflow check in fixp). • Subtract the exponents. • Divide the mantissas. 2/18/2023 Department of CSE (AI/ML) 22
  • 23. 2/18/2023 Department of CSE (AI/ML) 23
  • 24. Topics to be covered in next session 23 • Decimal Arithmetic unit and Operation 2/18/2023 Department of CSE (AI/ML) 24 Thank you!!!