Temperature compensation of semiconductor