As an addendum to Dr. LeFever's reply:
AIDS-related dementia seems to occur from a release of an excitotoxic
substance by infected phagocytes. HIV-1 does not appeart to directly
infect neurons, but rather induces phagocytes to chronically release
neurotodic proteins which act through NMDA receptors. This could well
explain the neuronal death, and even possibly the onset of cognitve &
psychiatric symptoms long before massive neuronal death occurs.
I don't know the exact mechanism of neurotoxicty in Korsakoff's offhand,
but I bring this up to illustrate that functional (e.g. cognitive) and
neurophysiological deficits may precede the onset of structural damage.
see:
Giulian, et al. Secretion of neurotoxins by mononuclear phagocytes
infected with HIV-1. Science. 14 Dec 1990. 250: 1593-6.