notyabussines Posted December 1, 2012 Share Posted December 1, 2012 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? Link to comment Share on other sites More sharing options...
Klaynos Posted December 1, 2012 Share Posted December 1, 2012 You have -7.25 incorrect, I think you have -6.75. Remember to include the fraction in the base 2 7 as well. Link to comment Share on other sites More sharing options...
notyabussines Posted December 1, 2012 Author Share Posted December 1, 2012 You have -7.25 incorrect, I think you have -6.75. Remember to include the fraction in the base 2 7 as well. But if I add another 1,then I won't have 6 bits but 7 bits :S Link to comment Share on other sites More sharing options...
lesolee Posted December 1, 2012 Share Posted December 1, 2012 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. 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 More sharing options...
Klaynos Posted December 1, 2012 Share Posted December 1, 2012 You don't need to add more, you need to add less. Your most negative number possible is -8. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now