Using arithmetic

The following steps should be performed using integer arithmetic:

  1. Select one of the following values, according to the type of encoding required: Call the value A.
  2. Divide the value of the MDENC field by A; call the result B.
  3. Divide B by 16; call the result C.
  4. Multiply C by 16 and subtract from B; call the result D.
  5. Multiply D by A; call the result E.
  6. E is the encoding required, and can be tested for equality with each of the values that is valid for that type of encoding.