The gain of U1 can be controlled by a digital binary 1248 nibble at ABC. The gain at digital 000 is unity or 1 and the gain at various stages are set by 4051.
Precision Attenuator with Digital Control – delabs
There are eight different gains as the steps of gain resistor network is chosen by 4051. The on resistance of 4051 channel around 100E gets added to U1 pin 2 internal impedance.
Auto ranging 4-1/2 Digit Digital Voltmeter – delabs
You can use separate resistor networks with trimpots for each channel if you require but keep the networks total burden on U1 pin 6 to around 10K, not less than than. You can use this to set the gain of a amplifier with the help of a microcontroller.
A sample and hold is like an analog memory. If The digital control A is low 4066 switch is open, and when A is high switch is closed. U2B is a buffer so as to ensure quick charging of C1 thru 4066 on resistance of 100E.
Mixed and Interface Circuits
U2A is a FET input opamp buffer which does not load or drain the cap C1. When A goes high the input analog sample is stored in C1. A has to be high for say 10*1uF*100E = 1mS, so that a proper stable sample is stored. When A is low C1 undergoes very slow discharge as opamp input resistance and 4066 off resistance is in giga ohms. The accuracy of reading Vout falls with respect to time due to leakage currents.