Question
4. Perform the following operations on x = 0xA5 and y = 0x2C (answer in hex): (a) x & y (b) x && y (c)
4. Perform the following operations on x = 0xA5 and y = 0x2C (answer in hex): (a) x & y (b) x && y (c) ~x & !(y | (x ^ y)) 5. Perform the following shift operations on the byte x = 0xB9 (answer in hex): (a) x << 3 (b) x >> 1, logical (c) x >> 3, arithmetic 6. Write out and sum the non-zero powers of two for the two functions shown. Express output in decimal: (a) B2U5(0x2E) (b) B2T5(0x2E) 7. Apply the function T2U5 to the two following decimal values. Express the answer as a decimal number. (a) -7 (b) 12 8. Assuming an 8-bit machine that uses 2s complement arithmetic, apply the appropriate casting and express the result as a relational value (true or false): (a) -127 == 127U (b) -127-1U == 127 (c) -1U < 128U (d) 255U == -128
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started