CSC231 Exercises on Signed Numbers
--D. Thiebaut 14:21, 6 October 2010 (UTC)
Contents
Problem #1
- what is the 8-bit representation of the following decimal numbers in signed magnitude, 1's complement, and 2's complement?
0 1 -1 11 -11 127 -127 128 -128
Problem #2
- Convert the following signed, 2's complement 16-bit binary numbers to their decimal equivalent.
0000 0000 0000 0001 1000 0000 0000 0001 0000 0000 1111 1111 1111 1111 1111 1111
Problem #3
- Perform the binary addition of the following decimal numbers using 2's complement, and assuming the numbers are 16-bit words
- (for reference, 23 decimal = 10111 binary, 100 decimal = 1100100 binary)
23 - 100 = 23 - 23 = 100 - 23 =
Problem #4: Interview Question
- What can you tell us about this byte: 0100 0001?
- What can you tell us about this one: 1000 0000?
Problem #5: Range
- We have an application that requires working with very small integers, that will always be between -100 and +100. Can we use a byte to represent them?