While explaining the working of a half wave rectifier, why is 'A' always positive and 'B' always negative during positive half cycle? Similarly why is 'A' negative and 'B' positive during negative half cycle? Please explain as soon as possible.
A and B are reference voltages.
The assumption is that A is expected to be positive and B is expected to be negative or common (As if your were measuring DC with a multi-meter with A as the positive terminal and B as the common).
During the positive half cycle of the input voltage, you will read a positive voltage since A is greater than B. During the negative half cycle of the input voltage, you will read a negative voltage because B is now greater than A, or to put in terms you are using, B is positive and A is negative.
If you were to draw a Sine wave (starting at 0 and moving in the positive direction) and call it A minus B, it will show you when A is positive and negative with respect to node B, which are your positive and negative half cycles.
Now flip the Sine wave and call it B minus A. This shows you when B is positive and negative with respect to node A. You will see that the voltages are opposite and that B is positive on the negative half cycle.
As for the half wave rectifier operation. The diode only allows current to flow when voltage of node A is greater than the voltage of node B (Ideally, true diodes have their own voltage drop usually described in textbooks as 0.7V that must be overcome). Due to this, you will only see the positive half wave of the input voltage signal across the load, therefore it can be considered DC as the current does not flow in the opposite direction.
To visualize this, cover the bottom half of a Sine wave.
Let's get one thing clear - the phase of the incoming mains AC is unimportant here and, because of that, when we talk about the positive half cycle we refer to the secondary voltage i.e. the voltage between A and B in the OP's diagram. If the incoming mains AC is in-phase or out-of-phase with the secondary, nobody will care in this example and most others.
So, it's purely semantics; when we talk about the positive half cycle and show a picture of a half wave rectifier we absolutely mean that the voltage feeding the anode of the half wave rectifier is positive.
It would be stupid to say that the forward conduction occurs in the negative half cycle because it doesn't make any logical sense.
You've got the cart before the horse.
We call the half-cycle on which the diode conducts the 'positive half cycle'. This distinguishes it from the other half cycle, which we call 'negative'.
There is no reference symbol shown on that schematic, so we cannot talk about any given terminal being positive or negative. However, the 'uninteresting' terminal of the secondary, the one not connected to the diode, sort of assumes the role of a reference terminal. That it's at the bottom of the diagram helps reinforce that choice. With that terminal playing the part of the reference terminal, the 'interesting' one with the diode attached is positive when the diode conducts, and negative when it doesn't.
It doesn't make any difference if you take A positive first or B positive first, but the point is that the current will flow in the load if and only if A is at a higher voltage than that of B.
You may revise the concept here: half wave rectifier introduction.