Data Operations
TOC
Logic Operations
- Example: 23, 11
Shift Operations
- Example: 15, -15
Questions
- Let X and Y be 39 and 127 respectively. Both are 8-bit unsigned numbers.
- Apply 1-bit logical/arithmetic left/right shift on X and Y. Show the process in binary format.
- Apply NOT, AND, NAND, OR, NOR, XOR, and XNOR on X and Y. Show the process in binary format.
- Show the results of problem 1. Conditions are the same, except that both numbers are now signed.
Arithmetic Operations
- Integer: 2’s complement
- Float: Sign and magnitude
- 1’s complement
Questions
- Show the following processes in binary format:
- 8-bit integer:
- 102 + 23
- -23 + 3
- -163 - 134
- IEEE 754:
- 34.75 + 23.125
- -34.75 + 23.125
- 34.75 - 23.125
- -34.75 - 23.125
- 8-bit integer: