RMA
Member
In my last year at Glasgow Uni in 1966 I indulged myself by taking the newly introduced course in "Computing". This allowed us a few seconds access to the newly installed English Electric KDF9 each week, in its day, also quite a big step forward in computer design (Apart from speed, one of it's main advantages over the EE DEUCE, which it replaced, was that being transistorised it didn't need to be shut down for an hour every night to change a bunch of thermionic valves (tubes, for our friends across the pond) according to a pre-defined maintenance rota!).
In those days, were I to have been daft enough to do a multiply by 2 (or 4, 8, etc.) instead of using Left Shift, I'd have been hung, drawn and quartered by the Prof.
Things seem to have changed! According to the OPs List for my S7 317-2 DP CPU, the operation times for the respective commands are as follows:
Thinking about it for a couple of seconds, it's not so surprising that the DWORD multiplication is faster than WORD, but who would have guessed that a DWORD multiplication would be 30% faster than Shift Left!
Does this apply to other PLCs as well?
In those days, were I to have been daft enough to do a multiply by 2 (or 4, 8, etc.) instead of using Left Shift, I'd have been hung, drawn and quartered by the Prof.
Things seem to have changed! According to the OPs List for my S7 317-2 DP CPU, the operation times for the respective commands are as follows:
Code:
SLW 0,19 µs
SLD 0,26 µs
*I 0,22 µs
*D 0,17 µs
Thinking about it for a couple of seconds, it's not so surprising that the DWORD multiplication is faster than WORD, but who would have guessed that a DWORD multiplication would be 30% faster than Shift Left!
Does this apply to other PLCs as well?
Last edited: