Post Reply 
(SR-52) Real Determinants
06-16-2020, 04:08 PM
Post: #1
(SR-52) Real Determinants
An excerpt from Programmable Calculator Evaluation of Real Determinants, Interface Age, May 1980 (pgs 104-107), M. Patt & L. Fisher {University of Lowell}

" … pocket calculator program … presented for use with the Texas Instruments Model SR-52 (Algebraic) … self-contained and complete, fits on a single magnetic card … enable an operator to quickly evaluate real determinants of sizes two-by-two through six-by-six … most accurate when all determinant elements are integers. Errors are generally less than 0.001 % for a six-by-six (worst case) determinant with all integer elements.
SOLUTION BY GAUSSIAN ELIMINATION
The program written for the SR-52 calculator evaluates the determinant by a modified Gaussian elimination process. Through the systematic addition of rows, this procedure develops a lower-triangular matrix whose determinant is equal to that of the original matrix. The determinant is then evaluated by taking the trace (product of elements on the diagonal) of the lower-triangular matrix … "

BEST!
SlideRule
Find all posts by this user
Quote this message in a reply
05-02-2024, 09:15 AM
Post: #2
RE: (SR-52) Real Determinants
As author (Fisher) of the article mentioned, thanks.

I'm sure many programmers of calculators of that time can identify with, the challenge in programming was limited data register count (nominally 20) and limited program storage (223 steps). I ended up packing one data register with both an index table (most significant digits) and code (least significant digits).

Ah, simple times, LOL.
Find all posts by this user
Quote this message in a reply
Yesterday, 09:43 AM (This post was last modified: Yesterday 12:34 PM by Thomas Klemm.)
Post: #3
RE: (HP-67) Real Determinants
The article contains also a program for the HP-67.
It can be used with this online-emulator: HP-67
Click the emulator display for the menu page, → Program and just paste the following code:
Code:
PROG
224
001: 31 25 11 : f LBL A
002: 35 71 00 : h F? 0
003: 22 11    : GTO A
004: 35 51 00 : h SF 0
005: 31 51    : f x=0
006: 34 06    : RCL 6
007: 33 05    : STO 5
008: 84       : R/S
009: 31 25 11 : f LBL A
010: 34 05    : RCL 5
011: 81       : /
012: 33 24    : STO (i)
013: 31 33    : f DSZ
014: 35 34    : h RC I
015: 33 09    : STO 9
016: 01       : 1
017: 33 08    : STO 8
018: 51       : -
019: 84       : R/S
020: 31 25 12 : f LBL B
021: 31 22 07 : f GSB 7
022: 01       : 1
023: 00       : 0
024: 22 09    : GTO 9
025: 31 25 13 : f LBL C
026: 31 22 08 : f GSB 8
027: 01       : 1
028: 04       : 4
029: 22 09    : GTO 9
030: 31 25 14 : f LBL D
031: 35 71 01 : h F? 1
032: 22 14    : GTO D
033: 33 14    : STO D
034: 01       : 1
035: 04       : 4
036: 31 22 03 : f GSB 3
037: 34 14    : RCL D
038: 31 25 14 : f LBL D
039: 31 22 07 : f GSB 7
040: 01       : 1
041: 07       : 7
042: 22 09    : GTO 9
043: 31 25 15 : f LBL E
044: 35 71 00 : h F? 0
045: 22 15    : GTO E
046: 33 14    : STO D
047: 01       : 1
048: 07       : 7
049: 31 22 03 : f GSB 3
050: 01       : 1
051: 07       : 7
052: 31 22 04 : f GSB 4
053: 34 14    : RCL D
054: 31 25 15 : f LBL E
055: 31 22 08 : f GSB 8
056: 01       : 1
057: 09       : 9
058: 22 09    : GTO 9
059: 32 25 15 : g LBL f E
060: 35 71 01 : h F? 1
061: 22 31 15 : GTO f E
062: 33 14    : STO D
063: 01       : 1
064: 09       : 9
065: 31 22 03 : f GSB 3
066: 01       : 1
067: 09       : 9
068: 31 22 04 : f GSB 4
069: 01       : 1
070: 09       : 9
071: 31 22 05 : f GSB 5
072: 34 14    : RCL D
073: 32 25 15 : g LBL f E
074: 31 22 07 : f GSB 7
075: 00       : 0
076: 31 25 09 : f LBL 9
077: 00       : 0
078: 35 51 02 : h SF 2
079: 35 22    : h RTN
080: 31 25 07 : f LBL 7
081: 35 71 01 : h F? 1
082: 31 22 09 : f GSB 9
083: 35 71 01 : h F? 1
084: 84       : R/S
085: 35 61 00 : h CF 00
086: 35 51 01 : h SF 1
087: 22 07    : GTO 7
088: 31 25 08 : f LBL 8
089: 35 71 00 : h F? 0
090: 31 22 09 : f GSB 9
091: 35 71 00 : h F? 0
092: 84       : R/S
093: 35 61 01 : h CF 01
094: 35 51 00 : h SF 0
095: 31 25 07 : f LBL 7
096: 33 14    : STO D
097: 34 06    : RCL 6
098: 09       : 9
099: 81       : /
100: 33 07    : STO 7
101: 34 14    : RCL D
102: 31 51    : f x=0
103: 35 53    : h Rv
104: 31 51    : f x=0
105: 34 07    : RCL 7
106: 33 14    : STO D
107: 33 71 05 : STO * 5
108: 35 22    : h RTN
109: 31 25 05 : f LBL 5
110: 31 22 07 : f GSB 7
111: 01       : 1
112: 07       : 7
113: 22 05    : GTO 5
114: 31 25 04 : f LBL 4
115: 31 22 07 : f GSB 7
116: 01       : 1
117: 04       : 4
118: 22 04    : GTO 4
119: 31 25 03 : f LBL 3
120: 31 22 07 : f GSB 7
121: 01       : 1
122: 00       : 0
123: 31 22 06 : f GSB 6
124: 31 25 04 : f LBL 4
125: 31 22 06 : f GSB 6
126: 31 25 05 : f LBL 5
127: 31 22 06 : f GSB 6
128: 31 25 06 : f LBL 6
129: 34 24    : RCL (i)
130: 22 02    : GTO 2
131: 31 25 07 : f LBL 7
132: 35 33    : h ST I
133: 35 51 02 : h SF 2
134: 09       : 9
135: 33 81 07 : STO / 7
136: 35 53    : h Rv
137: 35 22    : h RTN
138: 31 25 09 : f LBL 9
139: 34 14    : RCL D
140: 81       : /
141: 31 25 02 : f LBL 2
142: 35 52    : h x<->y
143: 35 24    : h x<->I
144: 35 53    : h Rv
145: 34 24    : RCL (i)
146: 51       : -
147: 31 34    : f ISZ
148: 35 53    : h Rv
149: 35 24    : h x<->I
150: 35 54    : h R^
151: 35 71 02 : h F? 2
152: 22 02    : GTO 2
153: 34 15    : RCL E
154: 81       : /
155: 33 24    : STO (i)
156: 31 34    : f ISZ
157: 32 25 14 : g LBL f D
158: 35 53    : h Rv
159: 35 53    : h Rv
160: 35 24    : h x<->I
161: 35 33    : h ST I
162: 31 34    : f ISZ
163: 35 54    : h R^
164: 35 22    : h RTN
165: 31 25 02 : f LBL 2
166: 31 61    : f x!=0
167: 22 02    : GTO 2
168: 35 53    : h Rv
169: 34 07    : RCL 7
170: 31 25 02 : f LBL 2
171: 33 71 08 : STO * 8
172: 33 15    : STO E
173: 22 31 14 : GTO f D
174: 32 25 13 : g LBL f C
175: 34 09    : RCL 9
176: 02       : 2
177: 71       : *
178: 35 33    : h ST I
179: 22 07    : GTO 7
180: 00       : 0
181: 22 09    : GTO 9
182: 32 22 15 : g GSB f E
183: 22 31 13 : GTO f C
184: 31 22 15 : f GSB E
185: 22 31 13 : GTO f C
186: 31 22 14 : f GSB D
187: 22 31 13 : GTO f C
188: 22 08    : GTO 8
189: 31 25 07 : f LBL 7
190: 22 24    : GTO (i)
191: 31 25 09 : f LBL 9
192: 31 22 03 : f GSB 3
193: 00       : 0
194: 31 22 04 : f GSB 4
195: 00       : 0
196: 31 22 05 : f GSB 5
197: 34 00    : RCL 0
198: 31 42    : f P<>S
199: 34 09    : RCL 9
200: 51       : -
201: 31 42    : f P<>S
202: 33 71 05 : STO * 5
203: 22 08    : GTO 8
204: 32 25 13 : g LBL f C
205: 34 14    : RCL D
206: 33 81 05 : STO / 5
207: 31 25 08 : f LBL 8
208: 34 08    : RCL 8
209: 33 71 05 : STO * 5
210: 34 05    : RCL 5
211: 23 00    : DSP 0
212: 31 24    : RND
213: 35 84    : h SPACE
214: 84       : R/S
215: 32 25 11 : g LBL f A
216: 31 43    : f CL REG
217: 35 61 00 : h CF 00
218: 35 61 01 : h CF 01
219: 43       : EEX
220: 04       : 4
221: 42       : CHS
222: 33 06    : STO 6
223: 44       : CLx
224: 35 22    : h RTN
DATA
26
00: 0
01: 0
02: 0
03: 0
04: 0
05: 0
06: 0
07: 0
08: 0
09: 0
10: 0
11: 0
12: 0
13: 0
14: 0
15: 0
16: 0
17: 0
18: 0
19: 0
20: 0
21: 0
22: 0
23: 0
24: 0
25: 0
STATE
7
DEG
FIX
2
1
0
1
1
HELP
1

CARD
11
Title: Real Determinants
A: 1st
B: 2nd
C: 3rd
D: 4th
E: 5th
a: reset
b: 
c: answer
d: 
e: 6th
END

There's a typo in the listing at line 4:
Code:
STF 0    31 51 00

That should be:
Code:
SF 0     35 51 00

Example

\(
\begin{vmatrix}
2 & 11 & 23 & 41 \\
3 & 13 & 29 & 43 \\
5 & 17 & 31 & 47 \\
7 & 19 & 37 & 53 \\
\end{vmatrix}
= 880
\)

f a
0.00

2 A
3 A
5 A
7 A
-4.00

11 B
13 B
17 B
19 B
3.00

23 C
29 C
31 C
37 C
3.00

41 D
43 D
47 D
53 D
3.00

f c
880.


PS: It's nice to have the author here in this forum.
Find all posts by this user
Quote this message in a reply
Yesterday, 12:35 PM
Post: #4
RE: (SR-52) Real Determinants
Interesting! Downloaded the article to see how you did this given the SR-52 memory “constraints”

You used the two extra registers R98 and R99. You also used a register of program memory R88 as a data register and then used 7 of the SR-52’s pending operation registers for data (R63 - R69)

Bravo. Have any other SR-52 material lying about ?
Find all posts by this user
Quote this message in a reply
Yesterday, 12:42 PM
Post: #5
RE: (SR-52) Real Determinants
On closer inspection I noticed other typos.

Line 74:
Code:
GSB 7a    22 07
Should we rather trust the code or the key sequence?
Code:
074: 22 07    : GTO 7

A GTO instruction would make the next line dead code.
Thus I'd got with the key sequence:
Code:
074: 31 22 07 : f GSB 7

This also fixed the Error I got when using subroutine e for the 2nd time.

Line 135:
Code:
STO / 9    33 81 07

Code:
135: 33 81 07 : STO / 7

The description of register 7 is: Modified zero approximator
Based on the following table I assume that the typo is in the key sequence.

Replacement
1.0 × 10-4
1.1 × 10-5
1.2 × 10-6
1.4 × 10-7
1.5 × 10-8

This is the sequence we get if 10-4 gets divided by 9.
Therefore I keep the line as is.

Meanwhile I've updated the program accordingly in my previous post.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)