posts - 293 , comments - 426 , trackbacks - 0

My Links

News

View Steve Michelotti's profile on LinkedIn

Twitter












Tag Cloud

Archives

Post Categories

My Online Presence

Computer Arithmetic - Binary for Decimal Numbers

 

This may be of use to someone else doing this course…

The Problem

In the section on Computer Arithmetic it gives an example of converting -7.6875 to IEEE floating point format. I understand all the steps except for the first one, where it does the following...

7.6875 (base 10) = 111.1011 (base 2)

I don't understand the conversion - I realize that 111 (base 2) = 7 (base 10), but how does the .6875 part relate to the .1011? Or am I totally off track with this?

The Solution

The fractional part of the decimal to binary conversion is done as follows:

0.6875 x 2 = 1.375 = 0.375 + 1 (Keep the 1 separate)

0.375 x 2   = 0.75   = 0.75    + 0

0.75 x 2    = 1.5      = 0.5      + 1

0.5 x 2     = 1.0       = 0.0       + 1

The bit pattern of 0s and 1s on the right-hand side gives you the fractional part.

So 0.6875 (base 10) = .1011 (Base 2)

See also Stallings, chapter 19.

Print | posted on Wednesday, March 21, 2012 7:41 AM | Filed Under [ UNISA COS 2621 Computer Organization ]

Feedback

Gravatar

# re: Computer Arithmetic - Binary for Decimal Numbers

.6875 to 1011 (base 2)

0.6875 * 2 = 1.375
0.375 * 2 = 0.75
0.75 * 2 1.5
0.5 * 2 = 1


Anyone with past papers and solution, please email to sedigeng@diarough.co.bw
4/23/2013 12:28 PM | sedigeng
Post A Comment
Title:
Name:
Email:
Comment:
Verification:
 
 

Powered by: