|
|
|
Section 3: Automatic Memory Stack and ALPHA Register54
|
|
Example. A bacteriologist tests a certain strain
whose population typically increases by 15% each day
(a growth factor of 1.15). If he starts a sample culture
of 1000, what will be the bacteria population at the end
of each day for five consecutive days?
|
|
Method: Put the growth factor (1.15) in the Y-,
Z-, and T-registers and put the original population
(1000) in the X-register. Thereafter, you get the
new daily population whenever you press
× .
|
|
|
|
|
|
1.15 _
|
1.15000
|
1.15000
|
1.15000
|
1000 _
|
1,150.0000
|
1,322.5000
|
1,520.8750
|
1,749.0063
|
2,011.3572
|
|
|
When you press × the first time, you
calculate 1.15 × 1000. The result (1,150) is displayed in the
X-register and a new copy of the growth factor drops into the Y-register.
Since a new copy of the growth factor is duplicated from the T-register each
time the stack drops, you never have to reenter it.
|
|
Notice that performing a two-number operation such as
× causes the number in the T-register to be
duplicated there each time the stack is dropped. However, the
R function simply rotates the contents of the stack
registers; it does not rewrite any number, but merely shifts the numbers that
are already in the stack.
|
|
|
|