Brains are pattern recognition machines that output symbols. Consciousness is the brain symbolizing itself; a symbol for the ability to create symbols. Our sense of self is a convenient, easily produced, recursive manifestation that we employ to recognize patterns in our own behavior. This ability is apparently evolutionarily beneficial (speeding up learning and adaptation), not to mention cool (full disclosure: I may be biased).
The functioning of the symbol generator is not revealed by its constitutive components, but how they are put together (this is true of anything, because only change and interaction create meaning, their absolute subunits are arbitrary). Consciousness is an inevitable result of a sufficiently powerful symbol generator.
Perception is the intersection of senses. Consciousness is the ability to replay perceptions, and it emeges once enough sense domains converge.