The water comes to home from underground pipes. The main entry of water into home goes to water heater. Because water heater controls the temperature of the hot water and can regulate the water. So water heater gets water from ground. Water heater heats the water using the gas and then send it across.
We have 2 water heaters one for 1st floor and other for 2nd floor. Hot water is distributed by separate water heaters to 1st and 2nd floors. Cold water is common for both of them.
Inputs to water heater
1. Cold water from ground (white color pipe)
2. Gas for heating (black color)
3. Temperature monitored wife (brown colored wire)
Output from water heater
1. Heated water
2. Cold water (interestingly it sends out the cold water also). Looks like the input cold water gets distributed to hot and cold compartments in heater system. So it will distribute both cold and hot water.
3. Temperate measurement