Question

In: Computer Science

2. Convert the following decimal fractions to binary with a maximum of six places to the...

2. Convert the following decimal fractions to binary with a maximum of six places to the right of the binary point: [12]

a. 25.84375 b. 57.55 c. 80.90625 d. 84.874023

Solutions

Expert Solution

a. 25.84375 b. 57.55 c. 80.90625 d. 84.874023

a. 25.84375

Decimal Part (need to do division with 2 untill we get qoutient =0)
25/2 ---> remainder = 1 , Quotient = 12
12/2 ---> remainder = 0 , Quotient = 6
6/2 ---> remainder = 0 , Quotient = 3
3/2 ---> remainder = 1 , Quotient = 1
1/2 ---> remainder = 1 , Quotient = 0

Write the remainders in reverse direction.
11001

Fraction Part(need to multiplication with 2 untill both fraction part and decimal part becomes 0)
0.84375 * 2 ---> 1.6875 , fraction = 0.6875 , Integer = 1
0.6875 * 2 ---> 1.375 , fraction = 0.375 , Integer = 1
0.375 * 2 ---> 0.75 , fraction = 0.75 , Integer = 0
0.75 * 2 ---> 1.5 , fraction = 0.5 , Integer = 1
0.5 * 2 ---> 1.0 , fraction = 0.0 , Integer = 1
0.0 * 2 ---> 0.0 , fraction = 0.0 , Integer = 0

Write the integers in normal direction.
110110

Append Fractional part to Decimal part with dot.

25.84375 = 11001.110110
  
b. 57.55

Decimal Part (need to do division with 2 untill we get qoutient =0)
57/2 ---> remainder = 1 , Quotient = 28
28/2 ---> remainder = 0 , Quotient = 14
14/2 ---> remainder = 0 , Quotient = 7
7/2 ---> remainder = 1 , Quotient = 3
3/2 ---> remainder = 1 , Quotient = 1
1/2 ---> remainder = 1 , Quotient = 0

Write the remainders in reverse direction.
111001

Fraction Part(need to multiplication with 2 untill both fraction part and decimal part becomes 0)
0.55 * 2 ---> 1.1 , fraction = 0.1 , Integer = 1
0.1 * 2 ---> 0.2 , fraction = 0.2 , Integer = 0
0.2 * 2 ---> 0.4 , fraction = 0.4 , Integer = 0
0.4 * 2 ---> 0.8 , fraction = 0.8 , Integer = 0
0.8 * 2 ---> 1.6 , fraction = 0.6 , Integer = 1
0.6 * 2 ---> 1.2 , fraction = 0.2 , Integer = 1

We can stop here, since in question it is asked for 6 places.

Write the integers in normal direction.
100011

Append Fractional part to Decimal part with dot.

57.55 = 111001.100011

c. 80.90625

Decimal Part (need to do division with 2 untill we get qoutient =0)
80/2 ---> remainder = 0 , Quotient = 40
40/2 ---> remainder = 0 , Quotient = 20
20/2 ---> remainder = 0 , Quotient = 10
10/2 ---> remainder = 0 , Quotient = 5
5/2 ---> remainder = 1 , Quotient = 2
2/2 ---> remainder = 0 , Quotient = 1
1/2 ---> remainder = 1 , Quotient = 0


Write the remainders in reverse direction.
1010000

Fraction Part(need to multiplication with 2 untill both fraction part and decimal part becomes 0)
0.90625 * 2 ---> 1.8125 , fraction = 0.8125 , Integer = 1
0.8125 * 2 ---> 1.625 , fraction = 0.625 , Integer = 1
0.625 * 2 ---> 1.25 , fraction = 0.25 , Integer = 1
0.25 * 2 ---> 0.5 , fraction = 0.5 , Integer = 0
0.5 * 2 ---> 1.0 , fraction = 0.0 , Integer = 1
0.0 * 2 ---> 0.0 , fraction = 0.0 , Integer = 0

Write the integers in normal direction.
111010

Append Fractional part to Decimal part with dot.

80.90625 = 1010000.111010

d. 84.874023

Decimal Part (need to do division with 2 untill we get qoutient =0)
84/2 ---> remainder = 0 , Quotient = 42
42/2 ---> remainder = 0 , Quotient = 21
21/2 ---> remainder = 1 , Quotient = 10
10/2 ---> remainder = 0 , Quotient = 5
5/2 ---> remainder = 1 , Quotient = 2
2/2 ---> remainder = 0 , Quotient = 1
1/2 ---> remainder = 1 , Quotient = 0


Write the remainders in reverse direction.
1010100

Fraction Part(need to multiplication with 2 untill both fraction part and decimal part becomes 0)
0.874023 * 2 ---> 1.748046 , fraction = 0.748046 , Integer = 1
0.748046 * 2 ---> 1.496092 , fraction = 0.496092 , Integer = 1
0.496092 * 2 ---> 0.992184 , fraction = 0.992184 , Integer = 0
0.992184 * 2 ---> 1.984368 , fraction = 0.984368 , Integer = 1
0.984368 * 2 ---> 1.968736 , fraction = 0.968736 , Integer = 1
0.968736 * 2 ---> 1.937472 , fraction = 0.937472 , Integer = 1

We can stop here, since in question it is asked for 6 places.

Write the integers in normal direction.
110111

Append Fractional part to Decimal part with dot.

84.874023 = 1010100.110111
  
  

Feel free to ask any doubts, if you face any difficulty in understanding.

Please upvote the answer if you find it helpful


Related Solutions

Convert signed integer 0xACE9 to binary and decimal. Convert unsigned integer0xACE9 to binary and decimal.
Convert signed integer 0xACE9 to binary and decimal. Convert unsigned integer0xACE9 to binary and decimal.
Problem: Convert the following binary number to decimal. 1. 110101.101 Problem: Convert the following decimal number...
Problem: Convert the following binary number to decimal. 1. 110101.101 Problem: Convert the following decimal number to fractional binary representation. 1. 103.5625
Convert the following binary number to dotted decimal format. 11000000100110010000100101011001
Convert the following binary number to dotted decimal format. 11000000100110010000100101011001
Convert the decimal number, 315.56 into binary form?
Convert the decimal number, 315.56 into binary form?
Convert 6∘ to radians, correct to 4 decimal places. 6∘= ____________ rad (4 dec. places). Convert...
Convert 6∘ to radians, correct to 4 decimal places. 6∘= ____________ rad (4 dec. places). Convert 4.75 rad to degrees, correct to 4 decimal places. 4.75 rad = ____________ degrees (4 dec. places).   Question b: (2 points) Determine the length of an arc of a circle with radius 6 metres that subtends a central angle of 300∘ to two decimal places. Arc length, s= ____________ m. c A circular wheel of radius 0.55 metres is spinning at a rate of...
Convert from hexadecimal to binary to decimal (PLEASE SHOW WORK) 1. B2 - binary: - decimal:...
Convert from hexadecimal to binary to decimal (PLEASE SHOW WORK) 1. B2 - binary: - decimal: 2. 37 - binary: - decimal: 3. 0A -binary: - decimal: 4. 11 - binary: - decimal:
Convert the following decimal numbers to binary (You may use as many binary digits as necessary)...
Convert the following decimal numbers to binary (You may use as many binary digits as necessary) 25610 246710 102310 2310 710 Convert the following binary numbers to hexadecimal 1101 0010 1101 1111 1100 0101 0010 1001 1000 0000 0000 0001 0001 1000 0000 0000 Given  bits, how many unsigned binary numbers can be represented? Given  bits, how many signed binary numbers can be represented using the two’s compliment method? In the two’s complement method, why is there one more negative number than...
Please convert decimal value -32760 into 2's complement binary value
Please convert decimal value -32760 into 2's complement binary value
1.Convert (FA)16 to decimal 2.Convert (10101110)2 to decimal. 3.Convert (0.10101)2 to decimal.
1.Convert (FA)16 to decimal 2.Convert (10101110)2 to decimal. 3.Convert (0.10101)2 to decimal.
ASAP (Convert decimals to fractions) Write a program that prompts the user to enter a decimal...
ASAP (Convert decimals to fractions) Write a program that prompts the user to enter a decimal number and displays the number in a fraction. Hint: read the decimal number as a string, extract the integer part and fractional part from the string, and use the Rational class in Listing 13.13 to obtain a rational number for the decimal number. Use the template at https://liveexample.pearsoncmg.com/test/Exercise13_19Test.txt for your code. Sample Run 1 Enter a decimal number: 3.25 The fraction number is 13/4...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT