Frequency distribution plots and sorting

A machine-language program can read at a rate high- er than the balance microprocessor refresh rate (35 times higher in this case) and is therefore ca...
0 downloads 0 Views 7MB Size
BALANCE SEGMENT

INTERFACE

p!q

COMWTER BIT

-f=

X REGISTER

ACCUMULATOR

STORE AT

LOAD ACCWLATOR WITH VALUE AT ADDRESS A + X

GND

I 5

AND WITH 22'4

I

COMPARE WITH VALUE AT

UlMPARE WITH VALUE AT RDORESS B + Y

-+$

6

EQUAL

7 DECREENT X

Figure 7. Balancelcomputer interface.

YES

used since TTL chips draw far too much current from the balance's microprocessor. Since the signal was intercepted at the point where the display unit plugs into the main circuit board, the balance components were not altered in any way. The hardware is similar to an interface described elsewhere (13).The software differs significantly although the general approach is the same; namely, to read the interface as often as necessary until the first digit is acquired, then obtain the second digit and repeating the process until allsix are acquired. Reading using BASIC may cause errors since the Mettler 440 balance has no "hold" input control. Since a BASIC reading routine operates a t a lower speed than the refresh cycle, the balance output could change during acquisition. A machine-language program can read a t a rate higher than the balance microprocessor refresh rate (35 times higher in this case) and is therefore capable of reading the entire set of digits on one balance refresh cycle. I t wasnecessary to include a delay loop t o allow the data for each digit to stabilize on the lines. Although no failures were encountered using a single cycle read routine, the read cycle was repeated as an additional precaution (Fig. 8). Additional software and hardware details including a sample program to determine density using Achimedes' Principle are available from the author. All are for the User Port of Commodore computers which contains a built-in interface adapter. Apple users may add a fi522 i n t e r f a adapter (14).

Enhance Your beadsheet Capabilities: ~re~uenc$'6istributionPlots and Sorting. ~~

Richard T. Luibrand and Varon SmHh California Stale University Hayward. CA 94542 Elecrronic spreadsheet programs have proven to he useful tools to the srientific as well as the husiness mmmunity (15). Several applications for chemical educators have been de-

DECREMENT Y

Figure 8. Machine language routine to read the interface. The portion on the leh reads and stores the balance digits Wlce while that on the right compares the two sets. The A addresses ere far any unused RAM. The values at the B addresses are digit select values stored by the BASIC portion of the Program. The machlne language program far the Commodore 64 is 160. 12, 162. 10, 173, 1. 221, 153. 112, 23, 41, 224, 217, 112, 24, 208. 241. 202.224. 0,208. 238, 136. 192,0.208.231, 162. 6, 160. 12, 189. 112.23.217, 112.23.208. 217, 136. 202, 224, 0. 208,242.96.

scribed. including maintaining made records (16-18), calculating and plotti& titratiun & v e s 1 1 % calculating activity coefficients frmn cell potentials (20). and cherking general chemistry laborator; calculations (21). Although most have the common mathematical oper-

by a BASIC program if the information is saved to the disc in a Data Interchange Format ( D I P ) file. Examples of BASIC programs that can read DIF files, including file handling subroutines for the Apple 11, IBM, and TRS-80 computers have been described (22). Applications that allow a frequency distribution plot to be obtained for scores in a spreadsheet, and a sorting capability are described here. 8 DIF

is a trademark of Soltware Arts. inc. Volume 64

Number 3

March 1987

241

A frequency distribution is a list of possible scores with the number of occurrences next to it. If each actual score is represented by an asterisk, a graph is obtained. Students are generally eager to see this frequency distribution plot for their exams because it provides information about how their performance compares with others, with total anonymity. This method gives more feedback than is available from having only an exam score and a class average, and is a valuable tool because of the reinforcement that it provides to students. The plot is also invaluable for assigning grades. Computers are ideally suited to construct the frequency distribution plot. If grades are recorded manually in agradehook, the scores can he entered and a program that provides both the plot and class average can he run in almost thesame amount of time required to obtain a class average using a calculator. If the scores have already been entered into a spreadsheet program, no additional input of data is required. The data is saved to disk as a DIF file, and a BASIC program that can read the information produces the plot. If your spreadsheet program does not have the capability of sorting, the information can be saved in a DIF file that can be sorted by a BASIC program. The program then writes a new DIF file that can be loaded back into the spreadsheet program. Sorting can be carried out in decreasing or increasing numerical order on the last column of numbers, or alphabetically on the first column of names.

242

Journal of Chemical Education

Two frequency-distribution programs and one sort program can be obtained from Project SERAPHIM on an Apple I1 diskette. Listings of the programs can be obtained from the author. The program that prints the frequency distrihution plot from scores entered directly (for manual grading) has been adapted to several other microcom~uterswith onlv minor modification. Llterature Cited 1. Rodewsld, L. B.: Culp. G. H.; Lapowki.J.J.J . C k m . Educ, 1984.47,134, 2. Clark, H. A ; Marshall,J.C.:laenhour,T L. J . Chem.Educ. 1913.50.645. 3. Fledman, M.; Bishop, M. J. J . Chrm. Edue. 1976,53,91. 4. Sandel, B. B.; Solomon. R. W. J . Cham. Educ 1981,58.799. 5. 5mith.S. G. J . Chem.Edur. 1971.48.727. 6. Od,H. W. J . Chem. Edur. 1975.52,465. 7. Smith.S.G.;Chabay,RJ. J . Chem.Educ. 1980.57.868, 8. Sta1ow.R.D.;Joncas.L.J.J.Chem.Edur. 1980,57,866. 9. Castlabarry,S.J.:Montsgue,E.J.;Lagowki,J.J.J.Res.Sci.Teoch.1970,7,197.Culp, . 1971,8,357. G. H.;Lagowski, J. J. J . Rea. S C ~Teach. 10. Barone. R.; Ribom, B; Gilbert,B.: Meyer, R J . Chem. Educ. 1985,62,411. 11. Kirkland. E. J. Byte 1985. Februay. 251-259. 12. Fanell,J. J. Byte 1986,February, 149-152. 13. Blanck. H. F. J . Chrm. Edue. 1984.61.533. 14. Paul. D.:Wisman. J.COMPUTE! 1981, August. 74. 15. Haye3.B. Sei.Am. 1983,249,22. 16. Spsrmw,G. J . Chem.Educ. 1985.62.139, 17. Can,J.0.. Grenc, P.: Kinnen, D. Computers Chem. Educ. Newel. 1986,IX (I),6. 18. Suder, R. J . Chem. Educ. 1985.62.499, 19. Bmneman.G L. J . Cham. Edur. 1986,63,321. 20. Ro8enberg.R.M.:Hobbs,E. V. J . Chem.Edue. 1985,62,14O. 21. Lbrahim, S. I. J.Chem.Educ. 1986.63.322. 22. Herzeri, D. Mostwing VisiCaic; Sybex:Berkeley, CA, 1983.