This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ndian machine. This program should run on any machine, regardless of its word size. Homework Problem 2.33 [Category 2]: Write a C expression that will yield a word consisting of the least signiﬁcant byte of x, and the remaining bytes of y. For operands x 0x89ABCDEF and y 0x76543210, this would give 0x765432EF. Homework Problem 2.34 [Category 2]: Using only bit-level and logical operations, write C expressions that yield 1 for the described condition and 0 otherwise. Your code should work on a machine with any word size. Assume x is an integer. A. Any bit of x equals 1. B. Any bit of x equals 0. C. Any bit in the least signiﬁcant byte of x equals 1. D. Any bit in the least signiﬁcant byte of x equals 0. Homework Problem 2.35 [Category 3]: Write a procedure int_shifts_are_arithmetic() that yields 1 when run a machine that uses arithmetic right shifts for int’s and 0 otherwise. Your code should work on a machine with any word size. Test your code on several machines. Write and test a procedure unsigned_shifts_are_arithmetic() tha...
View Full Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
- Spring '10
- The American