what others have already described is the way to go, but ultimately it is dependent on how many rungs, instructions, memory spaces you use, to not that some instructions take up more memory than others. As Steve has already mentioned account for the number of I/O modules you need plus leaving room for spare IO is good practice. if you can tell us what kind of application you are doing, and roughly how much IO you need, then we can probably give you a better answer