Binary shifts move all bits left or right by a specified number of positions. (a) Perform each shift operation on the 8-bit binary number and state the resu...

Assessment: Computer Science (9-1) 0984 | Paper 2 Mock 01 | Algorithms, Programming and Logic Subject: Computer Science (9-1) - 0984

Question 1 Report

Binary shifts move all bits left or right by a specified number of positions.

(a) Perform each shift operation on the 8-bit binary number and state the result. [4]

Original (denary)Original (binary)ShiftResult (binary)Result (denary)
1200001100Left shift by 1
1200001100Left shift by 2
1200001100Right shift by 1
1200001100Right shift by 2

(b) State the effect of a left shift by 1 on the denary value. [1]

(c) State the effect of a right shift by 1 on the denary value. [1]

(d) Explain what happens to the denary value when you left-shift the binary number 10000000 by 1 in an 8-bit system. [2]

(e) State the relationship between a left shift by N positions and multiplication. [2]

(f) Convert the denary number 156 to binary. Show your working. [2]

(g) Convert the binary number 11010110 to hexadecimal. Show your working. [2]

(h) Perform binary addition of 01101011 and 00110101. Show the carry row and identify whether overflow has occurred. [3]

(i) Explain why hexadecimal is used as a shorthand for binary in computing. [2]

(j) Convert the hexadecimal values 3F, A2 and 1B to denary. Show your working for each. [1]

Answer Details

(a) Binary shift operations on 00001100 (denary 12). [4]

Original (denary)Original (binary)ShiftResult (binary)Result (denary)
1200001100Left shift by 10001100024
1200001100Left shift by 20011000048
1200001100Right shift by 1000001106
1200001100Right shift by 2000000113

Left shifts move bits towards the most significant end and fill vacated positions with 0. Right shifts move bits towards the least significant end, discarding bits that fall off the right.

(b) A left shift by 1 doubles (multiplies by 2) the denary value: 12 becomes 24. [1]

(c) A right shift by 1 halves (integer division by 2) the denary value: 12 becomes 6. [1] Any fractional part is lost.

(d) Left-shifting 10000000 by 1 pushes the leading 1 beyond the 8-bit boundary. [2] The result is 00000000 (denary 0). The original value (128) is lost because the only set bit has been shifted out of the available storage. This is a form of overflow.

(e) A left shift by N positions is equivalent to multiplying the number by \(2^N\). [2] For example, left shift by 3 multiplies by \(2^3 = 8\). Similarly, a right shift by N divides by \(2^N\) (with truncation).

(f) Converting 156 to binary by repeated division by 2: [2]

DivisionQuotientRemainder
156 / 2780
78 / 2390
39 / 2191
19 / 291
9 / 241
4 / 220
2 / 210
1 / 201

Reading remainders from bottom to top: 10011100.

(g) Converting 11010110 to hexadecimal: [2]

Split into nibbles: 1101 and 0110.

  • 1101 = D (8+4+0+1 = 13)
  • 0110 = 6 (0+4+2+0 = 6)

Hexadecimal: D6.

(h) Binary addition of 01101011 + 00110101: [3]

  Carry: 0 1 1 1 1 1 0 0
         0 1 1 0 1 0 1 1
       + 0 0 1 1 0 1 0 1
       ------------------
         1 0 1 0 0 0 0 0

Result: 10100000. Denary check: 107 + 53 = 160, and 10100000 = 128+32 = 160. No overflow has occurred because both operands are positive (MSB = 0) and the result (160) fits within an 8-bit unsigned range (0-255).

(i) Hexadecimal is used as shorthand for binary because each hex digit represents exactly 4 binary bits. [2] This makes conversion trivial and reduces long binary strings to a much shorter, more readable form. For example, the 8-bit binary 11111111 becomes simply FF, which is easier for programmers to read and less error-prone to transcribe.

(j) Hex to denary conversions: [1]

  • 3F: \(3 \times 16 + 15 \times 1 = 48 + 15 = \) 63
  • A2: \(10 \times 16 + 2 \times 1 = 160 + 2 = \) 162
  • 1B: \(1 \times 16 + 11 \times 1 = 16 + 11 = \) 27

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning