A “four digit” address is NOT 100 to 127. These are still considered 2 digit for Digitrax systems and decoders. NCE systems can consider these addresses two or four digit. Some systems don’t allow 100 to 127 at all. Digitrax (and the NMRA) defines these as 2 hexadecimal digits which means 00 to ff or 1 to 127 in decimal. Four digit is defined as 128-9983 for Digitrax and 128-9999 by NMRA definition.
For a four digit address, the calculation of CV17 and CV18 is intensive for anyone.
Here is a link to a calculator that does this for you.
Link to Model Rail Forum