  For a wide class of noninteracting tight-binding models in one dimension we
present an analytical solution for all scattering and edge states on a
half-infinite system. Without assuming any symmetry constraints we consider
models with nearest-neighbor hoppings and one orbital per site but arbitrary
size of the unit cell and generic modulations of on-site potentials and
hoppings. The solutions are parametrized by determinants which can be
calculated from recursion relations. This representation allows for an elegant
analytic continuation to complex quasimomentum consistent with previous
treatments for continuum models. Two important analytical results are obtained:
(1) An explicit proof of the surface charge theorem is presented including a
unique relationship between the boundary charge $Q_B^{(\alpha)}$ of a single
band $\alpha$ and the bulk polarization in terms of the Zak-Berry phase with no
unknown integer left. This establishes a precise form of a bulk-boundary
correspondence relating the {\it boundary charge of a single band} to bulk
properties. (2) We derive a topological constraint for the phase-dependence of
the edge state energies, where the phase variable describes a continuous shift
of the lattice towards the boundary. The topological constraint is shown to be
equivalent to the quantization of a topological index $I=\Delta
Q_B-\bar{\rho}\in \{-1,0\}$ introduced in an accompanying letter
[arXiv:1911.06890]. Here $\Delta Q_B$ is the change of the boundary charge
$Q_B$ for a given chemical potential in the insulating regime when the lattice
is shifted by one site towards the boundary, and $\bar{\rho}$ is the average
charge per site (both in units of the elementary charge $e=1$). This
establishes an interesting link between universal properties of the boundary
charge and edge state physics discussed within the field of topological
insulators.
