Jump to content

HELP! IS this correct?


notyabussines

Recommended Posts

Convert 7 and -7.25 to twos complement with 6 bits and add them.So , -7.25 is smth like 1001,01. When I add 000111 to it,the result is 1000,01...and if i convert this to twos complement the result is not -0.25...whats wrong?

 

I am not sure why you think it is ok to spam the forum like this. This is the third post on essentially the same subject, the last two posts being identical.:mad:

 

Since you are now using a fractional representation we can consider the number as being scaled by x4.

7 x 4 = 28 --> 011100 using 6 bit signed binary

-7.25 x 4 = -29 -> 100011 using 6 bit signed binary

Add to give -1 -> 111111 using 6 bit signed binary

 

It would be much easier to use standard word sizes, 8/16/32 etc, as then you can just use a binary calculator to do the working.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.