The Deutsch-Jozsa algorithm to implement an
f -controUed-NOT transformation on a quantum computer was generalized to create arbitrary phases.This phase-creation algorithm was applied to solve an extended Deutsch problem for afunction that maps
{0,1}n to
{0,1}m .Implementation of the algorithm on an NMR quantum computer is discussed.