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

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...
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.)
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...
Assume the following list of keys: 78, 40, 16, 82, 64, 67, 57, 40, 37, 47,...
Assume the following list of keys: 78, 40, 16, 82, 64, 67, 57, 40, 37, 47, 72, 14, 17, 27, 55 This list is to be sorted using the quick sort algorithm as discussed in this chapter. Use pivot as the median of the first, last, and middle elements of the list. What is the pivot? Give the resulting list after one call to the partition function.
Q6. Perform the following operations using bit masking. (a) Set the bit 3 of a byte...
Q6. Perform the following operations using bit masking. (a) Set the bit 3 of a byte data (b) Clear the bit 5 of a byte data (c) Toggle the bit 7 of a byte data (d) Check the bit 0 of a byte data
Design a program which uses functions to sort a list and perform a binary search. Your...
Design a program which uses functions to sort a list and perform a binary search. Your program should: Iinitialize an unsorted list (using the list provided) Display the unsorted list Sort the list Display the sorted list. Set up a loop to ask the user for a name, perform a binary search, and then report if the name is in the list. Use a sentinel value to end the loop. Do not use the Python built in sort function to...
1) Covert the following binary values to decimal. Do this interpreting the binary as unsigned and...
1) Covert the following binary values to decimal. Do this interpreting the binary as unsigned and signed. a. 0111 1001 b. 1000 0000 c. 1111 1111 PLEASE EXPLAIN IT IN DETAIL
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT