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

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?
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.
1. Convert to binary and hexadecimal (PLEASE SHOW WORK) a. 35 - binary: - hexadecimal: b....
1. Convert to binary and hexadecimal (PLEASE SHOW WORK) a. 35 - binary: - hexadecimal: b. 85 - binary: - hexadecimal: c. 128 - binary: - hexadecimal: d. 4563 - binary: - hexadecimal:
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.
Provide an algorithm that solves the following problem: input: a binary heap B, an integer value...
Provide an algorithm that solves the following problem: input: a binary heap B, an integer value x output: all keys in B that are smaller than x Constraint: your algorithm must run in time O(K), where K is the number of keys output. Explain why your algorithm has the required runtime behaviour. (Use pseudocode or C++, or any informal (but clear) description. You are free to choose any kind of representation of binary heaps, as long as it was mentioned...
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 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...
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, . ....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT