# 10 - Binary Shift

1. What is the purpose of Binary Shifts? Why do we need them?

Binary shifts add or subtract a binary number

Binary shifts multiply or divide a binary number by 2

Binary shifts make a binary number cease to exist

Binary shifts make a binary number shift (physically in time and space)

2. In essence, what is done in a binary shift?

every digit in the number is moved two places because it is binary (2)

every digit in the number is moved one place

every digit in the number is moved 10 places.

every digit in the number is deleted

3. To multiply, the digits are moved:

none of the above

one place to the right

one place to the top

one place to the left

4. To divide, using a binary shift, the digits are moved:

one pace to the left

one place to the very bottom

one place to the right

none of the above

5. When multiplying, if you move all the digits one place to the left, a 0 is inserted in the _______________

rightmost position

leftmost position

topmost position

bottom most position

6. When dividing, the digits are moved and the….

topmost digit is subtracted

topmost digit is doubled

7. True or False: Binary shifts cannot deal with fractions very well. Read the following and fill in the blanks.
```if you are right shifting '111' (7 in decimal) it would become '11'
which is 3 in Decimal. Humans don't mind adding another column to the left
while multiplying but computers may have set sizes for numbers.

A CPU that left shifts a number will often drop the leftmost number,
just like we drop the right most one while shifting.

This can cause issues of _____________________.```

binary overflow

binary maths error

exploding bits

mathematical conjunction

8. Here is an example of a binary shift. Is the 'result' as shown, correct or incorrect?
```Binary Shift Example
=====================
The below number is no. 4 in Decimal. We want to multiply by 2.

Shift every bit to the left by one and insert a zero to the
rightmost bit. The original leftmost bit is discarded.

128   64     32     16    8     4     2    1
=============================================
0     0      0      0     0     1     0    0

Result
======

128   64     32     16    8     4     2    1
=============================================
0     0      0      0     1     0     0    0```

It is correct, because the answer is 8,and 00001000 is the binary for 8

It is incorrect, because it is not possible to add zero to the rightmost bit

It is correct, but it is incorrect to discard the leftmost bit in this case.

It is incorrect, because the answer should be 16

9. What is the result in binary after doing the left shift?
```Binary Shift Example
=====================
The below number is no. 32 in Decimal. We want to multiply by 2.

Shift every bit to the left by one and insert a zero to the
rightmost bit. The original leftmost bit is discarded.

128   64     32     16    8     4     2    1
=============================================
0     0      1     0     0    0    0    0

What is the Result in Binary?
======

128   64     32     16    8     4     2    1
=============================================
?     ?       ?      ?    ?     ?     ?    ?```

11110001

1000000

10000000

11100101

10. If we wish to ______ we shift every bit to the left by one and insert a zero to the rightmost bit. The original leftmost bit is discarded.

multiply

subtract

divide

11. In decimal, you have the number 468, which is 111010100 in Binary. Shift it to the left to multiply by two and what happens?

none of the above

Nothing spectacular. It will work as expected

You would get a result of 110101000 which is 424 - an overflow error has occurred

12. If 9 bits cannot be stored in an 8 bit register an _________ occurs.

overflow

right shift

multiplication

13. Overflow causes a lot of problems in the CPU and to address this a special __________(a single bit within a certain register) is used

nit

flag

nibble

rag

14. In the following example, can you spot the error. We are trying to divide 8 using binary shift.
```The video will help, but you do not need it to answer the question.                                    Binary Shift Example
=====================
The below number is 8 in Decimal. We want to divide by 2.

Shift every bit to the right by one.
The original rightmost bit is discarded.

256   128   64     32     16    8     4     2    1
==================================================
0     0      0     0      0     1     0    0    0

What is the Result in Binary?
=============================
256   128   64     32     16    8     4     2    1
==================================================
0     0     0      0      1    0     0     0    0
```

none of the above

two right shifts were necessary in order for the division to take place

a single right shift has been applied but the result has not been added to another bit of '1'

a single left shift has been applied instead of a single right shift

15. Can you spot the error in this binary shift (division)?

The shift should have been one twice to the left, not right.

The shift should have been just once to the right

The shift should have been one to the right, and the right most bit should not have been discarded but added to 1

There is no error. The calculation and shift has been performed correctly