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. Notes
  2. /Number Systems: Quick Revision
Computer Science

Number Systems: Quick Revision

A brief note on number systems: binary, denary and hexadecimal conversions, binary addition and overflow, logical shifts and two's complement, with the usual slips, practice, a program and questions to check yourself.

StemPy LabWritten by StemPy Lab
Log in to save

A brief note on Number Systems. Read it before a test. Try each question at the end before you open its answer.

The three bases

  • Denary is base 10, with the digits 0 to 9.
  • Binary is base 2, with the digits 0 and 1. A computer stores all data in binary because its switches have two states.
  • Hexadecimal is base 16, with 0 to 9 and A to F (A is 10, F is 15). One hex digit is one nibble of four bits.

Place values

  • 8-bit binary: 128, 64, 32, 16, 8, 4, 2, 1.
  • 16-bit binary: the next places are 256, 512, 1024 and so on, up to 32768.
  • Hexadecimal: 4096, 256, 16, 1.
  • 8-bit two's complement: −128-128−128, 64, 32, 16, 8, 4, 2, 1.

The conversions

  • Binary to denary. Add the place values under the 1s.
  • Denary to binary. Take away the largest place values that fit, or divide by 2 again and again and read the remainders upwards.
  • Binary to hex. Split into nibbles from the right. Each nibble is one digit.
  • Hex to binary. Write each digit as four bits.
  • Denary to hex. Divide by 16: the whole part is the first digit and the remainder is the second.

Arithmetic on a register

  • Addition. 1+1=101 + 1 = 101+1=10 and 1+1+1=111 + 1 + 1 = 111+1+1=11. Carry from right to left.
  • Overflow. An 8-bit register holds 0 to 255. A larger total loses its ninth bit.
  • Logical left shift of kkk places multiplies by 2k2^k2k. Logical right shift divides by 2k2^k2k. Bits that fall off are lost and 0s come in.
  • Two's complement. To store a negative number, write the positive one, flip every bit and add 1. The range is −128-128−128 to +127+127+127.

A worked example

Store −58-58−58 in 8-bit two's complement.

  1. The positive number. 58=32+16+8+258 = 32 + 16 + 8 + 258=32+16+8+2, which is 00111010.
  2. Flip every bit. 11000101.
  3. Add 1. 11000110.
  4. Check. −128+64+4+2=−58-128 + 64 + 4 + 2 = -58−128+64+4+2=−58.

Practice with new numbers

A program to try

The program prints one number in all three bases, using Python's format. It then reads each form back to show they are the same number.

Read it first. Then run it. Which of the three forms is the shortest?

1. Change the number to 250. Predict the binary and the hex before you run it.

Mistakes to avoid

  • Reading the remainders downwards. The first remainder is the last bit.
  • Grouping nibbles from the left. Always group from the right.
  • Forgetting the lost bit. An overflow or a shift can push a 1 out of the register.
  • Flipping without adding 1 in two's complement.

Check yourself

  1. Convert the binary number 01111001 to denary.
  1. Convert the hexadecimal number 2F to binary.
  1. Add 01000001 and 00111111 in an 8-bit register. Is there an overflow?
  1. What does the register 00000111 hold after a logical left shift of 4 places?
  1. Write −1-1−1 as an 8-bit two's complement number.

Sources

  • Cambridge International, IGCSE Computer Science 0478 syllabus for 2026 to 2028, section 1.1 (number systems).
← All Notes
← PreviousText, Sound and Images: Quick Revision →
More onComputer Science › Data Representation

Discussion (0)

Log in to join the discussion.

Loading…

On this page

  1. The three bases
  2. Place values
  3. The conversions
  4. Arithmetic on a register
  5. A worked example
  6. Practice with new numbers
  7. A program to try
  8. Mistakes to avoid
  9. Check yourself
  10. Sources

Goes with the lesson

  1. Binary addition, overflow, shifts and two's complement
Binary, Denary and Hexadecimal

More notes on this topic

  1. Storage Units and Compression: Quick Revision
  2. Text, Sound and Images: Quick Revision
  3. Logic Circuits and Truth Tables: Quick Revision
  4. NAND, NOR and XOR Gates: Quick Revision
  5. NOT, AND and OR Gates: Quick Revision
All notes on this topic →