I saw a site which claime a 4 microsecond time for an 8 bit add on the uno. THen another poster said that should be 4 milliseconds.
Anybody know the correct time duration for the addition of 2 8 bit numbers?
Adding two registers is one clock. Loading the data from memory will be a couple more. Storing the result back into memory adds a few more. It really depends on what you're looking at (e.g. are you looking a single ADD instruction in assembly, or something like x=a+b in C).
Definitely not 4 ms though.
4uS is 64 clock cycles.
8-bit add would be a lot less than that I would think.
Maybe only self-measurable with 4uS accuracy using micros();
If you put a scope/logic analyzer on an output pin I bet you would see it faster:
PORTD = PORT | B00000100; / set D2
PORTD = PORTD & B11111011; // clear D2
x=y+z; //8-bit add
PORTD = PORT | B00000100; / set D2
use scope analyzer to see how D2 is low for.
I bet only a few 62.5nS cycles.