We analize the statistical mechanics of a long-range antiferromagnetic model defined on a D-dimensional hypercube, both at zero and finite temperatures. The associated Hamiltonian is derived from a recently proposed complexity measure of Boolean functions, in the context of neural networks learning processes. We show that, depending of the value of D, the system either presents a low temperature antiferromagnetic stable phase or the global antiferromagnetic order disappears at any temperature. In the last case the ground state is an infinitely degenerated non-glassy one, composed by two equal size anti-aligned antiferromagnetic domains. We also present some results for the ferromagnetic version of the model.