Binary Arithmetic And Shifts (yr 11) Flashcards
How do you perform binary addition?
Add corresponding binary digits using the rules: 0+0=0, 1+0=1, 1+1=10 (carry 1), 1+1+1=11 (carry 1, write 1). Handle overflow if the result exceeds bit size.
What is an overflow error in binary?
An overflow occurs when a result is too large to be stored in the allocated number of bits. This can lead to data loss or incorrect values.
What is a binary left shift and its effect?
Shifting bits to the left multiplies the number by 2 for each shift, but may cause loss of data in the leftmost bit.
What is a binary right shift and its effect?
Shifting bits to the right divides the number by 2 for each shift (discarding remainders), potentially losing precision.
Why are binary shifts used in computing?
Binary shifts are used for efficient multiplication and division by powers of 2 and for certain low-level operations like encryption or graphics processing.