1. Number system
IGCSE Computer Science (0478)
  • Data Representation
    • Introduction
    • Why computers use binary (how binary represents data)
    • Number system
      • Introduction
      • Number Conversions
      • Addition of Binary Numbers
      • Logical binary shifts (positive 8-bit integers)
      • Two’s Complement (Signed: Positive and Negative Numbers)
      • Use of the Hexadecimal System
    • Text, Sound and Image
      • Text, Sound and Images
      • File Types
    • Data storage and File compression
      • Measurement of the Size of Computer Memories
      • Lossless and Lossy File Compression
  1. Number system

Logical binary shifts (positive 8-bit integers)

Logical Binary Shifts (Positive 8-bit Integers)#


Logical Left Shift (<< 1)#

What happens?
Bits move one position to the left.
A 0 is added on the right end.
Effect:
Multiplies the number by 2 (if no overflow occurs).
Example:
0011 0101 (53 in decimal)
Left shift by 1 → 0110 1010 (106 in decimal)

Logical Right Shift (>> 1)#

What happens?
Bits move one position to the right.
A 0 is added on the left end.
Effect:
Divides the number by 2 (integer division, fractional parts dropped).
Example:
0011 0101 (53 in decimal)
Right shift by 1 → 0001 1010 (26 in decimal)

Practice Answers — Logical Binary Shifts#

1.
Shift 0001 1010 left by 2
Step 1: Shift left by 1
0001 1010 → 0011 0100
Step 2: Shift left by 1 again
0011 0100 → 0110 1000
Final result: 0110 1000
Decimal value: 104 (since 64 + 32 + 8 = 104)
2.
Shift 1000 0001 right by 1
Step 1: Shift right by 1
1000 0001 → 0100 0000
Final result: 0100 0000
Decimal value: 64
Modified at 2025-08-11 07:32:29
Previous
Addition of Binary Numbers
Next
Two’s Complement (Signed: Positive and Negative Numbers)
Built with