1.Find the 2’s complement of 11111011. What is the decimal value of it
2.Find A-B using 2’s complement if A=1010 and B=11100
3. A) What is the range of numbers in a 4-bit machine if unsigned integer format is used.
B) What is the smallest and largest number when 2’s complement format is used.
Q1)
2's Complement of 11111011 = 00000101
In 2's complement if MSB Bit is 0 Then Number is Positive and If MSB is 1 the Number is negative
Decimal Value of = 00000101 = + 5
Q2)
In 2's complement we represent negative Number by taking 2's complement of its positive value .
A - B = A + 2's Complement of B
A= 01010
B = 2's Complement ( 11100) = 00100
Now add Both
01010
+00100
----------
01110
Result is 01110 = +14
This is how we can do the Subtraction using 2's complement .
Q3)
Part A
in 4 bits we have number ranging from 0000 to 1111
So 0000 = + 0
and 1111 = + 15
Hence we get Range as 0 - 15
Part B)
In 2's Complement form we have range [−2N−1, 2N−1 − 1] where N is Number of bits
Here N = 4
- 2^4-1 = -2^3= -8 ,
2^4-1 -1 = 2^3 -1 = 8-1 = 7
Hence Range is -8 To 7
This is how we can solve each problem
Thank You
If u like the answer then do Upvote it and have any doubt ask in comments
Get Answers For Free
Most questions answered within 1 hours.