  Two compounds, tetragonal YB$_4$ and cubic YB$_6$, have been investigated by
electric-field gradient (EFG) and Knight shift measurements at the boron sites
using the $^{11}$B nuclear magnetic resonance (NMR) technique and by performing
first-principles calculations. In YB$_6$ $^{11}$B ($I=3/2$) NMR spectra reveal
patterns typical for an axially symmetric field gradient with a quadrupole
coupling frequency of $\nu_Q=600\pm15$ kHz. In the second boride (YB$_4$) three
different EFGs were observed corresponding to the three inequivalent
crystallographic sites for the boron atoms ($4h$, $4e$, and $8j$). They
correspond to: $\nu_Q(4h)=700\pm30$ kHz with an asymmetry parameter
$\eta=0.02\pm0.02$, $\nu_Q(4e)=515\pm30$ kHz, $\eta=0.00+0.02/-0.00$, and
$\nu_Q(8j)=515\pm40$ kHz, $\eta=0.46\pm0.08$. The Knight shifts measured by
Magic-Angle Spinning (MAS) NMR at room temperature are very small being
$0.6\pm8$ ppm and $-1\pm8$ ppm for YB$_4$ and YB$_6$, respectively. For the
theoretical calculations structure optimizations were performed as a first
step. For the obtained structural parameters the EFGs were computed within the
local-density approximation. Very satisfactory agreement between experimental
and theoretical results is obtained both for the structural parameters and the
B EFGs thus confirming the underlying structural models. In addition to the
EFGs, band structures, densities of states, and valence-electron densities are
presented and the bonding situation in the two yttrium borides is discussed.
The band-structure results are compatible with the very low values for the
Knight shifts mentioned above.
