Consider the following C functions: Assume these are executed as a 32-bit program on a machine that

Question:

Consider the following C functions:int funi (unsigned word) { } return (int) ((word < < 24) >> 24); int fun2 (unsigned word) { } return ((int)Assume these are executed as a 32-bit program on a machine that uses two’s complement arithmetic. Assume also that right shifts of signed values are performed arithmetically, while right shifts of unsigned values are performed logically.

A. Fill in the following table showing the effect of these functions for several example arguments. You will find it more convenient to work with a hexadecimal representation. Just remember that hex digits 8 through F have their most significant bits equal to 1.W 0x00000076 0x87654321 0x000000C9 OxEDCBA987 fun1 (w) fun2 (w)B. Describe in words the useful computation each of these functions performs.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems A Programmers Perspective

ISBN: 9781292101767

3rd Global Edition

Authors: Randal E. Bryant, David R. O'Hallaron

Question Posted: