Close Menu
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) LinkedIn Pinterest RSS
    All Math Tricks
    Leaderboard Ad
    • Home
      • Blog
      • About Us
      • Contact Us
    • Math Tricks
    • Pure Mathematics
      • number system
      • Algebra
        • Polynomials
      • Progressions
      • Geometry
        • Coordinate geometry
    • Quantitative Aptitude
      • Interest Calculations
      • percentage
      • Ratio proportion and variation
    • Calculus
      • Derivatives
      • limits and integrals
    • Math Reasoning
    All Math Tricks
    You are at:Home»Calculators»Two’s complement steps | Conversion of decimal numbers or binary number into 2s complement with examples
    Two's complement steps | turn decimal numbers or binary number into 2s complement
    Calculators

    Two’s complement steps | Conversion of decimal numbers or binary number into 2s complement with examples

    sivaalluriBy sivaalluriNovember 6, 2022Updated:March 8, 2025No Comments12 Mins Read

    Table of Contents

    Toggle
    • The Two’s Complement Definition, Steps of Conversion with Examples.
      • Two’s Complement ( 2s complement) – Definition
      • Turning various number systems into twos Complement
        • Turning Binary numbers into 2s complement
        • Turning decimal numbers into 2s complement
        • Online calculator for binary or  decimal value to two’s complement

    The Two’s Complement Definition, Steps of Conversion with Examples.

    In number theory, the two’s (2s) complement is frequently used in machine languages to encode various terms. The representation of the two’s (2s) complement is similar to the binary variables such as 0 & 1.

    The one’s complement is used to convert the positive numbers in the form of 0 & 1. But it is not applicable for the negative numbers, so the 2s complement is created. In this post, we are going to explore  definition of Two’s complement and procedure of converting decimal numbers or binary number into 2s complement in step wise. Also provided here examples and online two’s complement converter.

    Two's complement steps | turn decimal numbers or binary number into 2s complement

    Two’s Complement ( 2s complement) – Definition

    In mathematics, to encode the positive and negative numbers in the form of 0 & 1, the two’s complement is used. On the other hand, the one’s complement is also used to encode the numbers in the form of binary variables.

    But it is only suitable for encoding positive numbers. So, the 2s complement is created for especially encoding the negative numbers. It is an example of a radix complement. In a number system, the 2’s complement is an operation that involves the binary variable.

    As we know the one’s complement is the transpose of binary variables as it inverts the o’s into 1’s and 1’s into 0’s. On the other hand, the two’s complement is determined by adding 1 to the LSB (least significant bit) of the transpose of the binary variables.

    Turning various number systems into twos Complement

    To turn the binary and decimal numbers system into twos complement follow the below procedure.

    Turning Binary numbers into 2s complement

    Follow the below steps to turn a binary number system into 2s complement.

    a) First of all, take a binary variable number in the form of 0 & 1.

    b) Take the transpose of the binary number system as inverting all the zeros into ones and vice versa. This process of inverting the binary variables is referring to 1s complement.

    c) To get the two’s complement, add one to the last digit of the one’s complement.

    The above three steps are helpful in turning the binary number system into two’s complement without any difficulty. Let us take some examples of this conversion to understand the concept more accurately.

    Example I :  Turn the given binary number into a 2s complement – 1111 0000 1110

    Solution

    Step-1: First of all, take a binary variable.

    1111 0000 1110

    Step-2: Take the transpose of the 1111 0000 1110 as inverting all the zeros into ones and vice versa.

    0000 1111 0001

    Step-3: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    0 0 0 0 1 1 1 1 0 0 0  1

                                      + 1

    0 0 0 0 1 1 1 1 0 0 1 0

    Hence,

    The 2s complement of “1111 0000 1110 ” is “0000 1111 0010”

    Example II : Turn the given binary number into a 2s complement  – 0101 0101

    Solution

    Step-1: First of all, take a binary variable.

    0101 0101

    Step-2: Take the transpose of the 0101 0101 as inverting all the zeros into ones and vice versa.

    1010 1010

    Step-3: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    1 0 1 0 1 0 1 0

                       + 1

    1 0 1 0 1 0 1  1

    Hence,

    The 2s complement of “0101 0101” is “1010 1011”

    Turning decimal numbers into 2s complement

    Follow the below steps to turn a decimal number system into two’s complement.

    For a positive decimal number

    a) First of all, take a positive decimal i.e., 102, 304, 415, etc.

    b) Turn the positive decimal number system into the form of binary variables.

    c) Take the transpose of the binary number system as inverting all the zeros into ones and vice versa. This process of inverting the binary variables is referring to 1s complement.

    d) To get the two’s complement, add one to the last digit of the one’s complement.

    For a negative decimal number

    a) First of all, take a negative decimal i.e., -11, -4, -45, etc.

    b) Find the 2s complement of the number without a negative sign by following the above four steps.

    c) After that take the transpose of the 2s complement of the positive number as inverting all the zeros into ones and vice versa.

    d) To get the two’s complement, add one to the last digit of the one’s complement.

    The above four steps of positive and negative decimal numbers are helpful in turning the decimal number system into a 2s complement without any difficulty. Let us take some examples of this conversion to understand the concept more accurately.

    Example III:  For a positive and negative decimal number

    Convert the given decimal numbers into 8-bit 2s complement.  a) 120     b ) -115

     a) 120

    Solution:

    Step-I: First of all, take a 8-bit positive decimal.  120

    Step-II: Now turn 120 in the form of binary variables.  

    2 | 120

    2 | 60 – 0

    2 | 30 – 0

    2 | 15 – 0

    2 | 7 – 1

    2 | 3 – 1

          1 – 1

    Hence,

    120 = (1 1 1 1 0 0 0 )2

    Completing the 8-bit of the above binary number.

    120 = (0 1 1 1 1 0 0 0)2

    Step-III: Take the transpose of the  0 1 1 1  1 0 0 0 as inverting all the zeros into ones and vice versa.

    1 0 0 0 0 1 1 1

    Step-IV: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    1 0 0 0 0 1 1 1 

                        + 1

      1 0 0 0 1 0 0 0

    Hence,

    1000 1000 is the 2s complement of 120.

    b) -115

    Solution

    Step-I: First of all, take a negative decimal number.   -115

    Let’s calculate the 2s complement of positive 115.

    Step-II: Now turn 115 in the form of binary variables. 

    2 | 115

    2 | 57 – 1

    2 | 28 – 1

    2 | 14 – 0

    2 | 7  – 0

    2 | 3 – 1

         1 – 1

    Hence,

    115 = (0 1 1 1 0 0 1 1)2 in 8-bit representation

    Step-III: Take the transpose of the 0 1 1 1 0 0 1 1 as inverting all the zeros into ones and vice versa.

    1 0 0 0 1 1 0 0

    Step-IV: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    1 0 0 0 1 1 0 0

                        + 1

    1 0 0 0 1 1 0 1

    Hence,

    1000  1101 is the 2s complement of 115.

    Step-V: Now invert the two’s complement of positive decimal number.

    1 0 0 0 1 1 0 1  becomes 0 1 1 1 0 0 1 0 after inverting.

    Step VI: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

     0 1 1 1 0 0 1 0

                       + 1

     0 1 1 1 0 0 1 1

    Hence,

    0111 0011 is the 2s complement of -115.

    Example IV:  For a positive and negative decimal number

    Convert the given decimal numbers into 12-bit 2s complement.  a) 257     b ) -357  

     a) 257

    Solution:

    Step-I: First of all, take a 12-bit positive decimal.  257

    Step-II: Now turn 257 in the form of binary variables.  

     

    2 | 257

    2 | 128 – 1

    2 | 64 – 0

    2 | 32 – 0

    2 | 16 – 0

    2 | 8 – 0

    2 | 4 – 0

    2 | 2 – 0

          1 – 0

    Hence,

    257 = (100000001)2

    Completing the 12-bit of the above binary number.

    257 = (000100000001)2

    Step-III: Take the transpose of the 000100000001 as inverting all the zeros into ones and vice versa.

    111011111110

    Step-IV: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    1 1 1 0 1 1 1 1 1 1 1 0

                               + 1

    1 1 1 0 1 1 1 1 1 1 1 1

    Hence,

    1110 1111 1111 is the 2s complement of 257.

    b) -357

    Solution

    Step-I: First of all, take a negative decimal number.   -357

    Let’s calculate the 2s complement of positive 357.

    Step-II: Now turn 357 in the form of binary variables. 

    2 | 357

    2 | 178 – 1

    2 | 89 – 0

    2 | 44 – 1

    2 | 22 – 0

    2 | 11 – 0

    2 | 5 – 1

    2 | 2 – 1

    1 – 0

     

    Hence,

    357 = (000101100101)2 in 12-bit representation

    Step-III: Take the transpose of the 000101100101 as inverting all the zeros into ones and vice versa.

    1110 1001 1010

    Step-IV: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    1 1 1 0 1 0 0 1 1 0 1 0

                               + 1

    1 1 1 0 1 0 0 1 1 0 1 1

    Hence,

    1110 1001 1011 is the 2s complement of 357.

    Step-V: Now invert the two’s complement of positive decimal number.

    1110 1001 1011 becomes 0001 0110 0100 after inverting.

    Step VI: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    0 0 0 1 0 1 1 0 0 1 0 0

                                 + 1

    0 0 0 1 0 1 1 0 0 1 0 1

    Hence,

    0001 0110 0101 is the 2s complement of -357.

    Example V : For a positive and negative decimal number

    Convert the given 16-bit decimal numbers into 2s complement.  a) 257     b ) -357  

     a) 257

    Solution:

    Step-I: First of all, take a 12-bit positive decimal.  257

    Step-II: Now turn 257 in the form of binary variables.  

    2 | 257

    2 | 128 – 1

    2 | 64 – 0

    2 | 32 – 0

    2 | 16 – 0

    2 | 8 – 0

    2 | 4 – 0

    2 | 2 – 0

          1 – 0

    Hence,

    257 = (100000001)2

    Completing the 16-bit of the above binary number.

    257 = (0000000100000001)2

    Step-III: Take the transpose of the 000100000001 as inverting all the zeros into ones and vice versa.

    1111111011111110

    Step-IV: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0

                                            + 1

    1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1

    Hence,

    1111 1110 1111 1111 is the 2s complement of 257.

    b) -357

    Solution

    Step-I: First of all, take a negative decimal number.

    -357

    Let’s calculate the 2s complement of positive 357.

    Step-II: Now turn 357 in the form of binary variables. 

    2 | 357

    2 | 178 – 1

    2 | 89 – 0

    2 | 44 – 1

    2 | 22 – 0

    2 | 11 – 0

    2 | 5 – 1

    2 | 2 – 1

    1 – 0

    Hence,

    357 = (0000000101100101)2 in 16-bit representation

    Step-III: Take the transpose of the 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 1 as inverting all the zeros into ones and vice versa.

    1 1 1 1 1 1 1 0 1 0 0 1 1 0 1 0

    Step-IV: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    1 1 1 1 1 1 1 0 1 0 0 1 1 0 1 0

                                             + 1

    1 1 1 1 1 1 1 0 1 0 0 1 1 0 1 1

    Hence,

    1 1 1 1 1 1 1 0 1 0 0 1 1 0 1 1  is the 2s complement of 357.

    Step-V: Now invert the two’s complement of positive decimal number.

    1 1 1 1 1 1 1 0 1 0 0 1 1 0 1 1 becomes 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 after inverting.

    Step VI: Now To get the two’s complement, add one to the last digit of the above inverted binary number.

    0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0

                                                + 1

    0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 1

    Hence,

    0000 0001 0110 0101 is the 2s complement of -357.

    Online calculator for binary or  decimal value to two’s complement

    Click Here  2s complement calculator

    Conclusion:

    In this article, we have covered all the basic intent of the twos complement. We discussed the definition and inversion of binary and decimal numbers system into 2s complement along with solved examples. Now you can learn all the basics of the 2s complement from this post.

    Related Articles:

    Shortcut to Find Number of Factors of a Number | Sum of Factors of a Number

    Average of numbers formula | Average of a series of numbers

    Simple Average Formulas for Aptitude Questions and Answers

    2s complement two's complement converter two's complement example two's complement steps two's complement to decimal
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    sivaalluri
    • Website

    Related Posts

    Cubic Feet conversion : Definition, formulas with practical calculations

    Logarithm Applications | Logarithm Examples and Answers | All Math Tricks

    Basic Concepts of logarithms | Log properties | Logarithm without base

    Leave A Reply Cancel Reply

    • Popular
    • Recent
    • Top Reviews
    February 3, 2018

    Multiplication tricks and tips in mathematics | Shortcuts in multiplications

    December 28, 2022

    Integral and Double Integral calculus Example with Solution | Allmathtricks

    July 23, 2017

    Shortcuts for Multiplication of numbers | Easy way for Multiplications

    January 24, 2024

    Standard Deviation Definition, Formula with Questions | Allmathtricks

    December 28, 2023

    Cubic Feet conversion : Definition, formulas with practical calculations

    November 9, 2023

    Calculating limits calculus with examples and solutions | types of limits

    Categories
    • Algebra
    • Applied Mathematics
    • Calculators
    • Calculus
    • Coordinate geometry
    • Derivatives
    • Education & Career
    • Geometry
    • Interest Calculations
    • limits and integrals
    • Math Quiz
    • Math Reasoning
    • Math Tricks
    • number system
    • percentage
    • Polynomials
    • Progressions
    • Quantitative Aptitude
    • Ratio proportion and variation
    • Statistics math
    Latest Galleries
    Latest Reviews
    About
    About

    Allmathtricks.Com, we firmly believe that everyone has the potential to become a math whiz – all it takes is a bit of guidance, a sprinkle of fun, and the camaraderie of a supportive community.

    Facebook Instagram
    Shortcuts methods of Division math | Tips and tricks for math division
    volume of hollow sphere, area of hollow sphere formula with examples
    Easy Thought Process in Addition and Subtraction - all math tricks
    Multiplication tricks and tips in mathematics | Shortcuts in multiplications
    Quadrilateral with their properties and formulas | Properties and formulas of Trapezium, parallelogram, Rhombus, Rectangle, Square, kite
    prism formulas |volume and surface area of a Octagonal prism
    Divisibility Rules of numbers from 1 to 20
    Definetions and Properties of Line, line segment and ray in math | all math tricks
    square root calculation methods | square root formulas
    cube root formula - easy method to calculate cube root of perfect cubes of two digit numbers
    Simple interest and Compound interest formulas with Online calculator- allmathtricks
    | log rules |properties of logarithms | logarithm rules practice | logarithm tutorial
    Quantitative Aptitude math | allmathtricks.com
    Terminology and Formulas of the Triangles | Classification according to angle and according to sides like Equilateral | Properties of the Triangles.
    Percentage calculation | Different shortcut methods to find out percentage |
    Sum of n natural numbers | Sum of odd and even numbers | Sum of the Squares of First n Positive Integers | Sum of the Cubes of First n Positive Integers
    Profit and loss formulas for quantitative aptitude | profit and loss shortcut tricks for bank exams, ssc cgl | profit and loss problems with solutions for all types of competitive exams | Formulas for Profit and loss and practice sums | Exercise – 4 | Profit and loss chapter question and answers
    Time and Work Aptitude | Concept, Formula Questions and Answers
    Multiplication tricks for 2digit, 3digit and 4digit numbers - all math tricks
    how to find collinear points | Examples of collinear points | point in geometry math | Number of Lines through non- collinear points | All math tricks
    Factors concept in number system | Total number of factors for a number | factors for numbers 1 through 100 | how to find factors of big numbers easily
    sequence and series definitions | Infinite sequence and series problems and solutions | arithmetic sequence questions | Find the nth terms of sequence
    Ratio, Proportion and Variation - Concepts, Important Formulas, Formulas, Properties with Quantitative Aptitude Shortcuts & Tricks for all Competitive Exams | allmathtricks
    Statement and proof of remainder theorem and factor theorem | application of remainder theorem and factor theorem | remainder and factor theorem tutorial
    Circle formulas in math | Area, Circumference, Sector, Chord, Arc of Circle
    how to find last digit of any number with power | Find the last two digits of a large exponent | unit digit problems with solutions | unit digit concept
    distance formula geometry definition with practice problems | Distance between two points on a line in the X-Y plane
    Harmonic progression formulas - nth term and sum of terms, harmonic progression properties with aptitude questions, harmonic mean formula between given quantities
    Factoring Polynomials by using Algebraic Expressions | How to Factor Algebraic Equations | all math tricks
    logarithm applications | logarithm tricks | logarithm tutorial | logarithm tricks | logarithm application | logarithm questions | logarithm examples | logarithm questions
    Factorise the Polynomial by using Factor Theorem | allmathtricks
    Cubic feet conversions formula Cubic Inches to Cubic Feets Cubic Yards to Cubic Feets Cubic Centimeters to Cubic feets Cubic meters to Cubic Feets
    Methods for finding HCF and LCM
    ratio proportion and variation problems with solutions with formulas, ratio and proportion tricks for bank exams, Ratio Proportion and Variation aptitude formulas, allmathtricks
    arithmetic progression problems | arithmetic progression questions |arithmetic progression basic problems |arithmetic progression exercise
    Polynomial Definition | Degree of a Polynomial | Types of Polynomials | Polynomial Concept
    What is an Angle| Different Types of Angles in Geometry | Zero Angle, Acute Angle, Right Angle, Obtuse angle, Straight Angle, Reflex Angle & Complete angle
    Typical problems on HCF and LCM | GCD and LCM Problems & Solutions || Practice problems on HCF and LCM for all competitive exams
    percentage formulas | percentage calculation with examples | Quantitative mathematics
    how many number of triangles | counting figures in reasoning tricks
    Types of Lines in geometry | Straight line, Curved line, Intersecting lines, Concurrent lines, Parallel Lines and transversal line with examples. | All Math tricks
    Remainder theorem of numbers | Remainder theorem aptitude questions | How to find remainder of a number with power | Remainder theorem tricks for ssc
    geometric progression examples with solution, geometric progression formula for nth term, geometric progression total sum, geometric progression problems with solution for all competitive exams as well as academic
    Basic Concepts of logarithms |log properties | logarithm tutorial | Excercise - 1 log rules |properties of logarithms | logarithm rules practice |
    standard deviation definition, formula, symbol, questions, standard dev calculator with The applications of both population standard deviation (σ) and sample standard deviation (s)
    number system ? allmathtricks.com
    Copyright © All Math Tricks 2024 @ All rights reserved | Designed & Developed by SivaRamaKrishna Alluri. .
    • Home
    • Buy Now

    Type above and press Enter to search. Press Esc to cancel.