Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Logical shifts

Write the number 121 in binary. Then


Logical shift left by 2: logical shift right by 3:
0 0 0 0 1 0 0 0 0 1 1 1 1 0 0 1

0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 1

Write the number 17 in binary. Then Write the number 64 in binary. Then
logical shift right by 1: logical shift left by 3:
0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0

0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0

Arithmetic shifts
Arithmetic shift left by 1: 1 1 0 1 0 1 0 1
1 1 0 1 0 1 0 1

1 1 1 1 0 1 0 1
1 0 1 0 1 0 1 0

Write the number 21 in binary. Then


Write the number 200 in binary. Then arithmetic shift right by 4:
arithmetic shift left by 4: 0 0 0 1 0 1 0 1
1 1 0 0 1 0 0 0

0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0

Write the number 133 in binary. Then


Write the number 62 in binary. Then arithmetic shift right by 6:
arithmetic shift right by 2: 1 0 0 0 0 1 0 1
0 0 1 1 1 1 1 0

1 1 1 1 1 1 1 0
0 0 0 0 1 1 1 1

Write the number 253 in binary. Then


arithmetic shift right by 2:
1 1 1 1 1 1 0 1

1 1 1 1 1 1 1 1

Arithmetic shift right by 2:

You might also like