Error in sph_time formula in SBP-2?

Stephen Finch/SSI1 Stephen_Finch/SSI1.SSI1 at
Mon Jun 30 07:04:43 PDT 1997

* From the T10 (formerly SCSI) Reflector (t10 at, posted by:
* Stephen Finch/SSI1 <Stephen_Finch/SSI1.SSI1 at>
It appears that there is an error in the calculation of the sph_time stored on 
media when cycle_count observed is less than CYCLE_TIME.cycle_count:

The formula is written as:

sph_time(stored) = 
   0x1F40000 - (sph_time(observed) & 0x1FFFFFF) + CYCLE_TIME & 0x01FFF000)

By including the least significant 12 bits of the field in the mask 0x1FFFFFF, 
the subtraction of this masked value from 0x1F40000 causes the least 
12 bits to change of the sph_timestored field to change. I don,t believe that 
this is
the intent of the formula. I think the intent of the formula is:

sph_time(stored) = 
   0x1F40000 - (sph_time(observed) & 0x1FFF000) + 
   (CYCLE_TIME & 0x01FFF000) + (sph_time(observed) & 0x0000FFF)

An Editorial side note:  Why do we have these equations processing the combined
cycle count and cycle offset fields and then mask off the cycle offset field?  
not make the equations work only on the cycle count field?  This is how the 
is shown.  The results, shown below, are much clearer...

syt.cycle_count(stored) =  syt.cycle_count(observed) - (CYCLE_TIME.cycle_count 
& 0xF);

if ( sph_time.cycle_count(observed) < CYCLE_TIME. cycle_count)
  sph_time.cycle_count(stored) = 0x1F40 - sph_time.cycle_count(observed) + 
  sph_time.cycle_count(stored) = sph_time.cycle_count(observed) - CYCLE_TIME;

* For T10 Reflector information, send a message with
* 'info t10' (no quotes) in the message body to majordomo at

More information about the T10 mailing list