Exam code: 9618
1/180Still learning
Know0
Define binary shift.
A binary shift is an operation that moves all the bits in a binary number left or right by a certain number of positions.

Join for free to unlock a full flashcard set, track what you know,
and turn revision into real progress.
What are binary shifts often used for?
Fast multiplication or division by powers of 2, or for manipulating individual bits.
Name the three main types of binary shift.
Logical, arithmetic and cyclic.
Was this flashcard helpful?
Define binary shift.
A binary shift is an operation that moves all the bits in a binary number left or right by a certain number of positions.
What are binary shifts often used for?
Fast multiplication or division by powers of 2, or for manipulating individual bits.
Name the three main types of binary shift.
Logical, arithmetic and cyclic.
What does a logical shift fill the gap with, and what is it used for?
It fills the gap with 0s, and is used for unsigned binary numbers or raw bit manipulation.
What is 0000 1110 after a logical left shift of 2, in binary and denary?
0011 1000, which is 56 — the original 0000 1110 is 14, and each left shift doubles it.
What is 1100 1000 after a logical right shift of 3, in binary and denary?
0001 1001, which is 25 — the original 1100 1000 is 200, and each right shift halves it.
What does an arithmetic right shift preserve, and why?
It copies the sign bit (MSB) into the new leftmost bit, so that signed numbers in two's complement keep their sign.
What is 1110 1000 after an arithmetic right shift of 3, in binary and denary?
1111 1101, which is −3 — the original 1110 1000 is −24, and each arithmetic right shift divides by 2.
How does an arithmetic left shift differ from a logical left shift?
It does not differ — an arithmetic left shift is the same as a logical left shift, shifting left with a 0 coming in.
What happens to the bits in a cyclic shift?
The bits are rotated around — nothing is lost and no 0s are added — because the bit that falls off one end is reused at the other end.
What is 1011 0001 after a cyclic left shift of 3, in binary and denary?
1000 1101, which is 141 — the three leftmost bits 101 wrap around to the right side.
Cyclic shifts do preserve the sign bit, and are not equivalent to multiplying or dividing by powers of two.
Cyclic shifts do not preserve the sign bit, and are not equivalent to multiplying or dividing by powers of two.
Define bit masking.
Bit masking uses binary patterns (masks) to test, set, clear or toggle specific bits without affecting the others.
What is bitwise AND used for in device control?
To test whether a specific bit is set to 1, since it only returns 1 when both the value and the mask have 1 in the same position — useful for checking a device's status.
What is bitwise OR used for in device control?
To set specific bits to 1, since it returns 1 if either the value or the mask has 1 — useful for turning a device on without changing the others.
What is bitwise XOR used for in device control?
To toggle or flip specific bits, since it returns 1 if the bits are different — useful for switching a device from ON to OFF or back.
How can a single byte represent the state of several devices?
Each bit in the byte can represent the state of a device or feature, such as a light being on, a sensor being active, or an error being flagged.
True or False?
Applying a mask with bitwise AND changes the bits that the mask has 0s in.
False.
Masking tests, sets or toggles the targeted bits without affecting the others — an AND with a 0 in the mask simply returns 0 for that position, leaving the value untested there rather than altering the original.
By signing up you agree to our Terms and Privacy Policy