Calculators

Historical Document · 1972

Hewlett-Packard Journal, June 1972: the HP-35

Read the PDF ↗

The Hewlett-Packard Journal of June 1972, introducing the HP-35, with articles on its design, its algorithms and accuracy (Cochran) and its packaging.

Author
Hewlett-Packard
Year
1972
Type
Historical Document
Credit
Hewlett-Packard; scan via hparchive.com.

← Back to the Reference Library

Hewlett-Packard Journal, June 1972: the HP-35

JUNE 1972 HEWLETT-PACKARD JOURNAL ® The ‘Powerful Pocketful’: an Electronic Calculator Challenges the Slide Rule This nine-ounce, battery-powered scientific calcu- lator, small enough to fit in a shirt pocket, has logarithmic, trigonometric, and exponential functions and computes answers to 10 significant digits. By Thomas M. Whitney, France Rodé, and Chung C. Tung HEN AN ENGINEER OR SCIENTIST _ transcendental functions (that is, trigonometric, log- NEEDS A QUICK ANSWER to a problem _arithmic, exponential) or even square root. Second, that requires multiplication, division, or transcen- _ the HP-35 has a full two-hundred-decade range, al- dental functions, he usually reaches for his ever- lowing numbers from 10°° to 9.999999999 X 10*°° present slide rule. Before long, to be represented in scientific however, that faithful ‘slip stick’ notation. Third, the HP-35 has may find itself retired. There’s five registers for storing con- now an electronic pocket cal- stants and results instead of just culator that produces those an- one or two, and four of these swers more easily, more quickly, registers are arranged to form and much more accurately. an operational stack, a feature Despite its small size, the new found in some computers but HP-35 is a powerful scientific | rarely in calculators (see box, calculator. The initial goals set | © arc. sin cos - tan jf page 5), On page 7 are a few for its design were to build a | | examples of the complex prob- shirt-pocket-sized scientific cal- lems that can be solved with the culator with four-hour operation HP-35. from rechargeable batteries at a cost any laboratory and many individuals could easily justify. The resulting nine-ounce prod- uct surprises even many who are acquainted with what today’s large-scale integrated circuits can achieve. The HP-35 has basically the same functions and accuracy of other HP calculators, and it is portable. It is a close cousin to the many four-function elec- tronic calculators which have | The enter-exponent key, EEX, appeared in recent years, ini- [7 Wkmam is used for entering numbers in tially from Japan and now from scientific notation. For example, many U.S. manufacturers, However, three features the number 612,000 may be entered as 6.12 EEX 5 or set the HP-35 apart from four-function calculators. 612 EEX 3 or .0612 EEX 7 as well as 612000. The First, none of the four-function calculators has change-sign key, CHS, changes the sign of the man- Data Entry The photograph of the calcu- lator on this page shows how the keys are arranged. Numbers enter the display, which is also called the X register, from left to right exactly as the keys are pressed. Entry is entirely free- field, that is, digits will be dis- played exactly as they are en- tered, including leading or trail- ing zeros. WPS Ae KATA PRINTED IN U.S.A @ HEWLETT-PACKARD COMPANY, 1972 tissa or, if pressed immediately following EEX, the sign of the exponent. Mistakes during data entry can be corrected by use of the clear x key, CLx. A special key is provided for entering 7. Display The display consists of 15 seven-segment-plus- decimal-point light-emitting-diode (LED) numerals. Answers between 10*° and 107 will always be dis- played as floating-point numbers with the decimal point properly located and the exponent field blank. Outside this range the HP-35 displays the answer in scientific notation with the decimal point to the right of the first significant digit and the proper power of 10 showing at the far right of the display. To make the display more readable, a separate digit position is provided for the decimal point. The display is always left justified with trailing zeros suppressed. For instance, the answer to 3 + 4 appears as .75 instead of 0.750000000. Cover: Our thanks to Dr. Dennis R. Clark of the Stan- ford University Department of Pharmacology for allow- ing us to photograph him at work with his HP-35 Pocket Calculator. In this Issue: The ‘Powerful Pocketful’: an Elec- tronic Calculator Challenges the Slide Rule, by Thomas M. Whitney, France Rodé, and Chung C. Tung......... page 2 Algorithms and Accuracy in the HP- 35, by David S. Cochran........... page 10 Packaging the Pocket Calculator, by Edward T. Liljenwall.............. page 12 New Capabilities in Digital Low- Frequency Spectrum Analysis, by Stephan G. Cline and Norman D. Marschk@.. 0.0... 0. ccc eee eens page 14 Answers greater than 10’ (overflow) are dis- played as 9.999999999 X 10°°, and answers smaller than 10°°° are returned as zeros. These are the HP-35’s ‘closest’ answers. Improper operations, such as division by zero or the square root of a negative number, cause a blinking zero to appear. Single-Operand Function Keys The function keys operate on the number dis- played in the X register, replacing it with the func- tion of that argument. The trigonometric functions, sin, cos, tan, arc sin, arc cos, and arc tan operate in degrees only. For inverse trigonometric functions the function key is preceded by the arc key. The angle obtained will be the principal value. The functions log x and In x compute the log- arithm of x to base 10 and base e respectively. The exponential function e* is also provided. Other sin- gle-operand functions are the square root of x, Vx, and the reciprocal of x, 1/x. Arithmetic Keys: Two-Operand Functions The arithmetic functions, +, —, <, and +, and the power function x’, operate on the X and Y regis- ters, with the answer appearing in X. Numbers are copied from X into Y by use of the ENTER’ key. Thus to raise 2 to the 7th power the key sequence is 7, ENTER, 2, x” and the answer 128 is displayed immediately after x” is pressed. This is a general principle: when a key is pressed, the correspond- ing operation is performed immediately. Although raising x to a power can be accom- plished via the formula x” = e” ™ * and in fact is done this way internally, the single-keystroke op- eration is much more convenient. The power, y, can be any positive or negative integer or fraction, while x must be positive. Registers and Control Keys Five registers are available to the user. Four of these, called X, Y, Z, and T, form an operational stack. The fifth, S, is for constant storage. (For clarity, capital letters refer to the registers and lower-case letters refer to the contents of the registers.) Five keys are used to transfer data between regis- ters. The ENTER? key pushes the stack up, that is, x is copied into Y, y into Z, z into T, and t is lost. This key is used as a separator between consecu- tive data entries, such as in the power example just described. Roll down, Ry, is used to view the contents of X, Y, Z, and T. Four consecutive opera- tions of this key return the registers to the original state with no loss of data. 12 | 12 DISPLAY 3.] 3. | 4./12.] 5. | 5.] 6. | 30.| 42 KEY ——} 3 4/x Tl 6 xk STEP NUMBER—*} © | ® @{[o]o]o o|o|]o 3 in display (X register) 3 duplicated into Y register by ENTER 4 in display. e®ee8°8e Product (12) appears in X and stack drops. Automatic ENTER* pushes 12 into Y. Display shows 5. ENTER‘ pushes y into Z, x into Y. x is unchanged. 6 in display. Product (30) appears in X and stack drops. Sum (42) appears in X and stack drops. e@ee8 6 Fig. 1. HP-35 Pocket Calculator has a four-register opera- tional stack (last-in-first-out memory). Here’s how the stack works to solve (3 X 4) + (5 X 6). Answers appear in display register X, in floating-point or scientific notation, to 10 significant digits. The contents of X and Y can be exchanged using xy; this is useful if the operands have been entered in the improper order for x’, —, or +. The constant storage location, S, is accessed via the two keys store, STO, and recall, RCL. The operational stack is automatically pushed up for data entries following any operation other than ENTER?, STO, and CLx. This saves many uses of the ENTER? key. The stack automatically drops down following any two-operand function (+, —, X, +, x’). For example, to do the problem (34) + (5X6) the key sequence is: 3, ENTERT, 4, X, 5, ENTER, 6, X, + (see Fig. 1). ENTER’ is unnecessary be- tween X and 5 because the answer to the first term, 12, is automatically transferred to Y when the 5 is entered. Also, no Rvis necessary after the second < since the first term, 12, is automatically transferred from Z to Y after the multiplication. The clear-all key, CLR, clears all registers includ- ing storage. Initial turn-on of the calculator has the same effect. On the back of the calculator is an instruction panel that provides the user with quick answers to the most commonly asked ‘how-to-do-it’ questions (Fig. 2). The panel also shows an example of a prob- lem solution. System Organization Now let’s go inside and see what makes it work. The HP-35 contains five MOS/LSI (metal-oxide- (EX) crears THe o [eHis} Cuan PLN BE USED AS THE FIRS WHEN ENTER NUMBERS x orey [REL {ENTER} PACKARD! EWANE SER. 143A 02986 500mw HEWLETT MADE IN USA PATENT PENDING Fig. 2. /nstruction panel on back of calculator answers most frequently asked questions. semiconductor/large-scale-integration) circuits: three read-only-memories (ROMs), an arithmetic and register circuit (A&R), and a control and timing circuit (C&T). The logic design was done by HP and the circuits were developed and manufactured by two outside vendors. Three custom bipolar cir- cuits are manufactured by HP’s Santa Clara Divi- sion: a two-phase clock driver, an LED anode driver/clock generator, and an LED cathode driver. Fig. 3 is a block diagram of the calculator. The HP-35 is assembled on two printed circuit boards (see Fig. 4). The upper board contains the display and drivers and the keyboard. The lower and smaller board has all the MOS logic, the clock driver, and the power supply. The calculator is organized on a digit-serial, bit- serial basis. This organization minimizes the num- ber of connections on each chip and between chips, thereby saving area and cost and improving reliabil- ity. Each word consists of 14 binary-coded-decimal digits, so each word is 56 bits long. Ten of the 14 digits are allocated to the mantissa, one to the mantissa sign, two to the exponent, and one to the exponent sign. Three main bus lines connect the MOS circuits. One carries a word synchronization signal (SYNC) generated by a 56-state counter on the control and timing chip. On another bus, instructions (Is) are transmitted serially from the ROMs to the control and timing chip or to the arithmetic and register Operational Stacks and Reverse Polish Notation In 1951, Jan Lukasiewicz’ book on formal logic first demon- strated that arbitrary expressions could be specified unam- biguously without parentheses by placing operators im- mediately before or after their operands. For example, the expression (a+b) X (c —d) is specified in operator prefix notation as XX + ab — od which may be read as multiply the sum a plus b by the dif- ference c minus d. Similarly, the expression can be speci- fied in operator postfix notation as ab + cd — X with the same meaning. In honor of Lukasiewicz, prefix and postfix notation became widely known as Polish and reverse Polish, respectively. During the following decade the merits of reverse Polish notation were studied and two simplifications in the execu- tion of computer arithmetic were discovered. First, as re- verse Polish notation is scanned from left to right, every operator that is encountered may be executed immediately. This is in contrast to notation with parentheses where the execution of operators must be delayed. In the above ex- ample, (a + b) X (c — d), the multiply must wait until (c — d) is evaluated. This requires additional memory and bookkeeping. Second, if a stack (that is, a last-in-first-out memory) is used to store operands as a reverse Polish ex- pression is evaluated, the operands that an operator re- quires are always at the bottom of the stack (last operands entered). For (a + b) X (c — d), the reverse Polish, ab + cd — X, is evaluated as follows 7 z. atb » TY a atb| c |a+b stack [x] a b latbl c d_[c—dl(a +b) x (¢—d) Reverse Enter alEnterb| + | Enter clEnter dl] — x Polish These properties have made the notation a valuable tool in the computer industry. All modern computer compilers for languages such as FORTRAN and ALGOL convert state- ments to reverse Polish in some form before producing a program that can be executed. Some computer manufac- turers have even designed their machines with special in- structions to perform stack operations to facilitate execution of reverse Polish. However, the HP-35 is the first scientific calculator to fully exploit the advantages of reverse Polish and automatic stack operations to provide user convenience seldom found in calculators. chip. The third bus signal, called word select (WS), is a gating signal generated on the C&T chip or by the ROMs; it enables the arithmetic unit for a por- tion of a word time, thereby allowing operations on only part of a number, such as the mantissa or the exponent. Control and Timing Circuit The control and timing (C&T) circuit performs the major nonarithmetic, or housekeeping functions in the calculator. These include interrogating the keyboard, keeping track of the status of the system, synchronizing the system, and modifying instruc- tion addresses. The keyboard is arranged as a five-column, eight- row matrix. It is scanned continuously by the C&T chip. When contact is made between a row and a column by pressing a key, a code corresponding to that row and column is transmitted over the I, line to the read-only memory (ROM). This code is the starting address of a program in ROM to service that key. Key bounce and lockout are handled by pro- grammed delays. In all digital systems, status bits or flags are used to keep track of past events. In the HP-35 there are twelve status bits, all located on the C&T chip. They can be set, reset, or interrogated by microinstruc- tions. ROM addresses are updated on the C&T chip and sent serially to the ROMs over the I, bus. During execution of a branch instruction, the appropriate signal—arithmetic carry or status bit—is tested to determine whether the incremented address or the branch address should be selected next. A powerful feature of the serial organization is the ability to operate on just a single digit of a num- ber as it flows through the arithmetic unit. On the C&T chip are a pointer register and a word-select circuit which issue a word-select signal (WS) cor- responding to the time slot being operated upon. The value of the pointer register can be set, incre- mented, and decremented by microinstructions. Read-Only Memory Preprogrammed mathematical routines are stored in three ROM chips, each of which contains 256 instructions of 10 bits each. A specific select code is assigned to each ROM chip. Only one of the three ROM chips is used at any time. When a ROM selec- tion instruction is issued, a decoder inside each ROM checks the select-code field of the instruction. In case of a match, the selected ROM turns on. Un- selected ROMs turn off. A timing circuit on each ROM is synchronized to the SYNC signal issued by the C&T chip as the cal- culator is turned on. This circuit then keeps the ROM chip running synchronously with the rest of the system. A ROM address register on each ROM chip re- ceives the address sent out by the C&T chip. The corresponding instruction is placed on the instruc- Power On Circuit Clock Driver (bipolar) ROM 1 ROM 2 2560 2560 Mos/Ls| ease Mos/Ls! Seu Is Is dws y ws SYNC Pointer Register Address Register Instruction Decoder Word Select Circuitry 12 Status Bits rN SYNC Control Circuitry Control And Timing Circuit (MOS/LSI) Carry Timing Ari Register Cathode Driver (bipolar) LED Display Anode Driver (bipolar) Display Decoder Zz Registers ithmetic And Circuit (MOS/LSI) Fig. 3. Five MOS/LS/ circuits, developed by HP, are manufactured by outside vendors. Three custom HP-developed bipolar IC’s are manufactured by HP. SYNC, Is, and WS are three main bus lines connecting the MOS circuits. tion line, Is, provided the ROM chip is turned on. The ROM chip also issues word-select signals for certain classes of instructions. Arithmetic and Register Circuit The arithmetic and register circuit executes in- structions coming in bit-serially on the Is line. Most arithmetic instructions must be enabled by WS, the word-select signal. Data to be displayed is sent to the LED anode drivers on five lines, and one carry line transfers carry information back to the C&T chip. The BCD output is bidirectional and can carry digits into and out of the A&R chip. The A&R circuit is divided into five areas: in- struction storage and decoding circuits, a timing circuit, seven 56-bit registers, an adder-subtractor, and a display decoder. Three of the registers are working registers. One of these and three of the remaining four registers form the four-register stack. The seventh register is an independent register for constant storage. There are numerous interconnections between reg- isters to allow for such instructions as exchange, Fig. 4. Two printed-circuit boards contain all circuits. Metal humps on the larger board are pressed down by the keys to make contact with printed traces underneath. é These comparisons were made by engineers who are not only highly proficient in slide rule calculation, but were also familiar with the operation of the HP-35. Thus, the solution times should not be taken as typical. They do, however, serve to indicate the relative time advantage of the HP-35 and to point up the still more significant advantage of its accuracy. PROBLEM 1; COLLECTION SOLID ANGLE FROM A POINT SOURCE. 7 -a|-\e | ler YAS bw [= 103 Om HP-35 SOLUTION: 2.6 G) 10.3G)G1G0 1DWwI@es3GI1G) 2G0G)G0 — .1772825509 SLIDE RULE SOLUTION: ise TIME ON HP-35: 20 seconds with answer to ten significant digits. TIME ON SLIDE RULE: 3 minutes, 15 seconds with answer to three decimal places. PROBLEM 2: GREAT CIRCLE DISTANCE BETWEEN SAN FRANCISCO AND MIAMI. As Goaneces|Coab cae-+ aonb aie Coa A} —1—"\\6 b SAN FRANCISCO, b> 90-37.6 = 524° bed Mian C > 90-257 = 64.3 122.4°W a 257°" A= 1224-90. = 42.30 to.l?w How the HP-35 Compares with the Slide Rule HP-35 SOLUTION: 52.4) 64.3 GOGO 52.40%) 64.300) 5) 42.3 ba) IFC) 60 (x) = 2254.093016 SLIDE RULE SOLUTION: 22227" TIME ON HP-35: 65 seconds with answer to ten significant digits. TIME ON SLIDE RULE: 5 minutes with answer to four sig- nificant digits. PROBLEM 3: pH OF A BUFFER SOLUTION. ts |t Eloka w= | Bet Foe a muxrure oF Nav, HPO4(D03P ano NasH POq@ 87x10°3 UL. ne 14 (3x07) (107) + [8.20107] (107) -Ht«Loa) + ( a ( 3x0? | 27x03 AH 10"? TO 7 HP-35 SOLUTION: 7.210) 10 0860 1492.16 2010 .0087 G04) &9),034) 11.72010@)@.0087 7.21 waawa= —7.47877778 SLIDE RULE SOLUTION: -242 TIME ON HP-35: 65 seconds with answer to ten significant digits. TIME ON SLIDE RULE: 5 minutes with answer to three sig- nificant digits. transfer, rotate stack, and so on. An advantage of the bit-serial structure is that interconnections re- quire only one gate per line. Transfers into or out of the stack or the constant register are always whole-word transfers. All other arithmetic instructions are controlled by the word select signal, WS. Thus it’s possible to interchange only the exponent fields of two registers, or to add any two corresponding digits of two registers. The adder-subtractor computes the sum or dif- ference of two decimal numbers. It has two data inputs, storage for carry or borrow, and sum and carry/borrow outputs. For the first three clock times, the addition is strictly binary. At the fourth clock time the binary sum is checked, and if the answer is more than 1001 (nine), then the sum is corrected to decimal by adding 0110 (six). The re- sult is then entered into the last four bits of the re- ceiving register and the carry is stored. A similar correction is done for subtraction. Carry informa- tion is always transmitted, but is recorded by the control and timing chip only at the last bit time of the word-select signal. Simulation and Test of the MOS Circuits In designing elaborate integrated circuits like the C&T, A&R, and ROM chips, two questions that have to be answered at the very beginning are: How is the design to be checked? and How is the final in- tegrated circuit to be tested? The first question has two answers. One is to build a breadboard and compare its operation with the desired operation. A second answer is a com- puter simulation of the circuit. When the MOS cir- cuits (C&T, A&R, and ROMs) for the HP-35 were being designed, the computer simulation approach was chosen over a TTL or MOS breadboard. It was felt that the hardware breadboard wouldn’t be an exact model of the final circuits anyway, and two or three months of development time could be saved by computer simulation because people could work in parallel rather than serially on a breadboard. A general-purpose simulation program, HP- DABEL, had just been developed by Jim Duley of HP Laboratories. This was used to check out each gate, each circuit, each chip, and finally all the chips together. Each MOS circuit is designed as a network of gates and delay elements. For each gate output an algebraic equation was written as function of the inputs to the gate. This produced a large set of algebraic equations to be evaluated every clock time. A printout was available so the operation of any of the gates or delay outputs could be observed, as if with an oscilloscope probe. In this respect the computer simulation was much better than a hard- ware breadboard. Because of the large number of equations to be evaluated each clock time the general-purpose simulation program was too slow to use for evaluat- ing the algorithms implemented in the ROMs. For this a higher-level simulation was used, so only the input/output functions of each subsystem had to be specified. This was fast enough that all the algo- rithms could be checked, even the transcendental functions. If anything went wrong it was always possible to stop the program and step through it until the trouble was found. Correcting a problem was a simple matter of changing a punched card or two. These are advantages a hardware bread- board doesn’t have. The simulation approach proved very successful. It saved a lot of time not only in logic design, but also in generating the test patterns to be used for testing the final integrated circuits. After a simu- lation is running successfully a pattern for each in- put is specified such that virtually every circuit element will be exercised. By running the program and recording all the inputs and outputs a complete test pattern is generated. This is recorded on tape, ready for final test of the IC. Fig. 5. Light-emitting-diode cluster was specially devel- oped for the HP-35. Magnifying lenses are built in. Display and Drivers It was apparent early in the HP-35 planning that new display techniques would be required. Existing light-emitting-diode products used too much power and cost too much. HP Associates developed a mag- nified five-digit cluster which saves both power and cost and is packaged in a convenient 14-pin pack- age (Fig. 5). Each digit has a spherical lens molded in the plastic over it. A slight reduction in viewing angle results, but for the handheld calculator this is not a problem. LED’s are more efficient if they are pulsed at a low duty cycle rather than driven by a dc source. In the HP-35, energy is stored in inductors and dumped into the light-emitting diodes. This drive technique allows a high degree of multiplexing; the digits are scanned one at a time, one segment at a time. Customized bipolar anode and cathode driver circuits incorporating the required features were developed and are manufactured by HP. The anode driver generates the two-phase system clock and the segment (anode) drive signals, decodes the data from the arithmetic and register chip and inserts the decimal point, sends shift signals to the other axis of the multiplex circuitry (the cathode driver), and senses low battery voltage to turn on all deci- mal points as a warning that about 15 minutes of operating time remains. The cathode driver contains a 15-position shift register which is incremented for each digit position. Keyboard Requirements for the HP-35’s keyboard were particularly difficult. The keyboard had to be re- liable, inexpensive, and low-profile, and have a good ‘feel’. The solution is based on the ‘oilcan’ or ‘cricket’ principle, that is, curved metal restrained at the edges can have two stable states. The larger board in Fig. 4 shows the etched metal keyboard strips running horizontally. At each key location the metal is raised to form a hump over a printed-circuit trace running underneath. Depressing a key snaps the metal down to make contact with the trace. The keys have a definite ‘fall-away’ or ‘over-center’ feel so that there is no question when electrical contact is complete. Acknowledgments The many people who contributed to the HP-35 did so with great energy and enthusiasm. There was a feeling throughout the project that we had a tre- mendous winner. Appreciation is due the particu- larly important contributors below: Tom Osborne for the initial product definition and continued guidance on what a calculator was and for whom it was intended. Paul Stoft for providing technical direction and an environment where wild ideas can flourish and for keeping our unbounded optimism in check. Dave Cochran for initial system design, algorithm selection, and sophisticated and clever micropro- gramming. Chu Yen for a super-efficient power supply and work on the recharger/ac adaptor, with the able assistance of Glenn McGhee. Ken Peterson for the automatic logic board tester and for devising novel methods to test the elusive dynamic MOS circuitry. Rich Marconi and Charlie Hill for the design of the display board tester and to Rich for patience through many redesigns of the PC boards. Bill Misson and Dick Osgood for an inexpensive, reliable and producible keyboard. Clarence Studley and Bernie Musch for creative and durable packaging and for not yelling, ‘There’s no more room’ too often. Jim Duley, Margaret Marsden, and John Welsch for assistance in computer programs for test pat- terns, simulation, and microassemblers. Ed Liljenwall for exceptionally creative industrial design work including the improbable result that 35 easily operated keys can exist in a three-by-five- inch area. Tom Holden and Neil Honeychurch for providing a close liaison with the manufacturing division to speed the design of the fabricated parts. And lastly to our behind-the-scenes project lead- er, Bill Hewlett, who initiated the project and kept the fires burning whenever needed. & Thomas M. Whitney Tom Whitney holds BS, MS, and PhD degrees in electrical engineering, all from lowa State University, received in 1961, 1962, and 1964, respectively. With HP Laboratories since 1967, he has served as digital systems section leader and as section manager for the HP-35 Pocket Calculator. He’s also a lecturer at Santa Clara University, currently teaching a course in microprogramming. Away trom electronics, Tom spends as much time as possible outdoors, with skiing, tennis, and camping the major activities. France Rodé France Rodé came to HP in 1962, designed counter circuits for two years, then headed the group that developed the arithmetic unit of the 5360 Computing Counter. He left HP in 1969 to join a small new company, and in 1971 he came back to HP Laboratories. For the HP-35, he designed the arithmetic and register circuit and two of the special bipolar chips. France holds the degree Deploma Engineer from Ljubljana University in Yugoslavia. In 1962 he received the MSEE degree from Northwestern University. When he isn’t designing logic circuits he likes to ski, play chess, or paint. Chung C. Tung Chung Tung received his BS degree in electrical engineering from National Taiwan University in 1961, and his MSEE degree from the University of California at Berkeley in 1965. Late in 1965 he joined HP Laboratories. He was involved in the design of the 9100A Calculator and was responsible for the design and development of two of the MOS/LSI circuits in the HP-35 Pocket Calculator: the control and timing chip and the read-only-memory chips. Now working for his PhD at Stanford University, Chung still manages to find time now and then to relax with swimming or table tennis. Algorithms and Accuracy in the HP-35 A lot goes on in that little machine when it’s com- puting a transcendental function. By David S. Cochran HE CHOICE OF ALGORITHMS FOR THE HP-35 received considerable thought. Power series, polynominal expansions, continued frac- tions, and Chebyshev polynominals were all con- sidered for the transcendental functions. All were too slow because of the number of multiplications and divisions required. The generalized algorithm that best suited the requirements of speed and pro- gramming efficiency for the HP-35 was an iterative pseudo-division and pseudo-multiplication method first described in 1624 by Henry Briggs in ‘Arith- metica Logarithmica’ and later by Volder' and Meg- gitt’. This is the same type of algorithm that was used in previous HP calculators. An estimate of program execution times was made, and it became apparent that, by using a bit- serial data word structure, circuit economies could be achieved without exceeding a one-second com- putation time for any function. Furthermore, the instruction address and instruction word could be bit-serial, too. The complexity of the algorithms made multilevel programming a necessity. This meant the calculator had to have subroutine capability, as well as special flags to indicate the status and separations of var- ious programs. In the HP-35, interrogation and branching on flag bits—or on arithmetic carry or borrow—are done by a separate instruction instead of having this capability contained as part of each instruction, This affords a great reduction in in- struction word length with only a slight decrease in speed. The arithmetic instruction set was designed spe- cifically for a decimal transcendental-function cal- culator. The basic arithmetic operations are performed by a 10’s complement adder-subtractor which has data paths to three of the registers that 10 are used as working storage. Partial word desig- nators (word select) are part of the instruction word to allow operating on only part of a number—for example, the mantissa or the exponent field. Sine Algorithm The sine routine illustrates the complexities of programming a sophisticated calculator. First, de- grees are converted to radians by multiplying by 27/360. Then integer circles are removed by repeat- edly subtracting 27 from the absolute value of the argument until the result is less than 27. If the result is negative, 27 is added to make it positive. Further prescaling to the first quadrant isn't required. The resulting angle is resolved by repeatedly subtracting tan? 1 and counting until overdraft, then restoring, repeatedly subtracting tan“ 0.1 and counting until overdraft, and so on. This is very similar to division with a changing divisor. Next the resulting pseudo- quotient is used as a multiplier. Beginning with an X vector of 1 and a Y vector of 0 a fraction of X is added to Y and a fraction of Y is subtracted from X for the number of times indicated by each multiplier digit. The fraction is a negative power of 10 cor- responding to that digit position. The equations of the algorithm are: pseudo-division {a0 = 6, — tan?k pseudo- Xn = Xa — Yak multiplication Yn. = Yn + Xnk X=1,Y=0 k=10! j=0,1,2... The pseudo-multiplication algorithm is similar to multiplication except that product and multiplicand are interchanged within each iteration. It is equiva- y 1000 el0 L Error in ex 100 | (counts in tenth digit) Vi : l ! lt 100 ; e 1 10 102 103 104 105 106 107 1040 1041 1042 1043 1044 1045 1046 1094 1095 1096 1097 1098 1099 e Fig. 1. Accuracy of exponential function in HP-35 Calculator. Error bound is approximately Se*, where 6 is the error due to prescaling and the algorithm itself. 8 is estimated to be equivalent to one count in the tenth significant digit of the argument x. lent to a rotation of axes. The resultant Y and X vectors are proportional to the sine and cosine respectively. The constant of proportionality arises because the axis rotation is by large increments and therefore produces a stretching of the unit circle. Since this constant is the same for both sine and cosine their ratio is identically equal to the tangent. The signs of each are preserved. The sine is derived from the tangent by the relationship tan 6 Accuracy and Resolution Determination of the accuracy of the HP-35 is as complex as its algorithms. The calculator has in- ternal roundoff in the 11th place. In add, subtract, multiply, divide, and square root calculations the accuracy is +¥2 count in the 10th digit. In calcu- lating the transcendental functions many of these elementary calculations are performed with the roundoff error accumulating. In the sine compu- tation there is a divide, a multiply, and a subtract in the prescale operation, and there are two di- vides, a multiply, an addition, and a square root in the post-computation. Roundoff errors in these calculations must be added to the error of the basic algorithm to get the total error. Accuracy and resolution are sometimes in con- flict; for example, the subtraction of .9999999999 from 1.0 yields only one digit of significance. This becomes very important, for example, in computa- tions of the cosines of angles very close to 90°. The cosine of 89.9° would be determined more accu- rately by finding the sine of 0.1°. Similarly, the sine of 10° wastes all ten digits of significance in speci- fying the input angle, because all integer circles will be discarded. For many functions there is no simple exact ex- pression for the error. The exponential function is a good example. Let § be the accumulated prescal- ing error and computational error in the algorithm, referred to the input argument x. Then for §<<1, aad e*(e* — 1) = 8e%. x e =e = ee 6 Fig. 1 shows the error bound for the exponential function for various arguments, assuming that 8 is equivalent to one count in the tenth significant digit of x. References 1. Jack E. Volder, ‘The CORDIC Trigonometric Com- puting Technique.’ IRE Transactions on Electronic Com- puters, September 1959. 2. J. E. Meggitt, ‘Pseudo Division and Pseudo Multipli- cation Processes,’ IBM Journal, April 1962. i r David S. Cochran Dave Cochran is HP Laboratories’ top algorithm designer and microprogrammer, having now performed those functions for both the 9100A and HP-35 Calculators. He was project leader for the HP-35. Since 1956 when he came to HP, Dave has helped give birth to the 204B Audio Oscillator, the 3440A Digital Voltmeter, and the 9120A Printer, in addition to his work in calculator architecture. He holds nine patents on various types of circuits and has authored several papers. IEEE member Cochran is a graduate of Stanford University with BS and MS degrees in electrical engineering, received in 1958 and 1960. His ideal vacation is skiing in the mountains of Colorado. 11 Packaging the Pocket Calculator The industrial design of the HP-35 was of primary importance, often taking precedence over electrical considerations By Edward T. Liljenwall HE INDUSTRIAL DESIGN OF THE HP-35 was unusual not only for Hewlett-Packard, but for the electronics industry in general. Usually, the mechanical and electrical components of a product are determined before the exterior is designed. The HP-35 took the opposite approach. Since the calculator was to be pocket-sized, size was the overriding constraint on the design. In addition to size three other param- eters were established. The calculator would have thirty to thirty-five keys, contain two or three bat- teries, and have a twelve- to-fifteen-digit LED dis- play. The industrial design be- gan with an investigation of keyboard, packaging, and overall shape concepts. Several basic form factors were studied using sketches and simple three-dimen- sional models. The models were particularly valuable at this stage of develop- ment. They allowed a good evaluation of the shapes and sizes being considered. Once the preferred direction had been established a detailed model was built. The model was well accepted and approval was given to develop the concept into a reality. Only a general idea of the electronic design was 12 known at this point. Designing and packaging all necessary electrical and mechanical components into the tiny product became a tremendous chal- lenge for electrical, mechanical, and industrial de- signers alike. From a human-engineering standpoint, the key- board was the most criti- cal area of the design. The problem was to place thir- ty-five keys in an area ap- proximately 21/2 inches by 4% inches and retain the ability to operate the keys without striking more than one at a time. It became apparent that the industry standard of %4-inch center- to-center key spacing could not be maintained. A suc- cessful compromise was to use 144¢-inch center-to-cen- ter spacing for the numeric keys, and %2-inch spacing for all others. This was made possible by reduc- ing the size of each key, thereby increasing the space between the keys. The keys are divided into groups according to func- tions. The groups are sepa- rated by size, value contrast, color, and placement of nomenclature. The numeric keys, which are most frequently used, are larger and have the strongest value contrast. They have their nomenclature di- rectly on the keys. The next group of keys accord- ing to frequency of use are identified by their blue color, The ENTER? key and arithmetic keys are separated within this group by placement of nomen- clature on the keys. The less frequently used keys have the least value contrast, and the nomenclature is placed on the panel just above the key. The keys have an over-center or snap feel when they are pressed. This comes from special spring contact developed by HP. The electrical and me- chanical parts of the keyboard are less than 1 inch high. The spring contacts are mounted on a printed- circuit board along with several other components including the fifteen-digit LED display. The display is tilted toward the operator for optimum viewing. A second printed-circuit board carries the ma- jority of the electronic components. The two boards are attached by a series of pin connectors. The external package was developed from a hu- man-engineering approach, with aesthetic appeal of major importance. The sculptural wedge shape per- mits the calculator to be comfortably held in the palm of one hand. It also allows the product to slide easily into a pocket. The keyboard and display slope upwards for a better viewing angle in desk-top use. The sculptural sides visually break up the total mass of the package. The top half of the case is highlighted while the bottom half is in shadow. This gives the product the appearance that it is thinner than it actually is. The product appears to be floating when viewed from a normal operating position in desk-top use. The use of textures that complement each other contribute significantly to the overall finesse and appearance. The texture on the case provides a non-slip surface, important when the calculator is being hand-held. Viewed from the bottom, the calculator retains a clean appearance. There are no exposed screws or other fastening devices. This is aesthetically im- portant to a product that is hand-held and viewed from all sides. The polyvinyl-chloride feet preven