Question: Consider the following C functions: Assume these are executed as a 32-bit program on a machine that uses twos complement arithmetic. Assume also that right

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.

int funi (unsigned word) { } return (int) ((word < < 24) >> 24); int fun2 (unsigned word) { } return ((int) word < < 24) >> 24;

Step by Step Solution

3.39 Rating (152 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The expressions in these functions are common program idioms for extracting values from ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Systems A Programmers Perspective Questions!