Question: Suppose you are implementing an Ada compiler, and must support arithmetic on 32-bit fixed-point binary numbers with a programmer-specified number of fractional bits. Describe the
Suppose you are implementing an Ada compiler, and must support arithmetic on 32-bit fixed-point binary numbers with a programmer-specified number of fractional bits. Describe the code you would need to generate to add, subtract, multiply, or divide two fixed-point numbers. You should assume that the hardware provides arithmetic instructions only for integers and IEEE floating-point. You may assume that the integer instructions preserve full precision; in particular, integer multiplication produces a 64-bit result. Your description should be general enough to deal with operands and results that have different numbers of fractional bits.
Step by Step Solution
3.37 Rating (169 Votes )
There are 3 Steps involved in it
Suppose we wish to compute c a op b Suppose further that f a f b and fc are the scaling factors for a b and c respectively That is for any x the natur... View full answer
Get step-by-step solutions from verified subject matter experts
