Mitochondria and chloroplast have their own genes hence they are called semi-autonomous organelles.
Through a sequence of chemical processes that move electrons through a membrane, mitochondria produce energy. A number of protein complexes, or big globs of protein that embed in the mitochondria's internal membrane, are essential to this process. The remaining genes in the mitochondria all contribute in some way to energy production.
Like mitochondria, chloroplasts have their own DNA, which scientists believe was passed down from an ancestor that was a photosynthetic cyanobacterium that was ingested by an early eukaryotic cell. Chloroplasts must be inherited by each daughter cell during cell division since they cannot be produced by the plant cell.