I don't understand what is the meaning of guard, round and sticky bits. I have an example: if we add 3.25+30 (3 bit mantissa) we get 32 because grs=011. I was trying to solve it but all I have managed to do is this: 30=1.111*2^4 3.25=0.001101*2^4 and if I add up the numbers the result is 1.0000101*2^5, which means g=0 r=1 s=1. The problem is now that I can't figure out why is the correct answer 32.

share|improve this question
    
The guard, round and sticky bits are used to determine if you must round, i.e. if you must remove some trailing bits from a value. The first two of the bits to be removed are the guard and round bit, respectively. The sticky bit is simply 1 if any of the other bits is 1. The combination of these three bits governs if the value of the bits that remain must be incremented by 1 or not. – Rudy Velthuis Aug 13 at 21:10
    
See the on Rounding part of the following text: pages.cs.wisc.edu/~markhill/cs354/Fall2008/notes/… – Rudy Velthuis Aug 13 at 21:13
    
FWIW, what do you mean with "3 bit mantissa"? And you don't have to round that at all. Both are exactly representable in any of the know IEEE-754 floating point formats, and so is the result. – Rudy Velthuis Aug 13 at 21:15
    
“3 bit mantissa” means a significand with three bits. The questioner is a student working on a sample problem using three-bit significands. The IEEE 754 floating-point formats are irrelevant to this. – Eric Postpischil Aug 14 at 0:59

Guard, round, and sticky bits of 0, 1, 1 tell you that the “residue bits” (by which I mean the bits starting just below the point where we are going to round) are .01xxx…, where xxx… is not known but contains at least one 1 bit. Thus, the “residue” portion is more than ¼ ULP (is .01 plus something positive) but less than ½ ULP (is less than .100…).

If you are rounding to nearest, you would round down, since the “residue” portion is less than ½ ULP.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.