Biosynthesis of NAD+
Nicotinamide adenine dinucleotide (NAD+) and its phosphorylated analog, NADP+, are important coenzymes that participate in a number of biological processes involving electron transfer. NAD+ contains an AMP moiety as part of the molecule:

NAD+ synthesis requires nicotinate (vitamin B6), which is derived from tryptophan. In the first step, nicotinate ribonucleotide is formed from nicotinate and PRPP:

In the following steps, an AMP moiety is transferred from ATP to nicotinate ribonucleotide to form desamido-NAD+. Finally, the carboxyl group of desamido-NAD is converted to amide using glutamine as an ammonia donor:

NADP is obtained by phosphorylation of the 2'-OH of the adenine ribose by ATP in the presence of NAD+ kinase.