Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Why are negative numbers stored as 2’s complement?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

When doing addition/subtraction on binary numbers in other representations we need to apply different logics (circuits) to perform addition and subtraction. In 2s-complement representation, we represent a positive number as it is and negative number by its corresponding 2s-complement, so we can use the same circuit to perform addition and subtraction.

For example: to add 6+3 using 5 bit 2s-complement representation,

00110
+
00011
——–
01001

To subtract 6-3, rewrite as 6+ (-3):

00110
+
11101 (2s-complement of 3)
——-
00011

My Personal Notes arrow_drop_up
Last Updated : 03 Oct, 2018
Like Article
Save Article
Similar Reads