CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickAcademy Computer Systems · 6 min · free

Binary Arithmetic: Addition, Overflow, Two's Complement and Shifts

6 min4 KwickClipsFull text belowFree
Next lesson →Kajal Ma'am (MCA), teaching since 2004Remembered in this browser

Learn binary addition with carries, overflow errors, two's complement for negative numbers and logical shifts. In 8 bits, 200 + 100 gives 44, because the ninth bit is lost: that is overflow.

Follows the syllabus of: ISC Class 11 Computer Science (868), Cambridge IGCSE Grade 9 Computer Science (0478), Cambridge IGCSE Grade 10 Computer Science (0478), Edexcel GCSE GCSE Computer Science (1CP2)

On screen in this lesson

Rules of binary addition

AddSum bitCarry
0 + 000
0 + 110
1 + 101
1 + 1 + 111

What is overflow?

A register holds a fixed number of bits
8 bits can store only 0 to 255
A result above 255 needs a ninth bit
The ninth bit is lost: an overflow error

Negative numbers

Computers have no minus sign, only bits
Two's complement: the leftmost bit is negative
In 8 bits, the leftmost place is worth -128
Range in 8 bits: -128 to +127

Making -5 in two's complement

StepBitsNote
Write +50000 0101positive
Flip every bit1111 10100 to 1, 1 to 0
Add 11111 1011this is -5

Check: 1111 1011

Place valueBitWorth
-1281-128
64, 32, 16, 81111120
4, 2, 10113
Total-5

Pause and predict

What does 1000 0000 mean in two's complement?
What does 0111 1111 mean?

Quick answers

What is 1 + 1 + 1 in binary?

1, carry 1.

What does 1000 0000 mean in two's complement?

-128, the smallest 8-bit value.

KwickClips from this lesson

Short clips, one idea each. Good for revision the night before.

The full lesson, in text

Hello students, welcome to Kwickprep. Can a computer add two hundred and one hundred and get forty four? Sadly, yes, and it is a famous error. Today we will add binary numbers, understand overflow, store negative numbers with two's complement, and shift bits left and right.

Binary addition needs only four rules. Zero plus zero is zero, with no carry. Zero plus one is one, with no carry. One plus one is two, which is one zero in binary, so write zero and carry one. One plus one plus a carried one is three, which is one one, so write one and carry one.

Let us add ninety and fifty five as eight bit numbers. Always start from the rightmost column, just like in decimal. Zero plus one is one. One plus one is zero, carry one. Keep going left, writing each sum bit and carrying where needed. The answer is one zero zero one zero zero zero one, which is one hundred forty five. Check it in decimal: ninety plus fifty five is one hundred forty five.

Now, the famous error. Inside the processor, numbers are held in a register, a small store with a fixed number of bits. With eight bits, we can only store from zero to two hundred fifty five. If a result is bigger, it needs a ninth bit. There is no room for it, so the carry is lost, and this is called an overflow error.

Let us see it happen. Two hundred plus one hundred should be three hundred. But three hundred needs nine bits. The final carry has nowhere to go, so it is lost. The eight bits left say zero zero one zero one one zero zero, which is forty four. The computer gives a wrong answer unless it checks the overflow flag.

Some exams ask how a program can catch this. We add A and B into Total. If Total is greater than two hundred fifty five, it cannot fit in eight bits. So we output an overflow error. Otherwise we output the total.

How does a computer store minus five, when it has only bits? The common method is called two's complement. In two's complement, the leftmost bit has a negative place value. In eight bits, that leftmost place is worth minus one hundred twenty eight instead of plus. So eight bits can store from minus one hundred twenty eight up to plus one hundred twenty seven.

Here is the three step method to make minus five. First, write plus five in eight bits: zero zero zero zero zero one zero one. Second, flip every bit, so each zero becomes one and each one becomes zero. Third, add one. The answer, one one one one one zero one one, is minus five.

Always check your answer with place values. The leftmost one is worth minus one hundred twenty eight. The next four ones are worth sixty four, thirty two, sixteen and eight, which add to one hundred twenty. The last three bits, zero one one, are worth three. Minus one hundred twenty eight plus one hundred twenty plus three is minus five.

Pause and predict. What does one followed by seven zeros mean in two's complement? It is minus one hundred twenty eight, the smallest eight bit value. And zero followed by seven ones? It is plus one hundred twenty seven, the largest.

Last topic, shifts. A logical shift moves every bit left or right, and fills the empty places with zeros. We start with twenty two. Shift left by one place, and it becomes forty four, which is double. Shift left by two places, and it becomes eighty eight, which is four times.

A right shift works the other way. We start with twenty two again. Shift right by one place, and it becomes eleven, which is half. Shift right by two places, and it becomes five, not five point five. The one that falls off the right end is lost, so the answer is rounded down.

Remember these shift rules for the exam. Shifting left by n places multiplies by two to the power n. Shifting right by n places divides by two to the power n. Bits pushed off either end are lost for good. If a one falls off the left end, the answer becomes wrong, which is overflow again.

Let us revise what we learned today. One plus one is zero carry one, and one plus one plus one is one carry one. Eight bits hold zero to two hundred fifty five, and a lost ninth bit is an overflow error. For two's complement, flip the bits and add one. Its eight bit range is minus one hundred twenty eight to plus one hundred twenty seven. And a left shift doubles, while a right shift halves.

Courses that teach this

CourseUnit
ISC Class 11 Computer Science (868)Computer Systems and Number Representation
Cambridge IGCSE Grade 9 Computer Science (0478)1. Data Representation
Cambridge IGCSE Grade 10 Computer Science (0478)1. Data Representation
Edexcel GCSE GCSE Computer Science (1CP2)Topic 2: Data

Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.

Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →