The document explains logical binary shifts, focusing on their definitions, operations, and effects on binary numbers. It details the processes of logical left and right shifts, illustrating how they correspond to multiplication and division by powers of 2. Additionally, it highlights important notes regarding data loss and the distinction between logical and arithmetic shifts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views9 pages
Logical Binary Shifts Presentation
The document explains logical binary shifts, focusing on their definitions, operations, and effects on binary numbers. It details the processes of logical left and right shifts, illustrating how they correspond to multiplication and division by powers of 2. Additionally, it highlights important notes regarding data loss and the distinction between logical and arithmetic shifts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9
Logical Binary Shifts
Cambridge IGCSE Computer Science
(0478) By: [Syeda Ghana Mumtaz ] Learning Objectives • - Understand what logical shifts are. • - Differentiate between left and right logical shifts. • - Learn how logical shifts affect binary numbers. • - Understand the relationship between shifts and multiplication/division by powers of 2. What is a Binary Shift? • - A binary shift moves bits left or right in a binary number. • - Used in low-level programming and data manipulation. • - Two main types: • - Logical shifts • - Arithmetic shifts (not covered in this presentation) Logical Left Shift • - Moves all bits to the left. • - A 0 is added on the right end. • - The leftmost bit is discarded. • - Example: • - Before: 0010 (2) • - After 1 left shift: 0100 (4) • - Note: Left shift by 1 = Multiply by 2 Logical Right Shift • - Moves all bits to the right. • - A 0 is added on the left end. • - The rightmost bit is discarded. • - Example: • - Before: 0100 (4) • - After 1 right shift: 0010 (2) • - Note: Right shift by 1 = Divide by 2 (ignores remainders) Summary Table • Operation | Example (4-bit) | Result | Decimal Change • ------------------|-----------------|--------|-------------- -- • Left Shift (×2) | 0011 (3) | 0110 | 6 • Right Shift (÷2) | 0100 (4) | 0010 | 2 Important Notes • - Logical shifts do not keep the sign (used for unsigned numbers). • - Arithmetic shifts are used for signed numbers (covered elsewhere). • - Shifting too far may result in data loss (bits pushed out are lost). Practice Questions • 1. What is the result of a logical left shift on 0001? • 2. What is the result of a logical right shift on 1000? • 3. Why does a left shift multiply the number? Thank you! • Questions?