- 2070 Bhadra · 2 marks
2's complement: 42 − 115
Short answer
42 = 00101010, 115 = 01110011 (8-bit). 2's complement of 115 = 10001101. Sum: 00101010 + 10001101 = 10110111, no carry. Magnitude from 2's complement is 01001001 = 73, result −73.
Perform the subtraction using 2's complement method: 42(10) − 115(10)
We compute 42 − 115 using 8-bit numbers.
- 42 = 00101010
- 115 = 01110011
- 1's complement of 115 = 10001100; add 1: 2's complement = 10001101.
- Add to 42:
00101010 (42)
+ 10001101 (2's complement of 115)
----------
10110111
- There is no carry out of the MSB, so the result is negative.
- Magnitude = 2's complement of 10110111 = 01001000 + 1 = 01001001 = 64 + 8 + 1 = 73.
Answer: 42 − 115 = −73
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- 2's complement subtraction; AND using NOR · Basic Electronics Engineering, chapter 6
- 2's complement: 15 − 20 · Basic Electronics Engineering, chapter 6
- Number conversions (122)10 to BCD etc. · Basic Electronics Engineering, chapter 6 · asked 3×
- Number conversions (903)10 to BCD etc. · Basic Electronics Engineering, chapter 6 · asked 3×
- Half adder/subtractor; 1's and 2's complement subtraction · Digital Logic, chapter 5
- (10.001)₂ − (11.101)₂ by 2's complement · Digital Logic, chapter 5
- 39 to Gray/Excess-3 and 2's complement addition · Digital Logic, chapter 1
- Gray→BCD, decimal→Excess-3 and 2's complement addition · Digital Logic, chapter 1