This topic is useful for KTU Regulation 2019 1. EET206 Digital Electronics ( ELECTRICAL AND ELECTRONICS ENGINEERING) 2. CST203 Logic System Design ( COMPUTER SCIENCE ENGINEERING) 3. ECT203 Logic Circuit Design (ELECTRONICS AND COMMUNICATION ENGINEERING) 4. EBT205 Logic Circuit and Design (BIOMEDICAL ENGINEERING) 5. ITT203 Logic System Design (INFORMATION TECHNOLOGY) 6. ECT203 Logic Circuit Design (APPLIED ELECTRONICS ENGINEERING) KTU Regulation 2015 1. EE204 Digital Electronics and Logic Design (ELECTRICAL AND ELECTRONICS ENGINEERING) 2. CS203 Switching Theory and Logic Design (COMPUTER SCIENCE ENGINEERING) 3. EC207 Logic Circuit Design (ELECTRONICS AND COMMUNICATION ENGINEERING) 4. EC207 Logic Circuit Design (APPLIED ELECTRONICS ENGINEERING AND INSTRUMENTATION) 5. IC207 Design of Logic Circuit (BIOMEDICAL ENGINEERING) FOR FULL CLASSES : https://youtube.com/playlist?list=PL2UV2EJdMQmgLuA8dwLY7-4DsbNQTsUOg #digitalelectronics#ktu#eee#electrical#cse FOR FULL CLASSES : https://youtube.com/playlist?list=PL2UV2EJdMQmgLuA8dwLY7-4DsbNQTsUOg #digitalelectronics#ktu#eee#electrical
Hello students, today we are going to discuss about Fixed and Floating Point Representation which is the first topic in Digital Electronics.
Let us see what is Fixed and Floating Point Representation.
We can store a decimal number in two ways in a computer.
First one is Fixed Point Representation.
Second one is Floating Point Representation.
We can store a decimal number in two ways in a computer.
That is called Fixed Point Representation.
Second one is Floating Point Representation.
Let us see what is Fixed Point Representation.
Consider an example.
I took a case of 42.24.
The left portion of the binary point is the integer part.
The right portion is the fractional part.
Consider an example.
I took a case of 42.24.
The left portion of the binary point is the integer part.
The right portion is the fractional part.
In Fixed Point Representation, a fixed number has a specific number of bits or digits.
A fixed number or a fixed digit is reserved to fill the integer part.
The left portion of the decimal part is the integer part.
A fixed number or a fixed digit is reserved to fill the integer part.
What is Fixed Point Representation?
In Fixed Point Representation, a fixed number or a fixed digit is reserved to fill the integer part.
A fixed number or a fixed digit is reserved to fill the fractional part.
What is the advantage of Fixed Point Representation?
It is a straightforward method.
Similarly, Representation is easy.
What is the definition of Fixed Point Representation?
A fixed number or a fixed digit has a specific number of bits or digits reserved for the integer part.
A fixed number or a fixed digit has a specific number of bits reserved for the fractional part.
Similarly, Representation is easy.
A fixed number or a fixed digit has a specific number of bits reserved for the integer part.
What is the drawback of Fixed Point Representation?
It creates the loss of range.
A Fixed Point Representation has three parts.
The first part is the sign field.
The second part is the integer field.
The third part is the fractional part.
A Fixed Point Representation has three parts.
Let us see the syntax of a Fixed Point Representation.
The syntax of a Fixed Point Representation is as shown in the box.
The first box indicates the sign field.
The second box indicates the integer field.
The third box indicates the fractional field.
A Fixed Point Representation has three parts.
The first part indicates the sign field.
The second part indicates the integer field.
In the case of a 32-bit register,
how is the number stored in the Fixed Point Representation?
1 bit is used for the sign field.
15 bits is reserved for the integer field.
16 bits is reserved for the fractional field.
In the case of a 32-bit register,
1 bit is used for the sign field.
15 bits is reserved for the integer field.
16 bits is reserved for the fractional field.
0 represents the positive number.
1 represents the negative number.
Let us see an example.
Represent minus 43.625 in 32-bit Fixed Point Representation.
This is minus 43.625.
This is a decimal case.
I have to convert this to binary.
43.625 in binary.
I am not taking the negative value.
What is the binary of 43?
I have given the power of weight.
We need 32 for 43.
What is the value of 8?
It is equal to 40.
42 plus 43 is equal to 0.
The answer is 101011.
This is the previous case of decimal point or binary point.
The value after the binary point is 0.625.
0.625 is multiplied by 2 to represent a fractional part.
1.25 is multiplied by 2 to represent a fractional part.
0.5 is multiplied by 2 to represent a fractional part.
1.0 is multiplied by 2 to represent a fractional part.
The value after the binary point is 101.
We have to convert this to Fixed Point Representation.
How is the format?
We have to reserve 1 bit for the sign.
I have given a box.
I have given 1 bit for the sign.
The sign is minus 43.625.
The sign is 1.
Since it is minus, I have given 1 to represent.
15 bits is the integer part.
15 bits is an integer part.
16 bits is a fractional part.
Here is 15 bits and here is 16 bits.
Here is 32 bits.
The question is how to represent 32 bits.
1 bit for the sign and 15 bits for the integer part.
16 bits for the fractional part.
First, we store the integer part.
for integer portion we get 1 1 0 1 0 1
how many bit is it?
here it is only 6 bit
for 15 bit we can give 9 zeros
1 2 3 4 5 6 7 8 9
now it is 15 bit
16 bit is reserved for fractional portion
fractional portion is 1 0 1
in earlier cases
when we add cases
we take positional weighted to the left of binary point
after binary point we take it to the right
using the same concept
from here we write the integer portion
for fractional portion
decimal point is here
here we are not giving decimal
from here
how do we write the integer portion?
from the binary point
to the left
after binary point
towards right
using the same concept
1 0 1 is the fractional portion
here we need 16 bit
remaining portion is 13 bit
16 bit is remaining
3 bit is filled here
13 bit we can fill with zeros
1 2 3 4 5 6 7 8 9 10 11 12 13
this kind of a question
minus 43.625
32 bit fixed point representation
we have to show like this
I hope you understood this question
next we will see what is floating point representation
second one is floating point representation
it is an alternative method for fixed point representation
the drawbacks of fixed point representation
range, precision
when we get values like this
42.21436
when we get a case like this
41.23
round off
that precision problem
when we get floating point representation
we can overcome
what is floating point representation?
it is an alternative method for fixed point representation
it is based on scientific notation
when we use scientific notation in decimal
how do we write the numbers?
which formula do we use?
plus or minus
that is our sign
mantissa
into
base
base to exponent
like this
in scientific notation
we write something
let us consider an example
6.02 into 10 raise to 23
it is an Avogadro's number
this portion 6.02
portion is
mantissa
this 10 is
base
23 is
exponent
how do we represent scientific notation?
plus or minus mantissa
into base raise to plus or minus exponent
this is an example
next case
1.6 into 10 raise to minus 19
1.6 is mantissa
mantissa
10 is
base
19 is
exponent
in this notation
this is scientific notation
in this way
we represent floating point representation
in this format
we represent scientific notation
in modern computers
or microprocessors
we follow this method
in this
we follow
IEEE
754
method
in any
system
in this method
we represent floating point representation
ok
fixed point representation of a number
consist of
sign, exponent
and mantissa
in this format
plus or minus mantissa
into
base
base raise to exponent
exponent is positive or negative
this is the format
how do we represent
sign, exponent
and mantissa
sometimes it depends on mantissa
next two types
two types of floating point representation
floating
point
representation
first
single precision
single
precision
representation
single precision representation
second double precision
double
precision
representation
ok
IEEE 754
single precision
double precision
single precision
32 bit
register
double precision
64 bit
first
single precision
floating point representation
32 bit
MSB
sign bit
0 is positive
1 is negative
following
8 bits
represent
exponent
represent
remaining
23 bits
represent
fraction
fraction or
mantissa
ok
floating point representation
single precision
32 bit
double precision
64 bit
ok
MSB
sign bit
0 is positive
1 is negative
MSB
sign bit
8 bits
represent
remaining
23 bits
represent
sign bit
1 bit
exponent
8 bits
mantissa
23 bits
ok
0 to 32
0 to 22
23 to 30
exponent
E dash is represented in the pattern of excess 127.
E dash is equal to E plus 127.
We are adding excess 127 in the pattern.
So, we do not have to represent E dash in the exponent portion.
We will understand this when we solve the problem.
The second method is double precision floating point representation.
We are using 64 bit register here.
MSB is the sign bit of double precision floating point representation.
MSB is the sign bit.
If it is 0, it is positive.
If it is 1, it is negative.
11 bit represents the exponent.
52 bit represents the fraction.
52 bit represents the sign bit.
52 bit represents the exponent.
Mantissa is the sign bit.
11 bit represents the exponent.
52 bit represents the fraction.
0 to 51, 52 to 62, 63 to 63.
This is the syntax.
MSB is the sign bit of double precision floating point representation.
MSB is the sign bit.
If it is 0, it is positive.
If it is 1, it is negative.
11 bit represents the exponent.
52 bit represents the fraction.
Let us see a problem based on single precision and double precision.
Express 10011101011.001 in single precision floating point representation and double precision floating point representation.
Let us write it down.
10011101011.001
Let us do it in single precision floating point representation.
I shifted this point to the left.
How many places are there?
1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
I shifted 10 positions to the left.
How can I write this?
1.0011101011001
Into 2 to the power.
How many places are there?
10 places.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
2 to the power 10.
What is E dash?
1 into n.
2 to the power e minus 127.
This is the normalization formula.
E minus 127 is equal to 10.
E is equal to 127 plus 10 which is equal to 137.
Let us find the binary of 137.
1, 2, 4, 8, 16, 32, 64, 128.
What do we get?
We need 128, 8, 136 and 1.
Remaining 0s are 0, 0, 0, 64, 32, 16, 4, 2.
We can write it as 1, 0, 0, 0, 1, 0, 0, 1.
This is in the terms of binary.
We have added the bias.
We have added the excess 127.
We have added a constant bias with the exponent.
We have written it as E dash.
E dash is equal to 127 plus 10.
Let us take that format.
0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0.
Remaining 0s are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23.
This is how we have to represent the question in the single precision floating point representation.
Let us see the double precision format.
In the double precision format, we will add the constant bias.
When we come here, 1 dot EN, the hole rise to 1 dot N into E minus 1, 0, 2, 3.
This is the IEEE 754 floating point standard.
In the previous case, we got the exponent as 10.
That is 2 to the power 10.
E minus 1, 0, 2, 3 equal to 10.
E equal to 1, 0, 3, 3.
Let us find the binary of 1, 0, 3, 3.
What do we get when we do the binary of 1, 0, 3, 3?
We get 1, 0, 0, 0, 0.
1, 0, 0, 0, 0, 0, 0.
1, 0, 0, 1 to the base 2.
Now, let us represent this in our box.
Since the question is positive, what is the sign bit?
It is 0.
Next, what is the exponent E dash?
It is this.
1, 0, 0, 1, 6, 0.
1, 2, 3, 4, 5, 6.
There is a 1 here.
How many bits is this?
11 bits.
This is 1 bit.
Next is the mantissa portion.
This is 52 bits.
We have to give the remaining 0 notation.
Here, 0, 0.
This is what we got earlier.
0, 0, 1, 1, 1.
0, 1, 0, 1, 1.
Give the remaining 0's.
0's.
This is the question in the double precision floating point representation.
Okay.
I hope you understood this case.
What we studied today is the fixed and floating point representation and the problems based on it.
I hope you understood this in two ways.
See you in the next section with a new topic.
Thank you.