HP Articles Forum
[Return to the Index ]
[ Next ]
Hewlett Packard HP-25 Calculator: The Minimum Computer
Posted by James Blodgett on 2 Apr 2000, 9:14 p.m.
The Hewlett-Packard HP-25 programmable calculator is the cheapest complete computer system on the market today. This statement may raise debate. For one thing, I am saying that the HP-25 is a computer while several cheaper programmable calculators are not. Second, despite its simplicity I am saying that it is a complete system. Both points are matters of definition and debate, but my definition makes good sense.
What, after all, makes a computer? At what level of complexity does a programmable calculator become a computer? At present common usage gives no precise distinction. But since loops, nested loops, and alternate sequences of operations are fundamental to programming, I would like to suggest that a system is a computer if it can do them, and is not otherwise. In general, this means that it must be able to do some form of conditional branching. Besides, I have tried programmable calculators without conditional branching, and they are simply not much fun. They can do only one short sequence of steps in one way, so the complexity of their programs is strictly limited. Conditional branching allows complexity. And the HP-25 is the cheapest programmable with conditional branching.
(This is not to say that a cheaper programmable might not be the best buy for many people. For some practical applications, a little programming goes a long way. And on some models, it is possible to simulate simple loops by pushing some version of the "run" button over and over.)
Another possible point of contention is my calling eh HP-25 a complete system. I call it complete because it computes, by itself, and it is all you have to buy. At this writing (Feb '76) there are more ambitious computers advertised in the price range of the HP-25, but they are by no means all you have to buy. for example, the Altair 680 CPU board in kit form lists for the same price as the HP-25 at retail ($195), although the 680 is not yet discounted while the HP-25 is. But the 680 CPU board is a "complete computer" only to those who are ready to wire it into something else--and that something else had better include some memory. Even the 680 "complete" kit with memory, front panel and case for $345 is a complete computer only to those who are willing the enter and read out both data and machine language instructions in binary, do this each time the machine is turned on, and flip switches forever. This might provide interesting recreational computing for some people, but the machine by itself is certainly not very practical. Most Altair users buy at least a terminal, the Basic language (available as of Feb. '76 only on the Altair 8800) and the extra memory necessary to support Basic, and these additions put the system in the $2,000 range.
One might also question my statement that the HP-25 is a complete computer because of features which it lacks, or because of the general limits of the system. Hewlett-Packard, for example, calls the HP-25 only a "programmable calculator, " while their HP-65 is "fully programmable" because it can store its programs on small magnetic cards. Such storage is certainly a useful feature, but it is not a necessary feature for programming to intellectually "fell like" computer programming. The HP- 25 feels like a computer, and it doesn't need a card to do so.
(The new Texas Instruments SR-52 also has a card, and twice the memory and program capacity of the HP-65 for half the price. Readers contemplating purchase might well consider the SR-52; the HP-25 is the cheapest but not necessarily the best choice.)
The HP-25 is in fact quite limited for a computer: it has 49 steps of programming and 8 memory registers, plus 5 registers in its operational stack. Refusing to call it a computer because of its limits, however, is mainly a matter of preference for larger systems. I would call the HP-25 a computer despite its limits. The system it defines is not at all trivial. It can do enough so that it is fun to program, and it is also useful, and will do a reasonable fraction of the personal computing that a mathematically oriented user would do with a much larger system.
Indeed, the very fact that the system is limited has both practical and recreational advantages. A larger system can be very impractical when one is seduced into wasting days solving what had at first appeared to be a simple problem, writing hundreds of steps, debugging, and improving the output. If one has an HP-25 and a problem can't be solved on it, one knows that the problem will take a substantial amount of programming on a larger system, and this is a very good point at which to ask whether the solution is worth the trouble.
Another recreational and educational advantage of a limited system is that one is much more quickly forced to optimize programs. Optimal programs are much better esthetically than sloppy programs, and there is a real feeling of craftsmanship in knowing a system well, trying every trick in the book, and finally being able to shoehorn a complicated problem into a limited number of steps.
An example of a recreational problem may give some idea of the possibilities and limits of the HP-25. I have been trying since I bought the machine to make it play ticktacktoe. I am almost certain that this is impossible in such a limited machine, but it is less impossible than one might think at first.
For example, there are nine positions in a ticktacktoe board--how can one store the contents of these positions in only eight memory registers? Well, the machine can take a number with a decimal point and throw away either the fractional or the integral component. Thus it is possible to extract a specific digit in a larger number by placing the decimal point in front of the digit, taking the fractional component of the number, then multiplying this fractional component by ten and looking at the integral component. It is also possible to place a digit in any decimal position by multiplying the digit by ten-to-the-power of the desired decimal position and adding the resulting number to the number in a storage register. (Unfortunately the ten-to-the-power function is slightly off in the last decimal place for ten-to-the-seventh and higher powers, but if necessary this can be corrected by a few steps of programming.) Since one can both take out and also put a number in any decimal position, the ten decimal places in one register can be used as ten different memory locations. Thus if necessary a representation of the ticktacktoe board can be stored in only one register.
A more fundamental limitation for implementing ticktacktoe is that the small number of branches which are possible in 49 steps seems much lower than the number of decisions a computer must make in playing tacktacktoe. The number of branches possible for the HP-25 is much less than 49 because a branch requires from one to five steps depending on what one is doing. In order to branch it may be necessary to bring the two numbers to be compared into the two appropriate registers, specify the logical test to be applied, and specify the two different directions to go to depending on the outcome of the test, and this totals five steps.
My latest thought is to sequentially peel off digits from a sequence of memory registers and use these digits as a sort of higher- level programming language to specify the sequence of application of a group of subroutines, thus in a sense expanding the programming capacity. I am fairly sure that this will not work, since the peeling-off and branching program alone will take quite a few steps, and there might be room for only about four or five very short subroutines.
Whether or not it can be implemented, the ticktacktoe problem is an example of the complexity and richness of strategy possible in what seems at first to be a very limited system. And despite the difficulty with ticktacktoe, by no means are all games excluded. For example, the Applications Programs book that comes with the HP-25 includes a moon- landing program and a version of nim. And I have written an ESP testing game, a ball-bouncing game, and others. Games which can be implemented tend to be relatively simple, however. The best game is the system itself.
From the Nov-Dec 1976 issue of Creative Computing: A Creative Computing Equipment Profile. Reprinted in The Best of Creative Computing - Volume 2 Feb 1977. (Not in the updated version, published several years latter when the HP-25 was no longer available.) © Creative Computing 1976. Reprinted with permission. Thanks to David Ahl, Editor.
[Curator's note: When James sent this to me I read the first sentence and realized that I had read it two decades ago in The Best of Creative Computing Volume 2 while sitting on my bed with my HP-25 next to me and my Altair 8800 three feet away. I had just flipped the bootstrap code into the Altair and was waiting for it to load Extended BASIC from an audio cassette tape at 30 characters per second - a ten minute process when it worked. Twenty years and 3000 miles of moves later, the Altair and The Best of Creative Computing are still just a few feet away along with several HP-25s.]
[ Return to the Message Index ]
Go back to the main exhibit hall