Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the result for the following initial conditions and operations: x = 101010

ID: 3619870 • Letter: W

Question

Write the result for the following initial conditions and operations:

x = 10101011
y = 11101001


output1 = ~x;
output2 = ~y;

What is the value of output1?
What is the value of output2?

Shift operations


In binary, these variables are 8 bits:

M = 01010101
N = 01101011


What is the result of the shifts in 8-bits?


M >> 5
N >> 2
M << 2
N << 1

If the result of the shifts are held in 16-bit variables,
what are the results:

M << 6
What are the results of the following shifts?

1 >> 1
2 >> 1
2 >> 2
n >> n


Write the result for the following initial conditions and operations:

x = 10101011
y = 11101001


output1 = ~x;
output2 = ~y;

What is the value of output1?
What is the value of output2?
Shift operations


In binary, these variables are 8 bits:

M = 01010101
N = 01101011


What is the result of the shifts in 8-bits?


M >> 5
N >> 2
M << 2
N << 1

If the result of the shifts are held in 16-bit variables,
what are the results:

M << 6 What are the results of the following shifts?

1 >> 1
2 >> 1
2 >> 2
n >> n

Explanation / Answer

please rate - thanks Shift operations


In binary, these variables are 8 bits:

M = 01010101
N = 01101011


What is the result of the shifts in 8-bits?


M >> 5          shift right 5    00000010
N >> 2          shift right 2     00011010
M << 2         shift left 2       01010100
N << 1        shift left 1         11010110

If the result of the shifts are held in 16-bit variables,
what are the results:

M << 6       M before shift 00000000 01010101    What are the results of the following shifts?
assuming 16 bit variables
1 >> 1        before 00000000 00000001 after shift 00000000 00000000
2 >> 1      before 00000000 00000010 after shift 00000000 00000001
2 >> 2        before 00000000 00000010 after shift 00000000 00000000
n >> n       N from above? 00000000 01101011 after shift 00000000 00000000