HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A ticket machine adds the number of tickets sold in the morning, 10101010, to the number sold in…
MediumComputer ScienceHigh School (9–10)Computer Science › Data RepresentationNumericalConceptualIGCSE

A ticket machine adds the number of tickets sold in the morning, 10101010, to the number sold in…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A ticket machine adds the number of tickets sold in the morning, 10101010, to the number sold in the afternoon, 01110001. Both are stored in 8-bit registers, and the total goes into an 8-bit register too.

  1. What is the true total in denary?
  1. What value does the 8-bit register actually hold?
  1. Explain what has happened.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

Add binary in columns from the right: 1+1=101 + 1 = 101+1=10 (write 0, carry 1) and 1+1+1=111 + 1 + 1 = 111+1+1=11 (write 1, carry 1). An 8-bit register holds 0 to 255, so a total above 255 is an overflow. A logical shift of kkk places left multiplies by 2k2^k2k, and right divides by 2k2^k2k; bits shifted off the end are lost and 0s come in. In 8-bit two's complement the MSB is worth −128-128−128.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Given. 10101010 and 01110001 in 8-bit registers.

Plan. Find the true total, then see which bits fit.

Step 1. Denary. 10101010 is 128+32+8+2=170128 + 32 + 8 + 2 = 170128+32+8+2=170. 01110001 is 64+32+16+1=11364 + 32 + 16 + 1 = 11364+32+16+1=113.

Step 2. The true total. 170+113=283170 + 113 = 283170+113=283. In binary that is the 9 bits 100011011.

Step 3. What is kept. The register keeps the right-hand 8 bits, 00011011, which is 16+8+2+1=2716 + 8 + 2 + 1 = 2716+8+2+1=27.

Step 4. Explain. 283 is greater than 255, the largest value 8 bits can hold. The ninth bit has no place in the register and is lost. This is an overflow error, so the stored total is wrong.

Check. 283−256=27283 - 256 = 27283−256=27. The lost bit was worth 256.

Answer: (a) 283. (b) 27. (c) An overflow: the answer needed 9 bits and the ninth was lost.

Log in to save this for later
← All Problems
← A weather station adds two rainfall readings stored in 8 bits: 01001011 and 00110110…A small processor has no instruction to multiply… →
More onComputer Science › Data Representation

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. A student must compress two files. File A is a text file holding the 7 characters ABCDEFG, one byte…Hard
  2. A line of an icon is stored with run-length encoding as these pairs of (count, colour code): (5…Medium
  3. One row of a scanned page is 13 pixels: 6 white, then 3 black, then 4 white…Easy
  4. An image is 800 pixels wide and 600 pixels high…Hard
  5. A camera takes photos of 2048 by 1536 pixels with a colour depth of 24 bits…Medium
All problems on this topic →