Insert 5 bits at underlined cp
  i (j)    
1. 1111 1111   Produce h=0111 and l=1000
2. 1111 xxxx 1111 Insert 5/4 elems at [i+1]
3. 0000 0111 1111 j = i+5/4; Zero out [i] & move h to [j]
4. 0000 0011 1111 Shift up 5%4 bits starting at [j]
5. 1000 0011 1111 Or l to [i]

 

Insert 5 bits at underlined cp with gap (no shifting required)
  i   (j)    
1. 1111 1111     Produce h=0111 and l=1000
2. 1111 xxxx xxxx 1111 c = (5+3)/4; Insert c elems at [i+1]
3. 1000 xxxx 0111 1111 j = i+c; Move l to [i]; Move h to [j]
4. 1000 0xxx 0111 1111 ibGap = cp+(5/4)*RSIZE; cbGap = c*RSIZE - 5;

 

Delete 7 bits at underlined cp
  i (j) k    
1. 111x xxxx xx11 0000 Produce h=0011 and l=1110
2. xxxx xx11 0000   Delete 7/4 elems at [i]
3. 0000 0011 0000   j = k-7/4; Zero out [i] & move h to [j]
4. 0001 1000 0---   Shift down 7%4 bits starting at [i]
5. 1111 1000 0---   Or l to [i]

 

Delete 7 bits at underlined cp with gap (no shifting required)
  i (j) k    
1. 111x xxxx xx11 0000 Produce h=0011 and l=1110
2. xxxx xx11 0000   c = 7/4; Delete c elems at [i]
3. 1110 0011 0000   j = k-c; Zero [i]; Move h to [j]; Or l to [i]
4. 111x xx11 0000   ibGap = cp; cbGap = 7%4;