This preview shows page 1. Sign up to view the full content.
Unformatted text preview: liar with Boolean operations. Operation Result
¼½½¼½¼¼½ ¼½¼½¼½¼½ ˜ ˜ & | ˆ Problem 2.6 Solution: [Pg. 37] ½¼¼½¼½½¼ ½¼½¼½¼½¼ ¼½¼¼¼¼¼½ ¼½½½½½¼½ ¼¼½½½½¼¼ This procedure relies on the fact that E XCLUSIVE -O R is commutative and associative, and that ˆ ¼ for any . We will see in Chapter 5 that the code does not work correctly when the two pointers x and y are equal, that is, they point to the same location. B.2. REPRESENTING AND MANIPULATING INFORMATION
Step Initially Step 1 Step 2 Step 3 *x ˆ ˆ
´ 693 *y ´ ˆ µ ˆ ´ ˆ µ ˆ ˆ µ ˆ ´ ˆ µ ˆ Problem 2.7 Solution: [Pg. 38] Here are the expressions: A. x | ˜0xFF B. x ˆ 0xFF C. x & ˜0xFF These expressions are typical of the kind commonly found in performing low-level bit operations. The expression ˜0xFF creates a mask where the 8 least-signiﬁcant bits equal 0 and the rest equal 1. Observe that such a mask will be generated regardless of the word size. By contrast, the expression 0xFFFFFF00 would only work on a 32-bit machi...
View Full Document
- Spring '10
- The American