Potassium nitrate exhibits a reentrant phase transformation, where a metastable ferroelectric phase (gamma-KNO3) is formed upon cooling from high temperature. The layered structure of this ferroelectric phase is composed of alternating layers of potassium ions and nitrate groups; wherein, a central nitrogen atom is coordinated by three equilateral triangular oxygen atoms. The group layer is located less than midway between the cation layers, giving rise to a polar structure. From a structural perspective, the calcite phase of calcium carbonate looks quite similar to this ferroelectric phase; however; it does not exhibit a ferroelectric transition. In this work we have performed an ab initio computational analysis to study the: structural stability, electronic characteristics, and bonding of various phases and ferroelectric properties of CaCO3 and KNO3. We find that both material systems have mixed covalent and ionic bonding. The covalent interactions are within the group atoms of carbonate and nitrate atoms while the ionic interactions occur between the negatively charged ( carbonate or nitrate) group and the calcium or potassium cations. For the low temperature stable phase of CaCO3 (calcite), however, there is a slight covalency between the cations and the oxygen atoms of the group. This latter interaction results in the crystallization of CaCO3 in the calcite form and prevents a ferroelectric transition. We suggest that, in analogy to KNO3, a metastable form of CaCO3 may also exist, similar to the phase of gamma-KNO3 that should have a spontaneous polarization equal to 30.6 mu C cm(-2), twice that of gamma-KNO3. Moreover, our analysis indicates that this material should have a coercive field smaller than that of gamma-KNO3.