Question

In: Computer Science

Show ALL work if it is required for the question and BASES 4. Convert the following...

Show ALL work if it is required for the question and BASES

4. Convert the following from Signed Binary to Decimal: (signed)

a. 10011010

b. 01001101

5. 10000001 - 01100110

6. 80D3 + 74C2

Solutions

Expert Solution

4)
a)
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.
   10011010 is flipped to 01100101
II. Add 1 to above result
01100101 + 1 = 01100110
III. Now convert this result to decimal value
Converting 1100110 to decimal
1100110
=> 1x2^6+1x2^5+0x2^4+0x2^3+1x2^2+1x2^1+0x2^0
=> 1x64+1x32+0x16+0x8+1x4+1x2+0x1
=> 64+32+0+0+4+2+0
=> 102
Answer: -102

b)
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
Converting 1001101 to decimal
1001101
=> 1x2^6+0x2^5+0x2^4+1x2^3+1x2^2+0x2^1+1x2^0
=> 1x64+0x32+0x16+1x8+1x4+0x2+1x1
=> 64+0+0+8+4+0+1
=> 77
Answer: 77

5)
convert -01100110 to two's complement
Step 1: flip all the bits. Flip all 0's to 1 and all 1's to 0.
   01100110 is flipped to 10011001
Step 2:. Add 1 to above result
10011001 + 1 = 10011010
Adding 10000001 and 10011010 in binary
    10000001
    10011010
-------------
 (1)00011011
-------------
So, sum of these numbers in binary is 00011011

Verification
---------------
first = 10000001
Converting 10000001 to decimal
10000001
=> 1x2^7+0x2^6+0x2^5+0x2^4+0x2^3+0x2^2+0x2^1+1x2^0
=> 1x128+0x64+0x32+0x16+0x8+0x4+0x2+1x1
=> 128+0+0+0+0+0+0+1
=> 129

second = 10011010
Converting 10011010 to decimal
10011010
=> 1x2^7+0x2^6+0x2^5+1x2^4+1x2^3+0x2^2+1x2^1+0x2^0
=> 1x128+0x64+0x32+1x16+1x8+0x4+1x2+0x1
=> 128+0+0+16+8+0+2+0
=> 154

sum = 00011011
Converting 00011011 to decimal
00011011
=> 0x2^7+0x2^6+0x2^5+1x2^4+1x2^3+0x2^2+1x2^1+1x2^0
=> 0x128+0x64+0x32+1x16+1x8+0x4+1x2+1x1
=> 0+0+0+16+8+0+2+1
=> 27
129+154 must be 283
This is not correct since we can verify that 129+154 not equals 27
So, there was an overflow.
Sum produces a carry of 1. We can ignore that carry.
So, sum of these numbers in binary is 00011011

Verification
---------------
first = 10000001
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.
   10000001 is flipped to 01111110
II. Add 1 to above result
01111110 + 1 = 01111111
III. Now convert this result to decimal value
Converting 1111111 to decimal
1111111
=> 1x2^6+1x2^5+1x2^4+1x2^3+1x2^2+1x2^1+1x2^0
=> 1x64+1x32+1x16+1x8+1x4+1x2+1x1
=> 64+32+16+8+4+2+1
=> 127
Answer: -127

second = 10011010
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.
   10011010 is flipped to 01100101
II. Add 1 to above result
01100101 + 1 = 01100110
III. Now convert this result to decimal value
Converting 1100110 to decimal
1100110
=> 1x2^6+1x2^5+0x2^4+0x2^3+1x2^2+1x2^1+0x2^0
=> 1x64+1x32+0x16+0x8+1x4+1x2+0x1
=> 64+32+0+0+4+2+0
=> 102
Answer: -102

sum = 00011011
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
Converting 11011 to decimal
11011
=> 1x2^4+1x2^3+0x2^2+1x2^1+1x2^0
=> 1x16+1x8+0x4+1x2+1x1
=> 16+8+0+2+1
=> 27
Answer: 27
-127+-102 must be -229
This is not correct since we can verify that -127+-102 not equals 27
So, there was an overflow.

6)
Hexadecimal     Binary
    0           0000
    1           0001
    2           0010
    3           0011
    4           0100
    5           0101
    6           0110
    7           0111
    8           1000
    9           1001
    A           1010
    B           1011
    C           1100
    D           1101
    E           1110
    F           1111
Use this table to convert from hexadecimal to binary
Converting 80D3 to binary
8 => 1000
0 => 0000
D => 1101
3 => 0011
So, in binary 80D3 is 1000000011010011

Converting 74C2 to binary
7 => 0111
4 => 0100
C => 1100
2 => 0010
So, in binary 74C2 is 0111010011000010

Adding 1000000011010011 and 0111010011000010 in binary
    1000000011010011
    0111010011000010
---------------------
 (0)1111010110010101
---------------------
So, sum of these numbers in binary is 1111010110010101

Verification
---------------
first = 1000000011010011
Converting 1000000011010011 to decimal
1000000011010011
=> 1x2^15+0x2^14+0x2^13+0x2^12+0x2^11+0x2^10+0x2^9+0x2^8+1x2^7+1x2^6+0x2^5+1x2^4+0x2^3+0x2^2+1x2^1+1x2^0
=> 1x32768+0x16384+0x8192+0x4096+0x2048+0x1024+0x512+0x256+1x128+1x64+0x32+1x16+0x8+0x4+1x2+1x1
=> 32768+0+0+0+0+0+0+0+128+64+0+16+0+0+2+1
=> 32979

second = 0111010011000010
Converting 0111010011000010 to decimal
0111010011000010
=> 0x2^15+1x2^14+1x2^13+1x2^12+0x2^11+1x2^10+0x2^9+0x2^8+1x2^7+1x2^6+0x2^5+0x2^4+0x2^3+0x2^2+1x2^1+0x2^0
=> 0x32768+1x16384+1x8192+1x4096+0x2048+1x1024+0x512+0x256+1x128+1x64+0x32+0x16+0x8+0x4+1x2+0x1
=> 0+16384+8192+4096+0+1024+0+0+128+64+0+0+0+0+2+0
=> 29890

sum = 1111010110010101
Converting 1111010110010101 to decimal
1111010110010101
=> 1x2^15+1x2^14+1x2^13+1x2^12+0x2^11+1x2^10+0x2^9+1x2^8+1x2^7+0x2^6+0x2^5+1x2^4+0x2^3+1x2^2+0x2^1+1x2^0
=> 1x32768+1x16384+1x8192+1x4096+0x2048+1x1024+0x512+1x256+1x128+0x64+0x32+1x16+0x8+1x4+0x2+1x1
=> 32768+16384+8192+4096+0+1024+0+256+128+0+0+16+0+4+0+1
=> 62869
This is correct since we can verify that 32979+29890 = 62869
So, there was no overflow.
Sum does not produces a carry
So, sum of these numbers in binary is 1111010110010101

Verification
---------------
first = 1000000011010011
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.
   1000000011010011 is flipped to 0111111100101100
II. Add 1 to above result
0111111100101100 + 1 = 0111111100101101
III. Now convert this result to decimal value
Converting 111111100101101 to decimal
111111100101101
=> 1x2^14+1x2^13+1x2^12+1x2^11+1x2^10+1x2^9+1x2^8+0x2^7+0x2^6+1x2^5+0x2^4+1x2^3+1x2^2+0x2^1+1x2^0
=> 1x16384+1x8192+1x4096+1x2048+1x1024+1x512+1x256+0x128+0x64+1x32+0x16+1x8+1x4+0x2+1x1
=> 16384+8192+4096+2048+1024+512+256+0+0+32+0+8+4+0+1
=> 32557
Answer: -32557

second = 0111010011000010
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
Converting 111010011000010 to decimal
111010011000010
=> 1x2^14+1x2^13+1x2^12+0x2^11+1x2^10+0x2^9+0x2^8+1x2^7+1x2^6+0x2^5+0x2^4+0x2^3+0x2^2+1x2^1+0x2^0
=> 1x16384+1x8192+1x4096+0x2048+1x1024+0x512+0x256+1x128+1x64+0x32+0x16+0x8+0x4+1x2+0x1
=> 16384+8192+4096+0+1024+0+0+128+64+0+0+0+0+2+0
=> 29890
Answer: 29890

sum = 1111010110010101
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.
   1111010110010101 is flipped to 0000101001101010
II. Add 1 to above result
0000101001101010 + 1 = 0000101001101011
III. Now convert this result to decimal value
Converting 101001101011 to decimal
101001101011
=> 1x2^11+0x2^10+1x2^9+0x2^8+0x2^7+1x2^6+1x2^5+0x2^4+1x2^3+0x2^2+1x2^1+1x2^0
=> 1x2048+0x1024+1x512+0x256+0x128+1x64+1x32+0x16+1x8+0x4+1x2+1x1
=> 2048+0+512+0+0+64+32+0+8+0+2+1
=> 2667
Answer: -2667
This is correct since we can verify that -32557+29890 = -2667
So, there was no overflow.

Let's convert this sum(1111010110010101) back to hexadecimal
Converting 1111010110010101 to hexadecimal
1111 => F
0101 => 5
1001 => 9
0101 => 5
So, in hexadecimal 1111010110010101 is 0xF595
Answer: 0xF595

Related Solutions

Show ALL work if it is required for the question and BASES 1. What is the...
Show ALL work if it is required for the question and BASES 1. What is the Binary representation of this Decimal? (signed) 115 2. What is the Hexadecimal representation of this Decimal? (signed) 220 3. Convert the following from Signed Decimal to Hexadecimal: (signed) -24
Show ALL work if it is required for the question and BASES 7. Name 3 components...
Show ALL work if it is required for the question and BASES 7. Name 3 components of the CPU and the Buses. Describe what they do. 8. Name 4 essential status flags and describe what they do. 9. Translate this Expression to Assembly: EAX = -val2 + 7 - val3 + val1
4) Interest (Show all of your work!) Find the interest rate required for an investment of...
4) Interest (Show all of your work!) Find the interest rate required for an investment of $10,000 to grow to $15,000 in 5 years if the interest is compounded as follows: a) Annually b) Quarterly 5) Inflation (Show all of your work!) Assuming annual compounding, find the time it would take for the general level of prices, in the economy, to double at the following annual inflation rates: a) 3% b) 8% 6) Time to Double (Show all of your...
Convert 1.8125 to IEEE-754 representation. Show all your work.
Convert 1.8125 to IEEE-754 representation. Show all your work.
Convert 1.8125 to IEEE-754 representation. Show all your work.
Convert 1.8125 to IEEE-754 representation. Show all your work.
Please show all work an explain to be upvoted. Write an assembly program to convert an...
Please show all work an explain to be upvoted. Write an assembly program to convert an 8 character string from upper case to lower case.
Convert the following numbers to floating point and show work. -0.063 65.3
Convert the following numbers to floating point and show work. -0.063 65.3
Please solve all parts of the following question. Please show all work and all steps. 1a.)...
Please solve all parts of the following question. Please show all work and all steps. 1a.) Solve x' = x + 3y + 2t y' = x - y + t^2 1b.) Solve x' + ty = -1 y' + x' = 2 1c.) Solve x' + y = 3t y' - tx' = 0
You are required to show all work, which will include completing the following steps: Determine your...
You are required to show all work, which will include completing the following steps: Determine your null and alternative hypotheses (see Slide 11) Set up a table (see Slide 10)Compute the estimated variance of the difference scores (see Slide 14) Compute the standard error of the mean difference (see Slide 15) Compute the t obtained (see Slide 16) Identify the t critical using the charts provided in class (see Slide 17) Compare the t obtained to the t critical to...
Please answer all parts of the question. Please show all work and all steps. 1a.) Show...
Please answer all parts of the question. Please show all work and all steps. 1a.) Show that the solutions of x' = arc tan (x) + t cannot have maxima 1b.) Find the value of a such that the existence and uniqueness theorem applies to the ivp x' = (3/2)((|x|)^(1/3)), x(0) = a. 1c.) Find the limits, as t approaches both positive infinity and negative infinity, of the solution Φ(t) of the ivp x' = (x+2)(1-x^4), x(0) = 0
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT