Question

In: Computer Science

1. Assuming A equals the binary value 10101010 and B equals the binary value 11110000, the...

1.

Assuming A equals the binary value 10101010 and B equals the binary value 11110000, the result of the bitwise-OR of A with B is?

Just enter the 8-bit binary number that represents the result of the operation. Do not add any spaces, decimal points, commas, or base-2 subscript. Do not delete leading zeros.

2.

Assuming A equals the binary value 10101010 and B equals the binary value 11110000, the result of the bitwise-XOR of A with B is?

Just enter the 8-bit binary number that represents the result of the operation. Do not add any spaces, decimal points, commas, or base-2 subscript. Do not delete leading zeros.

3.

Assuming A equals the binary value 11110000, the result of the bitwise inverse of A is?

Just enter the 8-bit binary number that represents the result of the operation. Do not add any spaces, decimal points, commas, or base-2 subscript. Do not delete leading zeros.

Solutions

Expert Solution

What are Bitwise operators :

Bitwise operators perform functions bit-by-bit on either one or two binary numbers. They make use of boolean logic operating on a group of binary symbols. These bitwise operators are widely used throughout both electronics and programming.

Bitwise Operators(AND,OR,XOR) are used to perform bit manipulation operations on one or two full binary numbers. Bitwise operation uses boolean logic operation on a group of binary symbols.

1. BITWISE-OR:


OR produces union of two numbers, If either or both bits are 1, the value of the result at that bit-position is 1. If both values have a 0 at that position, the result also gets a 0 at that position.
the four possible OR combinations, and their outcome are:

0 OR 0 = 0
0 OR 1 = 1
1 OR 0 = 1
1 OR 1 = 1

Based upon above logic,

For A = 10101010 and B = 11110000, Result of Bitwise-Or will be: 11111010

Explanation:
   A OR B
Bit 8: 1 OR 1 = 1
Bit 7: 0 OR 1 = 1
Bit 6: 1 OR 1 = 1
Bit 5: 0 OR 1 = 1
Bit 4: 1 OR 0 = 1
Bit 3: 0 OR 0 = 0
Bit 2: 1 OR 0 = 1
Bit 1: 0 OR 0 = 0

2. BITWISE-XOR:

XOR mean exclusive OR. XOR is like OR but it only produce a 1 if either one or the other numbers has a 1 in that bit-position.

The four possible XOR combinations, and their outcome are:

0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0

For A = 10101010, B= 11110000, Result of Bitwise-XOR will be: 01011010

Explanation:
   A XOR B
Bit 8: 1 XOR 1   = 0
Bit 7: 0 XOR 1 = 1
Bit 6: 1 XOR 1 = 0
Bit 5: 0 XOR 1 = 1
Bit 4: 1 XOR 0 = 1
Bit 3: 0 XOR 0 = 0
Bit 2: 1 XOR 0 = 1
Bit 1: 0 XOR 0   = 0

3. BITWISE INVERSE:

If the current bit is set i.e. 1 than invert it to 0 and vice versa

The possible outcome:

1 = 0
0 = 1

For A = 11110000, Result Bitwise inverse will be: 00001111


Related Solutions

Assuming the degrees of freedom equals 27, select the t value from the t table.
Assuming the degrees of freedom equals 27, select the t value from the t table.
​a) The critical value of t for a 99% confidence interval with df equals=88. ​b) The...
​a) The critical value of t for a 99% confidence interval with df equals=88. ​b) The critical value of t for a 90​% confidence interval with df equals=107.
Which of the following is wrong? a)The p-value is a probability. b)The p-value is calculated assuming...
Which of the following is wrong? a)The p-value is a probability. b)The p-value is calculated assuming that the null hypothesis is true. c)The p-value is the probability that H0 is true. d)The p-value can be different for different samples in the same test.
Assuming that P equals .60 and the sample size is 1,000, what is the probability of...
Assuming that P equals .60 and the sample size is 1,000, what is the probability of observing a sample proportion that is at least .64.
Question 1. The DDM model assumes that the value of a share of stock equals the...
Question 1. The DDM model assumes that the value of a share of stock equals the present value of its expected future cash receipts. The elements of the computation are: Dividend one year hence: D(1) = €3, Stock price one year hence: P(1) = €24 and Annual risk adjusted discount rate:1 k = 12.5%. Question 2. The Blue Dog Company has common stock outstanding that has a current price of $20 per share and a $0.5 dividend. Blue Dog’s dividends...
A binary call option pays $1 at expiry if the value of the underlying asset is...
A binary call option pays $1 at expiry if the value of the underlying asset is greater than the strike price, and $0 otherwise. The current interest rate is 3% pa. (a) Calculate the return R over one month. (b) Calculate all state prices at expiry for a ten-step binomial model where each time step is one month and the underlying asset is S=20, K=19, u=1.090, d=0.9173. That is, calculate all λ(10, j) for j = 0, 1, . ....
A firm's assets have a beta of 1.0. Assuming that the debt beta equals 0.0 and...
A firm's assets have a beta of 1.0. Assuming that the debt beta equals 0.0 and that there are no taxes, calculate the firm's equity beta under the following assumptions: a. The firm's capital structure is 100% equity. b. The capital structure is 20% debt and 80% equity. c. The capital structure is 40% debt and 60% equity. d. The capital structure is 60% debt and 40% equity. e. The capital structure is 80% debt and 20% equity. Do you...
1. Value the following scenario, assuming there is no end to the timeline and the following...
1. Value the following scenario, assuming there is no end to the timeline and the following data: Cost of equity = 17.75% Cost of debt = 6.83% Debt = $583MM Equity = $1237MM Tax rate = 40% Long-term growth expectations = 3.6% Future dividends are forecast as follows: Year 0: n/a Year 1: 128 Year 2: 149 Year 3: 162 Year 4: 175 Year 5: 182 (Round your answer to the nearest cent) 2. Use the data below to compute...
Total asset cost plus depreciation expense equals book value. Select one: a. TRUE b. FALSE
Total asset cost plus depreciation expense equals book value. Select one: a. TRUE b. FALSE
For a consumer to maximize utility? A Price equals marginal cost B Marginal Utility equals marginal...
For a consumer to maximize utility? A Price equals marginal cost B Marginal Utility equals marginal benefit C Marginal benefit equals total utility D Price equals marginal benefit
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT