In: Computer Science
x=61,y=73 compute x+y and x-y in8-bit 2's complement system, then convert the answer to decimal
2's Compliment addition and subtraction:
1) Convert the given numbers to 8 bit binary values.
2) Convert those binary numbers to 2's complimant.
-->First we have to convert the number to 1's compliment. To find the 1's compliment we have to make all the zeroes as 1's and all the 1's as 0's.
-->Then add 1 to the the obtained binary number. That becomes the 2's compliment.
we have to note that 2's compliment is used to represent the negative numbers.
3) Now addition and subtraction of the numbers will done using the above results.
The values of addition of numbers as follows.
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0 here we get the carry as 1 and we have to add that carry to left counted values.
we also have know that 1 + 1 + 1 = 1 and here the carry is 1. We use this in some situations where we get a carry.
4) From the above values, we can add the binary numbers.
5) Now we have to convert the obtained to decimal numbers from binary.
--> To convert from binary to decimal, we use place values of binary and adds them to get the relavant decimal number for the binary numbers.
6) Now we can cross check the result by adding the previous decimal values and the result that we got after the conversion from binary to decimal are same.
The above are the anwers for the question given and steps are noted there in the above answer in an order.
Hope the above is helpful. Please feel free to comment if any queries in the
comment section. I will try to solve them as soon as possible.
Do an up vote. Thank you...