Read the following algorithm: Algorithm for converting a fraction x into binary with p binary places....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Read the following algorithm: Algorithm for converting a fraction x into binary with p binary places. Inputs: fraction x EQ, 0<r<1 and number of places p E N. Outputs: bits b1, b2,..., by such that (0.b1b2... bp)2 is the Method: best approximation to x using p binary places. Initialise: j1, b1, b2,..., bp 0 Loop: if jp+1 stop. x+2x If≥1 [b,1, x+x-1] ==== 5. Can you spot how to j+j+1 Repeat loop (a) Verify that the algorithm converts to 0.110102 when express exactly in repeating binary? (b) Express 0.8510 as accurately as possible with 8 binary places. Read the following algorithm: Algorithm for converting a fraction x into binary with p binary places. Inputs: fraction x EQ, 0<r<1 and number of places p E N. Outputs: bits b1, b2,..., by such that (0.b1b2... bp)2 is the Method: best approximation to x using p binary places. Initialise: j1, b1, b2,..., bp 0 Loop: if jp+1 stop. x+2x If≥1 [b,1, x+x-1] ==== 5. Can you spot how to j+j+1 Repeat loop (a) Verify that the algorithm converts to 0.110102 when express exactly in repeating binary? (b) Express 0.8510 as accurately as possible with 8 binary places. Read the following algorithm: Algorithm for converting a fraction x into binary with p binary places. Inputs: fraction x EQ, 0<r<1 and number of places p E N. Outputs: bits b1, b2,..., by such that (0.b1b2... bp)2 is the Method: best approximation to x using p binary places. Initialise: j1, b1, b2,..., bp 0 Loop: if jp+1 stop. x+2x If≥1 [b,1, x+x-1] ==== 5. Can you spot how to j+j+1 Repeat loop (a) Verify that the algorithm converts to 0.110102 when express exactly in repeating binary? (b) Express 0.8510 as accurately as possible with 8 binary places.
Expert Answer:
Answer rating: 100% (QA)
The algorithm you provided is essentially a binary search algorithm It starts by initializing all bi... View the full answer
Related Book For
Statistics The Exploration & Analysis Of Data
ISBN: 9780840058010
7th Edition
Authors: Roxy Peck, Jay L. Devore
Posted Date:
Students also viewed these programming questions
-
Three Zero Coupon Bonds (ZCB) are issued on the market. They each have face value of 100 and maturity, respectively, of 1 year, 3 years and 4 years. Assume the first bond is sold for 99.01, the...
-
Suppose that, on June 1, Devine Design creates a petty cash fund with an imprest balance of $200. During June, Lucie Chao, the fund custodian, signs the following petty cash tickets: On June 30,...
-
In what must be a common development wherever there are state-sponsored lotteries, this is the story of two friends who split the price of a ticket only to have the ticket win and split their...
-
The following scenarios describe situations faced by hypothetical companies that currently have a centralized organization structure. As you review each of the scenarios, provide your opinion as to...
-
Wood County Hospital consumes 1,000 boxes of bandages per week. The price of bandages is $35 per box, and the hospital operates 52 weeks per year. The cost of processing an order is $15 and the cost...
-
Consider the acceleration of a good sports car in real life . (1) Pick a certain car model, which could be the one you are driving, or the one you wish you were --- and search online for its...
-
The House of Commons Committee of Public Accounts produced a report on the budget for the London 2012 Olympic and Paralympic Games, to investigate the reasons for budget increases announced by the...
-
Quebec Ltd. is a company that manufactures climbing rope for mountaineering and rescue operations. They sell various types of rope to four distributors: Alpine Adventures Corporation (AAC), Mountain...
-
What Is An IPO? https://www.forbes.com/advisor/investing/initial- public-offering-ipo/ IPO Investing Is Exciting, but Experts Warn to Proceed with Caution. Try These Safer Alternatives Instead...
-
In testing controls over cash disbursements, an auditor most likely would determine that the person who signs the check also: A . Is denied access to the supporting documents. B . Approves the...
-
Explain the statement, "Directives get people out of their ruts with the smallest change possible." How does that happen? Give an example. Include at least one scholarly source to support the...
-
To whom it may concern: Good evening, from North Carolina! I hope this message finds you in high and creative energy! So, I have a question that I need someone's assistance on. Can someone help me...
-
Which is NOT true about buying / selling Bitcoins on a centralized exchange (e.g. Coinbase)? You can get better prices than buying / selling on decentralized exchange You can find these transactions...
-
A go-cart track horizontal curve has a long chord (LC) of 2X0.00 feet, and back and forward tangents that intersect with a deflection angle at the PI of 7736'00" Right. Compute the radius of the...
-
In a system with light damping (c < cc), the period of vibration is commonly defined as the time interval d = 2/d corresponding to two successive points where the displacement-time curve touches one...
-
Data from a survey of 1046 adults age 50 and older were summarized in the AARP Bulletin (November 2009). The following table gives relative frequency distributions of the responses to the question,...
-
A certain chromosome defect occurs in only 1 in 200 adult Caucasian males. A random sample of n = 100 adult Caucasian males is to be obtained. a. What is the mean value of the sample proportion p^ ,...
-
According to a Washington Post-ABC News poll, 331 of 502 randomly selected U.S. adults interviewed said they would not be bothered if the National Security Agency collected records of personal...
-
The statement of financial position of A. Barnes and C. Darwin at 31 March 2015 is as follows: The partners share profits and losses: Barnes three-fifths and Darwin two-fifths. At the date of the...
-
Use the Ritz variational method for the harmonic oscillator, with trial wave functions \(\psi_{1}(x)=\) \(e^{-y^{2} / 2}, \psi_{2}(x)=e^{-y^{2}}, \psi_{3}(x)=e^{-2 y^{2}}\), where \(y=x \sqrt{m...
-
Consider a two-level system, with basis \(|1angle,|2angle\), and in this basis, a Hamiltonian with elements \(\left(\begin{array}{ll}1 & 1 \\ 1 & 1\end{array} ight)\). Use the first form of the...
Study smarter with the SolutionInn App