Design and Characterization of a Built-In CMOS TID Smart Sensor