How can I address the slaves for my master device?

How do you convert the dip switch to address?
How do you assign address for each device(1 master and 3 slave) with dip switch?
How do call a slave device from master with respective address?
How do you code that all?

I did not understand clearly. Could you please explain me in detail. or with Examples, or with code sinppets, or with some references or with any sources?????