Fixed point binary numbers
Objectives Draw a distinction between integers and numbers with a fractional part in a computer context. Describe how an unsigned denary number with a fractional part is represented in fixed-point form in binary.
Numbers A whole number is called an integer Integers are great because they can easily be converted to binary But… it’s generally accepted at some stage fractional numbers will occur For example 7 divide by 3 will equal This becomes more of a challenge
Negative numbers!! Once again we use the magic numbers but this time we are going to add a decimal place and some fractions. The other side of the decimal place we have to use fractions and half each time Lets have a go at converting First step is to do the whole number conversion Then do the fraction side /21/41/81/ NOTE You will only ever be asked to convert up to 4 decimal place
Fraction Conversion So it’s fairly standard thing to know that ½ = 0.5 ¼ = 0.25 But a little more difficult after that Binary fractionFractionDecimal Fraction 0.11/ / / / /
Fixed point binary numbers There are other ways of representing fractional numbers but you don’t need to know about these yet! The advantage of fixed point is that it is exactly the same as integer arithmetic, making processing faster The disadvantage is that it has limited range
Time to try Convert the following to fixed point binary 2.75 Convert the following, assuming 4 bits after the point: