Calculators

Historical Document · 1981

BYTE, January 1981: Hand-Held Computers

Read the PDF ↗

Pages from BYTE's hand-held computer issue of January 1981, on the TRS-80 Pocket Computer and its rivals.

Author
BYTE
Year
1981
Type
Historical Document
Credit
BYTE; scan via Valentin Albillo's archive.

← Back to the Reference Library

BYTE, January 1981: Hand-Held Computers

®@ JANUARY 1981 Vol. 6.0N0. 1 $2.50 in USA/9®.95 %h Canada e © A McGray-Hijl Pubficatipn e * _ HAND-HELD COMPUTERS i WOME Gueeem cons sae Circle 3 on inquiry card. UCSD" PASCAL FORTRAN PORTABLE Develop on a Z-80t, run on LSI-11%, T. |. 990, 6800 or vice versa EFFICIENT Structured, readable Speeds development X5 Easy maintenarice POWERFUL Full standard Pascal or ANSI'77 FQRTRAN plus extensions. Concurrency; multiple users soon. Cost-EFFECTIVE Complete system with compiler, editors, inter- preter, asseribler and utilities from $350. NOW AVAILABLE Operating System Compilers Programmer Utilities Data Base Management Word Processing Business and Medical Software Games, Home:& Hobby POPULAR MICROS SUPPORTED DEC, Radio Shack, Apple, Microengine, CP/M§ based and others PCD SYSTEMS P. 0. Box 143 Penn Yan, NY 14527 315-536-3734 The Hand-Held Computer Chris Morgan, Editor-in-Chief There's a new trend in personal computing today—the HHC (hand-held computer), For years computer aficionados have dreamed of a computer small enough to fit in one’s pocket, yet powerful enough to do the sorts of jobs that full-size microcomputers do today. Amazingly enough, the dream_is coming true. There are now no less than four models (the Radio Shack/Sharp, the Panasonic/Quasar, the Hewlett- Packard HP-41C, and the Sinclair ZX80) that fall roughly into the ultra-small computer category. One might quibble with calling the HP-41C a “computer” rather than a programmable calculator, but it has all the necessary elements to qualify: memory, processor, I/O (input/output), and a full line of peripherals. Each of these computers is discussed in this issue. Among the new crop of HHCs, the Panasonic/Quasar (reviewed on page 34) is perhaps the most impressive in terms of engineering innovations; it sports some features that many full-size personal computers don’t have, such as the ability to run for long periods from battery power alone—an impressive achievement when you realize that the unit uses, not a CMOS (complementary metal-oxide semiconductor) processor, but a standard 6502! It also has such niceties as user-definable keys, a built-in real-time clock, uninterruptible storage of user programs, and the ability to produce color images on a color television (with the addition of an optional interface unit). The Radio Shack HHC has its own attractions, including its (relatively) low price of $250 and its surprisingly complete BASIC interpreter. The first time I saw the Radio Shack unit was at the WestCoast Computer Faire last spring, where it was being shown in its original form from Sharp. I was intrigued, but I quickly concluded it was just a passing fad. Not until I used the computer at length did I begin to realize its potential. Here was a machine capable of run- ning complex BASIC programs—and it was truly portable! (I have to admit that a lot of the fun connected with these units is taking them out of one’s pocket and showing them to noncomputer people.) What about the practical considerations of typing programs on such a tiny keyboard? Well, at first it felt awkward, but I quickly adjusted to it. (The Panasonic/Quasar is a bit better in this regard, because the keys are spaced more widely apart.) Speaking of attractive prices, the Sinclair ZX80, for $200 or so, has its own appeal. Strictly speaking, it’s not a hand-held computer because it uses a separate AC adapter. Still, it’s tiny and can be easily transported. It has become an overnight sensation in England. As our review on page 94 points out, the ZX80 has some bad characteristics, such as screen blankout during ex- ecution of programs. Even so, a student or other beginner in computer pro- gramming could learn a lot with this machine in conjunction with its introduc- tory BASIC book (included in the purchase price), which seems to be very good. Why all the sudden interest in miniaturization? In part, it’s the logical culmination of the never-ending battle to put more and more capability into less and less space. Combine that with the recent Japanese trend toward miniature hi-fi components, and you begin to see the driving forces involved. The Panasonic and Quasar Hand-Held Computers Beginning a New Generation of Consumer Computers Arthur C Clarke talked about them in his futuristic novel Imperial Earth. Jerry Pournelle and Larry Niven talked about them in The Mote in God's Eye. The subject is hand-held computers that can run programs, re- mind you of upcoming appointments, and serve as portable intermediaries between you and large, immobile, mainframe computers. Are they still science fiction? No, the hand-held computer is here—and for less than the price of some color televisions. The HHC (hand-held computer) is a device about the size of a standard paperback book with two inches added to its longest dimension (see photo 1). Its weight is under a pound, yet it has the capabilities (when ex- tended with portable peripherals) to do anything that existing personal computers do. The device, developed jointly by the Japanese corpora- tion Matsushita (pronounced mat- SOOSH-ta) and Friends Amis of San Francisco, is being marketed in America by Panasonic and Quasar. Photographs in this article show both 34 ‘January 1961 © BYTE Publications Inc Gregg Williams, Editor Rick Meyer, Friends Amis c/o BYTE 70 Main St Peterborough NH 03458 a It Is Impossible to lose the work you are do- Ing by pressing the OFF key. el the Quasar and the Panasonic ver- sions. Description of the HHC System The Quasar/Panasonic HHC is an integrated package of hardware and software that has the ability to do anything that other personal com- puters do. The HHC unit has the following characteristics: e Dimensions; 22.7 by 3.0 by 9.5 cm (8%. by 1%. by 3% inches); Weight: 397 grams (14 0z.); ©6502 microprocessor running at 1 MHz; @Sixty-five-key keyboard with two- key rollover; 159 by 8 dot low-persistence LCD (liquid-crystal display); eUninterrupted storage of all user programs and other data through use of a unique “power-down” circuit; eRedefinition of all keys during execution of an application program; e@Redefinition of all characters displayed on the LCD display and printer during execution of an application program; @2 K bytes of programmable mem- ory, expandable to 4 K bytes internal- ly or any practical limit (up to a theoretical limit of 4 megabytes) ex- ternally, by adding programmable memory peripherals; ©16 K bytes of internal ROM (read- only memory) with sockets for four program capsules containing up to 64 K bytes of application programs or data (additional ROM, up to a the- oretical limit of 4 megabytes, can be added externally through ROM peripherals); @An internal real-time clock with a resolution of %55 second; eA built-in nickel-cadmium battery pack that supplies all power to the unit; Internal shielding against RF (radio- frequency) interference in compliance with the new regulations from the Federal Communications Commis- sion; eAn internal set of application pro- grams that includes a four-function calculator, a free-form file system and editor, as well as several other func- tions. In addition, the capabilities of the HHC are greatly extended by an in- tegrated system of intelligent periph- erals that include: eA bus expander through which other modules are connected to the HHC; eA portable thermal printer that prints 16 characters per line; eA ROM extender that allows you to attach an additional four program or data capsules; eA programmable-memory extender that allows you to add additional memory to the HHC; eA 110/300 bps modem and tele- computing program through which the HHC can act as a remote terminal to other computers and to large infor- mation utilities and data bases; eA cassette interface module that transfers data to a microcassette recorder at 1200 bps; eA color television interface that allows a display of 16 lines of 32 char- acters each or up to 48 by 64 pixel (picture element) graphics in eight colors and black. When connected to the HHC, all of the above peripherals can fit in a custom case the size of an average attaché case, or they can be intercon- nected to make a flat, rigid, easily portable combination. With the ex- ception of the color television inter- face, the HHC and the peripherals can operate without connections to any outside power source, thus mak- ing the system truly portable and hand-held. Photo 2 shows the HHC and several of its peripherals, Innovations in the HHC The Panasonic/Quasar HHC em- bodies several technical break- throughs. Without these develop- ments, a computer as small and as powerful as the HHC could not have been built. One of the most important innova- Bue: mM as ae aE Ms an Quasar HHCs (hand-held computers). Both units shown are prototype models and will have the same keyboard layout in the finished versions. tions in the HHC is the proprietary “power-down” circuit that allows the HHC to use the popular 6502 micro- processor in a hand-held device. In the past, manufacturers have designed hand-held products around microprocessors like the 1802. Such devices use a very small amount of current and can be powered by bat- teries, but they force the designer to use a slow microprocessor with a weak instruction set. Designers have been prevented from using the more popular micro- processors because of their high cur- rent drain: a conventional 6502-based circuit (using the same batteries as the HHC) would discharge them in about two hours. But, with this power- down circuit and additional hardware innovations, the amount of current needed to power the HHC in both its fully functioning and “off” (powered- down) modes is drastically reduced. A related feature of the HHC is that when the OFF button has been pressed, the computer is still on. It is in a dormant state that uses only January 1981 © BYTE Publications Inc 35 Photo 2: The HHC and its peripherals. The HHC computer is in the center of the photograph. The peripherals are (clockwise, from upper left): a programmable-memory extender, the'color television interface, the I/O driver (a distributor of bus signals from the HHC to other peripherals), an acoustic-coupler modem, a portable printer, a cassette interface, and a ROM expander. a All functions are selected via a set of nested menus. De enough current to retain the contents of the HHC’s display image and CMOS (complementary metal-oxide semiconductor) memory and to pre- serve the real-time clock and key- board functidéns. A side benefit of this feature is that it is impossible to lose the work you are doing by pressing the OFF key; when you press the ON key, the computer resumes whatever it was doing before it was turned off. A specially designed 44-pin bus connector allows you to connect and disconnect the HHC and its periph- erals while all the components are powered up. Because of this feature, the HHC and its peripherals can join their respective data, address, and control buses without destroying data in either unit. As an additional safety feature, the ‘piezoelectric beeper in- side the HHC sounds if the HHC finds any loose connectors. The ability to connect and discon- 36 January 1981 © BYTE Publications Inc nect modules while the power is on is very important because it allows the unit to be used in a variety of com- binations without worrying that data will be destroyed by doing so. The HHC and its peripherals can be con- sidered as interconnecting modules, and you can effectively forget that they contain volatile data. For exam- ple, when future program-develop- ment capsules become available, you will be able to write a program while traveling, then debug it more easily by hooking the HHC into the color TV adapter and printer. Data can also be entered into an HHC memory peripheral that may then be detached from the HHC and given to another HHC owner. He or she can plug it in- to another HHC and access the data that was stored. Friends Amis has invented a par- ticularly elegant solution to the packaging of programs in ROM (read-only memory). This solution also allows denser storage of informa- tion than was previously possible. The HHC uses 24-pin ROMs that are packaged in a plastic carrier around which the pins of the ROM are bent (see photo 3). This combination is called an Amis Memory System Cap- sule (patent pending). (When a cap- sule is inserted into the back of the HHC, the flat base of each pin makes contact with the socket. This insures a good electrical contact without the usual fragility of integrated circuit pins.) Since a minimal amount of hardware is used to package the ROMs, more can fit inside the small body of the HHC. These capsules have already been used in the Craig, Panasonic, and Quasar language translators (also developed by Friends Amis), and in the Friends Amis point of information display computer. Cap- sules can contain data to be manipulated (eg: words in a French language capsule), application soft- ware (eg: a capsule of game pro- grams), programming languages (eg: a BASIC capsule), or any other data that the computer can act upon. Cap- sules can hold 2 K, 4 K, 8K, or 16K bytes of information. The 16 K-byte ROM allows an unprecedented amount of data to be stored in a small space. The large amount of informa- tion that can be stored in the HHC is increased by its internal use of a threaded language and by the ap- plication of a set of data compression techniques. Human-Engineered Features As a direct result of the manufac- turers’ desire to design a computer specifically for the mass market, the Quasar/Panasonic HHC was devel- oped with a heavy emphasis on human engineering. This design philosophy is reflected in the opera- tion and features of the HHC. The keyboard has always been a crucial interface between the user and the computer, and the popularity of several existing microcomputers has been largely influenced by the us- ability of their keyboard. This fact, coupled with the small size of the HHC, makes it necessary for the HHC keyboard to be as usable as possible. We feel that the designers have achieved this objective. [Despite my initial disbelief that a keyboard this small could be of any practical use, I was soon convinced that the HHC keyboard is easy to use and that, given some familiarity with it, I could use the keyboard without being distracted from the task at hand...GW] Photo 1 indicates that the keys on the HHC are arranged in the standard typewriter format. In addition, a key can be pressed without pressing any adjacent keys, so it is possible to touch-type on the HHC, regardless of individual finger width. This fact allows the HHC to be used in text ap- plications—an area not practically accessible by any other device of its size, Another powerful feature of the HHC is its ability within an applica- tion program to redefine any key position to any function. With the addition of a keyboard overlay, this can provide a keyboard that is com- pletely suited to a given application. It was the intention of the HHC de- signers that no application, regardless of complexity, would require mem- orization of command language or special key sequence (like control-P for print) to perform a function avail- able to the computer but not allotted a key. With redefinable keys and keyboard overlays, this will never happen. Three special keys, labeled f1, 2, and f3, can be assigned to be any se- quence of keystrokes, including most function keys. When one of these keys is typed, its current definition is input as if the sequence of keys had been typed by the user. The defini- tions are processed as interrupts and are independent of the program in use. Thus, they can be used with any Present or future programs, even those written in BASIC or SNAP (the two computer languages currently planned for the HHC). For example, one key can be assigned to a sequence of calculations and/or constant values for use with the built-in calculator. Another key can be used to enter repetitive text in the memory bank text editor or to create special functions such as search-and-replace. Another definition can be used to make a commonly used sequence of menu selections to reach a frequently used program. A unique feature of the HHC is the HELP key. When this key is pressed, you are prompted by the LCD display to press any key to find its definition. When a key is pressed, the function is given in a complete sentence of up to 80 characters. For example, pressing the HELP key followed by the STP/SPD key causes the message “STOP / ENTER 1-9 FOR SPEED” to be displayed. Four HHC keys are used to indicate LEFT, RIGHT, UP, and DOWN. In most programs, these keys are used for cursor control and horizontal and vertical scrolling. Since the HHC’s built-in display shows only one short (26-character) line at a time, it is im- portant to be able to “steer” the display through a larger page or list of material. The display is often used as a window into a larger virtual space (as is done in the popular VisiCalc program), and the four direction keys, which are auto-repeat keys, move the window in any direc- tion. Another key, STP/SPD (stop/ speed), allows you'to freeze and con- tinue any program, like a run/ stop switch, and to adjust the rate of information display. The HHC also has INSERT and DELETE keys that allow text material to be changed. The HHC normally displays a solid rectangular cursor, but when you enter the insertion mode, the cursor changes to a blink- ing checkerboard cursor. Similarly, wor || First _| Letters BorRoweD | First | SECOND |NEXT LETTER | REMAINING NUMBER*| FROM LAST WORD | LETTER | NUMBER * | OF NEW WORD | LETTERS OF NOT (COUNT NEW WORD * copieo | FORWARD) SLOW -- -- - -- -- -- SLUMP 2 se o+ 6 ae ee SLY 2 at u+ 4s ae -- SMALL 1 = t+ 1s ie Uae: SMART 3 Sahin" lL + 6: oR Baca Figure 1: Compression of an alphabetized list. The tables of alphabetized lists within the HHC are kept as small as possible by using numbers to keep track of the number of letters shared from the previous word and the number of letters-between the first dif- ferent letter in the new word and its counterpart in the previous word. Note that the shaded letters on a line make up the word being encoded, but only the two numbers and the letters in the last column (all marked with an asterisk in their table headers) are ac- tually stored in the encoded table. The dashes indicate an empty entry (as in the line for the. word SLY). The first line is all dashes because it does not have a previous line to refer to; in practice, all the letters of the first entry must be normally encoded. Photo 3: Close-up of an HHC program capsule. The program capsule is actually a stan- dard 24-pin integrated circuit with its pins curled around a plastic harness. Its length is 3.65 cm (1%. inches). January 1981 © BYTE Publications Inc 37 Photo 4: The Quasar HHC connected directly to its acoustic coupler. The combina- tion, which is also available in the Panasonic HHC system, is a self-contained portable computer terminal. a The computer executes a FORTH-like language called SNAP. ——— Ey when you enter,the deletion mode, the cursor changes to a rectangular outline cursor. These useful features give you visual feedback regarding the mode that the computer is in. Other keyboard-related features are the search and locate commands available within the memory bank electronic file system. These features are available in two modes—context and initial search. A context search searches for a match to the given character string anywhere in the file, while an initial search searches for a match beginning with the first char- acter of each rétord in the file. The former method allows maximum searching power, but the latter pro- vides a faster search when the posi- tion of the string to be matched is at the beginning of each record (eg: when the file contains last names and telephone numbers and you are given the last name).’_ Other strong keyboard features of the HHC are the size and placement 38 January 1981 © BYTE Publications Inc of certain keys. The SPACE and ENTER keys are in their traditional positions, and both are wider than the other keys for ease of use. Also notice from photo 1 that the CLEAR, ON, and OFF keys are located five rows to the right of the rightmost let- ter key, and at least two rows to the right of any other key. Although the consequences of hitting these keys by accident are less critical than on other personal computers (more on that later), the keys were placed there to minimize the danger. Finally, the behavior of the SHIFT and LOCK keys should be mention- ed. In applications where the pro- gram differentiates between upper- case and lowercase letters, an upper- case letter is obtained by hitting the SHIFT key, followed by the key to be shifted. The HHC is locked into up- percase by hitting the LOCK key after the SHIFT key. You can return to lowercase by hitting either the SHIFT or LOCK keys. The LOCK key can also lock the four cursor-control keys and the INSERT and DELETE keys. The Menu and Other Features To allow for use of the Panasonic/ Quasar HHC with minimal prior knowledge of the machine, all func- tions are selected via a set of nested menus. The first menu that appears when the computer is turned on is called the primary menu. It displays the available internal and capsule program choices (eg: clock/secretary, program capsule, etc) with a 1-digit number assigned to each. A choice is selected by pressing the correspon- ding digit key. If the selected applica- tion allows choices of its own, its menu is displayed in the same way. This process is repeated until an ex- ecutable program is reached. Pressing the CLEAR key causes the HHC to display the second menu (the one immediately after the primary menu). Pressing the CLEAR key twice causes the HHC to return to the primary menu. The HHC computer contains a piezoelectric beeper that can produce either a click (to provide audible feed- back to an event, usually a keypress) or a tone within a four-octave range. Squeezing More into Less There has been recent publicity on threaded languages—most visibly FORTH. (See the special language issue on FORTH, August 1980 BYTE.) Threaded languages offer program compactness and speed of execution halfway between those of machine language and a high-level language like BASIC, while offering the programming ease and language transportability of high-level lan- guages. The Quasar/Panasonic HHC is actually a hardware machine that executes a FORTH-like language called SNAP, in addition to 6502 ma- chine code. The HHC uses SNAP for every function that it performs, from the display of characters on the LCD readout to the handling of interrupts from the peripherals. When timing is critical in a specific routine, such as interrupt handling for high-speed pe- ripherals, SNAP allows any portion of itself to be coded in assembly language for maximal speed. SNAP, like other threaded lan- guages, is defined in terms of a given set of operators (which are analogous to the operation codes of a given microprocessor). SNAP programs are simply lists of these operators, so these programs (including applica- tions programs embedded in program capsule ROMs) may be used without change on any machine that executes the SNAP language, provided no ma- chine code is used. This protects the sizable programming effort put into the HHC against hardware innova- tions in future versions of the HHC, while maintaining a body of pro- grams that execute quickly and use little memory. Another way in which the execu- tion time of programs is decreased is through the use of interrupts for the HHC keyboard and all peripherals. In contrast to other computers which use polling (ie: they periodically check the device to see if it needs computer time), the HHC peripherals and keyboard generate interrupts when they require attention from the 6502 microprocessor. In this way several peripherals can be serviced at once. The HHC slows down only when it is interrupted to do specific work and is therefore faster than computers that waste time polling in- active devices. The HHC peripherals that require serial data all use separate UART (universal asyn- chronous receiver-transmitter) in- tegrated circuits for this purpose. Given the 64 K-byte maximum ad- dressing ability of the 6502 microprocessor, the HHC must somehow pack more memory into less space. It does so, using the familiar technique of bank-switching. Three banks of memory, hexadecimal 2000 to 3FFF, 4000 to 7FFF, and 8000 to BFFF, are bank-switched. This means that several blocks of up to 16 K bytes of memory could be assigned to one of the above address areas, with electronic circuitry en- abling only one such block to be active at a time. The program capsules that insert into the back of the HHC all map into the same 16 K-byte address area: hexadecimal 4000 to 7FFF. Only one capsule is active at a time and is selected from the HHC primary menu. This area is also used for user data and programs. The 16 K-byte area from hexa- decimal locations 8000 to BFFF is used for external programmable memory banks. Since this bank is in a different address area from ROM banks, many ROM-based programs can reference data in programmable memory with- out bank-switching. The 8 K-byte address area (from hexadecimal locations 2000 to 3FFF) is used by the specialized firmware that is contained in each HHC peripheral. When a given peripheral is being used, the firmware that con- ee | Letter Huffman Code E 000 T 001 (a) | 010 fe} 0110 N 0111 Ss 1000 ° . . . . ° Bit(s) to Code Be Matched Comments 0.100111 10) --no match Q100111 01 --no match (b) 0100111 010 --matches | (1)0.111 0 --no match (0111 01 --no match (NO111 011 --no match (NOt O11 --matches N (1) (N) done --message is IN Table 1: An example of Huffman coding. Table 1a shows an example Huffman code for several letters. Table 1b shows how the code 0100111 is decoded into the letters | and N. Bits are taken from the left side of the remaining binary string until the sequence of bits matches one of the table entries. Notice:in table Ja that the code for no letter is a beginning substring of the code for another letter. (This, for example, accounts for the fact that no letter is given to the bit string 011—it would conflict with 0110, the code for the letter O.) Every Huffman code (of which there are an infinite number) is constructed so that no two letters can be confused with each other. If the letters are assigned codes in the order of their decreasing fre- quency for the text to be decoded, a Huffman code permits the maximum data compression possible. ee | Table Number of Elements Number of Bits Number of Bits Rank (N) in Table (= 2”) in New Permutation in Ordinary Look-up Algorithm Table (=N2”) (F(N) = 2" + 2F(N — 1) 1 2 1 2 2 4 6=442(1) 8 3 8 20 =8 + 2(6) 24 4 16 56 = 16 + 2(20) 64 5 32 144 = 32 + 2(56) 160 6 64 352 = 64 + 2(144) 384 Table 2: Efficiency of the permutation algorithm given in figures 2 through 4 and the text box. As can be seen from the last two columns, this algorithm uses fewer bits to define a given permutation. The ordinary look up table uses a table 2" entries long by N bits long to look up the value (from 0 to 2"—1) that a given element (in the same range) is permuted to. trols its communication with the HHC is selected and used. This area also contains the memory-mapped contents of the video display when the HHC is connected to the color TV interface. In both 16 K-byte bank-switched areas it is possible to reference a pro- gram or a program/data combination that is more than 16 K bytes long. The program (or program and data) is divided into 16:K-byte blocks, all of which map into the same area. Under program control the software can then jump between 16 K-byte blocks by writing the appropriate value to a location in the HHC that determines which block is currently selected. Text Compression in the HHC The increase in data storage caused January 1981 © BYTE Publications Inc 39 a) 1 t—— 1 p———- 2 2—— ; >< Figure 2: Two possible outcomes for the permutations of a two-element list. See the Mapping Algorithm text box for further details. by the use of SNAP and 16 K-byte program capsules is significant. But the increase caused by the use of data compression techniques is even more significant, almost doubling the amount of information that can be stored in an HHC data capsule. A variable word-length code and in- creased data compaction through context are the two techniques used. In traditional data storage, one character of information is stored in a byte (or 8 bits or binary digits) of computer memory. Letters, numbers, and punctuation are stored in the ASCII (American Standard Code for Information Interchange) format, which uses 7 bits per character. Using a method developed by Friends Amis that modifies what is called a Huff- man code, variable bit-length codes can be devised for the characters to be encoded such that frequently used characters will be given shorter codes (called codons), thus decreasing the average number of bits used per character. Table 1 shows an example of a standard Huffman code (there are an infinite number of such codes). Because of this variable-length coding, the computer's memory is seen as a long string of bits. Bits are read from left to right (figuratively speaking) until the bits read match the codon for any character in the set. (Codons are generated by rules that guarantee that a beginning string of bits can match the codon of only one letter in the set.) Codons are also devised so that the most frequently used letters have the shorter represen- tations and are also near the top of the look-up stack: Because the num- ber of look-up erttries read before a match occurs is kept to a minimum (on the average, slightly more than eight entries), the decoding process 40 January 1981 © BYTE Publications Inc does not slow the machine down. A further measure of compression is made by modifying the look-up procedure to be sensitive to the con- text of the previous letter. For exam- ple, even though the most frequently used letters in normal English text are (in decreasing frequency) E, T, I, O, N, and so on, if the previous letter looked up was Q, then the letter U is most probably the next letter and so should be close to the beginning of the look-up table. Within the HHC, the letter-decoding routine uses the previously decoded letter to index one of several look-up tables. In this way, encoded characters can be re- presented in even fewer bits than would otherwise be possible using straight frequency-determined co- dons. Two more techniques are used within the HHC to decrease the number of bits used to represent character information to a final density of just over 4 bits per char- acter. Although these techniques were developed to deal with alpha- betized lists of words (for the Friends Amis language translator), it is possi- ble to use them to compress nonal- phabetized text in some situations, The first technique replaces the beginning of each word (except the first word in a list) with two numbers. The first number tells how many let- ters to borrow from the previous word, The second number tells how many letters away the first non- matching letter is from its counterpart in the previous word. For example, if the words are SMALL and SMART, the following is stored for the word SMART: 3 (telling the computer to borrow SMA from the word SMALL); 6 (telling the computer to count forward six letters from the L in SMALL to arrive at the R in SMART); the encoded letter T (ending the encoding of the word SMART). (See figure 1 for other ex- amples.) Because the two numbers (contained in 3 and 4 bits, respective- ly) take up fewer bits than the letters The Mapping Algorithm It is sometimes profitable to maintain a list of words in alpha- betic order but to be able to - retrieve them in some other pre- __ specified order. The problem then "becomes one of finding the most compact way of specifying a per- mutation of N el ts from (1, 2, 3, ., N) to some other ordering. The algorithm used within the - Panasonic/Quasar HHC requires that the list be a power of 2 (ie: have 2, 4, 8, 16, 32, 64,... ele- ments). The algorithm can be con- sidered as a recursive set of pair switchings. The permutations of a _. list of two elements can be re- presented by 1 bit of informa- - tion—say, a 0.to represent that the | elements are not switched, eg: (1, 2) becomes (1, 2); anda I to repre- sent that the elements are switch- ed, eg: (1, 2) becomes (2, 1). This is where a box represents.1 bit of in- formation : Thedingcon infigure 3a is used stituted for OUT1 thru OUT4, The boxes in the first and third columns are filled in with either equal signs (=) or cross signs (X), leaving the boxes in the second column for last. Consider the example of permut- ing the list (1, 2, 3, 4) to become (4, 1, 3, 2), Given the interconnections between boxes and the constraints given above, the only path that can be taken from 1 to I goes through the top middle box (in a manner not yet specified) and to the righthand side through a cross in the upper-right box, as shown in figure 3b. In figure 3c, the element 4 is traced from box A to box B. Similarly, element 3 is traced from box B to box C, and element 2 is traced from box B to box S, where we started. Given the conditions shown in figure 3c, it is q simple task to fill in the middle columns, thus com- pleting the diagram. The finished diagram is shown in figure 3d. g Through use of this diagram, the ~ with @ list of four elements. The list (1, 2, 3, 4) can be permuted to - upper-lefthand box is always filled the list (4, 1, 3, 2) using 6 bits of in- in with an equal sign (=). The in- formation (1 bit for each of the six put arrangement, usually (1, 2, 3, boxes). 4), is substituted for INI thru IN4, Study of an eight-element list ex- and the desired permutation is sub- ample illustrates the recursive | betically. Note that when these © tlements first filling the 2" boxes in @ the number of boxes (or bits) nec they replace, this method can repre- sent the same text in fewer bits. The last technique saves space in that it allows alphabetized lists to be used in a different order. (For exam- ple, in language lists a given set of words is mapped from the sequential order in its alphabetized list to a semantic order in a list of words of equivalent meaning available in each language list; this is done so that the computer can translate a given word to its equivalent in another language.) With this technique, a list of 2” tlements can be permuted into any other arrangement of the same ele- ments by a relatively small number of bits of information (see table 2). Refer to the Mapping Algorithm text box for the details of this algorithm. The Real-Time Clock One of the most important internal features of the Panasonic/Quasar HHC is its real-time clock and event sequencer. The real-time clock exists in memory as a 40-bit number stored @ method that is used to generate the | final structure for longer lists. Figure 4 shows a mapping of the x list (1, 2, 3, 4, 5, 6, 7, 8) to (6, 3; 8, @ 17, 5, 4, 2). As before, box S is | marked with an equal sign, Boxes @ in the first and last columns are @ then filled in; this can even be done @ with no knowledge of the contents _ of boxes X and Y. The boxes A | through G are filled in alpha- | boxes are filled, the boxes X and Y @ become “black boxes” that map ~ four-element lists into another | ordering. These boxes are then _ solved as shown in figure 3, and _ the permutation of eight elements @ %& now solved. The final solution © fas twenty boxes: eight as shown © in figure 4, plus six boxes each for "boxes X and Y. - Larger lists are solved in an ana- logous way, with a list of 2” _ the first and last columns, followed _ by the solution of the two middle "boxes, each of which permutes a > Hist of 2"”* elements. Table 2 shows _ sary to solve larger permuta- 1N1 f—— OUT] ? IN2 L— oure (3a) IN3 t—— OUT3 P Na [— ours 1 1 1 4 2—+ 1 (3b) — 3 ? 4 2 1 1 1 4 , >< 2 {4 ——___ 3 3 sy (3c) 3 — 2 A 3 ? 4 4 2 2 1 4 (3d) | >< 3 2 Figure 3: Solving a four-element permutation problem as a network of binary deci- sions. Figure 3a shows the initial configuration used in the solution of any four-element permutation. Figures 3b, 3c, and 3d show steps in the solution of this problem. See the Mapping Algorithm text box for further details. January 1981 © BYTE Publications Inc 41 in 5 contiguous bytes of program- mable memory, supported by a hard- ware counter that can be preset. An increment of one unit in this number represents a time change of 1/256 sec- ond (about 4 milliseconds), so that the 40-bit number represents the number of 1/256 second intervals that have elapsed since the computer was permanently turned on. (Given the above figures, a 40-bit number will represent a time period of ap- proximately 139 years.) In keeping with the design philos- ophy of burdening the 6502 micro- processor with as few tasks as possi- ble, the real-time clock was designed to require the generating of as few in- terrupts as possible. Another area of memory contains a signed 23-bit counter circuit that automatically counts down to 0 at a rate of one count every 1/256 second. Normally, when this timer reaches 0 (once every 23/256 seconds, or about 9 hours), it generates an interrupt that adds the same amount (about 9 hours) to the 40-bit clock nuinber. However, if any program needs to access the real-time clock, the appropriate count based on the value in the 23-bit counter can be added to the 40-bit clock number and the 23-bit counter can be cleared, thus updating the clock to its correct value. Associated with the real-time clock is an event queue in which future events are stored as 40-bit numbers along with instructions to be carried out when the 40-bit clock number reaches that value. Internally, the operating system software can use this event queue to manage a set of asynchronous events with a mini- mum of processing. Application pro- grams can use the event queue, as can users programming on the HHC. Design for Component Interaction The Quasar/Panasonic HHC was designed to be compatible with both existing and future hardware and software. Because of this, the mem- ory usage ofthe computer had to be planned to provide maximum flex- ibility. In most microcomputer systems, there are fixed memory locations or 1/O (input/output) ports assigned for specific hardware peripherals. The limitation of this approach is that the entire memory mapping must be fore- seen; otherwise the ability to include 42 January 1961 © BYTE Publications Inc Data compression techniques In the com- puter almost double the amount of informa- tlon that can be stored In a given number of bits. future peripherals is questionable. The HHC does not make any fixed assignments. Instead, 4 bytes for each peripheral are dynamically assigned as I/O and status locations for all cur- rently connected peripherals each time the clear key is pressed, so any number of different peripheral types can be accommodated without run- ning into memory map conflicts. This flexible system of directing in- put and output allows the HHC to offer a more commonsense approach to dealing with devices like printers, modems, LCD displays, and other devices. In most computers, special commands must be given to direct in- put and output to specific devices, and even then you may not be able to distribute it to several devices. For ex- ample, a special command, LPRINT, must be used to get either the Radio Shack TRS-80 or the Atari 400 or 800 to print information on their associated printers, and it is impossi- ble to get a program to print on b