Sensory informations collected through various sensory organs are processed in CNS. Only few of these informations elicit immediate motor response whereas most of such informations are stored as memory for future use in thinking process. Storage site of such informations is cerebral cortex and some lower parts of brain and even spinal cord. Storage of information occurs through synapses. When sensory information passes through a synapse, the synapses become more capable of transmitting the same type of signal next time by a process called facilitation. Repeated transmission of message several times causes synapses to become so facilitated that even same signals could be transmitted through same synapses even in the absence of sensory input. This gives a person, the perception of experiencing the original sensation. After the memory is stored, they become part of brain processing mechanism for future thinking.
Nervous system versus computer
Both human nervous system and a computer work in similar fashion and are comparable in many respects. Input circuit of a computer is comparable to sensory portion of nervous system which collects various informations from key board/mouse/USB etc and pass it on to CPU. The output circuit of computer is comparable to motor portion of CNS and displays the information on monitor/screen of computer. CPU is used for processing and analyzing input and output informations just like brain and spinal cord in nervous system. Brain also works through stored information/memories just like computer.