Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1898474
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:46:10+00:00 2026-05-17T06:46:10+00:00

Using six-bit one’s and two’s complement representation I am trying to solve the following

  • 0

Using six-bit one’s and two’s complement representation I am trying to solve the following problem:

12 - 7 

Now, i take 12 in binary and 7 in binary first.

12 = 001100 - 6 bit 
7 =  000111 - 6 bit

Then, would I then flip the bit for two’s complement and add one?

12 = 110011 ones complement 
     +    1
    -------
     001101

7  = 111000 ones complement 
    +     1
   ---------
      111001

then, add those two complement together

 001101
+111001
-------
1000110 = overflow? discard the last digit?  If so I get 5

Now, if I have a number like

-15 + 2

I would then add a sign magnitude on the MSB if it’s a zero?

like:

-15 = 001111 6 bit

Would I add a 1 at the end here before I flip the bits?

  = 101111
  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:46:10+00:00Added an answer on May 17, 2026 at 6:46 am

    Using two’s complement to represent negative values has the benefit that subtraction and addition are the same. In your case, you can think of 12 - 7 as 12 + (-7). Hence you only need to find the two’s complement representation of -7 and add it to +12:

    12  001100
    -7  111001   -- to get this, invert all bits of 7 (000111) and add 1
    ----------
     5 1000101
    

    Then discard the carry (indicates overflow), and you have your result: 000101 which equals to 5 as expected.

    For your example of -15 + 2, simply follow the same procedure to get the two’s complement representation of -15:

    15  001111
        110000   -- inverted bits
        110001   -- add 1
    

    Now do the addition as usual:

    -15  110001
      2  000010
    -----------
    res  110011
    

    To see that res indeed equals -13, you can see that it is negative (MSB set). For the magnitude, convert to positive (invert bits, add 1):

    res  110011
         001100  -- inverted bits
         001101  -- add 1
    

    Hence the magnitude is 13 as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my_list = ['one', 'two', 'three', 'four', 'five', 'six', 'seven'] Using python, I need list
I have a single array such as this: array('one','two','three','four','five','six','seven') I'm using a foreach to
I am trying to plot a graph using gnuplot. I have six text files.
Given the following indented text: two spaces four six non-leading spaces I'd like to
So this problem is a little bit complicated to understand what I'm trying to
I am trying loop though this month until past six months using vb.net and
Given five random elements, it's possible to find the median using just six comparisons.
Some background: I setup six blogs this week, all using Wordpress 2.92, installed with
Using usort and strcomp together to order an array by one of its keys
I am using js/jquery to create draggable graph. Graph has two draggable elements that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.