×

Fixed and Floating-Point Number

Fixed and Floating-Point Number: In digital technology, data is stored in memory registers with binary bits 0’s and 1’s because the computer only understands binary language. When we enter data in the system, it is converted into binary bits, and it is processed and used in the CPU in different ways. Memory registers have a format and a specific range to store data. Scientists have designed a real number representation method in memory registers of 8 bit, 16 bit, 32bit.

There two types of approaches that are developed to store real numbers with the proper method.

  • Fixed point number
  • Floating point number
Fixed and Floating-Point Number

Fixed point representation

In computing, fixed-point number representation is a real data type for a number. With the help of fixed number representation, data is converted into binary form, and then data is processed, stored and used by the system.  

Fixed point representation of data

Fixed and Floating-Point Number

Sign bit -The fixed-point numbers in binary uses a sign bit. A positive number has a sign bit 0, while a negative number has a sign bit 1.

Integral Part – The integral part is of different lengths at different places. It depends on the register's size, like in an 8-bit register, integral part is 4 bits.

Fractional part – Fractional part is also of different lengths at different places. It depends on the register's size, like in an 8-bit register, integral part is of 3 bits.

8 bits =  1Sign bit + 4 bits(integral) + 3bits (fractional part)

16 bits =  1Sign bit + 9 bits(integral) +6 bits (fractional part)

 32 bits =  1Sign bit + 15 bits(integral) + 9 bits (fractional part)

How to write the number in Fixed-point notation?

Number is 4.5

Step 1:- Convert the number into binary form.

                 4.5 = 100.1

Step 2:- Represent binary number in Fixed point notation

Fixed and Floating-Point Number

The smallest negative number in fixed-point representation.

     1   1    1     1     1    1     1     1

Smallest negative number = -15.875

The largest number in fixed-point representation.

    0     1       1       1    1     1      1    1

Larger number = +15.875

Note:- Range of fixed-point notation is from -15.875 to  +15.875. We conclude that the fixed-point notation range is very less as we can only represent the number in a set limit. It is not suitable for presenting a large amount of data, so it is not used in computer nowadays.

Therefore, scientists feel that the system needs a new representation format with the least or no limit because data is becoming a vast nowadays. So, floating-point representation came into existence.

Floating-point representation

To discard the limitation of fixed-point notation, floating-point number representation was developed by scientists. The computer system uses floating-point numbers representation to convert input data into binary form. The binary form number is converted into ‘scientific notation,' and then this scientific notation is converted into floating-point representation.

The floating-point notation has two types of notation

  1. Scientific notation
  2. Normalized notation

Scientific notation – Method of representing binary numbers into a x be form. Scientific notation is further converted into floating-point notation because floating-point notation only accepts scientific notation. For example:-

Number = 376.423 ( its not scientific notation)

Number in scientific = 36.4423 x 101 or 3.64423 x 102

Fixed and Floating-Point Number

For example:-    32.625 x 103

                           1101.101 * 2101  

where 1101.101 is the mantissa part.

2101 = It is the base part where we need not explicitly represent radix or base because the binary base is always 2.

Note: The major problem in this notation is while storing mantissa, we need to tell the decimal position every time to the processor. So to overcome this problem, normalized notation was invented and used.

Normalized notation- It is a special case of scientific notation. Normalized means after the decimal point, we have atleast one non-zero digit. 

 Normalized notation  -            

Fixed and Floating-Point Number

                            where, value of m= .1?m?1, b= base, e= exponent integer

                                           ± 0.1bbbb…..b  * 2±e

If mantissa =101, then the processor will interpret it as 0.101 itself, so it's not necessary to tell the position of the decimal point every time to the processor. 

For example-   .36 x 1035 is a normalized notation in which the value of m is between .1 to 1. In normalized notation, value of m remains between .1 ?m?1.

For example:-   1101.101 * 2101 = (5)10  (convert this into normalized form)

                          0.1101101 * 2(1001)2 =(9)10=(5+4)10

So, there is no need to tell about the decimal point's position every time to the processor.

  • Zero (0) cannot be represented or normalized because the representation set starts from 0.1, so how can we normalize zero. It’s not possible.
  •  If the most significant bit of mantissa is a non zero, then such a representation is called normalized floating-point.

So, four things are used to represent a floating-point number: -

  1. Sign of Mantissa
  2. Sign of Exponent
  3. Magnitude of Mantissa
  4. Magnitude of Exponent

How to represent a number in floating-point representation?

Floating-point representation of data in a 16-bit register.

Fixed and Floating-Point Number

Sign bit -The fixed-point numbers in binary uses a sign bit. A positive number has a sign bit 0, while a negative number has a sign bit 1. In floating-point representation, sign of a number always depends on mantissa, not on exponent. Hence sign bit in the format is always for mantissa and not for the exponent. 

Mantissa Part –Mantissa part is of different length at a different place. It depends on the size of the register like in 16-bit register; mantissa part is of 8 bits.

Exponent part – Exponent is the power of the number. It depends on the register's size; like in the 16-bit register, exponent part is 7 bits. Excess 16,64,128, 512  are used to store exponent in this format.

Steps for representing the number in Floating point format

Step 1: Convert the given number into binary.

              6.25 = 110.01

Step 2: Normalize the number  = .11001 * 23  ( base is 2)

Step 3: Represent the number in a 16-bit register in floating-point notation.

 0110010001000011

This represent value = 6443H

Largest  normalized number in 16 bit register with excess 64

0111111111111111

    =   .11111111* 2127-64  ( excess- 64 is used to store exponent in this format)

    =   .11111111* 263

    =    27 -1 * 263

Smallest  normalized number in 16 bit register with excess 64

0100000000000000

    =   .1* 20-64  ( excess- 64 is used to store exponent in this format)

    =   .1* 2-64

    =    .5 * 264

    =    2-65

De-normalized Notation

It is just reverse of normalized notation. In normalized notation, after decimal we have‘1’ written in the equation but in de-normalized notation, we have ‘0’ after decimal. For example:-

Largest De-normalized number with excess-64

Sign bitExponent Mantissa

      0                                         1111111                              01111111

= .01111111 * 2127-64

= .01111111 * 263

= .1111111 * 262

= (1-2-7 )* 262

Smallest  De-normalized number with excess-64

Sign bitExponent    Mantissa

      0                                         1000000                              0000000

= .00000001 * 20-64

= .00000001 * 2-64

= 2-8 * 2-64

= 2-72


Related Topics

Advantages and Disadvantages of Flash Memory

What is Flash Memory? Electrically Erasable Programmable Read-Only Memory (EEPROM) and Erasable Programmable Read-Only Memory (EPROM) are used for flash memory (EEPROM). Although technically the word flash is used in the industry...

3 minutes read.

Local Broadcast Address and loopback address

In computer networking, if you send the data from one source to another source or group of sources in the form of packets, then this is called casting. We can categorize...

3 minutes read.

Basic Terminologies Related to COA

Some Basic Terminologies Related to COA Computer organization and architecture is the detailed study of the internal components of the computer with their functionality. It describes how components arranged together and...

7 minutes read.

Fixed and Floating-Point Number

Fixed and Floating-Point Number: In digital technology, data is stored in memory registers with binary bits 0’s and 1’s because the computer only understands binary language. When we enter data...

6 minutes read.

8086 Microprocessor Pin Configurations

8086 microprocessor is invented and developed by Intel in 1976. The 8086 Microprocessor is an enhanced version of the 8085 Microprocessor. There are 20 address lines and 16 data lines...

6 minutes read.

Micro-Operations

Micro-Operations If CPU wants to perform any operation, suppose execution of only one instruction or even break it down one particular execution phase (like fetch instruction, write back, decode, operand fetch...

9 minutes read.

Control Signals in 8155 Microprocessor

Intel designed the chip 8155 used to interface with I/O devices. Basically, the 8085 microprocessor is directly unable to deal with its peripheral input output devices for reading data or...

3 minutes read.

8085 instructions set

Introduction: In the computer, the user sends the data. The computer can use data and it also process the data. After the processing, send the result to the user. The specific...

10 minutes read.

Data Path, ALU and Control Unit

Data Path, ALU(Arithmetic Logic Unit) and Control Unit What is the Data path? Suppose any data processing operation should be performed in the CPU like transferring the content of register from one...

5 minutes read.

Machine Instructions

What is a Digital Computer? A computer that takes input in a binary form and produces output in binary form. The question arises of what kind of input the computer takes...

4 minutes read.

Microprocessor classification

Introduction: Microprocessor is known as the computer processor. The IC or integrated Circuit makes the microprocessor. that is the brain of the computer machine. The microprocessor is known as the...

6 minutes read.

Digital Number System

Digital Number System: The computer understands digital language only. Many number systems are used in digital technology. The most common are Decimal, Binary, Octal and Hexadecimal number systems. Types of the...

7 minutes read.

Instruction Cycle: Computer Organization and Architecture

What is an effective Address? “Effective address is the address of operand in a computation-type instruction.” Computation type instructions are like ADD, SUB, MOV, OR, AND, etc., which require operand to...

4 minutes read.

Assembly Language Register

Assembly Language Register Assembly language was introduced during the late 1940s in the second generation. It is a low-level language that helps in communication between the user and the computer. It...

6 minutes read.

COA: Interrupt and its types

Introduction: In general terms, the word interrupt means to stop the progress of ongoing work in between or to break the continuation of the work. In early digital computing, the...

5 minutes read.

Control Unit Organization

Control Unit Organization The Control Unit is the unit in the CPU, which controls the various components like input  & output devices, logic unit and memory. The Control Unit is the...

7 minutes read.

Interfacing DAC with the 8051 Microcontroller

A wide range of applications calls for microcontrollers, including measuring and controlling physical quantities like temperature, pressure, speed, and distance. In these systems, the microcontroller creates digital output, but the controlling...

2 minutes read.

Bipartite Graph

A graph is said to be bipartite if and only if we can divide all the vertices of a graph into two sets such that these sets are mutually exclusive...

4 minutes read.

74138 IC DECODER

74138 DECODER Decoder A combinational circuit called a decoder can have up to 2n output lines and 'n' input lines. When a decoder is enabled, depending on the mix of inputs,...

4 minutes read.

CPU Registers

CPU Registers Within the CPU, we have small- small storage units called registers. If we are executing a certain program within the CPU, there's a need to store that program content,...

11 minutes read.