Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Notes  >  Digital Logic  >  Number Representations & Computer Arithmetic (Fixed & Floating point)

Number Representations & Computer Arithmetic (Fixed & Floating point) | Digital Logic - Computer Science Engineering (CSE) PDF Download


Floating Point Representation

1. To convert the floating point into decimal, we have 3 elements in a 32-bit floating point representation:
    i) Sign
    ii) Exponent
    iii) Mantissa

  • Sign bit is the first bit of the binary representation. '1' implies negative number and '0' implies positive number.
    Example: 11000001110100000000000000000000 This is negative number.
  • Exponent is decided by the next 8 bits of binary representation. 127 is the unique number for 32 bit floating point representation. It is known as bias. It is determined by 2k-1 -1 where 'k' is the number of bits in exponent field.

    There are 2 exponent bits in 8-bit representation and 8 exponent bits in 32-bit representation.
    Thus
    bias = 3 for 8 bit conversion (22-1 -1 = 4-1 = 3)
    bias = 127 for 32 bit conversion. (28-1 -1 = 128-1 = 127)

    Example: 01000001110100000000000000000000
    10000011 = (131)2
    131-127 = 4

    Hence the exponent of 2 will be 4 i.e. 24 = 16.

  • Mantissa is calculated from the remaining 24 bits of the binary representation. It consists of '1' and a fractional part which is determined by:

    Example:

    01000001110100000000000000000000

    The fractional part of mantissa is given by:

    1*(1/2) + 0*(1/4) + 1*(1/8) + 0*(1/16) +……… = 0.625

    Thus the mantissa will be 1 + 0.625 = 1.625

    The decimal number hence given as: Sign*Exponent*Mantissa = (-1)*(16)*(1.625) = -26

2. To convert the decimal into floating point, we have 3 elements in a 32-bit floating point representation:
    i) Sign (MSB)
    ii) Exponent (8 bits after MSB)
    iii) Mantissa (Remaining 23 bits)

Thus the floating point representation of -17 is 1 10000011 0001000000000000000000

  • Sign bit is the first bit of the binary representation. '1' implies negative number and '0' implies positive number.
    Example: To convert -17 into 32-bit floating point representation Sign bit = 1
  • Exponent is decided by the nearest smaller or equal to 2n number. For 17, 16 is the nearest 2n. Hence the exponent of 2 will be 4 since 24 = 16. 127 is the unique number for 32 bit floating point representation. It is known as bias. It is determined by 2k-1 -1 where 'k' is the number of bits in exponent field.

    Thus bias = 127 for 32 bit. (28-1 -1 = 128-1 = 127)

    Now, 127 + 4 = 131 i.e. 10000011 in binary representation.

  • Mantissa: 17 in binary = 10001.

    Move the binary point so that there is only one bit from the left. Adjust the exponent of 2 so that the value does not change. This is normalizing the number. 1.0001 x 24. Now, consider the fractional part and represented as 23 bits by adding zeros.

    00010000000000000000000

The document Number Representations & Computer Arithmetic (Fixed & Floating point) | Digital Logic - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Digital Logic.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
32 docs|15 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Number Representations & Computer Arithmetic (Fixed & Floating point) - Digital Logic - Computer Science Engineering (CSE)

1. What are number representations in computer arithmetic?
Ans. Number representations in computer arithmetic refer to the different ways in which numbers are stored and manipulated in a computer system. This includes fixed-point and floating-point representations. Fixed-point representations use a fixed number of bits to represent both the integer and fractional parts of a number, while floating-point representations use a dynamic range of bits to represent numbers with a varying magnitude and precision.
2. What is the difference between fixed-point and floating-point representations?
Ans. The main difference between fixed-point and floating-point representations is the way they handle the decimal point. In fixed-point representations, the decimal point is fixed at a specific position, typically dividing the bits into integer and fractional parts. On the other hand, floating-point representations allow the decimal point to "float" and adjust its position based on the magnitude of the number, providing a wider range and greater precision for representing numbers.
3. How does a computer perform arithmetic operations on fixed-point numbers?
Ans. Arithmetic operations on fixed-point numbers are performed using the same techniques as integer arithmetic. The computer interprets the fixed-point numbers as integers and applies the appropriate arithmetic operations, such as addition, subtraction, multiplication, and division. However, care must be taken to handle overflow or underflow situations, where the result of an operation exceeds the range of the fixed-point representation.
4. What are the advantages of using floating-point representations in computer arithmetic?
Ans. Floating-point representations offer several advantages in computer arithmetic. Firstly, they provide a wider range of representable numbers, allowing for both very small and very large values. Secondly, they offer higher precision, allowing for more accurate calculations with decimal numbers. Additionally, floating-point representations also support special values like infinity and NaN (Not a Number), which can be useful in certain scientific or engineering applications.
5. What are the limitations of floating-point representations in computer arithmetic?
Ans. While floating-point representations offer increased range and precision, they also have certain limitations. One limitation is the loss of precision when performing operations on numbers with significantly different magnitudes, known as the "floating-point rounding error." Another limitation is the inability to represent some decimal numbers exactly due to the finite number of bits available. These limitations can lead to inaccuracies in certain calculations, requiring careful consideration and implementation of algorithms to minimize errors.
32 docs|15 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Important questions

,

Objective type Questions

,

Extra Questions

,

shortcuts and tricks

,

MCQs

,

Number Representations & Computer Arithmetic (Fixed & Floating point) | Digital Logic - Computer Science Engineering (CSE)

,

Viva Questions

,

Exam

,

mock tests for examination

,

past year papers

,

Previous Year Questions with Solutions

,

practice quizzes

,

Sample Paper

,

ppt

,

Free

,

Summary

,

study material

,

Number Representations & Computer Arithmetic (Fixed & Floating point) | Digital Logic - Computer Science Engineering (CSE)

,

Semester Notes

,

pdf

,

Number Representations & Computer Arithmetic (Fixed & Floating point) | Digital Logic - Computer Science Engineering (CSE)

,

video lectures

;