The chemical reactions and pathways resulting in the formation of nicotinamide adenine dinucleotide (NAD), beginning with the synthesis of tryptophan or aspartate from simpler precursors; biosynthesis may be of either the oxidized form, NAD, or the reduced form, NADH.