Hello! Welcome to your first lesson in our digital design course. Building on your existing knowledge of binary number systems, we will now explore how digital systems handle both positive and negative integers. This is a fundamental concept that forms the bedrock for all computer arithmetic.
Today, you will learn to represent signed integers using three different methods: sign-magnitude, 1's complement, and 2's complement. Understanding the trade-offs between these formats is crucial, as they directly impact the complexity and efficiency of arithmetic circuits—the very building blocks of the ALU you'll be designing later in this course.
The Need for Signed Numbers
You're already comfortable with unsigned binary numbers, where an n-bit number can represent values from 0 to . However, to perform meaningful arithmetic, especially subtraction, we need a way to represent negative values. All signed number systems accomplish this by designating one bit, almost universally the most significant bit (MSB), as the sign bit.
A 0 in the MSB typically indicates a positive number, while a 1 indicates a negative number. The key difference between the methods we'll study lies in how they represent the magnitude of these negative numbers.
1. Sign-Magnitude Representation
The sign-magnitude format is the most straightforward and intuitive method. It mirrors how we write signed numbers in decimal: a sign followed by a magnitude.
- The MSB is the sign bit (0 for positive, 1 for negative).
- The remaining bits represent the absolute value (magnitude) of the number in standard binary.

To dive deeper into this representation, please watch the following video segment. It explains the concept and also touches upon why this simple method is not ideal for computer arithmetic.
Binary Addition and Subtraction With Negative Numbers, 2's Complements & Signed Magnitude
This video from The Organic Chemistry Tutor clearly explains the sign-magnitude method with examples.
Please watch the section from the beginning until the end of the discussion on why sign-magnitude is not helpful for arithmetic operations. Pay close attention to the example of adding +7 and -7.
As you saw in the video, sign-magnitude has two significant drawbacks:
- Two Representations of Zero: In an 8-bit system,
00000000represents +0, and10000000represents -0. This ambiguity complicates hardware design and requires special checks. - Complex Arithmetic: Performing addition and subtraction requires separate logic to handle the signs and magnitudes, making the hardware more complex than necessary. For example, to compute A - B, the circuit must compare the magnitudes of A and B to decide the sign of the result and whether to add or subtract the magnitudes.
Due to these issues, sign-magnitude representation is rarely used for integer arithmetic in modern CPUs.
2. Complement Representations: A Smarter Approach
To simplify arithmetic, particularly subtraction, digital systems use complement representations for negative numbers. The core idea is to make subtraction equivalent to addition, allowing the same adder circuit to be used for both operations. This is a crucial step towards designing an efficient ALU. We will explore two such methods.
One's (1's) Complement
In 1's complement form, positive numbers are represented the same way as in sign-magnitude. To represent a negative number, you simply invert every bit of its positive binary equivalent. This bit-flipping operation is also known as taking the complement.
Example: To find the 8-bit 1's complement representation of -45:
- Start with the representation of +45:
00101101 - Invert every bit:
11010010
So, 11010010 is the 1's complement representation of -45. Notice that the MSB automatically becomes 1, correctly indicating a negative number.

For a detailed explanation, including the mathematical definition and range, please watch the following video clip.
1's complement and 2's complement | Signed Binary Numbers Explained
This segment from the "ALL ABOUT ELECTRONICS" channel provides a clear, step-by-step guide to 1's complement.
Watch the portion on 1's complement representation. Focus on how to find the complement and the mention of its primary drawback.
The main weakness of 1's complement, as highlighted in the video, is that it also has two representations of zero: 00000000 (+0) and 11111111 (-0). While it simplifies arithmetic compared to sign-magnitude, this ambiguity remains a problem. This leads us to the final and most important method.
3. Two's (2's) Complement
2's complement is the universal standard for representing signed integers in modern digital computers. It elegantly solves the problems of both sign-magnitude and 1's complement.
To find the 2's complement representation of a negative number, you first find the 1's complement and then add 1.
Example: To find the 8-bit 2's complement representation of -45:
- Start with +45:
00101101 - Find the 1's complement (invert all bits):
11010010 - Add 1:
11010010 + 1 = 11010011
So, 11010011 is the 2's complement representation of -45.
The following video provides an excellent, comprehensive explanation of 2's complement, including two very useful shortcuts for finding it by hand.
1's complement and 2's complement | Signed Binary Numbers Explained
This is the most important part of the lesson. The video thoroughly explains the three ways to calculate 2's complement, its range, and its advantages.
Watch the section on 2's complement representation. Pay close attention to all three methods for finding the complement, especially the shortcut of copying bits from the LSB up to the first '1' and inverting the rest.
Key Advantages of 2's Complement:
- A Single, Unambiguous Zero: In an n-bit system, 0 is represented only as
00...0. If you try to take the 2's complement of 0, you get 0 back (with a carry bit that is discarded), eliminating the +0/-0 problem. - Simplified Arithmetic: Subtraction (A - B) is performed by simply adding the 2's complement of B to A:
A + (2's comp of B). This means a single adder circuit can handle both addition and subtraction, drastically simplifying ALU design. - Asymmetric Range: An n-bit number can represent values from to . For an 8-bit system, this is -128 to +127. There is one more negative number than positive numbers because there is no redundant "-0".
Summary and Comparison
The best way to solidify your understanding is to see these three representations side-by-side. The following resource provides a webpage with a clear summary and a very helpful comparison table.
Signed Binary Numbers and Two's Complement Numbers
This section from Electronics-Tutorials.ws summarizes the different formats and provides a comparative table.
Please scroll down to the end of the article and study the comparison table. This table clearly shows how the same decimal values are represented differently in each format for a 4-bit system.
Practice Problems
To master these concepts, let's work through a few problems. This will be essential for the next lesson on binary arithmetic.
-
Using an 8-bit system, find the binary representation of -29 in:
a. Sign-Magnitude
b. 1's Complement
c. 2's Complement -
What is the decimal value of the 8-bit binary number
11101000if it is interpreted as:
a. An unsigned integer?
b. A sign-magnitude integer?
c. A 1's complement integer?
d. A 2's complement integer? -
What is the range of decimal values that can be represented using a 16-bit 2's complement system?
Self-Correction and Reflection:
- For problem 1(c): After finding the 2's complement, try converting it back to a decimal value to check your work. A quick way is to note the MSB is 1, so it's a negative number. Take the 2's complement of your result; you should get the binary for +29.
- For problem 2: This problem highlights why context is everything. The same pattern of bits can represent four completely different numbers depending on the interpretation.
Solutions
-
-29 in 8 bits:
- First, +29 = 16 + 8 + 4 + 1 =
00011101 - a. Sign-Magnitude:
10011101(Flip the sign bit) - b. 1's Complement:
11100010(Invert all bits of +29) - c. 2's Complement:
11100011(1's complement + 1)
- First, +29 = 16 + 8 + 4 + 1 =
-
Decimal value of
11101000:- a. Unsigned:
- b. Sign-Magnitude: Sign is '1' (-), magnitude is
1101000= . Value is -104. - c. 1's Complement: Sign is '1' (-). To find the magnitude, invert the bits:
00010111. This is . Value is -23. - d. 2's Complement: Sign is '1' (-). To find the magnitude, take the 2's complement: Invert (
00010111) and add 1 (00011000). This is . Value is -24.
-
Range for 16-bit 2's complement:
- The formula is to , where n=16.
- to
- -32,768 to +32,767
Conclusion
In this lesson, we have laid the crucial groundwork for understanding computer arithmetic. You've learned about the three primary methods for representing signed binary numbers and, most importantly, why 2's complement has become the industry standard.
Here are the key takeaways:
- Sign-Magnitude is intuitive but impractical for arithmetic due to its double-zero representation and complex hardware requirements.
- 1's Complement improves on arithmetic but retains the problematic double-zero.
- 2's Complement provides a single representation for zero and simplifies subtraction into addition, making it the most efficient method for hardware implementation.
This understanding is not just theoretical; it is the reason ALUs can be built so efficiently. In our next lesson, we will put this knowledge into practice by performing binary addition and subtraction using 2's complement arithmetic, a skill you will directly use when designing your ALU.