Wireless Sensor Networks (WSNs) are used to perform distributed sensing in various fields, such as health, military, home etc. In WSNs, sensor nodes should communicate among themselves and do distributed computation over the sensed values to identify the occurrence of an event. This paper assumes the no memory computation model for sensor nodes, i.e. the sensor nodes only have two registers. This paper presents an optimal architecture for the distributed computation in WSN and also claims that this architecture is the optimal for the described computation model.