DATA STORAGE AND MANIPULATION
Download the Lessonotes Mobile Ghana app for faster lesson access on Android and iPhone.
Subject: Computing
Class: SHS 3
Term: 1st Term
Week: 4
Grade code: 3.1.1.LI.2
Strand code: 1
Sub-strand code: 1
Content standard code: 3.1.1.CS.1
Indicator code: 3.1.1.LI.2
Theme: COMPUTER ARCHITECTURE & ORGANISATION
Subtheme: DATA STORAGE AND MANIPULATION
This page supports the lesson note with a companion video and a short classroom-ready summary.
For class groups and homework, share this lesson page so learners also get the summary, objectives, and full lesson context.
Welcome, learners! Today, we are going deep inside the "brain" of the computer—the Central Processing Unit (CPU). We will explore some of the quickest and most clever tricks the CPU uses to perform calculations. These tricks are called bit shifting and bit rotation. Why should you care about this? Every time you edit a photo on your phone, listen to digital music, or even send a secure message on WhatsApp, these super-fast operations are working behind the scenes. They are the secret ingredients that make our digital world fast and efficient. Understanding them helps us appreciate how computers perform complex tasks using very simple, fundamental actions.
At its core, a computer's CPU only understands binary (0s and 1s). All data—numbers, text, images, sound—is stored as a sequence of bits in memory locations called registers. Bitwise operations are actions that the CPU performs directly on these individual bits. They are incredibly fast because they are built directly into the computer's hardware.
Today, we focus on two main types: Shift and Rotation operations. We will use 8-bit registers for our examples, as this is a common size. A. Shift Operations
A shift operation moves every bit in a register one or more positions to the left or right. The bit that is "pushed out" is lost, and a new bit is "pushed in" on the other side. There are two main families of shifts: Logical and Arithmetic. Logical Shift
Logical shifts treat the number as a simple sequence of bits, without any special meaning. They are used for unsigned integers (positive whole numbers). Logical Shift Left (LSL) Action: All bits are shifted one position to the left. The Most Significant Bit (MSB, the leftmost bit) is discarded. A 0 is inserted into the Least Significant Bit (LSB, the rightmost bit) position. Mathematical Effect: Each single LSL multiplies the number by 2. Shifting left by *n* positions is equivalent to multiplying by 2ⁿ.