79. OCR A Level (H046-H446) SLR13 - 1.4 Floating point binary part 1 - Overview
Summary
TLDRThis video is the first in a series explaining floating point binary representation. It begins with an 8-bit binary number line, illustrating how integers and fractions are represented. The video then transitions to fixed point binary, where the binary point's position is fixed, limiting the range of numbers that can be stored. To overcome this, floating point binary is introduced, where the binary point 'floats', allowing for a trade-off between the size and accuracy of numbers. The video explains the division of bits into the mantissa (value) and exponent (binary point position), crucial for storing real numbers in binary. Examples are provided to demonstrate how numbers are converted from floating point binary to decimal.
Takeaways
- π In floating point binary, the position of the binary point can change, allowing for the representation of both large and small numbers with varying degrees of precision.
- π’ The binary number line's place values double as you move from right to left, which is different from unsigned binary or two's complement.
- π The most significant bit (leftmost bit) in floating point binary represents whether a number is negative or positive.
- π To represent fractions, the number line is extended to the right, with place values halving as you move from left to right.
- π« Fixed point binary has a limited range of numbers it can store accurately, as some bits are used for the fractional part of the number.
- π The method of changing the position of the binary point to increase accuracy or range is known as floating point binary.
- πΎ Storing a number in floating point binary requires splitting the bits into the mantissa (the actual value) and the exponent (the position of the binary point).
- π The number of bits used for the mantissa and exponent is determined by the data type, such as 24 bits for the mantissa and 8 for the exponent in a 32-bit single precision number.
- β The exponent in floating point binary is stored in two's complement, which indicates how many places to move the binary point.
- π Moving the binary point to the right increases the size of the number, while moving it to the left decreases the size but can increase precision.
Q & A
What is the significance of the most significant bit in an 8-bit binary number representing a negative number?
-In an 8-bit binary number representing a negative number, the most significant bit, which is the leftmost bit, must be a 1. This bit indicates that the number is negative.
How is the number 6.5 represented in fixed point binary format?
-The number 6.5 is represented in fixed point binary format as 0011 0100. This representation includes a one in the four and two column (which equals six), plus a one in the half column, resulting in 6.5.
What is the largest positive number that can be stored in an 8-bit format using fixed point binary?
-The largest positive number that can be stored in an 8-bit format using fixed point binary is 01111111, which equals 15.875 when calculated as 8 + 4 + 2 + 1 + 0.5 + 0.25 + 0.125.
Why can't the fraction 'a third' be accurately stored in the given fixed point binary format?
-The fraction 'a third' cannot be accurately stored in the given fixed point binary format because the binary representation of a third (0.333...) would repeat infinitely, and the format does not allow for infinite precision.
How does the floating point binary system allow for a trade-off between the size and accuracy of numbers?
-The floating point binary system allows for a trade-off between the size and accuracy of numbers by adjusting the position of the binary point. More bits can be allocated to the fractional part for higher accuracy, or to the whole number part for a larger range of values.
What are the two parts that the bits in a floating point binary number are split into, and what do they represent?
-The bits in a floating point binary number are split into two parts: the mantissa, which represents the actual value of the number, and the exponent, which represents the position of the binary point within the number.
How many bits are used for the mantissa and exponent in a 32-bit single precision floating point number?
-In a 32-bit single precision floating point number, 24 bits are used for the mantissa and 8 bits for the exponent.
What does the exponent in a floating point binary number indicate?
-The exponent in a floating point binary number indicates how many places to move the binary point within the mantissa to determine the actual value of the number.
How is the position of the binary point determined in a floating point binary number?
-The position of the binary point in a floating point binary number is determined by the exponent. The binary point starts after the most significant bit in the mantissa and is moved to the right or left based on the value of the exponent.
What is the significance of backfilling zeros in the mantissa of a floating point binary number?
-Backfilling zeros in the mantissa of a floating point binary number is significant because it allows for the adjustment of the binary point's position without changing the value of the number. It is permissible as numerically, zeros are not significant.
Outlines
π‘ Introduction to Floating Point Binary
This segment introduces the concept of floating point binary representation in a three-part series. It explains the binary number line, highlighting the difference between unsigned binary and two's complement systems. The significance of the most significant bit in representing negative numbers is discussed. The video uses an 8-bit example to demonstrate how to represent whole numbers and fractions, such as 6.5 and 3.75, in binary. The concept of fixed point binary is introduced, where the position of the binary point is fixed, and the limitations in the range of numbers that can be represented are discussed. The example of representing a third (0.333) is used to show the inaccuracy that can occur with fixed point representation. The video concludes by discussing the need for a more flexible system to increase accuracy, hinting at the floating point binary system.
π Exploring Floating Point Binary
This part of the video delves deeper into floating point binary representation. It explains how the binary point can 'float' to increase the size or accuracy of the number being represented. The trade-off between the range of numbers and their precision is discussed, using examples to show how the binary point's position affects the number's size and accuracy. The segment introduces the concept of the mantissa and exponent in floating point binary, explaining how the bits are split to represent the number's value and the position of the binary point. The video uses examples to demonstrate how to convert floating point binary numbers into decimal, emphasizing the importance of the exponent in determining the binary point's final position. The examples illustrate how the mantissa and exponent work together to represent numbers like 6, 1.75, and 0.125 in floating point binary.
π Understanding the Storage of Fractions in Computers
The final segment of the video focuses on how computers store fractions or real numbers using floating point binary. It explains the process of moving the binary point based on the exponent and how to disregard the exponent after determining the point's position. The video uses a negative exponent example to show how the binary point is moved to the left, and how zeros are backfilled to complete the number. The segment concludes by posing a key question to the viewer: how does a computer store fractions or real numbers? This question is meant to reinforce the understanding of floating point binary representation and its importance in computer science.
Mindmap
Keywords
π‘Floating Point Binary
π‘Binary Number Line
π‘Mantissa
π‘Exponent
π‘Two's Complement
π‘Fixed Point Binary
π‘Place Values
π‘Most Significant Bit (MSB)
π‘Precision
π‘Data Type
Highlights
Introduction to floating point binary in a three-part series.
Explanation of 8-bit binary number line with place values doubling to the left.
Differentiation between unsigned binary and two's complement for representing negative numbers.
Representation of the number six in binary as 00000110.
Extension of the number line for fractional components, halving place values to the right.
Binary representation of 6.5 as 001101000.
Binary representation of 3.75 as 00011110.
Storing negative numbers with fractional components using the most significant bit.
Binary representation of -6.5 as 110001100.
Definition and example of fixed point binary with a fixed position for the binary point.
Limitation in the range of numbers storable in fixed point binary due to fractional part usage.
Challenge of accurately representing fractions like a third in fixed point binary.
Introduction to floating point binary with a floating binary point for increased flexibility.
Trade-off between number size and accuracy in floating point binary representation.
Explanation of mantissa and exponent in floating point binary to store the number and binary point position.
Example of storing the number 110001 in floating point binary with 5 bits for mantissa and 3 for exponent.
Conversion process from floating point binary to base 10 using the mantissa and exponent.
Handling of negative exponents in floating point binary and their effect on binary point movement.
Final example demonstrating the storage of 0.125 in floating point binary with negative exponent.
Summary of how floating point binary allows for dynamic adjustment of number size and accuracy.
Transcripts
this video is part one in a three-part
series on floating point binary
in this video we provide an overview of
the topic
[Music]
look at this 8-bit binary number line
note how the place values double as we
move right to left
unlike unsigned binary with two's
complement the leftmost bit the most
significant bit
always represents a negative number
so the number six would be represented
as zero zero zero zero
zero one one zero that's a one in the
four column
plus a one in the two column four plus
two is six
to store numbers with a fractional
component such as six point five
we extend the number line from left to
right
note how the place values now half as we
move from left to right
we place a binary point between the 1
and the half
using this format 6.5 will be
represented as 0 0
1 1 zero one zero zero
so that's a one in the four and two
column four plus two is six
plus a one and a half column for six
point five
the number three point seven would be
represented as zero zero zero one
one one one zero so a two plus a one
is three plus a half is three point five
plus a quarter is three point seven five
we can also easily store negative
numbers with a fractional component
using this format
remember if this is a negative number
the most significant bit that's the
leftmost bit must be a 1.
so using this format minus 6.5 will be
represented as 1
1 0 0 1 1 0 0 that's minus 16
plus an 8 bring it up to 8 plus a 1
bringing us up to 7 plus a half bringing
us up to
minus 6.5
this method of storing is known as fixed
point binary
as the position of the point is fixed on
the number line
note that the range of numbers we can
now store is more limited
as some positions on the number line are
now being used to store
the fractional part of the number
biggest positive number we could now
store in this eight bit format
is zero one one one one one
one an eight plus a four plus a two plus
a one
plus a half quarter and an eighth or
15.875
now you may have spotted that some
numbers
can't be stored accurately at all
so looking at the format we've got on
the screen now how would you store
a third
well the best we could manage in this
format would be zero
zero zero zero zero zero one zero
which represents a quarter or 0.25
not a third however it's the closest we
can get
in this format
we could extend the number line to allow
for more fractional parts
and therefore more accuracy but the
pattern just repeats
one zero one zero one zero and it
actually repeats forever
we can't actually ever represent a third
precisely
to increase accuracy we can change
the way we use the binary point
while we're still using eight bits to
store the number here the eight bits on
the number line
change
to put it another way the binary point
is floating
up and down the number line
in this example we're using 8 bits from
-8 to 1 16 4 bits for the whole number
and 4 bits for the fractional component
in this example we're still using 8 bits
but this time the numbers from -64
down to a half so we're using seven bits
for the whole number
and only one bit for the fractional part
note how the size of the number we can
store has increased
but that's at the cost of reduced
accuracy
and in this example we're still using
eight bits
from minus four but this time all the
way down to one thirty second
that's three bits for the whole number
and a whole five bits for the fractional
part
so the size of the number we can store
has now really decreased
but we can now store it with a much
higher degree of accuracy
or precision
now the important takeaway here is that
the binary point is
moving it's floating up and down the
number line
as it does we can use more or fewer bits
to store the fractional component
and this is known as floating point
binary
the big advantage of this approach with
just eight bits is we can either choose
to increase the size of the number
or the accuracy of the number
now it may not have escaped or noticed
that with floating point binary
we've actually introduced a new problem
along with the actual number which we
need to store in binary
we also need to store the position of
the binary point
on the number line
we do this by splitting the bits into
two parts
the mantissa which is going to represent
the actual value of the number itself
and an exponent the position of the
binary point
within that number the number of bits
used for mantis for an exponent is
determined by the data type
a 32-bit single precision number uses 24
bits for the mantissa
and 8 for the exponent giving 24 bits of
precision
now in the exam the number of bits used
for mantissa for an exponent will always
be stated
in this example we're going to have five
bits for mantissa
and three for the excellent
so let's look at an example of a number
being stored in floating point binary
we're going to go with zero one one zero
zero
zero one one with the first five bits
for mantissa
and the last three bits for the exponent
to convert this into base 10 dna we
first have to look at the exponent as
this is going to tell us
where the binary point is going to need
to end up
note that the binary point always starts
after
the most significant bit in the mantissa
between the first two digits but that's
not
where it's going to end up we're going
to move it
based on this exponent
so we start by converting the exponent
now note
the most significant bit is representing
negative four because we store it in
two's complement
so our exponent is three we've got a one
in the two column
and a one in the one column two plus one
is three
so our exponent of three is telling us
we need to move the binary point in our
mantissa
three places to the right we move it to
the right
because the exponent is positive
now we're finished with the exponent now
all it was doing was storing how many
places to move the binary point
now we've moved it we can ignore it so
we're now left with the number
not one one naught point naught
we apply the normal binary waiting line
and add up
any columns that have a one in them
again note the most significant bit is
representing minus eight not positive
because we're using two's complement so
we've got a one in the four column and a
one in the two
four plus two is six so that's what this
actual number
was representing the dna value six
okay let's have another look at another
example again eight bits
five for the mantissa and three for the
exponent this number is zero one one one
zero
zero zero one
now our exponent is one that's all we've
got here nothing in the two column
nothing in the minus four
so it tells us to move the binary point
in the mantissa
one place to the right positive exponent
moves the binary point to the right
finished with the exponent so we
disregard it and we end up with the
number zero one
point one one zero we apply the normal
binary waiting line
and add up any columns with a one in we
have a one
plus a half plus a quarter so this
number
is 1.75
okay in this final example we're going
to use a negative exponent so again 8
bits
5 for the mantissa three for the
exponents the full number
zero one zero zero zero one one zero
so we start by working out the exponent
the exponent is
minus two minus four plus two is minus
-2
so we need to move the binary point in
our mantissa
two places to the left this time because
it's a negative
exponent now we can't easily move the
binary point off the left of this screen
visually so we're just going to slide
the bits across two places which serves
the same purpose
we can now disregard the exponent and we
end up with
zero point zero zero one zero zero zero
we apply the normal binary waiting line
and add up the columns with a one
all we've got is a one in the eighth
column so this number was naught
point one two five note how we had to
backfill for a couple of zeros to make
the number work
this is allowed as numerically zeros are
not significant
if the number is positive we can always
backfill with zeros as needed
if the number is negative we backfill
with ones as needed instead
having watched this video you should be
able to answer the following key
question
how does a computer store fractions or
real numbers
[Music]
you
Browse More Related Video
Data Representation - Mantissa And Exponents Part 3 - (A Level Computer Science Made Easy (A2) )
AS & A Level Computer Science (9618) - Chapter 16: ADVANCED Data Representation
ECAP268 - U01L04 - Fixed point and floating point representation
[Part 1] Unit 2.1 - Binary Numbers
3. CAMBRIDGE IGCSE (0478-0984) 1.1 Converting between number systems - Part 1
Floating Point Numbers: IEEE 754 Standard | Single Precision and Double Precision Format
5.0 / 5 (0 votes)