Added calculation for don't care term "D"