In the three decades since Marr put forward his computational theory of hippocampal coding, many computational models have been built on the same key principles proposed by Marr: sparse representations, rapid Hebbian storage, associative recall and consolidation. Most of these models have focused on either the CA3 or CA1 fields, using "off-the-shelf" learning algorithms such as competitive learning or Hebbian pattern association. Here, we propose a novel coding principle that is common to all hippocampal regions, and from this one principal, we derive learning rules for each of the major pathways within the hippocampus. The learning rules turn out to have much in common with several models of CA3 and CA1 in the literature, and provide a unifying framework in which to view these models. Simulations of the complete circuit confirm that both recognition memory and recall are superior relative to a hippocampally lesioned model, consistent with human data. Further, we propose a functional role for neurogenesis in the dentate gyrus (DG), namely, to create distinct memory traces for highly similar items. Our simulation results support our prediction that memory capacity increases with the number of dentate granule cells, while neuronal turnover with a fixed dentate layer size improves recall, by minimizing interference between highly similar items.