Question

In: Computer Science

Perform the following arithmetic in Binary assuming 16 bit registers (67)10 + (-89)10 List the values...

Perform the following arithmetic in Binary assuming 16 bit registers

(67)10 + (-89)10

List the values of the status bits: C, V, N and Z

Solutions

Expert Solution

C = 0 (No carry)
V = 0 (No overflow)
N = 1 (Negative)
Z = 0 (Not zero)

Explanation:
-------------
Number: 67
Let's convert this to two's complement binary
67
Since this is a positive number. we can directly convert this into binary
Divide 67 successively by 2 until the quotient is 0
   > 67/2 = 33, remainder is 1
   > 33/2 = 16, remainder is 1
   > 16/2 = 8, remainder is 0
   > 8/2 = 4, remainder is 0
   > 4/2 = 2, remainder is 0
   > 2/2 = 1, remainder is 0
   > 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 1000011
So, 67 of decimal is 1000011 in binary
so, 67 in 2's complement binary is 0000000001000011

Number: -89
Let's convert this to two's complement binary
-89
This is negative. so, follow these steps to convert this into a 2's complement binary
Step 1:
Divide 89 successively by 2 until the quotient is 0
   > 89/2 = 44, remainder is 1
   > 44/2 = 22, remainder is 0
   > 22/2 = 11, remainder is 0
   > 11/2 = 5, remainder is 1
   > 5/2 = 2, remainder is 1
   > 2/2 = 1, remainder is 0
   > 1/2 = 0, remainder is 1
Read remainders from the bottom to top as 1011001
So, 89 of decimal is 1011001 in binary
So, 89 in normal binary is 0000000001011001
Step 2: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   0000000001011001 is flipped to 1111111110100110
Step 3:. Add 1 to above result
1111111110100110 + 1 = 1111111110100111
so, -89 in 2's complement binary is 1111111110100111

Adding 0000000001000011 and 1111111110100111 in binary
    0000000001000011
    1111111110100111
---------------------
 (0)1111111111101010
---------------------
Sum does not produces a carry
So, sum of these numbers in binary is 1111111111101010

Verification:
---------------
sum = 1111111111101010
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   1111111111101010 is flipped to 0000000000010101
II. Add 1 to above result
0000000000010101 + 1 = 0000000000010110
III. Now convert this result to decimal value
Converting 10110 to decimal
10110
=> 1x2^4+0x2^3+1x2^2+1x2^1+0x2^0
=> 1x16+0x8+1x4+1x2+0x1
=> 16+0+4+2+0
=> 22
Answer: -22
This is correct since we can verify that 67+-89 = -22
So, there was no overflow.

Related Solutions

(6 marks- 3 marks each) The following hexadecimal values are shorthand for 16-bit two’s complement binary...
(6 marks- 3 marks each) The following hexadecimal values are shorthand for 16-bit two’s complement binary numbers. Working purely in hex, negate each and then state whether the result is positive or negative. (a) 5E91 (b) D00F 2.
Multiply the following 16 bit signed binary number together Provide a 32bit signed binary answer 0000...
Multiply the following 16 bit signed binary number together Provide a 32bit signed binary answer 0000 0001 0001 0001 1111 1111 1000 0000
1a. Convert 67 (base 10) to 8-bit binary using signed magnitude. Show your work. 1b. Convert...
1a. Convert 67 (base 10) to 8-bit binary using signed magnitude. Show your work. 1b. Convert 69 (base 10) to 8-bit binary using one’s complement. Show your work 1c. Convert 70 (base 10) to 8-bit binary using two’s complement. Show your work. 1d. Convert - 67 (base 10) to 8-bit binary using signed magnitude. 1e. Convert - 67 (base 10) to 8-bit binary using ones compliment. Show your work. 1f. Convert - 67 (base 10) to 8-bit binary using 2s...
1.convert the following numbers from decimal to binary assuming seven-bit twe's complement binary representation: a)49 b)...
1.convert the following numbers from decimal to binary assuming seven-bit twe's complement binary representation: a)49 b) -27 c)0 d) -64 e) -1 f) -2 g) what is the range for this computer as written in binary and in decimal? 2.convert the following numbers from decimal to binary assuming nine-bit twe's complement binary representation: a)51 b) -29 c) -2 d)0 e) -256 f) -1 g ) what is the range for this computer as written in binary and in decimal?
A population consists of the following five values: 10, 14, 15, 16, and 20. List all...
A population consists of the following five values: 10, 14, 15, 16, and 20. List all samples of size 3, and compute the mean of each sample. (Round your mean value to 2 decimal places.) Compute the mean of the distribution of sample means and the population mean. Compare the two values. (Round your answers to 2 decimal places.)
Convert the following values into binary numbers for each word and place the binary values in...
Convert the following values into binary numbers for each word and place the binary values in the two-dimensional array in their proper order of words. Value Binary Number Equivalent Word 0 462,91210 Word 1 1142008 Word 2 5420h Word 3 20,992d Word 4 1104208 Word 5 6102008 Word 6 9F88h Word 7 20,49610 Word 8 502416 Word 9 1101018 Word 10 71082h
1-How is -89 represented using 8-bit two's compliment? (The answer should be 8 binary digits). 2-What...
1-How is -89 represented using 8-bit two's compliment? (The answer should be 8 binary digits). 2-What is 10101100 - 00100100 using 2's compliment arithmetic? (The answer should be 8 binary digits) 3-Assume we are using the simple model for floating-point representation as given in the text (the representation uses a 14-bit format, 5 bits for the exponent with a bias of 15, a normalized mantissa of 8 bits, and a single sign bit for the number):Show how the computer would...
Problem: Perform following operations in binary using 8-bit addition/subtraction/multiplication. 1. −80 + 42 2. −99 −...
Problem: Perform following operations in binary using 8-bit addition/subtraction/multiplication. 1. −80 + 42 2. −99 − 20 3. 60 − 70 4. −59 × 3 5. 52×−1
Write a C++ program to perform two-4 bit binary number operations including addition and subtraction. The...
Write a C++ program to perform two-4 bit binary number operations including addition and subtraction. The user will type in two-4 bit binary numbers with the selection of one of the operations. Then, the program will calculate the result of the calculation. Display two-4 bit binary numbers and the result from the calculation.
Binary Search. Write a MIPS assembly program to perform a binary search on A[10], which is an array of 10 positive integers.
Binary Search. Write a MIPS assembly program to perform a binary search on A[10], which is an array of 10 positive integers. Your program should have a main routine that does the following:(a) Prompt the user to enter all the 10 integers in the array.(b) Prompt the user to enter the number to be searched.(c) Reads the integer values and makes sure it is a positive integer.(d) Prints the index of the integer. If the input is not available in...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT