Let's say I have a digital block with 3.3v supply, and the clock is running at 1Mhz. So the clock period is 1us. At every positive edge, I have a current spike of 1 mA (assume the spike is square waveform) with duration of 1 ns, can I say the power consumption for this block is
1mA * 3.3v * 1ns /1us = 3.3uW?
The question is simple. But I have never make it clear to me. Thanks.
yes, that is correct if your circuit only draws current during that 1 nS.
More generally, to calculate the power consumption of your circuit. Integrate your current value for ~10 cycles and multiply by Vdd to get the energy. Then divide by 10*T, where is T is the lenght of your cycle in time to get the power.