Consider the following C functions: int fun1 (unsigned word) { return (int) ((word < < 24)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
w fun1w fun2w 0x00000076 0x00000076 0x00000076 0x00CDEFEF 0x000000ef 0xffffffef 0x1234569C 0x0... View the full answer
Related Book For
Posted Date:
Students also viewed these accounting questions
-
Fill in the following table of values: 6 4 3 23 6 tan sec
-
Your portfolio had the values in the following table for the 4 years listed. Calculate your average return over the 4-year period. Beginning Value ($) 50,000.00 55,000.00 58,000.00 65,000.00 Year...
-
Fill in the blanks in the following table of GDPstatistics: 2005 2006 2007 13,843 Nominal GDP 12,434 Real GDP 11,003 11,319 GDP deflator 116.6 119.7
-
Please graphically demonstrate the effects on the level of prices and the value of money if consumers increase their spending due to stock market boom and therefore make more transactions. On the...
-
What is a spontaneous process? Give three examples of spontaneous processes. Give three examples of nonspontaneous processes.
-
Determine the missing amount for each of thefollowing: Assets = Liabilities + Owner's Equity a. X $25,000+ $71,500 b. $82,750 + 15,000 . 37,000 17,500 +
-
Andrew Reitz established a trust in 2000, naming his sons, James and John, as sole beneficiaries and himself as trustee. Upon Andrews death, Hal Rachal Jr., the attorney who drafted the trust, became...
-
Gallatin Carpet Cleaning is a small, family-owned business operating out of Bozeman, Montana. For its services, the company has always charged a flat fee per hundred square feet of carpet cleaned....
-
Oxygen gas having a volume of 1250 cm 3 at 43.1 C and 1.04 x 10 5 Pa expands until its volume is 1900 cm 3 and its press is 1.08 x 10 5 Pa. Find: (a) the number of moles of oxygen present and (b) the...
-
Should Grand Central Publishing continue to bid for Dewey, wait for the scheduled auction with several interested publishers, or pull out of the race? Why? 2. What is the role of authors, agents, and...
-
G is negotiating an acquisition of K. The tentative agreed upon value is $27 per share (all cash offer) for K's stock. You work for the investment banking firm representing G. You have compiled the...
-
Briefly describe and discuss your understanding of the phrase garbage in, garbage out.
-
Describe the addition law for events that are mutually exclusive and events that are not.
-
Which of the following is X in regression analysis? a. control variable b. dummy variable c. independent variable d. both a and c
-
When using regression, an error is also called a. an intercept. b. a prediction. c. a coefficient. d. a residual.
-
Descriptive analytics a. involves the use of optimisation methods. b. is concerned with the study and consolidation of historical data. c. is mainly used to predict future trends. d. none of the...
-
The network paradigm emphasises the role of linkages and relationships in the international process. Group of answer choices True False
-
Proposals have been made to ?sail? spacecraft to the outer solar system using the pressure of sunlight, or even to propel interstellar spacecraft with high-powered, Earth-based lasers. Sailing...
-
During the 1980s, the size of the federal government debt became so large that servicing the interest payments became a significant portion of total federal expenditure. In response, many...
-
Using Figures 17-2 and 17-3 as a guide, assume a price-setting monopolist firm with no fixed costs and constant marginal cost (MC0) of $3.00 faces an original demand curve P = 10 - 0.1Y. In Figures...
-
Discuss how the Feds monetary policy from 200204 fueled the housing bubble and how its change in policy from mid-2004 to mid-2006 contributed to the bursting of the housing bubble.
-
Mexico has labor laws that specify a daily (rather than hourly) minimum wage. In 2018, the daily minimum wage in Mexico was about 103 pesos per day, and the exchange rate between Mexican pesos and...
-
In 2017, an estimated 7.7 million Mexican-born immigrants were employed in the United States. a. If 60 percent of the Mexican-born immigrants remitted money to family members in Mexico in 2017, and...
-
A mathematical approximation called the rule of 70 tells us how long it will take for something to double in size if it grows at a constant rate. The doubling time is approximately equal to the...
Study smarter with the SolutionInn App