Logical and arithmetic shifts (Edexcel GCSE Computer Science): Flashcards

📚Flashcards
Logical and arithmetic shifts
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

15 cards from this deck

Show

What do bit shifts do to binary patterns?

Move all digits left or right by specified positions

Two common uses of bit shifts

Efficient multiplication/division & bit manipulation

Logical shift left: what fills right spaces

0s

Logical shift left: what happens to leftmost bits

Discarded when pushed off edge

Logical shift right: what fills left spaces

0s

Logical shift right: what happens to rightmost bits

Discarded when they fall off edge

Arithmetic shift right: key difference from logical

Fills left with MSB value instead of 0s

What does MSB stand for?

Most Significant Bit

MSB's role in signed binary numbers

Represents the sign (positive or negative)

How arithmetic shift left differs from logical

It doesn't - they work exactly the same

What can happen to precision when shifting numbers

Loss of information/precision

General effect of left shifts on values

Multiply by powers of 2

General effect of right shifts on values

Divide by powers of 2

0001 0100 logical shift left by 2

0101 0000

1011 1000 logical shift right by 3

0001 0111

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.