1. Show how you would do the following sum in binary (make sure to convert to binary first and give the result in both binary and base 10): 63+125
2. How many binary sequences are there of length n?
3. What is two’s complement and why is it used?
1.
Answer :
63 = 111111
125 = 1111101
Sum = 111111 + 1111101 = 010111100
2.
Answer :
2^n
Explanation :
At each position of the string there can only be two possibilities, i.e., 0 or 1. Therefore, the total number of permutation of 0 and 1 in a string of length N is given by 2*2*2*… (N times), i.e., 2^N.
3.
Two's complement is a mathematical operation on binary numbers, and is an example of a radix complement. It is used in computing as a method of signed number representation. The two's complement of an N-bit number is defined as its complement with respect to 2N; the sum of a number and its two's complement is 2N.
Two's complement allows negative and positive numbers to be added together without any special logic. ... This means that subtraction and addition of both positive and negative numbers can all be done by the same circuit in the cpu.
Get Answers For Free
Most questions answered within 1 hours.