??? 05/27/08 14:40 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#155157 - not input only Responding to: ???'s previous message |
Volatile is not for input only. It is also for outputs. Or even output side-effects resulting from reading. Consider the following cases:
1) The variable represents an output port. Writing two values to it in a certain order they must arrive in that order on the output. 2) Or two variables representing two outputs, also then the order of writes must be preserved. 3) Or one variable is an input and another is the output (data and clock?). You don't want to read the data before you strobed the clock. 4) The variable represents a buffer. Reading it removes the data from the buffer and shifts in the next value. Even a dummy read is important in this case. Maarten |
Topic | Author | Date |
keyword volatile | 01/01/70 00:00 | |
Opposite! | 01/01/70 00:00 | |
volatile modifier | 01/01/70 00:00 | |
Incorrect | 01/01/70 00:00 | |
incorrect! | 01/01/70 00:00 | |
even more | 01/01/70 00:00 | |
A heap o' trouble | 01/01/70 00:00 | |
the curse of the PC programmers | 01/01/70 00:00 | |
meaning of "volatile" with example | 01/01/70 00:00 | |
example | 01/01/70 00:00 | |
gobbelygook | 01/01/70 00:00 | |
heap? | 01/01/70 00:00 | |
Confused? | 01/01/70 00:00 | |
Google told me... | 01/01/70 00:00 | |
link | 01/01/70 00:00 | |
go through my explanation | 01/01/70 00:00 | |
put simply... | 01/01/70 00:00 | |
thanks | 01/01/70 00:00 | |
answer accepted by interviewer | 01/01/70 00:00 | |
Not entirely | 01/01/70 00:00 | |
not input only | 01/01/70 00:00 | |
That's the kind of thing I'd be looking for...![]() | 01/01/70 00:00 |