The result is a rather peculiar design with features

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: bits of the product can be computed with the expression x*y, so we only require a procedure with prototype unsigned int unsigned_high_prod(unsigned x, unsigned y); that computes the high-order Û bits of Ü ¡ Ý for unsigned variables. We have access to a library function with prototype: int signed_high_prod(int x, int y); that computes the high-order Û bits of Ü ¡ Ý for the case where Ü and Ý are in two’s complement form. Write code calling this procedure to implement the function for unsigned arguments. Justify the correctness of your solution. [Hint:] Look at the relationship between the signed product derivation of Equation 2.18. Homework Problem 2.41 [Category 2]: Suppose we are given the task of generating code to multiply integer variable x by various different constant factors à . To be efficient we want to use only the operations +, -, and <<. For the following values of à , write C expressions to perform the multiplication using at most three operations per expression. A. B. C....
View Full Document

Ask a homework question - tutors are online