Sunday, May 24, 2015

Data Runs and Signed Integers

After many difficult hours trying to understand this concept, I summarized it in a way I believe will be helpful to others.

Data runs are signed numbers, thus they can take both positive and negative values.  A negative value is determined by the most significant bit (MSB) which is the leftmost bit after a hex number has been converted to binary.  If the MSB is 1, that bit’s value is negative.  If the MSB is 0, the value is positive (or actually zero). 

The offset for the first run will be relative to the start of the file system (sector 0 offset 0), but all subsequent offsets (jump values) will be relative to the previous offset.  The polarity of the jump value ( + or - ) will determine the specific location of the fragment or data run on the disk.  The result is that the disk read and write head may jump forward and backwards to the different file fragments or data runs.  See the image below.
The chart below gives the full explanation.

4 comments:

  1. I believe your Hex value 0xBA is not converted correctly, it should be

    0XBA
    Decimal: 186 Binary: 10111010 Octal: 272 Hexadecimal: 0xBA

    ReplyDelete
  2. Thanks for bringing that to my attention. I will make the correction.

    ReplyDelete
    Replies
    1. When making the correction, I noticed the converted decimal number would actually be -70 because with data runs, the value of the MSB is negative.

      Delete
  3. Thanks for bringing that to my attention. I will make the correction.

    ReplyDelete