1. [10] Given the declarations: signed char x = 0x05, y = 0x0A, z = 0x2F; // we are using 1 byte = 8 bits Evaluate each of the following. Give the answers as two hexadecimal characters a) -9 b) x - y c) x \^ y d) (x << 2) & z e) (x \^ y) | (~z) 2. [10] Suppose we are using a machine with that uses 7 bits to store a float value with 3 bits for the exponent, in the manner of the IEEE 754 standard. (Hint: the bias would be 3) Do either: Decode: 1100110 OR Encode 3.25$_{10}$ Circle your choice, show work below.
Added by Virginia M.
Close
Step 1
The binary representation of -9 is 11110111. Converting this binary number to hexadecimal, we get F7. b) x-y Subtracting y from x, we get 0x05 - 0x0A = -5. Converting -5 to hexadecimal, we get FB. c) x^y Performing the XOR operation between x and y, we get 0x05 Show more…
Show all steps
Your feedback will help us improve your experience
Ct Turner and 65 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Given x and y: char x = 0xad; unsigned y = 0xad; Evaluate the following C expressions. Answer using hexadecimal notation: x << 3: x >> 2: y >> 2:
Akash M.
Answer the following questions in terms of the machine language described in Appendix C. a. Write the instruction 2304 (hexadecimal) as a string of 16 bits. b. Write the op-code of the instruction B2A5 (hexadecimal) as a string of 4 bits. c. Write the operand field of the instruction B2A5 (hexadecimal) as a string of 12 bits.
Convert the following 32-bit binary string into hexadecimal: 10110001 01101000 11010100 10010111 Write your answer as a string of eight hex characters, no spaces.
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD