What comes next?
|
10-15-2024, 02:53 PM
(This post was last modified: 10-15-2024 05:37 PM by Thomas Klemm.)
Post: #22
|
|||
|
|||
RE: What comes next?
(10-15-2024 01:34 PM)Gil Wrote: My next question is if I may ask: what is the code algorithm you used in your first post to get the binomial coefficient? Let me again add some comments: Code: 00 { 24-Byte Prgm } ; a_n We keep the increasing number of elements \(n\) in register 00. Let's assume we're at the situation of post #4 and we want to add 35. The difference is calculated in register X while the sum for the next value is calculated in register Y: \( \begin{array}{|l|l|l|} \hline X & Y & Z \\ \hline 35 & 35 & 6 \\ 15=35-20 & 50=35+15 & 5 \\ 5=15-10 & 55=50+5 & 4 \\ 1=5-4 & 56=55+1 & 3 \\ 0=1-1 & 56=56+0 & 2 \\ 0=0-0 & 56=56+0 & 1 \\ \hline \end{array} \) Meanwhile the counter in register Z is decremented until it is 0. I suggest to give Free42 a try. You can copy and paste the program when the simulator is in program mode: PRGM. Switch back and clear the registers with CLEAR ▼ CLRG. And then just follow the example. Press ▼ to single step through the program. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)