Question: Consider the following C functions: int fun1 (unsigned word) { return (int) ((word < < 24) > 24); } int fun2(unsigned word) { return

Consider the following C functions: int fun1 1(unsigned word) return (int) ((word << 24) >> 24); int fun2 (unsigned word) { return ((int) word << 24)24; Assume these are executed on a machine with a 32-bit word size that uses twos-complement arithmetic. Assume also that right shifts of signed values are per- formed arithmetically, while right shits of unsigned values are performed logically. Fill in the following table showing the effect of these functions for several example arguments You should input your answers using hexadecimal representation including any leading zeros (eg. 0x00...). fun1(1) fun2(w) 549 0x000000c9 OxEDCBA987

Consider the following C functions: int fun1 (unsigned word) { return (int) ((word < < 24) > 24); } int fun2(unsigned word) { return ((int) word < < 24) 24%3; } Assume these are executed on a machine with a 32-bit word size that uses two's- complement arithmetic. Assume also that right shifts of signed values are per- formed arithmetically, while right shifts of unsigned values are performed logically. Fill in the following table showing the effect of these functions for several example arguments. You should input your answers using hexadecimal representation including any leading zeros (e.g. Ox00...). w fun1(1) fun2(w) Ox000000c9 OXEDCBA987

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

w fun1w fun2w 0x00000076 0x00000076 0x00000076 0x00CDEFEF 0x000000ef 0xffffffef 0x1234569C 0x0... 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 Accounting Questions!