SlideShare a Scribd company logo
1 of 17
Prof.Dipak Mahurkar Department of E&Computer
Engineering
Sanjivani College of Engineering, Kopargaon
Department of Electronics & Computer Engineering
(An Autonomous Institute)
Affiliated to Savitribai Phule Pune University
Accredited ‘A’ Grade by NAAC
________________________________________________________________________________________
Subject: Digital Logic Design and HDL (EC203)
UNIT-1
Topic: computer arithmetic’s (fixed and floating point)
1
` There are two major approaches to store real numbers (i.e.,
numbers with fractional component) in modern computing.
These are (i) Fixed Point Notation and (ii) Floating Point
Notation. In fixed point notation, there are a fixed number of
digits after the decimal point, whereas floating point number
allows for a varying number of digits after the decimal point.
Prof.Dipak Mahurkar Department of E&Tc Engineering 2
• Fixed-Point Representation −
This representation has fixed number of bits for integer part
and for fractional part. For example, if given fixed-point
representation is IIII.FFFF, then you can store minimum value
is 0000.0001 and maximum value is 9999.9999. There are
three parts of a fixed-point number representation: the sign
field, integer field, and fractional field.
Prof.Dipak Mahurkar Department of E&Tc Engineering 3
Prof.Dipak Mahurkar Department of E&Tc Engineering 4
We can represent these numbers using:
• Signed representation: range from -(2(k-1)-1) to (2(k-1)-1), for k
bits.
• 1’s complement representation: range from -(2(k-1)-1) to (2(k-1)-
1), for k bits.
• 2’s complementation representation: range from -(2(k-1)) to (2(k-
1)-1), for k bits.
2’s complementation representation is preferred in computer
system because of unambiguous property and easier for
arithmetic operations.
Prof.Dipak Mahurkar Department of E&Tc Engineering 5
Example −Assume number is using 32-bit format
which reserve 1 bit for the sign, 15 bits for the
integer part and 16 bits for the fractional part.
Then, -43.625 is represented as following:
Prof.Dipak Mahurkar Department of E&Tc Engineering 6
• Where, 0 is used to represent + and 1 is used to represent - .
000000000101011 is 15 bit binary value for decimal 43 and
1010000000000000 is 16 bit binary value for fractional 0.625.
• The advantage of using a fixed-point representation is
performance and disadvantage is relatively limited range of
values that they can represent. So, it is usually inadequate for
numerical analysis as it does not allow enough numbers and
accuracy. A number whose representation exceeds 32 bits
would have to be stored inexactly.
Prof.Dipak Mahurkar Department of E&Tc Engineering 7
• These are above smallest positive number and largest positive
number which can be store in 32-bit representation as given
above format. Therefore, the smallest positive number is 2-
16 ≈ 0.000015 approximate and the largest positive number is
(215-1)+(1-2-16)=215(1-2-16) =32768, and gap between these
numbers is 2-16.
• We can move the radix point either left or right with the help
of only integer field is 1.
Prof.Dipak Mahurkar Department of E&Tc Engineering 8
• Floating-Point Representation −
• This representation does not reserve a specific number of bits for
the integer part or the fractional part. Instead it reserves a certain
number of bits for the number (called the mantissa or significand)
and a certain number of bits to say where within that number the
decimal place sits (called the exponent).
• The floating number representation of a number has two part: the
first part represents a signed fixed point number called mantissa.
The second part of designates the position of the decimal (or
binary) point and is called the exponent. The fixed point mantissa
may be fraction or an integer. Floating -point is always interpreted
to represent a number in the following form: Mxre.
Prof.Dipak Mahurkar Department of E&Tc Engineering 9
Only the mantissa m and the exponent e are physically
represented in the register (including their sign). A floating-
point binary number is represented in a similar manner
except that is uses base 2 for the exponent. A floating-point
number is said to be normalized if the most significant digit
of the mantissa is 1.
Prof.Dipak Mahurkar Department of E&Tc Engineering 10
• So, actual number is (-1)s(1+m)x2(e-Bias), where s is the sign
bit, m is the mantissa, e is the exponent value, and Bias is the
bias number.
• Note that signed integers and exponent are represented by
either sign representation, or one’s complement
representation, or two’s complement representation.
• The floating point representation is more flexible. Any non-zero
number can be represented in the normalized form
of ±(1.b1b2b3 ...)2x2n This is normalized form of a number x.
Prof.Dipak Mahurkar Department of E&Tc Engineering 11
Example −Suppose number is using 32-bit format: the 1 bit sign
bit, 8 bits for signed exponent, and 23 bits for the fractional part.
The leading bit 1 is not stored (as it is always 1 for a normalized
number) and is referred to as a “hidden bit”.
Then −53.5 is normalized as -53.5=(-110101.1)2=(-1.101011)x25 ,
which is represented as following below,
Prof.Dipak Mahurkar Department of E&Tc Engineering 12
• Where 00000101 is the 8-bit binary value of exponent value
+5(i.e 25 ).
• Note that 8-bit exponent field is used to store integer
exponents -126 ≤ n ≤ 127.
• The smallest normalized positive number that fits into 32 bits
is (1.00000000000000000000000)2x2-126=2-126≈1.18x10-38 ,
and largest normalized positive number that fits into 32 bits is
(1.11111111111111111111111)2x2127=(224-1)x2104 ≈
3.40x1038 . These numbers are represented as following below,
Prof.Dipak Mahurkar Department of E&Tc Engineering 13
• The precision of a floating-point format is the number of positions reserved for
binary digits plus one (for the hidden bit). In the examples considered here the
precision is 23+1=24.
• The gap between 1 and the next normalized floating-point number is known as
machine epsilon. the gap is (1+2-23)-1=2-23for above example, but this is same as the
smallest positive floating-point number because of non-uniform spacing unlike in
the fixed-point scenario.
• Note that non-terminating binary numbers can be represented in floating point
representation, e.g., 1/3 = (0.010101 ...)2 cannot be a floating-point number as its
binary representation is non-terminating.
Prof.Dipak Mahurkar Department of E&Tc Engineering 14
IEEE Floating point Number Representation −
IEEE (Institute of Electrical and Electronics Engineers) has
standardized Floating-Point Representation as following
diagram.
Prof.Dipak Mahurkar Department of E&Tc Engineering 15
• So, actual number is (-1)s(1+m)x2(e-Bias), where s is the sign bit, m is the
mantissa, e is the exponent value, and Bias is the bias number. The sign bit
is 0 for positive number and 1 for negative number. Exponents are
represented by or two’s complement representation.
• According to IEEE 754 standard, the floating-point number is represented
in following ways:
• Half Precision (16 bit): 1 sign bit, 5 bit exponent, and 10 bit mantissa
• Single Precision (32 bit): 1 sign bit, 8 bit exponent, and 23 bit mantissa
• Double Precision (64 bit): 1 sign bit, 11 bit exponent, and 52 bit mantissa
• Quadruple Precision (128 bit): 1 sign bit, 15 bit exponent, and 112 bit
mantissa
Prof.Dipak Mahurkar Department of E&Tc Engineering 16
Prof.Dipak Mahurkar Department of E&Tc Engineering
Thank You! 17

More Related Content

Similar to computer arithmetic’s (fixed and floating point)

Data representation computer architecture
Data representation  computer architectureData representation  computer architecture
Data representation computer architecturestudy cse
 
Number Systems.pdf .
Number Systems.pdf                        .Number Systems.pdf                        .
Number Systems.pdf .happycocoman
 
digital logic circuits, digital component floting and fixed point
 digital logic circuits, digital component floting and fixed point digital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed pointRai University
 
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)IIUM
 
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...IRJET Journal
 
Physics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gatesPhysics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gatesbiswanath dehuri
 
Digital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-IDigital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-Ipravinwj
 
Computer arithmetic operations.pptx
Computer arithmetic operations.pptxComputer arithmetic operations.pptx
Computer arithmetic operations.pptxssusera6fdd5
 
Dd 160506122947-160630175555-160701121726
Dd 160506122947-160630175555-160701121726Dd 160506122947-160630175555-160701121726
Dd 160506122947-160630175555-160701121726marangburu42
 
B sc cs i bo-de u-i number system
B sc cs i bo-de u-i number systemB sc cs i bo-de u-i number system
B sc cs i bo-de u-i number systemRai University
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdfmiftah88
 
Computer Organization and Architecture Overview
Computer Organization and Architecture OverviewComputer Organization and Architecture Overview
Computer Organization and Architecture OverviewDhaval Bagal
 
Lec 02 data representation part 2
Lec 02 data representation part 2Lec 02 data representation part 2
Lec 02 data representation part 2Abdul Khan
 
DESIGN OF DOUBLE PRECISION FLOATING POINT MULTIPLICATION ALGORITHM WITH VECTO...
DESIGN OF DOUBLE PRECISION FLOATING POINT MULTIPLICATION ALGORITHM WITH VECTO...DESIGN OF DOUBLE PRECISION FLOATING POINT MULTIPLICATION ALGORITHM WITH VECTO...
DESIGN OF DOUBLE PRECISION FLOATING POINT MULTIPLICATION ALGORITHM WITH VECTO...jmicro
 
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 .pdfAsst.prof M.Gokilavani
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.pptRavikumarR77
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of IntegersSusantha Herath
 

Similar to computer arithmetic’s (fixed and floating point) (20)

Data representation computer architecture
Data representation  computer architectureData representation  computer architecture
Data representation computer architecture
 
Final modified ppts
Final modified pptsFinal modified ppts
Final modified ppts
 
Number Systems.pdf .
Number Systems.pdf                        .Number Systems.pdf                        .
Number Systems.pdf .
 
digital logic circuits, digital component floting and fixed point
 digital logic circuits, digital component floting and fixed point digital logic circuits, digital component floting and fixed point
digital logic circuits, digital component floting and fixed point
 
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)Csc1401   lecture03 - computer arithmetic - arithmetic and logic unit (alu)
Csc1401 lecture03 - computer arithmetic - arithmetic and logic unit (alu)
 
Unit-1.pptx
Unit-1.pptxUnit-1.pptx
Unit-1.pptx
 
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
IRJET-Design and Implementation of LNS based Approximate Multiplier using Mit...
 
Physics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gatesPhysics investigatory project for class 12 logic gates
Physics investigatory project for class 12 logic gates
 
Digital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-IDigital Electronics & Fundamental of Microprocessor-I
Digital Electronics & Fundamental of Microprocessor-I
 
Computer arithmetic operations.pptx
Computer arithmetic operations.pptxComputer arithmetic operations.pptx
Computer arithmetic operations.pptx
 
Dd 160506122947-160630175555-160701121726
Dd 160506122947-160630175555-160701121726Dd 160506122947-160630175555-160701121726
Dd 160506122947-160630175555-160701121726
 
B sc cs i bo-de u-i number system
B sc cs i bo-de u-i number systemB sc cs i bo-de u-i number system
B sc cs i bo-de u-i number system
 
chapter one && two.pdf
chapter one && two.pdfchapter one && two.pdf
chapter one && two.pdf
 
Computer Organization and Architecture Overview
Computer Organization and Architecture OverviewComputer Organization and Architecture Overview
Computer Organization and Architecture Overview
 
Lec 02 data representation part 2
Lec 02 data representation part 2Lec 02 data representation part 2
Lec 02 data representation part 2
 
DLD_Lecture_notes2.ppt
DLD_Lecture_notes2.pptDLD_Lecture_notes2.ppt
DLD_Lecture_notes2.ppt
 
DESIGN OF DOUBLE PRECISION FLOATING POINT MULTIPLICATION ALGORITHM WITH VECTO...
DESIGN OF DOUBLE PRECISION FLOATING POINT MULTIPLICATION ALGORITHM WITH VECTO...DESIGN OF DOUBLE PRECISION FLOATING POINT MULTIPLICATION ALGORITHM WITH VECTO...
DESIGN OF DOUBLE PRECISION FLOATING POINT MULTIPLICATION ALGORITHM WITH VECTO...
 
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
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of Integers
 

Recently uploaded

Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 

computer arithmetic’s (fixed and floating point)

  • 1. Prof.Dipak Mahurkar Department of E&Computer Engineering Sanjivani College of Engineering, Kopargaon Department of Electronics & Computer Engineering (An Autonomous Institute) Affiliated to Savitribai Phule Pune University Accredited ‘A’ Grade by NAAC ________________________________________________________________________________________ Subject: Digital Logic Design and HDL (EC203) UNIT-1 Topic: computer arithmetic’s (fixed and floating point) 1
  • 2. ` There are two major approaches to store real numbers (i.e., numbers with fractional component) in modern computing. These are (i) Fixed Point Notation and (ii) Floating Point Notation. In fixed point notation, there are a fixed number of digits after the decimal point, whereas floating point number allows for a varying number of digits after the decimal point. Prof.Dipak Mahurkar Department of E&Tc Engineering 2
  • 3. • Fixed-Point Representation − This representation has fixed number of bits for integer part and for fractional part. For example, if given fixed-point representation is IIII.FFFF, then you can store minimum value is 0000.0001 and maximum value is 9999.9999. There are three parts of a fixed-point number representation: the sign field, integer field, and fractional field. Prof.Dipak Mahurkar Department of E&Tc Engineering 3
  • 4. Prof.Dipak Mahurkar Department of E&Tc Engineering 4
  • 5. We can represent these numbers using: • Signed representation: range from -(2(k-1)-1) to (2(k-1)-1), for k bits. • 1’s complement representation: range from -(2(k-1)-1) to (2(k-1)- 1), for k bits. • 2’s complementation representation: range from -(2(k-1)) to (2(k- 1)-1), for k bits. 2’s complementation representation is preferred in computer system because of unambiguous property and easier for arithmetic operations. Prof.Dipak Mahurkar Department of E&Tc Engineering 5
  • 6. Example −Assume number is using 32-bit format which reserve 1 bit for the sign, 15 bits for the integer part and 16 bits for the fractional part. Then, -43.625 is represented as following: Prof.Dipak Mahurkar Department of E&Tc Engineering 6
  • 7. • Where, 0 is used to represent + and 1 is used to represent - . 000000000101011 is 15 bit binary value for decimal 43 and 1010000000000000 is 16 bit binary value for fractional 0.625. • The advantage of using a fixed-point representation is performance and disadvantage is relatively limited range of values that they can represent. So, it is usually inadequate for numerical analysis as it does not allow enough numbers and accuracy. A number whose representation exceeds 32 bits would have to be stored inexactly. Prof.Dipak Mahurkar Department of E&Tc Engineering 7
  • 8. • These are above smallest positive number and largest positive number which can be store in 32-bit representation as given above format. Therefore, the smallest positive number is 2- 16 ≈ 0.000015 approximate and the largest positive number is (215-1)+(1-2-16)=215(1-2-16) =32768, and gap between these numbers is 2-16. • We can move the radix point either left or right with the help of only integer field is 1. Prof.Dipak Mahurkar Department of E&Tc Engineering 8
  • 9. • Floating-Point Representation − • This representation does not reserve a specific number of bits for the integer part or the fractional part. Instead it reserves a certain number of bits for the number (called the mantissa or significand) and a certain number of bits to say where within that number the decimal place sits (called the exponent). • The floating number representation of a number has two part: the first part represents a signed fixed point number called mantissa. The second part of designates the position of the decimal (or binary) point and is called the exponent. The fixed point mantissa may be fraction or an integer. Floating -point is always interpreted to represent a number in the following form: Mxre. Prof.Dipak Mahurkar Department of E&Tc Engineering 9
  • 10. Only the mantissa m and the exponent e are physically represented in the register (including their sign). A floating- point binary number is represented in a similar manner except that is uses base 2 for the exponent. A floating-point number is said to be normalized if the most significant digit of the mantissa is 1. Prof.Dipak Mahurkar Department of E&Tc Engineering 10
  • 11. • So, actual number is (-1)s(1+m)x2(e-Bias), where s is the sign bit, m is the mantissa, e is the exponent value, and Bias is the bias number. • Note that signed integers and exponent are represented by either sign representation, or one’s complement representation, or two’s complement representation. • The floating point representation is more flexible. Any non-zero number can be represented in the normalized form of ±(1.b1b2b3 ...)2x2n This is normalized form of a number x. Prof.Dipak Mahurkar Department of E&Tc Engineering 11
  • 12. Example −Suppose number is using 32-bit format: the 1 bit sign bit, 8 bits for signed exponent, and 23 bits for the fractional part. The leading bit 1 is not stored (as it is always 1 for a normalized number) and is referred to as a “hidden bit”. Then −53.5 is normalized as -53.5=(-110101.1)2=(-1.101011)x25 , which is represented as following below, Prof.Dipak Mahurkar Department of E&Tc Engineering 12
  • 13. • Where 00000101 is the 8-bit binary value of exponent value +5(i.e 25 ). • Note that 8-bit exponent field is used to store integer exponents -126 ≤ n ≤ 127. • The smallest normalized positive number that fits into 32 bits is (1.00000000000000000000000)2x2-126=2-126≈1.18x10-38 , and largest normalized positive number that fits into 32 bits is (1.11111111111111111111111)2x2127=(224-1)x2104 ≈ 3.40x1038 . These numbers are represented as following below, Prof.Dipak Mahurkar Department of E&Tc Engineering 13
  • 14. • The precision of a floating-point format is the number of positions reserved for binary digits plus one (for the hidden bit). In the examples considered here the precision is 23+1=24. • The gap between 1 and the next normalized floating-point number is known as machine epsilon. the gap is (1+2-23)-1=2-23for above example, but this is same as the smallest positive floating-point number because of non-uniform spacing unlike in the fixed-point scenario. • Note that non-terminating binary numbers can be represented in floating point representation, e.g., 1/3 = (0.010101 ...)2 cannot be a floating-point number as its binary representation is non-terminating. Prof.Dipak Mahurkar Department of E&Tc Engineering 14
  • 15. IEEE Floating point Number Representation − IEEE (Institute of Electrical and Electronics Engineers) has standardized Floating-Point Representation as following diagram. Prof.Dipak Mahurkar Department of E&Tc Engineering 15
  • 16. • So, actual number is (-1)s(1+m)x2(e-Bias), where s is the sign bit, m is the mantissa, e is the exponent value, and Bias is the bias number. The sign bit is 0 for positive number and 1 for negative number. Exponents are represented by or two’s complement representation. • According to IEEE 754 standard, the floating-point number is represented in following ways: • Half Precision (16 bit): 1 sign bit, 5 bit exponent, and 10 bit mantissa • Single Precision (32 bit): 1 sign bit, 8 bit exponent, and 23 bit mantissa • Double Precision (64 bit): 1 sign bit, 11 bit exponent, and 52 bit mantissa • Quadruple Precision (128 bit): 1 sign bit, 15 bit exponent, and 112 bit mantissa Prof.Dipak Mahurkar Department of E&Tc Engineering 16
  • 17. Prof.Dipak Mahurkar Department of E&Tc Engineering Thank You! 17