Even though the clock speed is very slow, 15 or possibly 44 cycles per second, the brain is running a signiicant portion of the 100 billion (in a human) CPU's in parallel.
Or maybe better described as cascade, since the output of one Neuron may feed a thousand other cells.
40 watts sounds about right, the total human idle power consumption (for air contitioning calculations) is 150 watts.
as to the operating mechanism, at the machine level the code is extremely simple. If a cell gets >x input "yes" pulses in a certain <z time, it fires, unless it gets >y "inhibit" pulses. Memory and learning are accomplished by changing x, y and z.
at the functional level, arrays of pulses pass through the brain, reenforcing and interfering with each other. Hologram pioneer Lloyd Cross said in a guest lecture that thought is a hologram. Much of this is "hard wired" sort of the human BIOS.
I believe the language we learn as a child is the Operating System.
So we see why it takes millions of computer operations just to simulate a single brain cell. The knowledge to be gained from this experiment is, hopefully, priceless.