I read somewhere (sorry can't find the source) that adding 22 Ohms resistor on a digital line helps in matching impedance. Is it true? Is this a common value? Where should this be added? Near node A or B or on both?
That sounds like someone gave you a "rule of thumb" for doing series termination. The purpose of a series terminator, placed close to the source or output of the chip, is to match the output impedance of the driver to the impedance of the trace on the board. A lot of times people don't bother / can't figure out the output impedance of the driver so they just default to using some value like 22, 33, etc. Assuming then that the output impedance is in the 28 to 17 Ohm range respectively, and that your transmission line impedance is 50Ohms.
The purpose of a series terminator is one to match the output driver to the transmission line, and two to absorb reflections from the far end.
This assumes that your trace is long enough to be a treated/act as a transmission line in the first place.
You should take a look at some transmission line theory to better understand what is happening here.
Two other interesting things. One if you can get yourself access to a simulator like Hyperlynx you can actually see the effect of changing the series terminator, you might even be able to use spice. Two sometimes EMI guys will put resistors on traces not for impedance matching but to try and slow down the edge to reduce the high frequency content. Sometimes that's ok for your signal sometimes not.
That resistor is not a termination. It's recommended that you place it near the driver, so clearly not a load termination; it's not quite a source termination (or is it?), because you would need a similar termination on the load side. The problem is, if you did that you would have your voltage divided by 2 on the load. So the next best thing we can do is to prevent reflected voltages (*) from damaging the driver. It also helps somehow to reduce EMI, by smoothing out sharp edges, as it forms a low pass filter with the trace capacitance.
(*) There is an almost perfect reflection, because the load termination is essentially an open circuit
22 ohm you'd get alot of useless heat and no matching. 22 ohm would be fine for certain high speed lines where you don't care much about IV deviation induced by the resistor noise itself.