BINARY TOPIC 01 – DECIMAL NUMBERS IN
BINARY LESSON NOTE SCIENTIFIC NOTATION FOR BASE 10 You
have seen numbers expressed in their scientific notation (SN) form. Let's
consider the SN of the number 4238 in base 10. 423810 = 4 x 1000 + 2 x 100 + 3 x
10 + 8 x 1 And
we can also write the above with powers 423810 = 4 x 103 + 2 x
102 + 3 x 101 + 8 x 100 Of
course, the powers all have a base of 10 because we are in base 10. Let's
consider the SN of the number 1100 1011 in base 2.
We
can also express decimal numbers using scientific notation. 48.732510 = 4 x 10 + 8 x 1 + 7 x 0.1
+ 3 x 0.01 + 2 x 0.001 + 5 x 0.0001 or
using powers 48.732510 = 4 x 101 + 8 x
100 + 7 x 10-1 + 3 x 10-2 + 2 x 10-3
+ 5 x 10-4
Let's
consider the SN of the number 1010.0111 in base 2 We
will start with powers this time and then use decimal numbers.
CONVERTING DECIMAL
NUMBERS FROM BASE 2 TO BASE 10 Example – Convert 110.1012 to base 10. Solution: Of course, we can simply ignore the zeros giving us this:
And instead of powers, we can use actual numbers giving us this:
And since all multiplications are by 1, we can just add the numbers
up.
THE
CHART APPROACH The following chart approach is a quick way of converting from base 2
to base 10 and works the same way as the above scientific notation approach.
We simply place the binary number at the top and add up the powers
that line up with the 1s. The powers
can also be replaced by their actual value. Example – Convert the
number 10001.0112 to base 10.
Therefore, the answer is 16 + 1 + 0.25 + 0.125 = 17.375 CONVERTING
DECIMAL NUMBERS FROM BASE 10 to BASE 2 To convert decimal numbers from base 10 to base 2, we simply apply the
chart method from above in reverse order. Example – Convert the
number 11.87510 to base 2. The largest power of 2 that is smaller then
11.875 is 8. So we will start
there. We aren't sure how long our
chart has to be though so we will end it with … for now and extend it if
necessary.
Let's get started.
STEP 2 – There is no 4 in 3.875.
So we add a 0 above the 4. UPDATE – This is how the chart looks like so far with the added
material shown in red:
STEP 5 – We continue is the same way.
There is 0.5 in 0.875. So we
add a 1 above 0.5 in the chart and remove that from our number leaving us
with 0.375. STEP 6 – There is 0.25 in 0.375.
So we add a 1 over 0.25 and that leaves us with 0.125. The final result in the chart is as follows:
The answer is 1011.111. INFINITE
DECIMAL EXPANSIONS It is important to note that numbers that have finite decimal
expansions in base 10 do not necessarily have finite decimal expansions in
base 2. Example – Convert 0.110 to base 2.
STEP 1 – The value 1 goes into 0.1 zero times. So we put 0 above the 1.
STEP 6 – The value 0.03125 goes into 0.0375 one time. So we put 1
above 0.03125 and we are left with 0.00625. UPDATE – Here is the chart so far:
STEP 9 – The value 0.00390625 goes into 0.00625 once. So we put a 1 over 0.00390625 and we are
left with 0.00234375. So, so far we have 0.00011001 and we are not done. And, the numbers are getting messy to work
with. It turns out that the decimal expansion is the following: 0.00011001100110011001100110011001100110011001100110011001100110...
|