Understanding Diode ROM
There are no connections where the lines cross (there's no black dot to indicate a connection) so only D2 is pulled low. The others stay high, so the voltages are 5/0.7/5/5 = 1011.
The diodes are to prevent sneak paths as would occur if the diodes were replaced by shorts. Only a is low, so the other diodes (where present) are either unbiased or reverse biased. Only the one diode to D2 comes into play.