FEBRUARY 1976 $1.50 the small systems journal Processing Algebraic Expressions • Color Graphics for TV Typewriters Computer Megalomania? sally; Waam I *i^£§£«&"""" sp It seems that a great many people came to the same conclusion that we did here at SwTPC. The M6800 is an outstanding processor and makes a great computer — "BUT" — Not all computers using the M6800 pro- cessor are the same. May we suggest that you consider the following fea- tures when you make your choice. IT IS A COMPLETE 6800 SYSTEM? You cannot get all of the advan- tages of the 6800 system with only the processor chip. Unless the whole 6800 family of chips is used you can- not possibly get all of the versitility and superior performance that the system is capable of providing. If for instance the design does not use the MC6820 parallel and the MC6850 serial integrated circuits for interfac- ing, you lose the programmable inter- face feature that makes it so easy to interconnect the computer system with outside devices such as termi- nals, printers, disks, etc. IS THE SOFTWARE COMPATABLE OR UNIQUE? If the design does not use the "Motorola" Mikbug® ROM, then the software and programs that will run on the system are probably unique to __— 1 COMPUTER 5SJfif 6800 BVSTEM that particular brand of computer. SwTPC uses the standard Motorola MCM6830L7 ROM. This provides automatic loading and an operating system that is compatable with other systems using the standard widely sold Motorola evaluation set. As an owner of our 6800 computer system, you are eligible for membership in the Motorola Users Group. If you join you have access to a library of programs that will run on your sys- tem. Editor and assembler programs are available directly from SwTPC. CAN THE SYSTEM BE EXPANDED AT A REASONABLE COST? Some of the limited systems be- ing offered at lower prices can be expanded only with difficulty. Check the amount of memory that can be added and at what cost. How many additional interfaces can be added, if any. How much of the above can be run off of the power supply provided with the system? The SwTPC 6800 can be expanded up to 16K words of memory in the standard cabinet and with the power supply provided. It may also be expanded up to eight interface (I/O) boards for external devices by simply plugging in the cards. Memory is $125.00 for each 4,096 words of expansion and inter- face cards are only $35.00 for serial or parallel types. Memory expansion will be essen- tial if you ever intend to use a resi- dent assembler, or higher level lan- guages such as APL or BASIC on your system. Assembler programs typically require a minimum of 4,096 words of memory and higher level languages require even more. HOW DO YOU ENTER AND READ DATA? Let's hope it is by way of a TTY, or video terminal. No one with a serious computer application would consider attempting to enter data from a switch and status light con- sole. These may be educational, but they sure aren't practical. Calculator keypads and digital readouts are not much better. There is no substitute for a full alphanumeric keyboard and terminal system display for serious work. Mikbug® is a registered trademark of Motorola Inc. Computer System with serial interface and 2,048 Words of memory $450.00 □ Enclosed is $450 for my SwTPC Computer Kit □ Send Data □ or BAC # □ or MC Ex Date ADDRESS CITY STATE ZIP Southwest Technical Products Corp., Box 32040, San Antonio, Texas 78284 In the Queue Foreground KEYBOARD MODIFICATION 16 Surplus— Macomber LEDs LIGHT UP YOUR LOGIC 54 Techniques— Gray BUILD A TTL PULSE CATCHER 58 Test Equipment— Walde DRESSING UP FRONT PANELS 60 Techniques— Walters Background MY DEAR AUNT SALLY 18 Algorithms— Grappel PROCESSING ALGEBRAIC EXPRESSIONS 26 Algorithms— Maurer DATA PATHS 32 Hardware— Liming THE NEW ALTAIR 680 42 New Product— Vice HOW TO SAVE THE BYTES 46 Man-Machine Interface— Mclntire MORE ON THE SWTPC 6800 SYSTEM 50 New Product— Kay TV COLOR GRAPHICS 62 Hardware— Lancaster COULD A COMPUTER TAKE OVER? 76 Speculation— Rush Nucleus In This BYTE 2 Join the Club 4 Letters 10 Our New Offices 14 BYTE's Bits 31, 83 Chips Found Floating Down Silicon Slough 41 Classified Ads 61 BYTE magazine is published Numbers 69 monthly by BYTE Publica- Clubs Newsletters 70 tions. Inc., 70 Main St, Peter- borough, New Hampshire Audio Cassette Standards Symposium 72 03458. Subscription rates are $12 for one year worldwide. View From Silicon Valley 74 Two years, $22. Three years, „__„ „ _ . —. . „, #30. Second class postage ap- 8080 Op Code Table 84 plication pending at Peterbor- _ _ __ ough New Hampshire 03458 Book Reviews 92 and at additional mailing of- an a/id or fices. Phone 603-924-7217. DUMB 30 Entire contents copyright tu p BYTE Questionnaire Q6 1976 BYTE Publications, Inc. I TO DT I C uuestionnaire MO Peterborough NH 03458. Ad- Reader's Service 96 dress editorial correspondence to Editor, BYTE, 70 Main St, Peterborough NH 03458. New BYTE phone: 603-924-7217 BITE #6 FEBRUARY 1976 P. 14 p. 32 • • • * ! it AS ** II , ' ^ d ESQ P. 42 p. 50 DISPLAY QUEEN p. 62 In This EITE How does a computer evaluate a complicated mathematical BYTE has published a few examples of LEDs used in test expression? There are many ways to accomplish this function, probes and diagnostic equipment. In his article E. W. Gray One technique is to use the My Dear Aunt Sally Algorithm provides some basic information on the use of LEDs. After which is described by Robert Grappel. incorporating his suggestions you can have LEDs Light Up Your Logic in more ways than one. There is more than one way to Process Algebraic Expres- sions, of course. In his article on the subject, W.D. Maurer describes the Bauer-Samelson algorithm, which uses an oper- ator stack and an operand stack to parse algebraic expressions. How do bits get from one place to another? The design of Data Paths to convey information is an important con- sideration in any system. Gary Liming provides some back- ground information on the subject. MITS makes a 6800 product, too. James B. Vice of MITS describes his company's design in an article on The New Altair 680. Hard copy can be created in many ways. Its purpose is to record information in a form which humans can interpret unaided. In How to Save the Bytes, Thomas Mclntire proposes a multiple-segment character set which might be useful for an inexpensive print mechanism. Gary Kay continues a presentation of information on the Southwest Technical Products Corporation's 6800 system which was begun in BYTE No. 4. This month's installment presents information about the memory boards, serial inter- face, control interface, parallel interface, power supply and case. The information is completed with a short discussion of available software and future additions to the system. One way to monitor digital data lines is simply to drive an LED based upon the steady state of the line. But what if you are dealing with occasional pulses? A simple indicator is the TTL Pulse Catcher described by Bill Walde, a test instrument which can be built from one IC, one LED, two switches and two resistors. How do you generate graphics patterns for TV raster scanning? One answer is provided by Don Lancaster's discus- sion of Color Graphics Techniques. Could a Computer Take Over? Ed Rush provides us with some thoughts on the subject with ample references to the speculative fiction of computer technology. We'll let readers draw their own conclusions. Getting Information from Joysticks and Slide Pots is a problem which must be solved for interactive game purposes. One solution to the problem is shown in this issue. And on the cover, artist Robert Tinney shows My Dear Aunt Sally at work tutoring a computer on the subject of interpreting arithmetic expressions. Lowest Price in the World! In January of 1975, MITS stunned the computer world with the announcement of the Altair 8800 Computer that sells for $439 in kit form. Today MITS is announcing the Altair 680. The Altair 680, built around the revolutionary new 6800 microprocessor chip, is the lowest priced complete computer on the market. Until December 31, 1975, this computer will be sold in kit form for the amazing introductory price of $293! (A savings of $52!) The Altair 680 comes with power supply, front panel control board, and CPU board inclosed in an 11" wide x 11" deep x4 11/16" case. In addition to the 6800 processor, the CPU board contains the following: 1. 1024 words of memory (RAM 2102 type 1024 x 1-bit chips). 2. Built-in Interface that can be configured for RS232 or 20 mA Teletype loop or 60 mA Teletype. 3. Provisions for 1024 words of ROM or PROM. The Altair 680 can be programmed from the front panel switches or it can be connected to a computer terminal (RS232) or a Teletype such as an ASR-33 or surplus five-level Baudott Teletype (under $100). The Altair 680 can be utilized for many home, commercial or industrial applications or it can be used as a development system for Altair 680 CPU boards. With a cycle time of 4 microseconds, 16-bit addressing, and the capability of directly addressing 65,000 words of memory and a virtually unlimited number of I/O devices, the Altair 680 is a very versatile computer! Altair 680 Software Software for the Altair 680 includes a monitor on PROM, assembler, debug, and editor. This software is available to Altair 680 owners at a nominal cost. Future software development will be influenced by customer demand and may include BASIC on ROM. MITS will sponsor lucrative software contests to encourage the rapid growth of the Altair 680 software library. Programs in this library will be made available to all Altair 680 owners at the cost of printing and mailing. Contact factory for updated information and prices. Altair Users Group All Altair 680 purchasers will receive a free one year membership to the Altair Users Group. This group is the largest of its kind in the world and includes thousands of A/tairSSOOand 680 users. Members of the Altair Users Group are kept abreast of Altair developments through the monthly publication, Computer Notes. Altair 680 Documentation The Altair 680 kit comes with complete documentation including assembly manual, assembly hints manual, operation manual, and theory manual. Assembled units come with operation and theory manuals. Turnkey model and CPU boards also include documentation. NOTE: Altair 680 manuals can be purchased separately. See back page of this catalog for prices. Delivery Personal checks take 2-3 weeks to process while money orders and credit card purchases can be processed in 1-3 days. Delivery should be 30-60 days but this can vary according to order backlog. All orders are handled on a first come, first served basis. Altair 680 Prices Altair 680 comp\ete computer kit .... $293 ($345 after December 31, 1975) Altair 680 assembled and tested $420 Altair 680T turnkey model (complete Altair 680 except front panel control board) Kit Only $240 ($280 after December 31, 1975) Altair 680 CPU board (including pc board, 6800 micro- processor chip, 1024 word memory, 3 way interface and all remaining components except power supply) $180 ($195 after December 31, 1975) Altair 680 CPU board assembled and tested $275 Option I/O socket kit (required when interfacing 680 to external devices) $ 29 Option cooling fan (required when expanding 680 internally) $16 ($22 after December 31, 1975) Option cooling fan installed $ 26 PROM kit (256 x 8-bit ultraviolet, erasable 1702 devices) $42 Creative Electronics Prices, delivery and specifications subject to change. Join the Club BITE staff PUBLISHERS Virginia Peschke Manfred Pesch ke EDITOR Carl T. Helmers, Jr. GENERAL MANAGER Manfred Peschke PRODUCTION MANAGER Judith Havey PRODUCTION ASSISTANT Beth Alpaugh CIRCULATION Deborah R. Luhrs ADVERTISING Virginia Peschke TYPOGRAPHY Custom Marketing Resources, Inc. Goodway Graphics PHOTOGRAPHY Ed Crabtree Custom Marketing Resources, Inc. DRAFTING Bill Morello PRINTING Custom Marketing Resources, Inc. The George Banta Company ASSOCIATES Hal Chamberlin Dan Fylstra Don Lancaster Chris Ryland I found an interesting quotation in the Wall Street Journal in a recent front page news analysis on the subject of philan- thropy. The theme of this quotation is the American heritage of forming voluntary associations for specific purposes. "Americans of all ages, all stations in life, and all types of disposition are forever forming associations," wrote Alexis de Tocqueville in the 1830s. "Americans combine to give fetes, found seminaries, build churches, distribute books and send missionaries to the antipodes. Hospi- tals, prisons and schools take shape that way. ... If (Americans) want to proclaim a truth or propagate some feeling by the encouragement of a great example, they form an association." (Wall Street Journal, November 26, 1975.) This thought provides a timeless introduc- tion to the latest manifestation of that trend, the formation of computer associa- tions and societies for the purposes of advancing the personal use of small systems technology. To paraphrase an appropriate definition in Webster's, a society is a group of in- dividuals who elect to associate with one another for a common interest or purpose, and who meet periodically to help advance that interest or purpose. Fine. This concept of society could equally well be applied to groups ranging from a regular Saturday night beer drinking circle to a specialized scientific association. How does it apply to our com- mon interest in the technology of small scale computing? Some thoughts on the subject are the substance of this month's editorial. Information, Friendship and Trade Defining the purpose of an association is probably the most important task to be accomplished. The beer drinking circle has a purpose assented to by all its members: Editorial by Carl Helmers drinking beer, talking and relaxing at the end of a week's activity. The scientific associa- tion has its purpose too: exchanging infor- mation, arguing and debating fine points which can lead to productive experiment, and socializing with compatriots in the same field of endeavor. So what is the purpose of an association of computer experimenters? At the risk of omitting something (to be corrected by reader feedback, no doubt) I've made a tentative list of common purposes which are the defining interests of computer societies. The list contains 3 items: Information — about computers and their use. Friendship — fraternizing with other in- dividuals in the field. Trade — exchanging equipment and learn- ing about what is available. In making this list, I draw upon examples provided by the similar activities of scientific and engineering societies as well as numerous hobby societies in fields like audio reproduc- tion, amateur radio, radio controlled models, amateur astronomy and model railroading. Not to be omitted of course are the begin- nings of similar associations in the small systems field (more on that a bit later). Information The information activities of a computer society can be one of the most important reasons for establishing these organizations. Information comes in many forms. Given the idea, what are some of the possibilities for specific activities to be arranged by a computer society's education and informa- tion committee? I can think of a few and list them, but will make no pretension that this is a complete or final list. Application reports. Small computer systems can be used for a variety of pur- poses. One important activity of the com- puter society is the exchange of ideas and concepts on applications of the machines. LOOK k WHAT WE'VE Wlflf PlflCIl Fast & Easy FROM VECTOR. . .slashes time of point-to- point wiring; eliminates Cutting to length, stripping, and crimping! 36 ga. wire has special insulation that melts when heated. With 1 red, 1 green bobbin of wire. As reviewed in the December 1975 issue of Popular Electron- ics. Add shipping for 1 pound. $9.SC OK, all you wire pencil fanatics, we've got replace- ment wire bobbins. Specify RED, GREEN, BLUE, or CLEAR. BILL GODBOUT ELECTRONICS BOX 2355, OAKLAND AIRPORT, CA 94614 t itmtns ; 1 s$ut A medium current (150 ma per side) supply, designed for economy and stability. Uses a dual tracking regulator; short proof and ther- mally limited. Perfect for op amp and other applications requiring ±15 volts. $9.95 + shipping for 2 lbs. Less case and hardware. TERMS: Add 50« to orders under $10; add shipping where shown. NO CODs ! Cal res add tax. Mastercharge® or Bankamericard®: call (415) 357"7007 IK hours a day. , 11 voir. % amp Idea! for powering automotive equipment also makes a dandy lab supply. Better than .05V regulation, indefinite short protec- tion, adjustable output ll-l^t volts, cur- rent limits at 13 amps. Kit complete but less chassis and hardware. A BEST SELLER Easy & Fast MkL mm This kit provides dual tracking regulated output voltages, both (+) and (-) referenced to ground, from under 1 volt to more than +18 volts DC. Short circuit pro- tection, thermal limiting, etc. Kit doesn't include case or hard- ware. Get one for $10.95 plus 2 lbs shp. Up to 150 ma per side. NEW AND IMPROVED F1KED l"2 BI1P Regulated, short-proof, thermally limited. iA continuous, or 1 amp intermittent. Specify 5, 8, or 12 volt model. Less ease&hrdwre .^SSY^Tp TOO^ g5 WHY SOLDER YOUR PROTOTYPES? Wire wrapped connections protect components from heat, are easily modified for corrections or changes, make connec- tions that are better than solder, and can speed up the time required for complex digital projects. If the high cost of wrapping tools puts you off, look at ours; you get the tool (rechargeable so you don't have to deal with trailing cords in tight places), bit, charg- er, nicads, and instructions. o plus 2 lbs. SHIP fi &@®RW klt(/) *A kK EROM IC---similar> "to the 5203, but twice the cap- acity. Fully programmable; erasel with UV light." ■■■ ^^ ^^^^ acity. i-uliy progr« 5204$ 2450 ^^ ^™ ^*^ STATIC— NON- 2102* s STATI C— N0N-V0LAT I LE= VERSATILE! THE SPECIAL CONTINUES! Guaranteed faster than 750 ns. 5558 5/$1.95 So you've got yourself a mi crocomputer . . .only to find out you need soft- ware to run it efficiently. Give your 8080 editor, assembler, and moni- tor routines with our 8080 Software Board. $225 brings you '(kbytes of programmed Eraseable Read-Only Memory, dedicated to making happier 8080s. ...Or maybe you have your own software. Don't load it in your RAM; put it in one of our unprogrammed EROM boards. A 2Kx8 board is $125; a l(Kx8, $200; and 8Kx8, $352. Add 1 3S to any of the above boards, and we'll program it according to your specifications. What do all our EROM boards have in common? DIRECT PLUG-IN COMPATIBILI- TY WITH THE ALTAIR 8800, as well as sockets, Industrial quality plated through boards, ultra-low power consumption, buffered inputs and outputs, and lots of bypassing. Includes full instructions and logic print. We haven't forgotten you RAM fans, either. Our AK x 8 RAM kit of- fers DIRECT PLUG-IN COMPATIBILITY WITH THE ALTAIR 8800, as well as the usual high-quality board, bypassing, sockets, buffered addresses and outputs, 500 ns access at 25°Ctyp. FULL INSTRUC- TIONS and logic print included. ENJOY! 4KX8Rr1MklT k The information activities of a computer society can be one of the most impor- tant reasons for establish- ing these organizations. When a person or informal project group has spent some time developing some aspect of the use of the systems, a report in the form of an informal lecture followed by question and answer sessions is a very good activity for both the person giving the lecture and the rest of the membership. Show and Tell. This is a specialized version of the application report, in which the society member giving the report brings along some examples of equipment to talk about. Ideas for this kind of activity abound. Do you want to see what an Altair looks like? Have an Altair owner give a demo some meeting. Do you want to see what a home brew microprocessor comes out like? Have the person who has put together one of the contemporary microprocessors show off the result some evening. Elementary Courses Anyone? There is much interest in learning the elements of computer technology. Knowledge of the technology does not grow on trees, and personal interaction with people possessing such knowledge is an excellent way for novices to obtain the required information. One way to disseminate such information is for a computer society to schedule "Novice Nights" devoted to talks on topics in compu- ters chosen to teach new information to people without extensive computer back- grounds. The novice whose primary skills lie outside computer areas is obviously in- terested in this type of talk and can benefit greatly. But even the advanced persons in the field can benefit since specialization is so common in these days of high technology. The person with a background in hardware design (the nuts and bolts of computers) is likely to benefit from elementary lectures given by an experienced software person. The software person, on the other hand, can benefit greatly by learning elementary infor- mation from the hardware person. Here is an obvious trade of information and ideas between two parties (the third party of the less experienced person can gain from either type of lecture). The act of preparing such talks, whether formally or informally, re- quires thought on the part of the lecturer in order to review and organize material. This in itself is useful activity and benefits the speaker by adding to his or her skills and experience. One benefit of bringing the novice up to speed in the intellectual activities of the computer world is that it enables all prac- titioners in the field to take advantage of the greatest multiprocessor system of them all, a civilization of active, educated and goal- seeking individuals. While these benefits are not immediate, there is long term value in getting people to know the technology. It helps increase the potential for innovation and invention as more and more people learn to use, manipulate and create using the tools of computing. Technology Updates. Sessions of interest to many people are those devoted to infor- mation on new computer technology. Such lectures combine tutorial information of interest to novices with advanced informa- tion on the new ways of doing old problems. For example, in a lecture on one of the new bipolar microcontroller chips, it is almost certain that the advanced person would learn about the system architectures of con- ceivable machines and the types of instruc- tions sets that could be implemented. The novice at the same time would probably pick up some notion of what a microprogrammed machine is, and what it takes to make one. Special Interest Groups. Whenever two or more people share a common goal which is a subset of the whole small systems computer world, there is potential for a special interest group to be formed. The reason for such a group could be a particular type of processor and its techniques of use, it could be a particular application area such as model trains, radio controlled models, music, amateur radio networks, etc., and it could even be an interest in a side issue such as computer science fiction stories. A computer society can provide the coordination needed to bring such special interests together, by making announcements at meetings, by putting information in newsletters, etc. Workshop sessions, question and answer sessions and other interactive learning situa- tions. There is no reason that a learning session has to be a one way street. Work- shops (the computer society equivalent of an undergraduate laboratory course) are a way to intensively concentrate upon one aspect of the small systems field. This could include programming workshops for learning soft- ware principles, and hardware implementa- tion workshops concentrating upon fabrica- tion and testing of elements of the computer systems. One of the most useful activities which a computer society could consider as a regular meeting feature would be the question and answer session. Such a proce- dure can be very productive. Simply appoint one person as a moderator, who will then search the meeting room for raised hands indicating a query. After restating the ques- tion over the PA system (if any) the modera- tor would then ask for a volunteer to provide information on the question. If the local computer society is full of bashful persons, the questions could be handled in SOFTWARE - ■ ■■■■■■is the best thing to feed your computer! Makes it healthy! Gets rid of that dull, aimless, blinking lights expression so many small systems exhibit these days. Feed your machine SOFTWARE! Make it feel good. Machine will then perform services. That will make YOU feel good. Put your machine on a good SOFTWARE diet like some of the following CHOW! ASSEMBLER PROGRAMS FOR THE '8 8' Discusses a "minimum length" Assembler program that can reside in 2K of memory, plus a more sophisticated version for those who have additional memory and desire a more powerful version. Included in this manual is a thorough explanation of the fundamental concepts of an assembler's operation, details on how to format the "source listing," step-by-step analysis and presentation of subroutines, program flow charts, and assembled listings of the programs! Price? A very reasonable $1 7.95. AN '8 8' EDITOR PROGRAM Describes variations of an "Editor" program that can reside in 2K of memory. Additional memory may be used to increase the size of the text buffer. The program enables one to manipulate "text" in order to create "source listings" or perform other kinds of text preparation. Includes discussion of routines, flow charts, and assembled listing. Priced at just $14.95. '8 8' MONITOR ROUTINES Describes a "Monitor Control" package that allows you to control the operation of your computer from an external "keyboard" device. Various routines enable you to examine and modify memory locations and CPU registers, set "breakpoints" and execute programs for "debugging" purposes, control bulk storage I/O devices, and perform other useful functions. This manual comes complete with subroutine explanations, flow charts, and an assembled, highly commented program listing. Low priced at just $1 1 .95. NEW! - FOR HUNGRY 8080 MACHINES! AN '8 8 0' ASSEMBLER PROGRAM This assembler program utilizes some of the unique routines we utilized in our popular '8008' assembler which enables us to provide an '8080' assembler that operates comfortably in 4K bytes of RAM (including the symbol table). An unusual feature of this assembler program is that it has been designed to accept mnemonics closely related to those used by SCELBI for our '8008' based machines. What this means is that programs originally written for an '8008' unit can be directly processed by this assembler to produce object code for an '8080' machine! NEAT! Of course, it also handles the extended instruction set of the '8080' as well. This program is provided in our popular style of a manual that discusses the major routines, presents pertinent flow charts, and includes a highly commented assembled listing. $17.95. AN '8 8 0' ED /TOR PROGRAM This is essentially a "carbon copy" of the material in our earlier manual describing a '8008' Editor, except the assembled listing is provided with the machine code for an '8080.' It is a good deal at $14.95. '8 8 0' MONITOR ROUTINES These routines perform the same types of functions as described above for the '8008' version except routines were specifically developed to utilize the extended capabilities of the '8080' instruction set. Great price at just $1 1.95. WANT TO "SPOON FEED" YOUR MACHINE? You CAN learn how to develop your own machine language programs. And, if you are really serious about utilizing a small system effectively, you had better plan on learning something about it sooner or later! Here is a good way to get started. MACHINE LANGUAGE PROGRAMMING FOR THE '8 8' (AND SIMILAR MICROCOMPUTERS) THIS manual was written to provide the reader with the detailed knowledge one needs to know in order to successfully develop machine language programs. This information packed publication discusses and provides numerous examples of algorithms and routines that can be immediately applied to practical problems. Virtually all the techniques and routines illustrated in the manual can also be applied to other similar microcomputers such as "8080" systems (by applicable machine code conversion). The price of this exciting new manual is a low $19.95. (The floating-point arithmetic package presented in the publication is worth that price alone!) Prices given are for domestic delivery at book mailing rate. Add $2.50 for each publication if PRIORITY air service desired (U.S.J Overseas include $6.00 for each publication for airmail service. (Pricing, specifications, availability subject to change without notice.) Order direct from: 1322 REAR BOSTON POST ROAD ffllRI fOMDIITFD deptbf CoVuillM. INC. MILF0RD C0NNECTICUT ° 646 ° True computer hackers are noted for being slightly strange, above average in intelligence, and in general somewhere off on the slopes of some multidi- mensional probability dis- tribution surface of human characteristics. written form but it would be better all around to use oral methods. Prerecorded lectures and seminars. Every time a computer society has a talk on a subject of any sort, a good policy would be to record the talk and have several people take notes on any visual materials. It will then be possible for the lecture to be replayed for later use by individuals who missed the first presentation. Such proce- dure also lends itself to exchanges between computer societies and could become a major activity of a national personal com- puting society. This kind of policy would be particularly beneficial to local groups in areas remote from such current hotbeds of activity as Los Angeles, San Francisco, Den- ver and Boston. (More on computer associa- tions at a national level appears a little later in this editorial.) Friendship One of the reasons which make special interest societies form and flourish is the common human need to associate with people of similar interests. True computer hackers are noted for being slightly strange, above average in intelligence, and in general somewhere off on the slopes of some multi- dimensional probability distribution surface of human characteristics. This eccentricity does not mean an absence of the same needs to interact and talk about common interests which are characteristic of humans in general. In fact, the social aspects of the neighborhood computer group are very important because who else would listen and converse with as much enthusiasm as another hacker? The computer society thus serves a useful function as a framework in which to meet people on a basis of common interest. This immediately establishes a more friendly atmosphere and helps minimize the usual psychological barriers to making new acquaintances. (You don't go out on the street and accost the nearest person to talk about your favorite CPU chip; if you do, you might run certain risks in today's state of civilization.) The selection function which is the computer society's common interest definition guarantees that you have a high probability of a meeting of the minds. Sharing the common interest helps loosen up conversation and create new acquaintances. Trade While it is often fashionable in conven- tional intellectual circles to look down upon commerce and trade with a petty moralistic disdain, the value of trade and commerce is obvious to any person who uses the results of modern technology. Trade and commerce can enter into the computer society in several ways. Perhaps the most fundamental way in which trade and commerce become an activity of the computer society is in the traditional "flea market" or "garage sale" sessions of such technological social gather- ings. If I wanted to unload a spare gate or two, the place to do so would be at a meeting of fellow experimenters. The way it is done is this: each person who has some spare or surplus personal equipment brings that equipment and engages in some old fashioned person to person bargaining in the course of looking for a buyer. (By the way, a computer group can and should generate part of its financial inputs by asking for a commission upon such flea market trans- actions. A commission of several percent would probably be appropriate.) Trade can be fostered at computer society convocations by making arrange- ments for manufacturers' representatives to come with short talks and demonstrations of their products. As long as such demonstra- tions are carried out in a spirit of informa- tion gathering and "show and tell" nothing but good can come of it. By providing this sort of platform, society members can get a first hand look at the wonderful new gadgets and kits manufacturers supply for them. The computer society idea can also be used to achieve a price break for members on equipment which is expensive in single unit quantities. Virtually any manufacturer will provide a quantity discount at certain levels of volume. The societies take advantage of this by pooling orders for expensive equipment (two examples are floppy disks and hard copy terminals) then purchasing the items with the usual OEM (original equipment manufacturer) discounts for quantity purchasing. This same concept can apply to a number of items which are virtually unavailable through other channels due to price or a manufacturer's disinterest in servicing small orders. Such activity also can finance a computer society's activities through a percentage fee (SCCS asks 2% on their group purchases). The concept does not have to apply solely to large orders for exotic equipment. It can also be applied to certain parts and printed circuits which can be ordered by a local group in sufficient quantity to justify the price breaks. Toward a National Personal Computing Society? All the reasons which make a computer society a useful item to have around one's Continued on page 95 5 WAYS TO STOP WASTING TIME IN ELECTRONICS. IStop wasting your time soldering. Save hours of soldering, desoldering, re- soldering with QT sockets and bus ■ strips. Connect and disconnect resistors, capacitors, transistors, IC's etc., literally as fast as you can push in —or pull out— a lead. Make instant interconnections with short lengths of wire. And interlock sockets and bus strips for infinite expand- ability on bench, chassis, plug-in cards, etc. At $2. 00-12. 50? you'll wonder how you've done without them! 2 Stop wasting your time design- ing circuits. Design ■ Mate™1 will help, by providing you with QT hookup versa- tility (see above), a continuously-variable 5-15V, 600mA 1%-regulated supply, and a voltmeter to monitor supply or circuit. Plug it in, turn it on and start designing more by soldering less. At $49.95? you can afford to. Stop wasting your time testing. On DIP IC's, Ifindingthe lead you want— and making sure you don't short others— can be as delicate as surgery. Until you discover our handy Proto-Clip™ ll( ...the instant, short- proof way to test IC's up to 24 pins. Available without cable or with cable, they're the most economical and foolproof IC test aids on the market. 4 Stop wasting your time bread- boarding. Small budgets or big requirements are no obstacle to I owning and enjoying today's most popular solderless breadboarding system ...our Proto-Board* line. For just $15. 95? you can have our PB-6 Proto-Board kit. Takes about 10 minutes to assemble, and gives you 630 solderless QT terminals. On the other end of the spectrum is our giant PB-104, with 3,060 solderless terminals for $79.95? |:. k or only 2.6$ apiece! You can :-:%T : ,. choose from a variety of models, 0&> with or without regulated power supplies. 5 Stop wasting your time testing. You can own the test gear you ■ need at economical prices. Our Design Mate 2, for instance, gives you a 3-waveform function generator- sine, square and triangle— from 1 Hz to 100 kHz... for just $64.95* Design Mate 3 R/C bridge pro- vides 5%- accurate measurements of unknown resistors and capacitors from 10 ohms to 10 meg and 10 pF to 1 uF, with built-in LED null indication. Price is a "micro' $54.95? And as you're reading this, we're busy adding new low-priced, high- quality Design Mates. Stop wasting your time reading. Send for the complete CSC catalog and dis- tributor list . . . and start making more of yourtime in electronics. •Manufacturers recommended retail. CONTINENTAL SPECIALTIES CORPORATION I 1975 Continental Specialties Corp. 44 Kendall Street. Box 1942 New Haven. CT 06509 • 203-624-3103 TWX: 710-465-1227 West Coast office: Box 7809, San Francisco, CA 94119 «415-421-8872 TWX: 910-372-7992 Canada: Len Finkler Ltd., Ontario NEVER YOU MIND OCCUPANT BOX BYTE PETERBOROUGH NH 03458 EVEN CATS LIKE BYTE Last week my cat tore up my copy of BYTE Number 3, the November issue. I had not been able to finish reading it before this happened and I desperately need a new copy of this issue. Richard Straedey Madison Wl tion, complete with personal paging, and telephone answering services. We also need to retrieve short messages which we may have stored for a T.A.S. or telephone cus- tomer. The majors have a program for portions, but not for nearly all of it, and with my very limited knowledge of the subject I cannot consider our own program! One of the lesser known majors had a demo system up and running at a recent inter- national convention — aimed at our market — and was SWAMPED with interested pros- pects. I am surprised that someone else does not come forth in the same area with a better system (theirs was very basic!), since the interest and market is there. I would be most interested in a possible assist to some- one working in this area at this time. Keep up the journal — some of it is too deep, but all is interesting! Duane L Williams Custom Radio Inc Caspar WY ON FILLING VACUUMS ... I am 100% in agreement with your editorial in the December issue, concerning "what this country needs," and certainly agree with Mr. Ryland that there is a BIG vacuum in the software area! If the microprocessor/minicomputer companies can't get together on a fairly universal language and instruction set they will never be more than a toy. (By the way, PLEASE — unless you are serious — delete the reference to the "world's greatest toy," "ultimate toys" and stay with "the small systems journal!") A pointfor reference would be the railroad systems — until they compromised on a standard gauge they were not a viable entrant into the transportation marketplace. I feel the same is true of the small systems manufacturers. Our particular application, for which we have not been able to get a satisfactory solution from the "majors," is accounting, inventory, billing (from time and charges entered manually and by either punch paper or cassette from other automatic terminal equipment), payroll, payables and possibly some other information concerned in a mobile telephone sales and service organiza- BASIC ISSUES BYTE is fine. I am enjoying it — and learning a few things. Just received the December issue. I must take issue with your editorial in the December issue, however, ragarding your discussion of shortcomings of BASIC. It would seem to me that your knowledge of BASIC is, perhaps, somewhat out of date or else you have some very restricted "defi- nition" in your mind of what constitutes BASIC. In particular, I refer you to the HP 3000 BASIC Interpreter Manual. In regard to argument and parameter linkages as stated in your editorial, the HP 3000 BASIC with ten deep nested GOSUBs doesn't seem to me to be "too" primitive; but beyond that the HP 3000 BASIC'S multi-branch GOSUB (i.e., GOSUB integer expression OF statement label, statement label, statement label . . .) hardly seems primitive at all, with essentially no limit to the number of branches. In addition, the defined functions, where both single line and multi-line forms exist (see section VI of the HP 3000 BASIC manual) provide, I believe, all of the GOSUB 10 capability and more without (I think) the nesting limit since functions can be "called" within a function. With regard to parameter passing, refer to the HP 3000 BASIC manual pages 6-10 to 6-12, passing parameters by reference or value. With regard to the IF-THEN-ELSE and DO-END constructs, see the HP 3000 manual section on conditional statements beginning at page 2-25. We have there: a. IF expression THEN statement label b. IF expression THEN statement c. IF expression THEN DO statement list . . . DOEND and further, "The IF. ..THEN statements can be followed by an ELSE statement to specify action in case the value of the expression is false. Like THEN, ELSE can be followed by a statement, a statement label, or a series of statements enclosed by DO . . . DOEND." My apologies for not sending along a few pages from my HP 3000 Manual. At any rate, I think your editorial does not present an accurate picture of today's [HP 3000] BASIC and its capabilities, and would suggest that you rectify this in a future editorial after looking into it. In my opinion, BASIC is far and away the best high level language around for most purposes, and particularly for engineering, statistical or mathematical purposes. So that you know where I'm "coming from," let me say that I have no connection whatsoever with HP, other than owning an HP calculator and having occasional access to an HP 3000 system at work. Thanks for your "ear" and for a good job with BYTE. Robert E Booth Santa Clara CA You make good points, Robert, but omit one important fact: an extended BASIC such as HP 3000 BASIC is no longer the portable language shared in common by several implementations. If you want to write BASIC programs which can be run on any (or most) BASIC interpreters, you must restrict your programs to those BASIC features found as a common denominator of all your intended BASIC implementations. A standard is a standard. For example, the number of changes required to transport an ANSI I standard FORTRAN IV program from one manufacturer's implementation of FORTRAN IV to another is very small (but not zero) provided programming is kept to that standard. If you use the (highly desir- able) extensions of HP 3000 BASIC, then you limit the use of your programs to HP 3000 BASIC unless extensive modifications are allowed in the process of transporting programs from one machine to another. However, your enthusiasm for BASIC does prove one important point — any high level language is better than none at all. As tools to aid in design and debugging of software and algorithms, languages like BASIC are an immense improvement over the use of lower level programming techniques. 720 INFO WANTED This is an out and out letter of praise. I have waited a few months so as not to contribute to the deluge of mail you must have received at the start, and also in case it is slacking off, to let you know it is still great. What more can I say that has not been said before? Perhaps only that BYTE was just what / needed at this time. Quite often when someone gets involved in a subject of great interest he feels that he is the only one in the world interested in it. BYTE has shown that this is not true in personal computers. I attended MITS ALTAI R caravan semi- nar the other day and found an excited, involved mob of computer hobbyists who are as serious about this as I am. While my only interest is in the pro- gramming and use of computers in problem solving, I applaud your excellent mix of articles that approach the computer from all sides. Keep the variety going, don't become a software journal, or a hardware tech mag or design sheet. We all need to see what the other guys are doing. Your timing on the keyboard article in BYTE Number 1 was perfect! I had just got one and you really laid it out for me. Thank you! One request, how about an article on the 720 (Sanders) terminal. What it is, how it works, how to interface it with a computer, some service info? There must be tens of thousands of them around and their owners would love you for it. Tom Pappan Corunna IL SOME THOUGHTS ON STANDARDS Let me take this opportunity to con- gratulate you and your staff for an excellent magazine. This is one publication I read from cover to cover. Keep up the good work! It's interesting to note the various calls for standardization in the hobby computer field; I heartily agree that there should be as much as possible. Along this line, let me suggest one more I found an excited, in- volved mob of computer hobbyists who are as seri- ous about this as I am. 11 The computer was de- signed as a scientific tool; we all don't want to play "super space electronic hangman life-war pong." item in software which could use some help — the 10 problem. Granted, the hardware manufacturers are helping, by offering some- what standard cards, but what of the fellow who wants to use something other than a Model 33 TTY or a TV Typewriter? For example, I use a parallel-input 30 cps printer, a parallel-output 600 cps tape reader, and a parallel-input punch. I have to write my own drivers for these devices and they can be a lot longer than the standard UART routine. Therefore, any ready-made program I want to run on my computer has to be modified so I can use my drivers with it. If I don't have a listing of the program, I don't know where all the 10 routines are located, so I have to de-assemble portions of the object tape to find them; this can be a real bear! What would be really helpful in a case like this would be to have some standard addresses which would then vector the pro- gram to the appropriate 10 driver. Every time a printer output is necessary, for instance, the program would call location 100 (or whatever). This three byte section of memory would then contain a jump to the actual IO driver. Thus it would be quite easy to modify any program with this feature to run on any computer; you know where the branch table is located and can easily insert your own driver addresses. Naturally, each program could contain its own drivers, if you wanted to use them. It sure would be nice if someone (BYTE?) would make strong recom- mendations along this line and if the manufacturers would give serious considera- tion to adopting the recommendations. Michael M Dodd Fairfax VA A standard for complex peripheral devices has not yet been proposed in the small systems context. There is a de facto plug compatibility standard in the Altai r 8800 bus of M ITS due to second sourcing of memory cards and peripherals from many firms. An important factor to be considered by potential software vendors is the issue of modularity and customization to weird peripherals. The most generally useful soft- ware will be written with machine-specific "black boxes" assumed for 10 operations. A software package might come with a standard serial 10 routine. But if the soft- ware is documented and supplied with patching instructions, the serial 10 black boxes can be replaced by new routines specific to a particular system. CHEERS Several years ago while daydreaming in one of my computer science classes, I formulated what I have since called the programmer's cheer. As a systems program- mer, I now recite this occasionally to uplift the spirits of my fellow software and hard- ware specialists. It is also invigorating to insert this in documentation and in the comments of program listings. Maybe BYTE readers and staff members can use this to inspire enthusiasm and spread the good word? Programmer's Cheer Shift to the left Shift to the right Pop up! Push down! BYTE, BYTE, BYTE! Marilyn Boguski N Olmsted OH BEYOND GAMES Enclosed is $12 for my subscription to BYTE. I think the journal is a fine start, certainly a welcome change from the base- ment mimeo-outputs I've been getting. A few suggestions, if I may. Advertising is nice, and I know it makes the presses go round, but don't be afraid to be objective in your reviews of products, or to knock an adver- tiser for poor service, etc. Your readers will appreciate it. Standardization will be important in the microcomputer field. Everyone it seems will go the cassette route for mass storage and data exchange. It is not too early to look at all the possible cassette software packages available and to recommend the one that seems to be most flexible, least speed- dependent, capable of the most BPI, etc. How about a comparison between Lan- caster's design and the pi:lse modulation system in TCH? The sooner one method becomes accepted, the sooner a free exchange of programs between micro- computer users can begin. In my own work, I use the computer for data storage, retrieval and statistical analysis using APL, FORTRAN, FOCAL, and the MARS (CDC) and TRIAL (Northwestern) data storage and retrieval programs. Articles on scientific applications would be nice. The computer was designed as a scientific tool; we all don't want to play "super space electronic hangman life-war pong." Paul Kanciruk Tallahassee FL 12 For a limited time only, you can own an Altair 8800 Computer kit with 4,096 words of memory, new Altair multi-port interface, and revolutionary Altair BASIC language software, for just $695. A savings of up to $114!* Computer. The Altair 8800 is the best-selling general-purpose computer in the world today. It is a parallel 8-bit word/lb-hit address computer with an instruction cycle time of 2 micro- seconds. It was designed for almost unlimited peripheral and memory expansion, using a bus system where all input/output connections merge into a common line. The Altair 8800 is capable of addressing up to 65,536 words (bytes) of memory. Regularly priced at $439 for a kit and $627 assembled. Memory. The Altair -4K Memory Board provides 4,096 words of dynamic random-access-memory for the Altair 8800. Contains memory protect circuitry, and address selection circuitry tor any one of 16 starting address locations in increments of 4K. Access time is 200-300 nanoseconds. The entire 4,096 words of memory on the board can be protected by switching to PROTECT. RegU- larly priced at $195 for kit and $275 assembled. Interface. Your choice — either the new Altair 88-2SIO serial interface or the new Altair 88-4PIO parallel interface. The serial interface can be ordered with either one or two ports and the parallel interface can be ordered with up to four ports. Add $24 fo; an additional 88-2SIO port kit. Add $30 for each additional 88-4PIO port kit. Each port of the new serial interiace board is user-selectable lor RS232, TIL, or 20 milliamp current loop (Teletype). The 88-2SIO with two ports can interface two serial I/O devices, each running at a different baud rate and each using a different electrical interconnect. For example, the 88-2SIO could he inter- faced to an RS232 CRT terminal running at 9600 baud and a Teletype running at 110 baud. An on-board, crystal-controlled clock allows each port to be set for one of 12 baud rates. The S8-2.S/0 is regularly priced at $115 kit and $144 assembled. Each port of the new parallel interiace board provides 1b data lines and four controllable interrupt lines. Each of the data lines can be used as an input or output so that a single port can inter- face a terminal requiring 8 lines in and 8 lines out. All data lines are TTL compatible. The 88-4PIO regularly sells for $86 kit and $112 assembled. Software. Altair 4K BASIC leaves approximately 725 bytes in a 4K Altair" for programming which can be increased by deleting the math functions (SIN, SQR, RND). This powerful BASIC has 16 statements (IF . . . THEN, GOTO, COSUB, RETURN, FOR, NEXT, READ, INPUT, END, DATA, LET, DIM, REM, RESTORE, PRINT, and STOP) in addition to 4 commands (LIST, RUN, CLEAR, NEW) and 6 functions (RND, SQR, SIN, ABS, INT, TAB, and SGN). Other features include: direct execution of any state- ment except INPUT: an "@" symbol that deletes a whole line and a "<— " that deletes the last character; two-character error code and line number printed when error occurs; Control C which is used to interrupt a program; maximum line number of 65,529; and all results calculated to seven decimal digits of precision. A/ta;> 4K PASIC is regularly priced at $60 tor purchasers oi an Altair 8800, 4K oi Altair memory, and an Altair I/O board. Please specify paper tape or cassette tape when ordering. $t Savings depends upon which interface board you choose. An Altair 4K BASIC language system kit with an 88-2SIO interface regularly sells for $809. With an 88-4PIO interface, this system sells for $780. NOTE: Offer expires on March 30, 1976. \m ' Creative Electronics MITS/6328 Linn N.E., Albuquerque, NM 87108 505/265-7553 or 262-1951 MAIL THIS COUPON TODAY! □ f.iu losed is check for S_ Q BartkAmericard _ □ or Master Charge D Altair BASIC System Special □ -1PIO interface D 2StO interface D Cassette tape O or paper tape O Extra SIO port □ Extra 4PIO ports Add $fl for postage and handling. D Please send free literature ADDRESS. CITY .STATE & ZIP_ NOTE: Personal checks take 2-3 weeks for clearance. For immediate processing send money order or use charge card. Delivery: 30 days. Prices, specifica- tions and delivery subject to change. 13 Our New Offices Publishing has got to be one of the craziest fields of endeavor in the known universe, especially as practiced in up country New England. After a start which reads like a romantic light opera with an episode or two reminiscent of the Keystone Cops, BYTE magazine finally has moved into separate offices of its own. BYTE is now located at 70 Main Street, Peterborough NH 03458 (phone 603-924-7217). We'll leave the complete story for our memoirs, but the fact is we've moved across town to the American Guern- sey Cattle Club building (known as "the Guernsey" to Peterborough residents). We're located on the fourth floor of Peter- borough's largest building, a veritable skyscraper if it weren't for Monadnock and Pack Monadnock mountains towering above us nearby. Circulation and billing will soon be changing over to the Guernsey's IBM 360 Model 25 computer (not very exotic but quite functional) and much of our type- setting and graphic work is now being done by the craftspeople at the cattle club. That 360/25 is itself evidence of progress — the Guernsey used to have almost 200 clerks keeping track of the family trees of pure bred cows before the computer automated the records. If you're passing through Peter- borough, stop by our humble abode and say hello." 14 Ydu can buy this microcomputer for $39.95, but... We would be a bit surprised if you could do anything meaningful without additional hardware and software. mc Wave Mate's Jupiter II™ isn't the kind of microcomputer kit you only stare at . . . when you've completed your Jupiter II just plug in your teletype and you're ready to go. That's because it goes beyond the sum of its high quality parts. It's the ultimate micro kit experience. In performance, in documentation, in reliability. First, consider its superb features. It has small pluggable wire wrapped cards easily tailored to suit your modifications. Every IC is socketed and 100% burn-in tested. In fact every part including the powerful MC 6800 CPU and the 8K dynamic RAM 68oo is guaranteed for 120 days. It has the best software around, System Monitor and Debug programs (ROM). Includes powerful text editor and Motorola compatible assembler. And BASIC at no extra cost. Because we've been making microcomputer systems for over 4 years, we can offer you the broadest line of interfaces including TV terminal and dual audio cassette. Impressive. And yet the grandest feature is the experience ( / { f\~~\ of completing a kit that works. [' Qj '/ j Guaranteed. Wmvjl mate. ACT NOW AND SAVE. Introductory price $1225. (Assembled $1885.) (Good until February 1, 1976) □ Send Jupiter II Microcomputer Kit. Includes: Modular plug-in power supply 9 module PC backplane CPU module System monitor module 8K dynamic RAM module Serial RS 232 communication interface module Front panel module Front panel Wire; cut, stripped, color coded. • Rack mount module cage • Wire wrap tool • Wire unwrap tool • Cables, connectors, all other necessary hardware • Software (editor, debug, assembler, BASIC) • Assembly manuals • Operators manuals • Theory of operation manuals • Annual membership in users group D Send details on kit-a-month club □ Kit □ Assembled □ RS232C conversion kit (teletype) $47.85 □ I'm not convinced; send me 101 reasons why. □ Please send free Jupiter II System catalogue. ] Check enclosed for $ Include $10.00 for postage and handling. California residents add 6% tax Delivery 60 days ARO □ Master Charge # □ Bank Americard # Credit card expires on Name_ Address . City/State/Zip. WAVE MATE 1015 West 190th Street Gardena, California 90248 Telephone (213) 329-8941 WmvjlTTUlU L WARRANTY 120 days on all parts, materials and workmanship. 15 Keyboard Modification George Macomber 1422-1 8th Ave Seattle WA 98122 I read your article in the September 1975 BYTE on surplus keyboards with interest. I have made some simple modifications to produce lower case codes on RTL and DTL keyboards. I have a Southwest Technical Products keyboard which I have modified. I have also modified a Sanders 720 owned by a friend. Control Key: On keyboards with RTL or DTL outputs (Sanders 720), simply ground- ing the most significant bit (MSB) converts the upper case letters to the corresponding control codes. "M" becomes "carriage return" and "J" becomes "line feed," etc. Most keyboards have some control codes, but this simple modification gives all 32 possible codes 0000000-001 1111. As an example, on a Sanders 720, the "repeat key" is wired to terminal 8 (yellow wire), which is the flag output (see "Deci- phering Mystery Keyboards," September 1975 BYTE). The repeat key simply grounds the flag output. Moving the wire to terminal 15 converts the repeat key to a control key. Lower Case: A somewhat more com- plicated modification which works on both MSB IN BIT NO. 6 T control _r J -; KEY £> SHIFT KEY JT -MSB OUT BIT NO. 5 — I BIT OUT BIT NO.5 the Sanders 720 and the Southwest Tech- nical Products keyboards allows the produc- tion of lower case letter codes 1100000-1111111. In order to get lower case codes from a keyboard which produces only upper case, it is necessary to make the fifth bit high. The code for "A" 1000001 becomes "a" 1100001, and "[" 1011011 becomes " { " 1111011. The circuit shown adds lower case and control to any RTL or DTL output keyboard. The control key has already been men- tioned and is not required if the keyboard already has one (Southwest Technical Pro- ducts). Both a shift key and a toggle switch are shown. You will probably want both. When the toggle or key switch is closed, the keyboard behaves as it did before modifica- tion. When both are open, the keyboard generates lower case, but the numbers and other shifted keys (i.e., 1 -* !) are un- affected. A convenient key to use on the Sanders is one of the shift keys, leaving the other shift key for numbers and some other symbols (i.e., [, \ ,],_)• What happens when both shift keys are pressed? Shift' has no effect on the numbers since bit no. 6 is 0, which forces the upper case or shift' function. But the old shift changes the letter codes, either by forcing the fourth bit to 0, or by inverting the fourth bit (Sanders). Inverting the fourth bit allows the generation of some additional codes ([, \ , ], _), and their equivalent lower case ( ( , } , «, DEL) and control codes. These will not be available if your keyboard forces the fourth bit, unless it has separate keys for these codes. ■ 16 FROM THE COMPANY THAT DELIVERS COMES THE BIGGEST SURPRISE OF THE CENTURY. ASSEMBLED 4K COMPUTER Graphics and Cassette I/O $860.00 ... A GRAPHICS CONTROLLER FOR USE WITH YOUR TV. MOTOROLA 6800 MICROPROCESSOR BASED COMPUTER HOUSED IN AN ATTRACTIVE DESKTOP TERMINAL, AND MUCH, MUCH MORE. PHEEE CORPORATION 791 South 500 West Dept. 122 fRfm 9Q9 ft AAA Bountiful, Utah 84010 ^ U1 ' *VJ*-84bb WRITE TODAY FOR THE FULL MICRO-SPHERE PACKAGE. 17 The "My Dear Aunt Robert Grappel MIT Lincoln Laboratory Lexington MA 02173 The number of mathematical operations a computer can perform without the aid of programming is quite small. The bare machine can add and subtract, and perhaps it can also multiply and divide. It cannot comprehend a series of operations, nor can it evaluate a mathematical expression as a human would typically write it. It cannot group operations as required by the rules of mathematics. All these require software; programs which convert mathematical state- ments to sequences of machine instructions. This article describes a set of programs which can read a mathematical statement in its normal form and evaluate its result. The discussion is kept on a general level: no specific machine or language structure is assumed. These programs should find their way into many "do-it-yourself" assemblers, compilers and interpreters .... wherever it is useful to write mathematical expressions for input to a computer. My Dear Aunt Sally Shortly after students learn to do the basic operations of addition, subtraction, multiplication, and division (the same opera- tions that bare computers can perform), they are faced with problems of the follow- ing kind: 3—5*2=?. A student with imagina- tion finds such a problem paradoxical; there are several apparently "correct" answers. Performing the operations in the order of appearance, he gets —4 (scanning left-to- right). Performing the multiplication first, he gets —7. If he chooses to scan from right to left, then the results +4 and +7 are possible. Which is correct? My teacher gave us a rule to remember how to proceed with these problems — multiply, divide, add, subtract — or, "My Dear Aunt Sally" as we came to remember this order. Mathematical statements are read from left to right, for each operation. The evaluation starts with all the multiplications, left to right. It then proceeds in the order of "my-dear-aunt-sally," evaluating all the divi- sions, then all the additions, then all the subtractions. Mathematicians call this order- ing the "precedence of functions," and all mathematical operations can be ranked in the order in which they are to be performed. Hence, the example has only one correct result, and this is —7. Unfortunately, precedence is not enough to force a single answer from every problem. Suppose one wishes to perform one opera- tion upon the result of a group of several other operations, some of which are of higher precedence. One needs some mech- anism to group certain parts of a mathe- matical statement so that they can be considered as a single unit to be treated by some other operation. For this purpose, mathematics uses parentheses. If one wrote the example from above as: (3— 5)*2=?, it is clear that the subtraction should be per- formed first, in spite of the precedence of the two operators. With the two tools of precedence and parentheses, one can force the desired ordering of operations upon a mathematical statement and ensure that there will be only one correct result. What Is a Parser? Now, how can a computer deal with complex mathematical statements like the example? The computer can perform each operation individually, either by a single 18 Sally" Algorithm elementary operation or by calling a sub- routine. The problem is the same one that we faced as students; how does one break down a complex mathematical statement to perform the individual operations in the right order? The name for this operation of breaking down a complex statement into its component parts, determining the structure of the statement, and evaluating it as re- quired, is "parsing." This article describes a set of procedures which together form a parser. Tokens At the outset, the computer sees a mathe- matical statement as a string of characters. All that is known about the string is its starting address and its length. The statement X-2/(YAXIS+Z) is a string of 13 characters at some address. One of the first things that is necessary is a procedure to subdivide this string into its elements: variables, constants, operators, and parentheses. The example contains three variables: X, YAXIS, and Z. It contains one constant: 2. There are three operators: -, /, and +. There are also two parentheses. Each of these elements is a character string. These strings may be of differing lengths. There may be blanks embedded in the input string, but these are not desired in the element strings. The procedure which subdivides the input string and eliminates blanks is called NEXTOKEN. Each element of the input string is called a token. The first problem of constructing a parser is to find a way to inform a computer about the tokens con- tained in the character string representation of a mathematical statement. Blanks as Separators There are several ways to approach this problem. Perhaps the easiest (in the sense that the coding of NEXTOKEN is simplest) is to require that the writer of a mathe- matical statement put at least one blank between every element or token in the statement. In this way, the human pro- grammer breaks the input string into tokens before the computer gets it. We would require that the above statement be written as X -2 /( YAXIS + Z) where all the extra spaces are required. With this method of token separation NEXTOKEN would work like this: Starting at the last character processed (the leftmost one at the start of the string), NEXTOKEN scans the input string from left to right until a blank occurs. This substring (from starting point to blank) is the next token. The next step is to determine what type of token has been scanned. The rule that will be followed in this article is that the first character of a token determines its type. If the first charac- ter is alphabetic, then the token is a variable. If the first character is a digit or decimal point, then the token is a constant. If the first character is neither of the above, then it is checked against a table of legal operators. If it is not an operator, then it is checked to see if it is a parenthesis. Variables might be checked for invalid characters in their names or too many characters in the name; con- stants might be checked for non-numeric 19 "My Dear Aunt Sally" is a precedence ordering rule. A parser is a programming scheme to analyze state- ments. Figure 1 : Flow chart of the NEXTOKEN algorithm used in this design, (a) The main routine, (b) The variable name collection algorithm, (c) The numeric constant collection algorithm, (d) Parenthesis handler, (e) Single character function name handler, (f) Generalized function name handler. , BEGIN A YES /get next / / character/ TEST NEXT CHARACTER DISCARD CHARACTER S Q L WK^S. £ COLUTT CHARACTER GET NEXT CHARACTER TEST NEXT CHARACTER COLLECT CHARACTER GET NEXT CHARACTER TEST NEXT CHARACTER COLLECT CHARACTER RETURN PARENTHESIS TOKEN COLLECT CHARACTER ■O TEST VALID 'Y OF COLLECTED STRING TEST VALID 'Y OF COLLECTED STRING RETURN operator toktj; A character is fetched by the "get next character" operation. This character may be collected into an output string by NEXTOKEN, or discarded if it is to be ignored. If it is neither collected or discarded, the character will be reused the next time the "get next character" operation is performed. Flow is from left to right or from top to bottom unless an arrowhead indicates a different flow direction. 20 characters or more than one decimal point. A token which failed to match the model of any of the four token types would be flagged as an error, as would any of the error conditions described above. A check for string length of an operator might be used: The string '+=VAR' is not an operator, despite its first character. A Smarter Token Separator Requiring blanks around every token of a mathematical statement not only takes up valuable memory space but also makes the parser very susceptible to programmer errors. It is far too easy to forget one of those critical blanks. Fortunately, with a slightly more complicated mechanism for NEXTOKEN, one can parse a randomly written statement with any spacing. This algorithm is flowcharted in figure 1. The routine starts by always scanning and ignoring any leading blanks. Eventually it finds a non blank character, the first charac- ter of some token. Remember that a rule was established for this parser: The first character of a token determines its type. Once the token type is known, the NEXTOKEN routine checks that subsequent characters are valid for that token type. As soon as a character is found which is invalid for that token type, the token is completed. For example, consider the expression X+5. The first character (leftmost) is alphabetic; this means that the first token is a variable. The second character is not alphanumeric, so it is not part of the variable type token. Hence, the first token is X which is a variable. The next token starts with a + which is found in the operator table. Hence it is an operator. The next character is the digit 5. This is the start of a constant type token. There are no further characters, so the token is complete. Is It an Operator or a Variable? One useful extension to the algorithm should be considered here. Many operator names that we would like to use are not single symbols, but are several characters in length. One might for example want to call the cosine operator by the name COS. Unfortunately, the simple minded NEXTOKEN procedure would confuse this with a variable named COS. There are several ways around this problem. One is to define new symbols for each operation added to the system. These are added to the character tests for operators and the parser will work fine. This makes for clumsy notation, how- ever; and there may not be enough distinct characters available in keyboards, Teletypes, etc. A second approach is to require a special character, such as the dollar sign ($), as the first character of the string desired as an operator name. The cosine function might therefore be named $COS. The dollar sign would disqualify the name as a variable and identify it as a candidate for operator status. NEXTOKEN would then check the re- maining characters in the name (using the same rules as for variables) against a table of operator names. If a match is found, then the string is an operator. The third approach is to forego the identifying first character in operator names and to treat operator names as a special kind of variable in NEXTOKEN: When a character string is typed as a variable, it is then checked against the list of operator names. If a match is found, then the token is changed in type from variable to operator after further statement analysis. Since this is complicated, NEXTOKEN assumes the dollar sign as identifying charac- ter for extended operator names. We see that NEXTOKEN starts with a character string, a starting pointer within that character string, and the position of the end of the string. NEXTOKEN returns a character string which is the new token, an indication of the token type, and the token length. It leaves the input string starting pointer with a new value after collecting or discarding each character needed to build the current token. Some Small Procedures There are several small procedures which are necessary to the parser and which are briefly described now. Two of these are required to convert the character strings, which are the tokens, into their values. One of these, called CONST, works on constants. The other, called VARIABLE, works on variables. Routines like these are usually available in a large computer's operating system. For minicomputers, the algorithms can be extracted from programming texts and programmed for software deficient home brew systems. The mechanism of VARIABLE depends on the structure chosen for the symbol table used to store variables. There should be some form of check that a variable has a value before it is used. If it has no value, an error message should be generated. Another routine needed is a form of branch table to convert the character string name of an operator into a call to the proper subroutine to perform the operation. A mechanism for generating the prece- dence of operators is also needed, as was demonstrated in the introduction to this article. This amounts to a table of prece- dence values indexed by the operator name. Every legal operator is assigned a prece- Computing the value of a statement is often easier if the statement is first re- written in a form better suited to computers. Polish notation is such a form. 21 Operator Precedence Trigonometric functions, 7 or more Logarithmic functions, Roots, etc. t (Exponentiation) 6 * (Multiplication) 5 / (Division) 4 + (Addition) 3 — (Subtraction) 2 parenthesis 1 empty stack Table I: Precedence of operators. This is a typical mathematical precedence of operations. ( BEGIN J CALL NEXTOKEN TEST TOKEN G> MOVE TOKEN TO STACK MOVE TOKEN TO POLISH STRING -O MOVE STACK TO POLISH STRING UNTIL ' ( ' LOOK UP OPERATOR PRECEDENCE -O MOVE TOKEN TO STACK 6 Figure 2: The POLISH routine specified as a flow chart. This routine uses NEXTOKEN to obtain individual tokens of the syntax, then uses its logic to rearrange these tokens in Polish notation. The output of this routine is a Polish string. dence, as are parentheses and the right and left terminations of the input string. This article assumes that the higher the prece- dence value, the earlier the operation should be done. In other words, the operator with highest precedence goes first, the second highest goes next, etc. Table 1 is a typical precedence table. This precedence lookup procedure is called PRECEDE. Intermediate Results As shown in the introduction of this article, it is often necessary to evaluate a mathematical statement in a different order than that in which the statement was written. "My Dear Aunt Sally" does all the multiplications first, then the divisions, then the additions and subtractions. This parser operates by rewriting the statement into a more desirable form. In the new form, the operators are performed in the order that they appear. There are no parentheses re- quired in the new form. The operands (the variables and constants) and operators are located in a simple and consistent relation- ship to one another in the new form. This makes the evaluation algorithm easier to write and more efficient. This "nice" form for writing mathematical statements was devised by the Polish logician J. Lukasie- wicz. The next item to consider in this parsing system is a procedure to rewrite the input character string into Polish notation. This procedure, called POLISH, uses NEXTOKEN to disassemble the input string when required by its algorithm. POLISH also uses PRECEDE to compare the precedences of operators in different parts of the string. Figure 2 shows a flowchart of POLISH. This procedure forms the heart of the parser and is described in some detail. Several examples are also worked through. Once a mathe- matical statement is in Polish notation, it is rather easy to evaluate it. A few examples of Polish notation and its evaluation are in order here. Consider the statement A*B+C*D. We know by prece- dence that the multiplications are to be performed first. In Polish notation we choose to write the operands first, followed by the operator. Hence, A*B becomes AB*. Similarly, C*D becomes CD*. Then the addition of these quantities is written AB*CD*+. This is the Polish form of the example statement. This string is evaluated as follows: Starting at the left, operands (variables and constants) are passed directly into a software pushdown stack in memory, which is a temporary holding area organized so that the first item in the stack will be the last item out of the stack. (This stack should not be confused with the subroutine call and return stacks of many microcomputers.) The 22 stack will hold the values of the operands, as returned by the procedures VARIABLE and CONST. When an operator is encountered, it is applied to the top two values in the stack. The result of the operation is returned to the stack in place of the operands. Figure 3 shows a flowchart of the evaluation proce- dure, called EVAL. Let us proceed to evaluate the example AB*CD*+. First, we place A, which is a value, on the stack. Then we place B on the stack. Next, we encounter the operator *. The top two values on the stack are A and B, so we compute A times B and return that value to the stack. Next, we put C on the stack. Next, D goes on the stack. Then the operator * is encountered again. The top two entries on the stack (the last ones entered) are C and D. We compute C times D and return that value to the stack. The stack now holds two values which are the products of A and B, C and D, respectively. Finally, we encounter the operator +. We perform the addition and then we are done. In a similar manner, the first example of this article, 3—5*2, would be written as 352*— in Polish. POLISH starts by calling NEXTOKEN for the first token. If it is not an operator or parenthesis, the token is output to the Polish string and NEXTOKEN is called for the next token in the input string. If the token was a left parenthesis, the parenthesis is placed in the stack and NEXTOKEN is called again. If the token was a right parenthesis, the con- tents of the stack are moved to the output Polish string until a left parenthesis is en- countered or the stack is empty. Both the left and right parentheses are deleted and NEXTOKEN is called. Parentheses must occur in left-right pairs — if there is no left parenthesis in the stack after a right paren- thesis is found, there is an error and the string cannot be parsed. If the token was an operator, then its precedence is checked against the precedence of the top of the stack. If the new operator is of lower precedence than the top of the stack, the top of the stack is output to the Polish string and the check is performed with the new top of stack. Eventually the new operator will have higher precedence than the top of the stack (an empty stack has zero precedence). If the new token is the end of the input string, then it is treated as an operator of lowest precedence. Some languages use a special character for the input string termi- nator, but this is not necessary. In any case, if the new token is the end of the input string, then POLISH is finished when the stack is empty. If the new token is not the end of the input string, then the token is placed on the stack and NEXTOKEN is ( BEGIN ) GET NEXT POLISH STR'G TOKEN TEST TOKEN TYPE PUSH OPERAND INTO POLISH STACK PUSH OPERATOR (A,B) TEST STACK SIZE A:=POP RETURN A [ END ) Figure 3: The EVAL routine specified as a flow chart. This routine is an example of an interpreter. It takes the Polish string created by POLISH, and decodes it and evaluates the mathematical value to be computed. Several functions are employed by the EVAL routine, as follows: PUSH means place the value in question into the operand stack, increasing the stack size by one value. POP means recover the top operand from the operand stack, decreasing the stack size by one value. OPERATOR(A,B) means evaluate the combina- tion of the value A and the value B according to the definition of the current operator in the POLISH string. The data concepts employed during evaluation are as follows: Temporary data storage is found in A and B. The Polish string is a series of separated tokens created by POLISH as its output. The operand stack is a first-in-first-out stack of values defined by operand tokens (variables and constants) in the Polish string, or by the results of previous operations which are left in the stack. 23 Table 2: An example of the POLISH routine in operation. The output string of a practical implementation of POLISH must have a convention to separate tokens. Storing out- put as a reconstructed character string with blanks to separate operands allows EVAL and UNPOL to use the same NEXTOKEN routine which POLISH calls. Other storage techniques, which do not require the use of blanks as separators, are possible. ( BEGIN J PUSH 1 ( ' INTO STACK PLACE OP ON STACK nput Stack Output A A + + B + B t ( +tl C +t( C * +t(* D +t(* D / ( +t(/ +t(/| * D +t(/( D + +t(/(+ F +t(/(+ F ) +t(/ + * +t(* / G +t(* G ) +t * end of string t + OUTPUT TOKEN \ EtD J -O Figure 4: The UNPOL routine specified as a flow chart. This routine takes the Polish string created by POLISH and inverts the transformation to obtain a normal arithmetic expression again. called again. Table 2 shows the input string, stack contents, and output string as POLISH works through the string A+Bt(C*D/(D+F)*G) where the upward arrow symbol represents the exponentiation. Exponentiation has a higher precedence than the other operations in this example. Work- ing through the example shown in table 2 should convince the beginning programmer that this algorithm actually does translate to Polish notation. EVAL can then evaluate the Polish expression to obtain the final result. Undoing What's Just Been Done Polish notation is a convenient way to store a mathematical expression in computer memory. It tends to contain fewer charac- ters, since parentheses are not needed. Also, it can be readily evaluated without the need to first perform a complicated conversion of the sort we just saw described. However, if one wants to edit an expression or change its structure, then one would really like to see the original form of the expression. Figure 4 shows the flowchart of a procedure called UNPOL which reverses the process of POLISH and converts a statement of Polish notation back to normal form. It scans from right to left (the reverse of POLISH) and outputs the normal string in reverse order. UNPOL can use the same NEXTOKEN and PRECEDE that POLISH uses (see the note in table 2). The only change is the sequence in which the tokens are used. Table 3 shows the input, stack contents, and output of UNPOL as it reverses the processing of the example A+Bt(C*D/(D+F)*G). Note that unnecessary parentheses are dropped when a mathematical expression goes through POLISH and then through UNPOL. For Input Stack Output + + t +t * +t(* ) G +t( G* / +HI + +t{/(+ ) F +t(/( F+ D +t( D(/ # +t(* D +t( D* C + C( t B B+ A A NOTE : Processing starts at the top of this table. The Polish string is scanned in reverse order starting with its rightmost character. Pro- ceeding down the table, the output is generated in reverse order also, starting with the rightmost character. Table 3: An example of UNPOL in opera- tion. The Polish string input to UNPOL is scanned in reverse order (right to left) and generates the output string starting at the left. 24 example, (A*B)+(C*D) becomes A*B+C*D. The parentheses were unnecessary because operator precedence ensured that the multi- plications would be done first. UNPOL will not drop any necessary parentheses. Trying a few examples through the parsing algorithms presented here should convince even a beginning programmer that Polish notation provides a straightforward way to make a computer evaluate complex mathematical expressions. Using these algorithms, it will be possible for readers to incorporate evaluation of mathematical state- ments into their programming systems." My Dear Aunt Sally's Glossary Alphabetic Character: Any of the letters A through Z. Assembler: A program which translates symbolic assembly language intput into machine language output. Assemblers frequently require arithmetic statement parsers in order to compute addresses and data values based upon symbolic assembly language statements. Compiler: A program which translates symbolic statements of a high level language input into a machine language output. Compilers require some form of arithmetic statement parsing, although the output is generally converted one step further into actual machine code. Constant: A constant is a way of specifying data which is fixed. In the My Dear Aunt Sally parser, constants are defined by input character strings which begin with a numeric character, and contain only numeric characters or at most one decimal point. Interpreter: A program which translates symbolic statements of a high level language input into an immediate action. An interpreter could use the My Dear Aunt Sally parser to evaluate arithmetic expressions when required. Mathematical expression: An input character string which obeys the syntactical rules of the My Dear Aunt Sally parser and can potentially be evaluated as a single resulting arithmetic value. breaking that input string into a series of tokens according to the syntax rules. Pop: Remove an element from a stack storage mechanism, in a last in, first out order. Precedence: In evaluating an arithmetic expression, precedence is used to resolve ambiguities in the order of execution of several operations: The operations with higher precedence are performed first. Push: Add an element to a stack storage mechanism. Scan a string: The process of sequentially looking at each character or token of a string in a well defined order from left to right, or right to left. Software pushdown stack: A stack storage mechanism can be implemented exclusively in hardware, or by using mechanisms which are part hardware and part software, or entirely in soft- ware. For the purposes of the My Dear Aunt Sally algorithm, all stacks are implemented in software. This means that each stack reserves a random access memory region and is supported by sub- routines to perform the push and pop functions. The POLISH routine uses an operator stack to temporarily store and reorder the operator tokens when creating a Polish string; the EVAL routine uses an operand stack to temporarily hold values as it interprets the Polish string. Statement: A statement is the programming lan- guage equivalent of a sentence in a natural language such as English. String: A string is a series of values with definite starting and ending points. The parser of this article requires an input character string containing the human readable codes of an arithmetic expres- sion, and produces a Polish string output of parsed tokens which can be evaluated by the Polish string interpreter. Subroutine: A subroutine is a section of a program which is called to perform its function. When completed, it returns control to the routine which calls it. Subroutines are created for two purposes when programming: To modularize a program according to function, and to share common functions and save memory space. Numeric character: Any of the numbers through 9. Operator: An operator is a token specifying an action to be taken when the expression being parsed is evaluated. My Dear Aunt Sally recognizes two kinds of operators: Single character operators are used to denote the conventional arithmetic operations; multiple character operators are recog- nized by a dollar sign (as in $SIN) and are used for mathematical functions. Parenthesis: Left and right parentheses are used to group operations in mathematical expressions. The only requirement for consistent evaluation of expressions is that left and right parentheses must balance. Parser: A computer program mechanism for per- forming the parsing function. Parsing: Given a set of syntax rules (a grammar) and an input string, parsing is the process of Symbol table: A central collection of the variable names used in a program, along with related information. For the My Dear Aunt Sally parser, a symbol table would be composed of the variable token (a character string) and current numeric value for each variable found while parsing a statement. Note that the My Dear Aunt Sally algorithm by itself does not provide a means for setting the value of variables; an extension of the software into a full interpretive high level language with an assignment statement would provide such a means. Token: A token is a basic unit of the syntax of an expression. In the My Dear Aunt Sally parser, tokens are character strings collected and returned by NEXTOKEN along with an indication of syntactical type. Variable: A variable is a symbolically named data location. The parser of this article detects variables as character string names which begin with an alphabetic character. 25 You don't need high- powered compiler theory to process your own algebraic expressions — all you need are a few variations on one basic idea, developed in West Germany . . . Processing Algebraic Expressions W Douglas Maurer University Library Room 634 George Washington University Washington DC 20052 To the amateur programmer, algebraic expression processing may seem a formida- ble obstacle. How do you write a program which takes a character string like 2+3*(4-(1 4/7-1)) as input, and produces the right answer — in this case 1 1 — as output? The programmer seeking answers to such questions is usually led to a collection of sources on compiler theory, and to arcane-sounding terms like "recursive de- scent," "top-down and bottom-up parsing," and the like. These were developed for use by the compiler writer, although even com- piler writers find much of compiler theory interesting for theoretical purposes only. The net result has been, in all too many instances, to scare the ordinary programmer away from algebraic expressions entirely — a decidedly unfortunate state of affairs. Most people who do work with algebraic expressions in a small system setting have made use of what is called "Polish nota- tion." Although we shall describe Polish notation next month, the warning must be given that Polish notation can be misused as easily as it can be used. The much more direct method which we shall describe was developed by F.L. Bauer and K. Samelson at the Technische Hochschule in Munich, Germany. We refer to it as the "Bauer- Samelson algorithm." Before describing the Bauer-Samelson al- gorithm, let us first take up a number of elementary points about the processing of algebraic expressions. The input to any algebraic expression processor will, of course, be a string of characters. These are given in some sort of character-code format, and there are as many such formats as there are computers. Even the number of bits per character varies from one system to another. Some systems use five bits per character, some six, some seven, but most use eight — the standard IBM 360 (and 370) "byte." Since there are 26 letters in the alphabet, at least 26 different codes must be used. To find out how many bits are needed to represent that many codes, we take the next higher power of 2, in this case 32, or 2-\ There are 32 different possible codes in 5 bits (from 00000 to 11111). Therefore 5 bits are enough to represent the 26 letters of the alphabet; whereas 4 bits would not be, because there are only 16 possible codes in 4 bits (from 0000 to 1111). If we wish to represent digits as well, we need 26 + 10 = 36 codes. Now five bits are not enough, and we must take the power of 2 next higher than 36, that is 64 = 2 6 . There are 64 possible codes in six bits, and six bits are what is used on many big computers — the UNIVAC 1106, the CDC 6400, and the obsolete IBM 7094. (The PDP-10, DEC's biggie, has two character code schemes; one uses six bits, the other uses seven.) Once we have 64 codes, of course, we can represent characters other than letters and digits, such as +, — , *, /, =, parentheses, period and comma, and so on — known as special characters. Where five bit codes are used, the special characters include shift characters, analogous to the shift key on a typewriter, 26 enabling us to pass from one group of 32 codes (including the shift characters them- selves) to another such group and back. Once we know how many bits are in a character, the choice of the actual character codes is still quite variable from one com- puter to another. There is a "standard" code called ASCII, or American Standard Code for Information Interchange. But this, as its name suggests, is a standard code for infor- mation interchange (between different com- puters) only, and many individual computer makers continue to use their own code schemes. All of the codes in common use, however, share certain characteristics. One of the most important of these is that the codes for the digits are all consecutive. That is, whatever the code for zero is (and this is quite variable), the code for 7, say, is 7 more than the code for zero. This is quite helpful to us in finding the binary equivalents of integers. Another common characteristic of character codes is that the codes for letters of the alphabet are given in numerical order (although not always consecutively). Thus the code for T, for example, will be greater than the code for R, because T follows R in alphabetical order; but it will not always be true that the code for T is 2 more than the code for R. A sequence of characters is given in a character array. On a byte machine, charac- ter arrays are easy to index. As soon as we have loaded the first character in our array into a register, we add 1 to our index register (or indirect address location) and we are immediately set up to load the next charac- ter. If we are working on a machine which holds more than one character per word — such as a 16 bit or 18 bit machine — our best course, when processing character strings (of limited size) is usually to unpack them into a word array in which one character is con- tained in each word. This is illustrated, for a 16 bit machine, in figure 1. After unpacking, the characters may be processed in the same way as given above. We will thus have an index in our program which is initialized to point to the first character in our array, and which is incremented, after we are through processing that character, to point to succeeding char- acters in the array. Let us now turn to the question of how these characters should be processed. Suppose, first of all, that we load a character into a register and discover that it is a digit. Our first job should be to find out whether any of the characters immediately following this one are also digits. Since numbers are stored internally in binary form in almost all computers, a string of digits Figure 7: Unpacking characters on a 16 bit machine. representing an integer will have to be converted to this form for further proc- essing. Let us assume that we have a cell called NUMBER which is initialized to zero. Then our algorithm for finding the binary value of a string of digits is as follows: 1. Check the current character. If it is not a digit, stop. 2. Multiply NUMBER by 10; add the current character; and subtract the character code for zero. 3. Advance to the next character in the string and go back to step 1. Thus for the character string 327, we perform 0X10 = 0, + 3 = 3; then 3X10 = 30, 30 + 2 = 32; and finally 32 X 10 = 320, 320 + 7 = 327 — all in internal binary form. Each time we add the value of the next digit, which is equivalent to adding the character code for the digit itself and then subtracting the character code for zero. Now suppose that, instead of a digit, we find the character code for a letter of the alphabet. The normal rule here is to look for letters and digits following this letter and to keep them in a string. Once we have found the first character that is neither a letter nor a digit, the letters and the digits that we have gathered so far constitute an identifier, which we may process further in a number of ways, depending on the way in which we are processing algebraic expressions. As an example, consider the expression ALPHA*BETA+GAMMA*DELTA. We load the first character, namely A, into a register. Since this is a letter, we keep looking for 27 letters and digits, and we find L, P, H, and A. All of these characters are kept in a string. When we get to the *, the characters we have kept in our string so far constitute the identifier ALPHA. How we process this identifier depends on what it is supposed to mean. Is it a constant with a defined value? In that case the value is presumably in a table, and we can look it up. Or perhaps the purpose of processing this character string is to give this identifier some constant value. For example, suppose the string were ALPHA=3 and suppose we were processing this in such a way as to put the the value 3 in a table, corresponding to the identifier ALPHA. In this case, when we reach the character =, we can put ALPHA into our table, and then later put in the value. Much algebraic expression processing in- volves special identifiers, or identifiers which are to be processed differently from the others — such as SIN, COS, and SQRT, or, perhaps, IF, STOP, and GOTO. All special identifiers should be collected into a table, and every time we recognize an identifier — that is, at the point in our program at which we have encountered a character that is not a letter or a digit, so that we know that the characters we have accumulated so far con- stitute an identifier — this table should be searched, to see whether any of its entries are equal to the current identifier. For each special identifier, we will then have a sub- routine, or a section of our program, which handles it. Let us now see what happens when, in the processing of our character string, we encounter an operator — a character such as + » —) *, I, or parentheses. This is where we use the Bauer-Samelson algorithm. The Bauer-Samelson algorithm uses two stacks — one for operators and one for operands. Many programmers, although they understand the basic idea of a stack, have never actually written a stack-oriented pro- gram. The easiest way to do this is by using an array — call it S — together with a current length for the array, which we may call LS. At the start of our program, LS is set to zero. To put the quantity X on top of the stack, or, as we call it, to push down X on the stack, we perform IF LS = MAX THEN GOTO OVERFLOW LS: = LS + 1 S(LS):=X where MAX is the dimension of the array S, and we transfer to OVERFLOW if we have stack overflow, that is, if the stack has grown too large. Pushing down X on the stack, of course, puts X on top of the stack while preserving all quantities on the stack that were previously put there. To take the quantity X off the top of the stack, or, as we say, to pop up X from the stack, we perform IF LS=0 THEN GOTO EMPTY X:=S(LS) LS: = LS - 1 where we transfer to EMPTY if the stack was empty when we tried to pop it. (This is usually not an error condition, but normally means that our stack process has termi- nated.) Of course, in the Bauer-Samelson algorithm, since we have two stacks, we may call them S1 and S2, with corresponding current lengths LS1 and LS2, both of which are initially set to zero. In order to follow the operation of the Bauer-Samelson algorithm, we shall have to understand the basic idea of precedence of operators. Taking the five operators +, — , *, /, and ** (the last of these denoting expo- nentiation), we shall assign to each one a number called its precedence, as follows: The easiest way to understand precedence is to consider what would happen if we didn't have it. For example, let us look at the expression 2*5+3*4. Suppose we tried to find the value of this expression in the following way: 2 times 5 is 10, plus 3 is 13, times 4 is 52. Clearly, this would be the wrong answer. What we want to do is to perform the multiplications first, namely 2 times 5 is 10 and 3 times 4 is 12, and then add together the resulting values, 10 and 12. Since we perform the multiplications before the addition, we say that multiplication (as an operator) has higher precedence than addition. The numbers which we have assigned to the operators reflect this fact; that is, 2 (the precedence of multiplication) is higher than 1 (the precedence of addition). We shall now describe the basic opera- tions of the Bauer-Samelson algorithm. The algorithm proceeds by scanning over the characters of the given string from left to right. Every time we encounter an operand — a constant or a variable — while we are doing this, we place it on the operand stack S1. Every time we encounter an operator, we try to place it on the operator stack S2. This is not done unless the precedence test is satisfied; that is, unless the precedence of the given operator is higher than that of the 28 operator at the top of the stack (or unless the operator stack is empty). If the prece- dence test is not satisfied, we remove an operator from the top of the stack S2, remove its operand or operands from the top of SI, calculate a result, and put this result back on SI. This is called unstacking an operator. We continue to unstack all opera- tors from S2 until the precedence test is satisfied. When we reach the end of the entire original string, we unstack all opera- tors from S2. An example should make this clear. Suppose we have the string 2*5+3*4 men- tioned earlier, and we are trying to calculate its value, which is in this case not 52 but 22. In the following analysis, we shall denote the contents of a stack by several quantities in parentheses, with the last of these quantities denoting the top of the stack. Thus (10,3,4) as the contents of the stack SI means that the number 4 is at the top of this stack. The Bauer-Samelson algorithm proceeds in this case as follows: 1. The 2 goes on the stack SI. 2. The first * goes on the stack S2. (The precedence test is satisfied, since the stack S2 was empty.) 3. The 5 goes on the stack S1, which now contains (2,5). 4. We cannot put the + on the stack S2, because the precedence of + is lower than that of *. Therefore we unstack the * from the operator stack S2. This means: we take * off the stack S2, leaving S2 empty; we take its operands off the top of S1 (that is, we take 5 and 2 off S1 ); we calculate the result, namely 2*5 = 1 (the second operand of any operator is always removed from the stack first); and we put the 10 back on the operand stack S1, which now contains 10 and nothing else. 5. We are supposed to keep unstacking operators until the precedence test is satis- fied. At this point, however, the precedence test is in fact satisfied, since the operator stack is empty, and we may therefore place a + on the operator stack and continue. 6. The 3 goes on the stack SI, which now contains (10,3). 7. The * goes on the stack S2, which now contains (+, *). The precedence test succeeded in this case, since the precedence of * is higher than that of +. 8. The 4 goes on the stack SI, which now contains (10,3,4). We are now at the end of the original string, and it is time to unstack all the operators from the stack S2. 9. The operator at the top of S2, namely *, is taken off this stack. Two operands are taken off the top of SI, namely 4 and 3; this leaves 10 on S1. The result, namely 3*4 = 12, is calculated and placed back on S1, so that S1 now contains (10,12). 1 0. The operator at the top of S2, namely +, is taken off this stack. Two operands are taken off the top of SI, namely 12 and 10; this leaves S1 empty. The result, namely 10+12 = 22, is calculated and placed back on S1. 11. The operator stack S2 is now empty; the Bauer-Samelson algorithm has finished; and the answer, namely 22, is on the operand stack S1. (Unless there has been an error, the Bauer-Samelson algorithm will always end with exactly one quantity on the operand stack, and this quantity will be the final result.) This is the basic Bauer-Samelson al- gorithm. It may now be modified and extended in a number of ways. Let us first consider parentheses. A left parenthesis is treated as an operator. It is always placed directly on the operator stack without making the precedence test; that is, it is treated as if it had the highest prece- dence. Once it is on the operator stack, however, it is treated as if it had the lowest precedence; that is, any other operator is placed directly above it on the stack, or, to put it another way, the precedence test always succeeds if there is a left parenthesis at the top of the operator stack. A right parenthesis is treated somewhat like the end of the expression. We unstack all operators on the operator stack until we come to a left parenthesis, which we remove from the operator stack and continue to scan the given string. If there is no left parenthesis on the operator stack, there were too many right parentheses in the original expression. Conversely, if we come to the end of our string and start unstacking operators, and one of these is a left paren- thesis, then there were too many left paren- theses in the original expression. As an example of the use of parentheses, we consider the expression 2+4*(5-(6-3))/8, the value of which is 3. We shall again "walk through" the Bauer- Samelson algorithm as it scans this string. This time, however, we shall use an abbre- viated notation. In the second column below, marked action, we use one of the following codes: O (Operand) — An operand is placed on the operand stack. S (Succeed) — The precedence test succeeds, and therefore an operator is placed on the operator stack. U (Unstack) — The precedence test fails (or else we are at the end of the expression, or at a right parenthesis), and thus an operator is unstacked. 29 Table 1: Calculation 2+4*(5-(6-3))/8. of the value of Current Operand Operator Character Action Stack Stack 2 12) Empty + S (2) (+) 4 (2,4) (+) * S (2,4) (+,*) ( L (2,4) l+.\L) 5 (2,4,5) (+.\U - S (2,4,5) <+,*,L,-> 1 L (2,4,5) (+,\L,-,L) 6 O (2,4,5,6) (+,*,L,-,L) — s (2,4,5,6) (+,M-,-,L,-) 3 (2,4,5,6,3) (+,\L,-,L,-) ) u (2,4,5,3) (+,*,L,-,L) R (2,4,5,3) (+/.U-) ) U (2,4,2) (+,*,D R (2,4,2) (+,*) / U (2,8) (+) S (2,8) (+,/) 8 (2,8,8) (+,/) End U (2,1) (+) u (3) Empty L (Left parenthesis) - A left parenthesis is placed on the operator stack. (This is denoted by L in table 1. R (Remove left parenthesis) — A left parenthesis is removed from the operator stack (this happens after unstacking, when the current character is a right parenthesis). The operation of the Bauer-Samelson algorithm in this case can now be expressed by means of table 1. Of course, the "current character" col- umn in table 1 takes advantage of the fact that every operator and every operand in our example program consists of a single charac- ter. In a more general case, this column would be headed "current operator or op- erand." Let us now consider unary operators. Superficially, there is no difference between a unary and a binary operator from our point of view, except that when we unstack a unary operator we must remove only one operand, rather than two, from the operand Table 2: Calculation -S-(-3-4). Current Current Label Character Action of the value of Operand Operator Stack Stack L1 — S Empty (U) L1 5 (5) (U) L2 - U (-5) Empty s (-5) (-) L1 ( L (-5) K L) L1 — S (-5) (-,L,U) L1 3 (-5,3) 1-L.U) L2 - u (-5,-3) l-.L) s (-5,-3) (-L-) L1 4 (-5,-3,4) (-,L-> L2 ) u (-5,-7) KL) R (-5,-7) (-) L2 End U (2) Empty stack. However, when we put the unary minus sign on the operand stack, we must be careful to identify it as a unary, rather than a binary minus sign, so that we know how many operands to take off the stack SI . This in turn means that we are going to have to be able to tell the difference between a unary and a binary minus sign as we are scanning our string. The simplest way to do this is to think of our Bauer-Samelson algorithm as having two basic labels, which we shall call LI and L2. We start off at LI (after all necessary initializations). When we are at L1, we are expecting to find an operand. If we find one, we put it on the stack S1, and go to L2. When we are at L2, we are expecting to find an operator. If we find one, it will be a binary operator; we put it on the stack S2 (after any necessary unstacking) and go back to L1. But if we are at L1 and we find an operator, it must be a unary operator; we put it on S2, after unstacking if necessary, and then return to L1. Suppose now that we find a right paren- thesis. Then we must be at L2 (if we are at L1, we have an error in the string we are scanning). We perform all necessary unstack- ing, remove a left parenthesis from the operator stack as described above — and then return to L2, since we are now expect- ing a binary operator. If we find an operand at L2, this is also an error condition. If we find a left parenthesis (of the type that we have so far described), we should be at L1; we put it on the operator stack and then return to L1, since we are again expecting to find an operand. This interplay between L1 and L2 may be illustrated by the following example, con- taining two unary and two binary minus signs, in addition to parentheses. For the moment, we shall consider a unary minus sign to have precedence equal to 2. A binary minus on the stack S2 will be denoted by '— ', a unary minus by U, and a left paren- thesis by L. The codes in the "action" column are as in the preceding example. The string to be scanned is —5— (—3— 4); its value, which is 2, is calculated by the Bauer-Samelson algorithm as in table 2. It is, incidentally, a matter of controversy as to what the precedence of the unary minus should be. It should clearly be lower than that of exponentiation (thus— X**N is clearly -(X**N), and not (-X)**N) and higher than that of addition (thus — X+Y is clearly (-X)+Y, and not -(X+Y)). What about — X*Y, however? The two expressions (-X)*Y and -(X*Y) are equal, and the same is true of (-X)/Y and -(X/Y). It is not clear which choice leads to the greatest efficiency of calculation." 30 New England Seminar on Computers in the Laboratory The New England Section of the Society for Applied Spectroscopy and the Analytical Section, American Chemical Society (New England) announce a seminar series, Auto- mation and the Laboratory - 1976. This seminar, open to non-members of the sponsoring organizations, is aimed at the scientist, professional researcher or engineer with little or no formal training in computers and digital electronics. The course is designed to cover laboratory automation topics ranging in scope from the smallest microcomputer systems to tradi- tional large scale installations. Speakers are from the local universities, industry and computer publications. All sessions will be Thursday nights, 6:30 to 9:30, at the Hartwell Avenue facility of IL Inc., Lexington MA 02173. The fee for individuals who are not members of the sponsoring societies is $30 for the whole series, $5 for individual lectures. Each session will be divided into two segments separated by a coffee break with refresh- ments. For details contact Marti Bancfroft at: IL Inc. Jonspin Road Wilmington MA 01887 or, by phone during business hours at 617-658-5125 Extension 40 If you have been out of school five years and are a little frustrated by computereeze, this seminar is for you. It should be especially appropriate if you are considering the use of laboratory data processing equipment. MICROCOMPUTER PROFILE (A One Day Technology Update) A survey and update on microcomputers and how they make it easier to use micro- processors, presented with hands-on demon- strations and important survey materials. Seven offerings during March 1976: Los Angeles, Chicago, Ottawa, Boston, Washing- ton DC, Dallas, and San Diego. Fee: $165 includes survey papers, course notes, reprints, coffee breaks and luncheon. For information: Technology Service Corpora- tion, 281 1 Wilshire Boulevard, Santa Monica CA 90403. Telephone: (213) 829-7411. An Update on the SCCS Computer Purchase Hal Lashlee, SCCS treasurer, reports the following progress on the Los Angeles group's DEC LSI-11 purchase. First, the SCCS has changed its commission to 7% of the purchase price (larger donations are solicited). Second, the first order of 50 machines has been placed with DEC now that the minimum number has been reached. Third, SCCS now has an OEM arrangement with DEC and will continue to coordinate purchases of the LSI-11 and related equip- ment. Individuals interested in an LSI-11 should contact Hal at the SCCS post office box address: Southern California Computer Society PO Box 987 South Pasadena CA 91030 Now — a lower- priced and easy way to save your Altair 8800 programs __ JJ 3VTFSlVf : :' Hiiii(tiJi»;;;;i;iJiiiiiiiiJiiiHii(Hiii." T ™ Cromemco's BYTESAVER™ memory board makes it simple to save your Altair 8800 programs. That's because (1) the BYTE- SAVER™ has a built-in PROM programmer and (2) holds up to 8k of PROM or ROM memory. Having its own programmer lets you transfer programs directly from the computer RAM to the BYTE- SAVER™ PROMS. Then your programs can't be lost since the BYTESAVER™ keeps its memory content even when you turn off the computer. Great when developing software. The BYTESAVER™ is fast and good sized — holds up to 8k of • Has butlt-in PROM programmer and a memory of up to 8k • Holds memory content indefinitely • Permits full computer speed • Erasable PROM or ROM memory. Yet it's priced much less than a separate programmer itself. The BYTESAVER™ plugs dir- ectly into your Altair 8800. Accepts new 2704 512-byte or 2708 1k-byte PROMS both of which permit full computer speed. Erasable with UV. The disable switch prevents accidental pro- gramming. Comes with one 2704 PROM and either kit or assembled. Order now from a growing com- puter peripherals firm. And watch for another new product to be announced soon. ORDER INFO: BYTESAVER™ kit (Model 8KBS-K) $195 BYTESAVER™ assembled (Model 8KBS-W} S295 Shipped prepaid if fully paid with order. Calif, users add 6% sales tax. Mastercharge and BankAmericard accepted with signed order. Q CROMEMCO Specialists in computer peripherals One F irst St., Los A Itos, CA., 94022 < (415) 941-2967 31 Data Paths Gary Liming 3152 Santiago Dr Florissant MO 63033 Data transmission in a broader sense doesn't have to mean large networks of computers and remote terminals. Data transmission usually brings to mind terminals, telephone lines, satellites, and large computer centers. Computer links in retail stores, banks, airlines and government agencies are becoming more and more wide- spread. Such large scale operations can easily cost millions of dollars and are thus out of the range of the hobbyist. The prospect of linking home systems across distances for program swapping and interactive games will undoubtedly become more a possibility as the technology improves. However, data transmission in a broader sense doesn't have to mean large networks of computers and remote terminals. It is defined as the process of sending error free bits from one place to another, and applies to all digital systems regardless of com- plexity. In this article we illustrate some data transmission principles applied to hobby system design, over distances ranging from the length of printed circuit foil runs on a circuit card to the extremely long distances involved in phone or radio links. Communication Theory Data transmission is part of the broader subject of communication theory which is used to analyze communication systems. Any communication system has three parts: a message source, a medium, and a receiver. To communicate, information of some kind must be transferred. Information is defined simply as an orderly representative signal. Orderly means that the signal is sent in a known format which can be interpreted and decoded by the receiver. Representative means that there is agreement between source and receiver upon what the signal will mean. A signal could be a series of printed characters, a bell, a whistle or even a color. The smallest unit of information is the bit, representing only an on off or yes no condition. One or a series of these fun- damental bit signals makes up the message in digital communications. Any medium that can transfer a message has limits, and the medium within these limits is called the channel . The limits which define a channel might be physical prop- erties such as the technologically available bandwidth, or human defined limits such as an arbitrary FCC ruling that a radio station is allocated a particular set of frequencies with a prescribed bandwidth for its signals. Noise is defined as any signal that interferes with the message, like radio static or dirt on a camera lens. A communication that works one-way, or does not allow information to be mutually exchanged is called a simplex transmission or communication. If information can be exchanged, it is called a duplex system. There are two kinds of duplex systems: If information can be sent between two points simultaneously, it is called a full duplex system; if the information can be transferred in both directions but not at the same time, it is called — you guessed it — half duplex. Figure 1 illustrates the various kinds of communications exchanges. Let's apply this to a simple example — consider the page you are looking at. The author is the message source, you are the receiver, and paper and ink are the medium. The size of the page sets the channel limits, and ink blots or printing errors comprise noise. Communication is simplex. When a reader replies, it has become half duplex. This point of view can be applied at different levels to your system design. Inte- grated circuits, printed circuit boards, peripherals and terminals can all be con- sidered sources and receivers. They all use the bit as the common unit of information. An important factor in data communi- cations is the data or transmission rate at which the bits are transferred. This is mea- sured, naturally, in bits per second (abbrevi- ated b/s). It is on this simple point that many newcomers first get into trouble by using the term baud. Baud has a different meaning which can be ambiguous, as we will see when we look at modulation methods and modems. Another important parameter of informa- tion transmission is the error rate, measured by the number of bits in error out of the 32 Simplex: Half Duplex: Full Duplex: & ^»- a/ -^* / R One way for all time. B Now. Alternating, B Later. but one way. B Simultaneous two way. Figure 1: The terminology describing modes of communication between sender and receiver depend upon who is sending data and when the data is sent. Data transmission is the process of sending error free bits from one place to another. total number transmitted. If your computer processes instructions at 500 kilobytes per second which equals 4 megabits per second, an error rate of one in 10 million (10**— 7) will give you an error on the average of every 2.5 seconds. Clearly, what is a tolerable error rate depends on the transmission rate. A central processor which has errors every 2.5 seconds is not very usable. Medium Characteristics To transfer data, the hobbyist can use any medium that will support a bit stream. There isn't any reason why you couldn't take a serial interface and hook it up to modulate a laser beam. However, since most of the transmission done by the hobbyist uses conductors, let's first look at small gauge wire used as a communication channel. As the data rate through the wire increases, the bit stream begins to look like an AC signal passing through a transmission line, and must be treated as such. This is not necessarily related to a reversal of current flow, like AC, but is due to the fast rise and fall times of the pulses. Therefore, the channel must have a fairly wide band of frequencies it can pass {band- width). It must pass an AC signal with approximately the same rise and fall times as the pulse and the flat portion of the pulse, which is essentially AC at zero frequency. Conductor properties such as resitance, capacitance, and inductance degrade the quality of the pulses. The voltage drop due to the resistance of the wire lowers the voltage of the received pulse. Capacitance between the signal wire and the ground wire shunts some of the voltage, and inductance and capacitance both provide impedance to the flow of the pulses. Noise induced from the environment and the power supply will further degrade signal quality. Another problem amateur radio operators will be familiar with is the skin effect, where high frequency current tends to concentrate in the outer layers of the wire, increasing the effective resistance. Also, the propagation time of the pulses should be taken into account. Even though the pulses travel at near the speed of light, for 22 AWG (0.79 mm0) wire, the delay is about 1.5 ns/ft (4.9 ps/cm); a 100 foot coaxial cable introduces a transmission delay which is nearly a whole machine cycle delay in some high speed systems. Indeed, such transmission lines are often used as delay elements in oscilloscopes. All these phenomena depend on the length of the wire and the frequencies of the signal. They can combine to ruin the shape of the pulse to the extent that the logic gates can become confused as to whether they are seeing a zero or a one. We conclude then that the longer the wire and the higher the transmitted frequencies, the harder it is to get an acceptable error rate. Microtransmissions Armed with these characteristics and definitions, let's look at how conductors affect data transmission in a typical proc- essor. To date hobby systems have been predominantly designed with 7400 series TTL, which can handle clock frequencies up to around 35 MHz, but are commonly clocked at around 1 MHz. At 1 MHz, characteristics like resistance and capaci- tance of wires are not significant for short transmissions such as chip to chip or board to board transfers. The big problem inside systems is induced high frequency noise due to changes of logic states. The typical TTL transition time of ten nanoseconds has a significant harmonic content well into the VHF range of 50 to 200 MHz. (This is the reason your computer can generate some powerful television interference if it is not properly shielded.) The current surges at the power connection of a TTL gate which is changing state induces a noise signal, since the power bus is typically a poor conductor of VHF. Thus one common source of noise is a poorly designed power supply and distribu- tion system. Because of its high speed characteristics, TTL logic is very sensitive to To communicate, infor- mation of some kind must be transferred. 33 What is a tolerable error rate depends upon the number of bits per second transferred. changes in its supply voltage. The power surges of one gate changing state can momentarily drop the level of a local power distribution wire, affecting its neighboring integrated circuit and thereby giving birth to a. glitch in the system. Detecting a glitch is a real hassle for the pros, and the best policy is to use sound design practices from the start. The design of well regulated power supplies is a significant subject in its own right, and will not be covered in this article. Home brew computer experimenters can often find excellent high current logic power supplies in surplus stores. Noise spikes in the power wiring can also occur between chips on the power paths and can spread to other chips and boards. These noise spikes in the power wiring are induced due to the inductance of the printed circuit foils or wire wrap wires as the gates change state and draw a lot of current. Using wide flat power supply runs in the PC artwork will lower the high frequency impedance of the conductors. Problems can be further minimized by placing many small ceramic decoupling capacitors of approximately 0.01 uF between the positive power supply bus and ground. Use one decoupling capacitor for every five to ten TTL integrated circuits. Using an integrated circuit voltage regulator on each board will also help provide isola- tion of power supply noise between boards. A well grounded case will greatly help reduce environmental noise. The case will also shield you from your neighbor's com- plaints about interference with his television reception. Another benefit of a well grounded system case or chassis is protection from static electricity. In a dry house in winter, shuffling across the room to turn on the system can wipe out some MOS chips, as I know from bitter experience. These may not sound like important data transmission problems, but they are direct results of the same high frequency trans- mission characteristics which affect long wire links. Troubles that start with an improperly designed power distribution and layout scheme are hard to spot and correct, but will certainly show up in transmissions over long wires. Macrotransmissions Macrotransmission problems occur between central processors and peripherals. The transmission line characteristics become important: If the length of the wire approaches the order of magnitude of the wavelength of the signal, transmission line effects are a potential source of problems. This phenomenon occurs in short wires at high frequencies, and in longer wires at lower frequencies. As mentioned previously, the frequency characteristics of TTL logic circuits changing state - VHF components in the 100 MHz range — are what tend to dominate the transmission line properties of long wires carrying TTL signals. Using the usual radio formula, X = 300/f (X in meters, f in MHz) gives wavelengths for the high frequency components of a TTL state transition which are in the vicinity of three meters at 100 MHz. Thus cables with lengths of one or two meters should exhibit many of the prop- erties of transmission lines when they carry standard TTL signals. Note that this prop- erty primarily depends upon the transition time, and is independent of the actual number of transitions per second. By slowing the transition time by a factor of 100 to one microsecond or more, trans- mission line effects will not begin to occur until cables of 100 meters or more are considered. Given some arbitrary length of cable, the alternatives open are to take into account transmission line behavior through impedance matching techniques, or to slow down the signals so that transmission line effects are no longer a consideration. Since the latter option produces a non-TTL signal because it changes state too slowly, let's turn attention to methods of compensating for transmission line behavior. As a simple example, consider two paral- lel wires. Each wire has the properties mentioned before, and is represented in figure 2. In order for the pulses to travel through the conductor with minimal losses in signal quality, each end of the cable must be terminated properly. Termination of the Figure 2: Symbolic representation of parallel wire transmission. The system is symmetric, so it does not matter whether the left terminals are at the source and the right terminals are at the receiver or vice versa. The symbols used in the diagram are as follows: L, inductance of the wire. R, resistance of the wire. C, capacitance between the wires. G, high resistance leakage path between the wires. 34 Dear Friends , You are invited to attend the first annual WORLD ALTAIR COMPUTER CONVENTION. This exciting event will be held at the new MITS factory on Saturday and Sunday, March 27-28, in Albuquerque, New Mexico. Hobby clubs and individual Altair owners have been asked to bring their Altairs to Albuquerque to set up demonstrations . Thousands of dollars worth of Altair equipment will be awarded to the users with the most innovative demonstrations . Seminars will be conducted by MITS engineers , MITS software writers , and by some of the leading figures in the home computer field. Since the new MITS factory is located close to the Albuquerque Airport, it will be very convenient for out-of-town guests to attend the convention. The entire Albuquerque Airport Marina Hotel has been reserved for this occasion. This hotel is across the street from the terminal building and just a short walk away from MITS. Attendence to the convention will be free (not counting travel and hotel costs) and MITS will provide door prizes and at least one free luncheon. Call or write for hotel and convention reservations. Or for more information: WACC/MITS 21+50 Alamo SE Albuquerque, NM 87106 phone 505-265-77553 or 262-1951 With the help of the thousands of Altair Users and friends of Altair, it is hoped that this convention will be one of the most exciting computer events in the industry. Thanks from Ml Creative Electronics "Altair is a registered trademark of MITS, Inc. Photo 1: Coaxial cable consists of a central conductor, an outer conductive braid, and a protective coating. It is bulky and expensive, but it has good characteristics as a transmission line for data. Photo 2: Two examples of ribbon cable. The lower example is a surplus item consisting of flat copper conductors (similar to PC lamination) embedded in a plastic carrier. The upper example is a more conventional cable intended for assembling to a special dual in line package (DIP) plug. > m*mmi&*» Photo 3: Twisted pair cable is the only good data transmission line which can be easily fabricated at home. Here is an example made using an electric drill to do the twisting. line involves matching the characteristic impedance of the wire with the impedance of receiver and transmitter. As a pulse is sent to the other end, the energy of the pulse is dissipated by the termination of the wire. If the wire is not terminated properly, a reflection of the pulse will travel back to the source, and a condition called ringing will occur. It is for this reason that flip flops should never be used to directly drive a line of significant distance. Ringing or noise spikes could occur on the line and enter the flip flop circuit and change its state. Typical 7400 gates have an impedance of 100 O in the high state and nearly O in the low state. Almost all newer small scale TTL integrated circuits are diode clamped, pre- venting most ringing on the inputs. This allows wires to go about 5 feet between gates without using external impedance matching techniques, and assumes a rela- tively high speed and constant impedance line. If a standard TTL gate is used as the transmitter in a data link, fan out rules must be observed to supply sufficient current. To raise the output voltage of the pulse, a 2.2 kO resistor can be connected between the output and the 5 V source. This pullup resistor raises the output pulse to a full 5 V and reduces the chances of noise affecting the line. For longer runs at high speeds, a TTL line driver chip like the 74128 can be used to provide more current to the line. For even longer runs or in critical applications special chips like the Signetics 8T13 and 8T16 are used as drivers and receivers to insure a low error rate. The maximum length for these transmissions depends on the type of wire being used. Coaxial cable is one of the best cables to use for long distance transmission of digital data. It has a center conductor set in a non conductor with a metallic braid or foil (the shield) wrapped around it. The shield is used as the ground return and for protection from external noise. Photo 1 illustrates a typical coaxial cable, cut so its construction can be seen. Cables with a nominal characteristic impedance of around 100 O are normally used in order to match gate terminations. Coaxial cable has the disadvantage of being inflexible and bulky, especially if many wires have to be terminated in a small area. An even worse disadvantage is its high cost. Coax is usually used when other wires aren't suitable. Flat ribbon cable, which usually has every other conductor grounded, provides a con- stant impedance and reduces the chance of wires inducing signals on each other. Ribbon cable for the hobbyist is still rather expen- sive, and special connectors generally must be used. Photo 2 shows two types of ribbon cable: flexible copper strips in plastic, and multiple stranded wires. Twisted pair wire is the most cost effec- tive transmission line for long runs in hobby systems. This kind of cable can be fabricated at home using an electric drill. In multipair cable, each pair should be used as a single signal path, with one wire grounded. The rise time characteristics of the pair are deter- mined by the conductor size and tightness of the twist. For a 100 O cable, the wire should be 22 to 24 AWG (stranded) with about three turns to the inch. Multipair wire is available at many surplus houses, and is generally a bargain. Photo 3 illustrates a typical home made twisted pair. Good old hookup wire is the most suscep- tible to noise and usually has a highly 36 COMPUTER EXPERIMENTER SUPPLIES FACTORY FRESH— PRIME QUALITY PERFORMANCE GUARANTEED MICROPROCESSORS AND MEMORY Commercial Grade— up to 35°C. 8008 $ 35.00 8080 135.00 2102 3.50 2102-2 4.50 These units are factory fresh, full spec devices. COMPUTER GRADE REGULATED POWER SUPPLIES All units are short-circuit proof, fold back current limited and with over-voltage crowbar protection. MD-15 ±15 Volt at 200MA Dual Tracking $30.00 MD-5-1 +5 Volt at 1 $24.50 Amp MD-5-3 +5 Volt at 3 Amp $34.50 MD-5-6 +5 Volt at 6 Amp $44.50 MICRO COMPUTER SUPPLY COMBINATIONS For the 8008 MD-08— +5 volt at 6 amp, -12, -9 at 200 ma $75.00 For the 8080 MD-80— +5voltat6amp,±12vat200ma . . .$75.00 FortheFairchild F-8 MD-8— +5voltat6amp,+12vat200ma . . .$65.00 For the M6800 MD-5— +5 voltat6amp $44.50 All units are short circuit proof, fold-back current limited and with over voltage crowbar protection. TTL INTEGRATED CIRCUITS All devices are factory fresh, full spec uniis. 7400 23 7404 25 7442 60 7447 95 7448 95 7475 60 7490 60 7493 60 74125 55 74126 55 74192 1.10 74193 1.10 All Prices Subject to Change Without Notice Minimum Order $10.00 Add $1.00 to Cover Postage and Handling Send Check or Money Order (No C.O.D.) To: N. J. Residents Add 5% Sales Tax MICRO DIGITAL CORP. BOX 413, EDISON, NJ 08817 • (201) 549-2699 37 A well grounded case . . . will help shield you from your neighbor's com- plaints about interference with his television reception. When wires get long enough to look like trans- mission lines, termination and impedance matching become important. -i 1.852 .652 - .544 ► 055DIA. (25) \ — 435 — —.326-1 r .274 r*-\ — .218 f— 1 \ .'oH H ij ^ ©©©©©©©©©©©©©*-y^ W ©©©©©©©©@@©©-ttn I20DIA. (2) -J .163 .272 -.055 056 J | — . .112 —.381—- 48S 598 ► I 2 3 4 5 6 7 8 9 10 II 12 13 r lUUUUUU V TTTTTTTTTTTT 14 15 16 17 18 19 20 21 22 23 24 25 RS-232 PIN ASSIGNMENTS Pin Name Function 1 FG Frame Ground (not switched) 2 TD Transmit Data 3 RD Receive Data 4 TRS Request To Send 5 CTS Clear To Send 6 DSR Data Set Ready 7 SG Signal Ground 8 DCD Data Carrier Detect 9 Positive DC Test Voltage 10 Negative DC Test Voltage 11 Unassigned 12 (S)DCD Secondary Data Carrier Detect 13 (S)CTS Secondary Clear To Send 14 (S)TD Secondary Transmit Data 15 TC Transmit Clock 16 (S)RD Secondary Receive Data 17 RC Receive Clock 18 Receiver Dibit Clock 19 (S)RTS Secondary Request To Send 20 DTR Data Terminal Ready 21 SQ Signal Quality Detect 22 Rl Ring Indicator 23 Data Rate Select 24 ETC External Transmit Clock 25 Busy Figure 3: The commonly used RS-232 elec- trical interconnection for data transmission is shown here in the form of pin assignments for the typical D connector. A typical part number for the connector is DB-25P (plug) and DB-25S (socket) made by Cinch. AMPLITUDE MODULATION FREQUENCY MODULATION PHASE MODULATION ! | j | I | I i I rvL/^A/r\Jyviu/i/y^ I I I I I I I I I I I SPACE I O I I I I I I I I I MARK MARK 3 4 5 6 7 STOP STOP Figure 4: Two level asynchronous modulation, shown for the ASCII character "5" along with typical modulated waveforms for different methods of modulation. unpredictable characteristic impedance. Hookup wire should be used only for short runs between boards and as on board jumpers. The Long Haul At distances greater than your next door neighbor's house, it begins to become impractical to use your own wire between systems. This is primarily due to a very important conductor property — cost. Cop- per is not cheap, and stringing wire all over the place will give hobbyists a bad name. However, the phone company has already done this and will provide service to you if you pay the price. Another alternative is using a different medium, like radio waves. It will be inter- esting to see how many people suddenly want FCC ham licenses in order to play interactive TV games and exchange software. Both of these methods have a major drawback; they will not directly pass a digital signal. The telephone system was designed to carry audio frequencies. Phones just cannot carry DC level signals. Radio frequencies are at the other end of the spectrum and certainly won't support a usable DC coupled logic signal. However, the pulses of digital trans- mission can be superimposed on an AC signal that is within the bandwidth of the channel being used. The process of super- imposing one signal on another is called modulation. A device that will translate the digital bit stream to an encoded analog signal for transmission and analog to digital for reception is called a modulator-o'emodulator, or modem . Since it is impractical to have eight telephone lines or eight radio frequencies transmit in parallel, a conversion to serial must be done. This can be accomplished by writing the conversion in software, but is more cost effective by using an integrated circuit called a UART (Universal Asyn- chronous Receiver-Transmitter). This chip takes the data in parallel form and converts it to serial at a rate specified by external components. For a more detailed discussion of the serial interface and UARTs, see "The Serial Interface" by Don Lancaster in the September 1 975 issue of BYTE. There is a standard for interfacing serial data transmission between peripherals, sys- tems, and modems. The Electronic Industries Association (El A) of America has, by consent of various manufacturers and users, standardized a 25 pin connection with appropriate signal levels called the RS-232 interface. There is also a new EIA standard that has been introduced, called the RS-422 standard that is more suitable to TTL. 38 However, since almost all modems and peripherals now available and all surplus items are likely to use the RS-232 standard, it will remain the most significant to hobbyists for some time. A commonly used RS-232 connector along with pin assignments is shown in figure 3. The signals that appear on the signal pins must be bipolar with 3 V to 25 V represent- ing a logical one and —3 V to —25 V being a logical zero. There are chips available to do this conversion from TTL, the 1488 and 1489. If you are going to use commercial RS-232 equipment, you should expect to provide this interface; and you'll also need the positive and negative supply voltages. Keep in mind that in common practice many of the pins in figure 3 are not used. The most important lines on the RS-232 inter- face plug are the grounds, the transmit data (TD) and receive data (RD). In many instances it is sufficient to use only these lines, especially if you are just experimenting with an RS-232 peripheral. Note, however, that some terminals require inputs for one or more additional pins, many of which can simply be wired to the RS-232 logic zero or logic one lines (—12 V or +12 V, for example). Data Modulation There are three basic techniques for modulating an analog signal and many dif- ferent variations of these. An analog signal that is to be modulated by the data is called a carrier, and the carrier has three basic characteristics that can be varied. If the amplitude, frequency, or phase is varied in step with the bit stream, modulation occurs. An example of each technique is shown in figure 4. Amplitude modulation is seldom used in modems because of its high susceptibility to noise and attenuation, but the technique is used in some magnetic tape encoding schemes. Frequency modulation is a more common technique. The example shown in figure 4 uses one frequency to represent a bit and a higher frequency to represent a 1 bit. This particular method is called fre- quency shift keying (FSK). The phase modulation example in figure 4 shows a two level coding scheme with each 180° phase shift triggering a logical state change. The number of times the signal is varied each second is called Baud or Baud rate. Suppose you were designing a modem using phase modulation. You could, for example, divide the possible phase shifts into 45° each, having eight possible phase shifts for each signal change. A 45° shift would represent a group of three bits, namely '000'. 90° would represent '001', 135° = '010', 180° = '011', etc., up to 360° for '111'. In this case a signal changing 100 times a second, or at 100 Baud, would actually transfer data at 300 b/s. This method of one signal change representing more than one bit is called multilevel encoding. It is in principle the way some commercial high speed modems function. In order to obtain a fair amount of accuracy in transmitting data from a trans- mitter to a receiver, it is necessary to keep the two systems in step with each other. There are two common methods to do this, called synchronous and asynchronous trans- mission. Asynchronous transmission is also called start-stop transmission because each charac- ter is sent as it is created at the transmission interface. To synchronize the receiver, each character carries its own timing in the form of additional bits called start and stop bits. These give the receiver the ability to decode each bit reliably. The format of a single character is shown in figure 4 along with data for the digit 5 encoded in ASCII. Synchronous transmission is usually associated with blocks of data, where groups of characters are sent together. A fixed speed of transmission is set by clocks or oscillators, and data bits are transferred at this rate. To provide character synchroniza- tion, usually two special synchronization characters precede the actual block of data. An end of block character follows the data to signal the receiver that all of the data in that block has been sent. An additional error detecting character may also be sent as shown in figure 5. ERROR DETECTION CHARACTER- Figure 5: Synchronous transmission is block oriented and assumes highly accurate com- mon clocking of both the sender and the receiver. Finally, there is one other complication in using radio or telephones for your com- munication channel — the FCC. The FCC regulates the telephone industry by tariffs that specify the costs and types of devices that can be used with Ma Bell. They also regulate radio frequency allocation and power output and information codes that can be transmitted by radio. There are good reasons for having these regulations followed, but they do tend to make life difficult for the hobbyist. A dedicated 100 mile phone line with a Bell modem will exceed most other system costs A baud is not necessarily a bit per second — although it might be in special cases. A baud is a signal change per second. 39 available now A microprocessor based computer system as a replacement for the PDP-8. Check these features of TECHTRA DATA SYSTEMS new TMC 1 12: ******** A complete system with operator's control panel, up to 32K of core or semi-conductor memory, user custom programs in R01V1 as required, and lots more. ******** A complete range of peripherals tailored to fit the micro-processor systems world both in price and performance. Printers, video displays, floppy disk systems, cassette and reel to reel magnetic tape drive, and paper tape punches and readers. ******** A complete operating systems software package, from TECHTRA. Proprietary systems programs to help a user get his system up quickly along with TECHTRA'S custom software for a variety of intriguing applications. Compatibility with the PDP-8 opens up the world's largest software library. ******** All hardware is available in kit form or fully assembled. Programs as you need them on floppy, mag-cassette or paper tape. ******** TECHTRA DATA SYSTEMS offers complete, turnkey systems, components, or software to users or OEM 's. Special discount prices for students, computer clubs, universities, or quantity buyers. NOTICE TECHTRA is now seeking a limited number of agents and sales representatives. Engineering or computer science students to cover the educational market. Also for part time sales. For product prices and delivery information contact TECHTRA CORPORATION 130 WEBSTER STREET OAKLAND, CALIFORNIA 94607 (415)763-5717 for a home computer in a very short time. A ham license and suitable radio equipment are not cheap, either. Long distance real time data transmission is presently out of reach to many hobbyists." GLOSSARY Asynchronous transmission: Transmission where data is sent a character at a time with syn- chronizing bits added. See Synchronous Transmission. b/s: Bits per second. Bandwidth: The width of the frequency spectrum that a channel can pass, measured in Hz. Baud: The number of signal changes per second. Carrier: The analog signal that is modulated by the information that it is to carry. Also, the provider of a communications channel, i.e., Wla Bell. Duplex: Communication system that allows information to be exchanged. See simplex. FSK: Frequency shift keying, a type of frequency modulation for digital data. Full duplex: Communication system that allows simultaneous information exchange. See half duplex. Half duplex: Communication system that allows information to be exchanged, but not simultane- ously. See full duplex. Modem: Modulator-demodulator. A device used to convert digital to analog signals and vice versa. Modulation: The process of superimposing information on a carrier. See carrier. Multilevel Encoding: The process of using a signal change to represent more than one bit of information. Noise: Unwanted signals that interfere with the message. Ringing: A condition in transmission lines where "reflections" of pulses oscillate due to an impedance mismatch. Simplex: Communication system that does not allow information to be exchanged. See duplex. Synchronous Transmission: Transmission where the bit rate is clocked. Usually associated with block transmission. See asynchronous transmission. 40 Chips Found Floating Down Silicon Slough Roy H Trumbull 833 Balra Dr El Cerrito CA 94530 The state of the Art is changing rapidly. In fact I ran into him in New Mexico last month. Seems he had just gotten back from China where he had seen their latest computer. It was really fantastic, but they still have a problem with noise from the beads. I asked Art to clue me in on the latest devices coming out of research and these are the ones he told me about: 3D r DON'T GATE NOISE EMITTING DfODE &> The Don't Gate You don't get no output no matter what's at the inputs. It is believed that the don't gate was the breakthrough that made the LSI write only memory possible. Noise Emitting Diode (NED) When connected across a 1000 volt supply it makes a loud noise (once). The NED was discovered by Igor Pravaganda whom you'll recall worked many years trying to filter AC with electrolytics. He'll always be remembered as the father of the confetti generator. SHIFTLESS REGISTER TICK TOCK ►- I -"—NUMBERS FALLING I OUT GRANOLA OUT MAYOE IN-OP AMP J (UN)K FLIPFLOP Shiftless Register Must be used with 3 speed forward clutch gate. Shifts at 1 5, 25, and 35 bits per second. Double clutching with logic 2s is not suggested. Inoperational Amplifier (IN-OP AMP) Linear cousin of the DON'T gate. Provides no output for any input at a slew rate of volts per microsecond. Mil Spec, version available at 100 times the cost of OEM version. J(UN)K Flip Flop Doesn't change state when clocked regardless of input states. Changes state only when cola machine down the hall makes change. Excess 3 To Insufficient 4 Carry Forward Fudger Used to enter Murphy factor and get the programmer off the hook. Moss Highly experimental material. Very rare at present since only source is from under grizzly bear toenails. Turns green when facing north while on wood substrate. Fuzz Locked Loop Great if you want to avoid radar speed traps. ■ H CLUTCH GATE EXCESS 3 TO INSUFFICIENT 4 CARRY FORWARD FUDGER 41 The New ALTAIR 680 James B Vice MITS Inc The new ALTAIR 680 designed by MITS is a system based on the 6800 microproc- essing unit (MPU). The MPU is available from Motorola or American Micro-Systems and adapts nicely to a minimum design configuration. The ALTAIR 680 case measures about 11" by 11" by 4-3/4" (28 cm by 28 cm by 12 cm) making it less than one third the size of the ALTAIR 8800. The basic system is available in three configurations, depending on the intended application. These include a user programmable processor with complete front panel controls, and two smaller ver- sions oriented towards dedicated ROM pro- grammed applications. The compact size of the 680 obviously precludes any significant amount of internal expansion, although additional memory and IO control are already on the drawing board. Its small physical size can be deceiving. The overall concept was to keep the machine as simple, small and inexpensive as possible; but it forms the complete central processor of a system in itself. All that is needed to make a MITS 680 system is the addition of some IO devices and software. , The Three Models The construction of this machine is a relatively easy matter for even the most inexperienced kit builder. Almost all of the circuitry is contained on a single large printed circuit board, including memory and a built-in IO port. This single board is a full central processor with the exception of a power transformer and some control switches. This is where the main distinction between the three configurations is encountered: • Most hobbyists will be concerned with the full front panel model. This con- tains all of the necessary controls for addressing and entering data besides those for controlling the processor itself. • A turn key front panel model is also available which eliminates all controls except restarting the processor's ROM software. This could be used in appli- cations where it is desirable to elimi- nate the possibility of the operator or any other person affecting the machine's memory or computing cycle. An example for such an applica- tion might be its use in controlling an intrusion detection system, or for a manufacturing machine control system. • The third configuration is similar to the turn key version. The 680 will also be available as just the large PC board mentioned above. This board contains 42 everything but a power supply and controls. Its application is similar to the turn key model, except that the computer would be "buried" inside another machine. The board only model is an excellent starter for the experimenter who wishes to purchase an absolute minimum and do a bit of his own designing. Such experimental use is aided by the considerable amount of information available on the 6800 micro- processing unit from Motorola Semi- conductor Products, Inc. The 6800 MPU is also TTL compatible and requires only one 5 volt power supply. Front Panel In the front panel model of the 680 there is an additional printed circuit board. This board contains all of the logic circuitry necessary to reset, halt or start the proces- sor. Also located on this board are switches and associated LED indicator lights for each of the sixteen address lines and eight data lines. The front panel printed circuit board mounts directly to the main printed circuit board via a 1 00 contact edge connector. This eliminates the need for a cumbersome wiring harness. The only other control is the power switch, located on the back panel of the unit for safety purposes. On the dedicated program models, no front panel is needed because PROM or ROM software is used to store the starting address; a minimum fixed set of programs must be supplied by the user or manufac- turer in this form of the system. Functional Description The basic ALTAI R 680 computer can be subdivided into five functional sections. These are the MPU and clock, the memory, an IO port, control and indication, and- the power supply. The first three of these sections, along with the power supply regulation compo- nents, are located on the main printed circuit board. MPU and Clock At the heart of the 680 system is the 6800 microprocessing integrated circuit. This is a versatile and very powerful little processor, yet it is directly responsible for the overall simplicity of the 680 design. The 6800 is an 8 bit parallel processor using a bi-directional data bus and a 16 bit address bus. The address bus gives it the ability to directly address 65,536 bytes of memory. (Of course most configurations will have fewer than 65,536 bytes.) The instruc- tion set consists of 72 basic instructions with various addressing modes giving a total of 1 97 different operation codes. The 6800 has seven different addressing modes, with the available modes being a function of the type of instruction selected. The seven modes include the following: • Accumulator Addressing — one byte instructions which specify either of the two accumulators use this mode. • Immediate Addressing — two or three byte instructions with data specified in the instruction use this mode. In immediate mode instructions, one or two bytes of data follow the op code, depending upon the instruction involved. • Direct Addressing — two byte instruc- tions which allow the user to directly address the first 256 bytes of memory address space in the machine employ this mode. • Extended Addressing — three byte instructions with a full 16 bit address in the second two bytes use this mode. There is no need to set up an on-chip register to access all of memory with the 6800. This mode is available for most data manipulation operations. • Indexed Addressing — two byte in- structions with this mode add the second byte of the instruction to the 16 bit index register to give the address of the operand. • Inherent Addressing — certain one byte instructions imply the operands directly and thus do not need a separate address. • Relative Addressing — all the branch instructions calculate the branch address by adding the second instruc- tion byte to the current program counter plus two. The relative offset is treated as a signed two's complement number (8 bits) being added to the address in the program counter. This allows the user to branch to memory location +129 to -125 bytes from the location of the present instruction. These various addressing modes may take a bit of getting used to, but once understood they allow for some very fast programs to be written. The 6800 MPU contains three 16 bit registers and three 8 bit registers. The program counter is a two byte register which keeps track of the current address of the program. The stack pointer is also a two byte register which contains the next address in a variable length stack found in main memory. The index register is a two byte register used to store data or a memory address for indexed addressing operations. There are two single byte accumulators used 43 for holding operands and results from the arithmetic logic unit (ALU). The 8 bit condition code register indicates the results of an ALU operation. In this register there are two unused bits, kept at a logic one. The remaining six bits are used as the status flags for carry, overflow, zero, negative, interrupt and half carry. There are several timing and control signals required to operate the MPU. Two clock inputs are required, phase 1 and phase 2. These must be nonoverlapping and run at the Vcc voltage level. Ordinary TTL will not drive these clocks properly. In the 680 the clock is a 2 MHz crystal controlled oscillator with logic to provide a 500 kHz two phase clock. (Although the 6800 is capable of running with a clock of up to a 1.0 MHz, MITS has set the speed of the 680 to 500 kHz in order to greatly reduce the cost through use of slower and less expensive system components.) Sixteen active high address outputs are used to specify the sections of memory or 10 to be used. These can drive up to one standard TTL load and 130 pF. There are also eight bi-directional data lines with the sam e drive capability as the address lines. The HALT signal is an active low input which ceases activity in the computer. The RW (read or write) signal in the high state indicates that the processor is in a read condition; in the low state it indicates that the processor is in a write condition. The VMA (valid memory address) signal tells external devices that the proc- essor has a valid address on the memory bus. The DBE (data bus enable) signal is the input which enables the bus drivers. The BA (bus available) signal indicates that the machine has stopped and that the address bus is available. RESET is used to reset and start the MPU from a power off condition. The IRQ (interrupt request) signal, when low, tells the processor to start an interrupt sequence. This can occur only if the inter- rupt mask bit in t he condition code register is low. The NMI (nonmaskable interrupt) 44 signal is essentially the same as the IRQ signal except that it is not dependent on the condition code register. Memory The main printed circuit board on the 680 contains the basic memory for the unit also. This includes 1024 bytes of random access memory and provisions for another 1024 bytes of read only memory. The random access memory circuits being used are the 2102 static 1024 X 1 bit parts. Read only memories of the mask programmed type can be custom ordered, and are very expensive in small quantities. The 1702 type, ultra-violet erasable programmable read only memories are typically used in this system. These are 256 X 8 bit units, so four 1702As would be required to fill up the available space in the 680. There is additional memory for the 680 on the drawing board at this time which may add up to 12 K bytes more storage to the unit. IO Port Also on the main printed circuit board is a built in IO port and the appropriate interface circuitry. This port may be con- figured as either an RS232 level port or either a 20 mA or 60 mA current loop TTY level port. This means it can be interfaced with proper software to the old Baudot type Teletypes, such as the Model 19 and Model 28 machines. The entire design of the 680 is greatly simplified due to the 6800's use of memory address space for IO addressing. The proces- sor uses addresses to refer to IO devices as well as memory, rather than have special IO instructions and a separate IO bus. Within the limits of practical engineering, pro- gramming and memory requirements, as many IO devices as desired can be added to a 6800 microprocessor system. No logical limitation is built into the instruction set. MITS also has additional IO interfaces on the drawing board at this time; although availability of this and the additional memory boards will be greatly influenced in their development by customer response. Control and Indication On the fully user-programmable version of the 680, the front panel assembly con- tains a RUN/HALT switch with an LED indicator for each switch position. There is a RESET switch with no indicator, and another indicator for the AC power switch which is located on the back panel of the unit. The switches for the 16 address lines and 8 data lines, and their associated indica- tor lights, are also located on the front panel assembly of the fully programmable model. There is also a DEPOSIT switch. The DEPOSIT, RESET, DATA and ADDRESS switches are enabled only when the RUN/HALT switch is in the HALT position. To view the data in a particular memory address, the RUN/HALT switch must first be in the HALT position and then the ADDRESS switches may be set to the required address. The data located at that particular address will then appear on the DATA LED indicators above the DATA switches. To write data in a desired location, once the correct address has been set on the address switches, the appropriate data should be entered on the DATA switches and then the DEPOSIT switch activated. Since the address bus is already connected to the switches by being in the HALT state, a write pulse causes the data to be written into the selected RAM address. When the RESET switch is activated, the processor itself resets. This initiates a restart sequence, pulling the address bus to its high state and causing hard-wired data on the board to be used as the restart address. On the dedicated program versions of the 680, most of these functions are taken care of by ROM or PROM. The only controls available to the user are the AC power and RESET switches. Power Supply The 5 volt supply to the computer is supplied from the power transformer through a conventional bridge rectifier and filter capacitors and voltage regulator IC. A 32 volt winding on the transformer is used to generate the unregulated ±16 volts re- quired for a TTY interface, and a —16 volt line is fed to four zener diode regulated outputs to provide four —9 volt lines for the PROMs. The transformer itself, along with the power switch, is located on the computer's back panel. There are also provisions for installing a cooling fan when necessary. As far as software goes, MITS has a package available similar to the 8800's Package One. This includes an editor, PROM monitor and assembler. This all goes to make the ALTAI R 680 a rather powerful little machine. There is also the possibility for further software development. MITS has decided to await customer response to determine the course of further 680 development in both the areas of software and hardware. Although it's not quite as powerful as the ALTAI R 8800, the ALTAI R 680 is mighty close and costs less." 45 How to Save the BYTEs Thomas C Mclntire 310 Village Dr Centerville OH 45459 The personal computer is today, a real, affordable entity. A paradox is appreciated, however, when configuring a system. You can order a computer for less than a good color television. But talking to it costs much more. Computer communications, meaning the traditional twins of input and output, are commonly referred to as IO. The para- dox is that it costs more to save the bytes than to process them. A friend has recently completed assembly of an ALTAI R 8800 and is interfacing a TV typewriter and an audio cassette recorder for bulk storage. The keyboard, TV, cassette recorder and electronics cost more than the computer! Another popular approach is to use a tele-typewriter. Combining the keyboard, serial printer and punched paper tape IO into one machine, you might get by with as little(?) as one K dollars. A traditionalist, looking back a couple of generations, might opt for a key punch of maybe 026 vintage. Assuming this is affordable, a card reader must also be had. Still, no back talk. You have input, but no output. Even the veteran of the tab card shop doesn't enjoy reading the Hollerith coded holes. Magnetic recording media is the present vogue of the big boys. Random access storage on disk has many virtues. Unfor- tunately, disk drives and Cadillacs have a common trait . . . price. The Pinto-like affordability of the cassette devices is a partial solution, but printed output is still desired. Punched paper tape could be dual purpose, but you might end up as cross-eyed as the tab card interpreter. Looking at the ads, I find a Centronics printer might cost about the same as a three year old Ford . . . but, my wife says I can't sell her car. Since the ENIAC, man has been busy devising various ways to convert the printed word to a form recognizable by a machine. And, with the number crunching completed, the machine has to output the results in a form that is readable by man. Some specialized attempts to make character representations dual purpose have been very successful. Notice the MICR encoding near the bottom of your personal checks. Notice also, the precision printing and magnetic recognition units involved are usually owned by those who can afford it . . . the banks. Because I don't own a bank (the converse is more nearly correct), and a Cadillac isn't in my home-owned computer budget, a cheaper method is sought for hauling and storing my labors-of-love bit strings. Building my own printer might have some merit. There are many proven architectures from which to choose. Ball, basket type, drum, belt, moving head, move the paper, move both, are some of the many possible. All commercial printers have one thing in com- mon ... a proliferation of moving mechani- cal parts. The major reason is our alphabet. If we changed the character set, printing would be simpler. If a semblance of logic prevailed, optical recognition might be easier. The puritanical school of thought is to require as little change in man's ways as possible when dictating computerizing con- ventions. The backyard bit fiddler is usually more condescending, and I for one wouldn't mind bending the rules a little. Applying a true structured programming approach: first, the character set; we'll get on to the printing and reading later. The ASCII code representations are both logical and suit computer oriented, binary storage nicely. This fact may well have occurred to the originators: In hexadecimal notation the letter A is 41 ; the letter B is 42; and the letter C is 43, etc. What is needed is a way to encode in a given printed character the entire byte range of 00 to FF. If we use a 46 single, vertical line as the root of a character, visual focusing (and machine registration) can be achieved. The left and right side of the line, respectively, can denote the HIGH and LOW significance. Top to bottom we assign positional values of 1, 2, 4, and 8. Where 1 is the top and 8 is the bottom, 2 and 4 are equidistant between. Using the text book descriptions of ON and OFF, we can draw connecting, horizontal lines to code the bits. The coded print value of hexadecimal FF is thus: The results: After one week of elapsed time (and curtailed allowances) all four subjects successfully memorized the coded character set. Testing was conducted by myself and critiqued by my wife. In turn, for each examinee, I flashed the cards in random order for their response. Individual results were as follows. Eight year old, three mistakes, corrected with prompting. Our number two son had only two mistakes, self-recognized and corrected without prompting. The oldest boy needed the dollar ... no mistakes. Not too impressed with the . VERTICAL LINE HIGH SIDE 2 2 LOW SIDE 4 4 p BIT POSITIONS^ D °=\ A -r K -E U =F 1 T B -h L -t v =h 2 =h C -F m __p w ZE 3 =F D + n 4e X =L <=r- E -P °-F£ y =l: 5 =F F 4= p ^ z =b 6 ^ G -E Q T *^ 7 =P H -L R =h *=r- 8 =L l -L s 3= + -E 9 T J -t T =r- 85 =E Such symmetry! Hercule Poirot, the Belgian detective in Agatha Christie's novels, would surely applaud. Using this scheme, we can encode the entire range of bits possible within a byte. The chart that follows is a partially encoded ASCII code set. As an experiment to test the "human" readability of such graphics, I selected an unbiased sampling group ... my kids. The subjects: Sons, ages 8, 10 and 11. Our 17 year old daughter also participated to appease women's lib. Motivation was to learn the alphabet and I would pay one dollar. Total research and development costs: $4. The method: I used blank 96 column cards and drew one character per card, encoded as above, with the conventional letters printed on the backs. Each partici- pant studied the flash cards at their own leisure. Intensity and frequency of study was dictated by individual need and greed. NOTE: A dollar seems like more to an eight year old than to a teenager. Group study was suggested, but resulted in some disharmony at times. funding, our teenager didn't make any mis- takes, but considerable prompting was neces- sary. Conclusions: A dollar doesn't buy much. Kids have good memories. This scheme should work well in junior high schools. Critic's comment: "Try a re-test, but with the cards turned around." The test group also unanimously suggested that I attempt the test myself . . . overruled . . . rank has its privileges. The problem of printing and reading such a character set was broached next. To keep mechanical movements to the minimum, the plan is for using friction-fed, rolled paper tape imprinted by a matrix type electro- mechanical assembly. Reading is by detec- tion of intensity of reflected light from a common source, carried from the read head by optical fibres. My current efforts are aimed at scrounging and evaluating surplus and junk parts for fabrication. It is highly doubtful that this scheme will revolutionize the industry, but hopefully, I can save my bytes inexpensively . . . and teach my children hieroglyphics." 47 :\v ! . . . V II A\ - 1 features- mm ultra high speed intelligent display — generates 16, 64 character lines of alpha-numeric data mm displays upper and lower case characters mm full 128 ascii characters mm single printed circuit card mm standard video output i SPECIAL FREE OFFER! Scientific Notation Software Package with Formatted Output The floating point math package features 12 decimal digits with exponents from +127 to —127; handles assigned and unassigned humbers. With it is a 5 function calculator package: + — X "=" & sq. root. It includes 3 storage and 3 operating memories and will handle chain and column calculations. With the purchase of (1) VDM-1 and (1) 4KRA-4 Memory: Just $299.00 (Offer expires 2-1-76) from- Processor Technology viim;o display AVOIHJM I Corporation S 2465 Fourth Street Berkeley, Ca. 94 710 More on the SWTPC 6800 System Gary Kay Southwest Technical Products Corp 219 W Rhapsody San Antonio TX 78216 The Parallel Interface Board is used to latch and control the input and output of 8 bit bytes. The Motorola 6820 Peripheral Interface Adaptor (PI A) is the main component of this board, with several smaller chips acting as buffers. This board permits parallel connections to such devices as printers, laboratory breadboards, and special purpose keyboards. In the December 1975 issue of BYTE we talked about the microprocessor/system board (MP-A) and the mother board (MP-B) for the Southwest Technical Products 6800 microprocessor system. This article describes the serial control interface (MP-C), the 2,048 byte random access memory board (MP-M), the power supply (MP-P) and cabinet (MP-F). We will also talk about the serial interface boards (MP-S) and parallel inter- face boards (MP-L). Serial Control Interface The serial control interface (coded MP-C) is a 5.25 inch by 3.5 inch doubled sided, plated through hole board containing a 6820 peripheral interface adapter integrated circuit and circuitry which forms the serial control interface. Data rates of 110 or 300 baud are selected by a jumper wire. The interface includes software control of an input to output echo feature which is necessary in some tape reader operations. Its data input or output must be in ASCII (without parity) and either 20 mA Teletype or RS-232 compatible. A low cost terminal such as the TV Typewriter II (February 1975 issue of Radio Electronics Magazine) is ideal. IO connections are made to the interface via a 10 pin connector along the top edge of the board. Power for the board is provided by a 5 VDC regulator at a current con- sumption of about 0.2 A. 12 VDC and -12 VDC sources are also used. V^ ki*+ > , W, ***.. w ' *j- ^L* ^. ^^ IE m^A 2V> ® X M K> ** U. 50 ftl9*l§*&15 "». Is V) - '■„:% :V^ The Serial Interface Board is used to convert parallel data from the processor into serial data to a terminal (and vice versa). The major portion of this task is accomplished using the Motorola 6850 Asynchronous Communications Interface Adapter (ACIA) circuit, which Is the large package in the center of the board. The remaining components on this board are used to provide both an RS-232 interface and a Teletype 20 mA current loop interface. The board itself must only be plugged onto the first interface port position of the mother board. It is constantly polled for incoming commands by the Motorola MIKBUG software stored in the operating system ROM whenever the system is powered up, or is reset and is under oper- ating system control. When system control is turned over to your program, the control terminal is also available for program 10. To output a character to the terminal's display, store the character in accumulator A and jump to subroutine OUTEEE, which is a character output routine written into the operating system ROM. To input a character from the control terminal's keyboard, jump to subroutine INEEE, which is a character input routine written into the operating system ROM. In this subroutine the system hangs in a loop until a character is typed at which time there is a return from subroutine with the entered character deposited in accumulator A. The use of these ROM stored subroutines greatly simplifies the job of the programmer for control terminal data input/output. In addition to the Serial Control Inter- face, any combination of up to seven parallel or serial interfaces may be plugged onto the interface connectors. Since the 6800 family of chips includes both parallel (6820) and serial (6850) interface elements, interfacing is extremely flexible. Parallel Interface The Parallel Interface (coded MP-L) is a 5.25 inches X 3.5 inches (12.86 cm X 8.57 cm) double sided, plated through hole circuit board containing a 6820 peripheral interface adapter integrated circuit and its associated circuitry which is used to connect a parallel data device such as a printer or parallel data terminal to the computer sys- tem. The board is provided with two sepa- rate connectors along the top edge of the board. One has eight fully buffered TTL compatible high current data outputs along with one buffered "data ready" output line and one "data accepted" input line for complete handshake control. The other con- nector has eight TTL compatible input lines along with one "data ready" input line and one "data accepted" output line, here again for complete handshake control. The "data 51 The memory board, show memory chips, is one of black chips at the right decoding. The two voltdge remaining integrated circuits n here with a full 4096 word complement of 2102 the more important elements of the system. The dge of the photo are interface devices and address regulators on the board are in the center. The are 32 chips of I K by I bit memory. ready" and "data accepted" lines are under complete program control even to the extent of setting the transition polarity upon which the lines will be triggered. Interrupts are under complete software control as well. For the user who has specialized parallel 10 requirements, the TTL data buffers may be omitted from the board, and each of the sixteen data lines may be individually soft- ware programmed by the user as either all inputs, all outputs or any combination of the two. The programmer has complete software control of the four handshake lines, two of which are software programmable for input or output. Power for the board is supplied by a 5 V regulator at a current consumption of 0.3 A. Serial Interface The Serial Interface (coded MP-S) is a 5.25 inches X 3.5 inches (13.3 cm X 8.9 cm) double sided, plated through hole circuit board containing a 6850 asynchronous com- munications adapter integrated circuit and its associated circuitry which is used to interface a serial device such as a terminal to the computer system. Like the Serial Con- trol Interface, its communication must be in ASCII form and either 20 mA TTY or RS-232 compatible. Baudot coded teletypes will not work. The data 10 baud rate for each of the interfaces is jumper program- mable and may be set for 110, 150, 300, 600 or 1200 baud operation. One central clock on the microprocessor/system board provides all of the various baud rate clocks 52 simultaneously, so that each of the serial interfaces can have an independent data rate. This eliminates a good deal of duplicate circuitry and keeps the serial interface cost low. As with the Parallel Interface, there are many functions that are under software control. Selection of one of 8 different combinations of bit count, parity, and number of stop bits is user programmable as is control of transmitter and/or receiver interrupts. Checking the interface for trans- mitter buffer empty, receiver buffer full, framing error, parity error, and receiver overrun are here again all done through software just by reading the data contained within the interface's internal status register. External connections to the board are made via a ten pin connector along the top edge of the board. Power for the board is supplied by a +5 V regulator at a current consumption of approximately 0.2 A. +12 VDC and -12 VDC sources are used for generating the Teletype currents and the RS-232 voltage output. Memory Board The Memory Board (coded MP-M) is a 5.5 inch by 9 inch (14 cm by 22.9 cm) double sided plated through hole circuit board with data bus buffering, and address decoding for up to 4,096 bytes of fast 2102 static random access memories. The basic memory board kit comes with only 2,048 words, however. To fill the board to a full 4,096 words of RAM, you must add the memory expansion kit (MP-MX) which contains another 2,048 words of memory ICs and a separate voltage regulator. Up to four of these 4,096 word boards may be plugged onto each mother board. The 2102 static memories were chosen because of their availability, low cost and established reliability. Although the 4 K dynamic memories are becoming popular, they require refresh circuitry and slow the processor during refresh cycles. Address assignments are made on each memory board by connecting the address jumper to one of the eight possible positions, pro- gressing on each memory board from to 7. This programs the boards from to 32 K words in 4 K word increments. Since each mother board will only support up to four 4,096 word memory boards, it is necessary to use another mother board with separate power supply to expand the memory beyond 16,384 words. Power for the lower 2,048 words of memory as well as the decode and buffer circuits is provided by a 5 V regulator with a current consumption of approximately 0.8 A. Power for the upper 2,048 words of memory when present is provided by a separate 5 V regulator at a current consumption of approximately 0.6 A. Power Supply The MP-P power supply consists of a power transformer, high current bridge recti- fier, filter capacitor, and power supply board. The low voltage transformer sec- ondary winding, bridge rectifier and filter capacitor provide the 7 to 8 V DC at 10 A required by the complement of boards in the computer system. Since the regulation down to 5 V is provided on each of the system boards, the actual value of this voltage is not critical. It must however be maintained at no less than 7 V for proper regulator operation while not so high as to cause the regulators to generate abnormal temperatures. The higher voltage transformer secondary winding along with the rectifiers and filter capacitors on the power supply board pro- vide the + 12 and -12 V DC at 0.5 A required by the control and serial interfaces. All connections from the power supply to the mother board are made through an easily detached connector on the power supply board. This makes mother board installation and removal a snap. The power transformer's primary may be wired for either 120 or 240 VAC operation with a current consumption of 120 VAC at 1 A or 240 VAC at 0.5 A. Chassis and Cover All of the boards for the 6800 computer system including the power supply are housed in a 1 5.125 inches wide X 7.0 inches high X 15.25 inches deep (37.05 cm wide X 17.15 cm high X 37.36 cm deep) anodized aluminum chassis with a perforated cover. The use of the perforated cover eliminates the need for a cooling fan in almost all environments. The front panel supports both the POWER on-off and RESET switches. The RESET switch initializes all of the registers in the system and loads the terminal controlled Motorola MIKBUG operating system whenever depressed. The rear panel contains an array of holes through which the interface cables and line cord may pass. Both panels along with the cover may be easily removed providing 360° access to the system for prototyping or service. The 6800 system presented within this and the previous article, has been shown to have outstanding ease of use and is an economical package. But as many of us already know, hardware is but a small part of a "computer system." Programming, or software as it is generally referred to, is just as important as the hardware. Of course this system does have a very useful ROM stored operating system, but what else is available, and how does one load such software in memory without having to type it in through the control terminal one byte at a time? Well, first of all several diagnostic listings are provided by the manufacturer of the kit to help check out the various boards within the system. These diagnostics are typically less than 90 bytes in length and can be entered manually from the control ter- minal in less than five minutes. Included within these diagnostics are two programs that provide a thorough checkout of the random access memory boards, a common failure point for many systems. Regarding some method of storing and loading in programs, a low cost audio cas- sette tape digital storage system is presently in the works that will be totally compatible with this computer system. You can expect to see it in a forthcoming BYTE Magazine article. Also to be available shortly is an editor/assembler software package which will be sold for the cost of the documenta- tion and tape only to those people simul- taneously purchasing 4 K of the 8 K words of memory necessary to support the package. Another note of importance is that the ROM stored mini-operating system on the Microprocessor/System Board is exactly the same (MC6830L7) as that used on Motorola's Evaluation Module and Inte- grated Circuit Evaluation Kit. This means that most all programs written for the Motorola's Evaluation Module will function on the 6800 computer system presented here. Motorola also supports their more sophisticated prototyping system called the EXORcisor® (Registered trademark of Motorola Inc.). This system has a larger, more sophisticated firmware package, but it uses the same 6800 microprocessor element, therefore much of its software is compatible with the 6800 system presented here. Because of this compatibility, arrangements have been made with Motorola Inc. to allow Southwest Technical Products 6800 Com- puter System customers to have access to Motorola's 6800 program library. Customers will be permitted to join by either sub- mitting an acceptable program or by paying a membership fee. Either makes them a member of the Motorola 6800 User's Group for two years with access to programs within the library plus upcoming program additions. For those applications requiring the utmost in speed and storage capability, arrangements are in the works with ICOM Corporation to supply a floppy disk and floppy disk operating system (FDOS) that is compatible with the 6800 system described in this article. ■ 53 This photograph illustrates two common LEDs which were purchased from suppliers advertising in the pages of BYTE. The grouping at the left is a highly desirable MV5024 lamp with mounting ring and collar. This facilitates a convenient panel mounting of the lamp. The lamp at the right is a Hewlett Packard 5082-4487 LED which is typical of the small LEDs which are useful as in-circuit indicators. LEDs Light Up Your Logic E W Gray 3321 O 'Henry Dr Garland TX 75042 Of the many technological developments in recent years, perhaps none is more intriguing than the visible light emitting diode, or LED. This tiny semiconductor device, with its hypnotic red glow, is a far cry from the cat whiskered crystals which introduced so many of us old-timers to the wonderful world of electronics. A crystalline compound of gallium, arsenic, and phos- phorous, the LED is a diode that emits visible light when forward biased. No attempt is made here to explain how the light emission works. Instead, this article shows how LEDs can be used to advantage as data displays, fault, and status indicators. These highly reliable devices have largely eliminated burnout associated with incan- descent indicators. Their small size, low cost, and low power requirement make their use as indicators in circuits very desirable. The LED is ideally suited to today's digital circuits, since it can be driven directly from the logic elements. Some Applications Hand-held logic probes, many of them using LEDs as indicators, are well known (see December 1975 BYTE 4 for Alex. F. Burr's review of several commercial probes on page 20, and for Bob Baker and John Errico's plan of a handy logic test clip using LEDs as readouts on page 26). But why not simply incorporate the diode directly into your next project? Select the circuit points which reveal the most about circuit opera- tion and monitor them with LEDs. For example, a single LED driven from a key- board strobe signal monitors the data transfer operation each time a key is depressed. Or devote a diode to the output of the system clock generator. Given a clock rate, select the diode's current limiting resistor so that the diode glows dimly when the clock is operating normally. Should the clock fail, the LED will either be extinguished or at full brilliance depending on which logical state results from the failure. Obvious applications include the outputs of control flip flops and state counters. Not so obvious, perhaps, is a shift register output monitored to show normal data recircula- tion, or diode logic built with LEDs as a training aid. 54 TO OTHER LOGIC GATES Figure I: In circuit indicators. A: The diode lights when both inputs are at the high level. TOOTHER LOGIC GATES B: The diode lights when either input is at the low level. LED = Light Emitting Diode is a specially constructed diode which emits light when forward biased. In a digital system having several registers, the addition of a multiplexer provides a path to switch selected register content to a LED display. In a bus oriented system, use a bus receiver to drive LEDs from the bus itself (one diode for each bit) and all data sources in the system are available for visual examin- ation. Designing With LEDs Rules for using light emitting diodes are simple. As with any semiconductor device, read the specification sheet first. The typical spec sheet will contain the device descrip- tion, dimensions of the package and mounting details, and perhaps a few device features or applications. Most important, however, is the section defining electrical characteristics. It is from these specifications that we determine how a particular device is to be operated. For most designs, the only information required to insure satisfactory operation will be the diode's forward potential (V) and forward current (A) ratings. These parameters allow selection of the series current limiting resistor used to control brightness. Relative brightness of the emitted light is dependent on the forward current. Generally, a diode will begin to emit light at about .5 mA forward current. The light is easily seen at about 1 mA to 5 mA. Forward currents of 10 mA to 20 mA bring most diodes up to full brilliance. Most manufacturers include a graph or chart in their specification sheet which illustrates brightness versus forward current. 20 mA is usually the recommended value for viewing over any distance. Having chosen the desired brilliance and the required forward current, and given a specific supply potential (S), the current limiting resistor (R), which is to be wired in series with the LED, is calculated according to the following formula: R = (S - V) / A, where S and V represent the supply and forward potentials, respectively, which arc measured in volts, and where A stands for the forward current measured in amperes. Note that one milliampcrc equals a thou- sandth of an ampere (.001 A = 1 mA). As an example, suppose it is desired to operate a LED at 10 mA forward current. The diode will be driven from a transistor- transistor logic (TTL NAND gate. The power source is rated at 5 VDC. The LED specifica- tion sheet requires a forward potential of 1.65 V. The calculation is: R = (5-1.65) /.01 =335 The closest standard resistor of 330 O can be used. Some Typical Circuits Two methods of monitoring TTL logic using permanently installed circuit indicators are shown in figure 1. In part A of figure 1 the diode will light when the gate output is at the low level. Since the 7400 NAND gate is capable of 16 mA sink current, the diode current should be limited to this amount. Normally, the gate will be used to drive other logic; the driving ability of the gate (fanout) will be reduced by the amount of current diverted through the diode, divided by the current required at a gate's input. For example, TTL gates require 1.6 mA input current at the low level. If the LED is operated at 10 mA, fanout will be reduced As with any semicon- ductor device, read the specification sheet first. An LED can be driven directly by TTL logic for use as an indicator. 55 MONITORE SIGNAL ""^ /" R -WV- Figure 2: Bypass capacitor increases light level for signals having low duty cycle. LEDs can be used with logic families other than TTL. Such uses may require buffers and attention to ratings. LEDs embedded in seven segment displays are no different from discrete LEDs. by slightly more than 6 loads, so the gate driving the diode should not drive more than three additional gates. In part B of figure 1, the diode lights when the gate output is high. Although fanout of the driving gate is not reduced by this circuit, the DC noise margin at following gate inputs is reduced. The diode current limiting resistor (R) and internal resistance of the driving gate form a voltage divider which reduces the high level output potential of the driving gate. The diode current must be limited to a level that will not reduce the gate's output level below the specified minimum for a logical one. For the 7400 NAND gate, this is 2.4 V. For reliable circuit operation this minimum must be maintained. It is often desirable to monitor circuits having a relatively low duty cycle, such as strobe lines to input or output devices. In such cases, adding a bypass capacitor as shown in figure 2 can increase the light level of the indicator. Choose the current limiting 7. h /. SEGMENT LAYOUT /""7 o OGIC 1 1 r LOGIC / 7 Figure 3: Using a seven segment display to monitor a bit. 56 resistor to hold diode current at a sale level should the driving circuit fail and remain at the low level. Using LEDs with DTL or CMOS If your logic is implemented in a logic family other than TTL, you can still use LEDs as indicators. Diode-transistor logic (DTL) gates work well using the circuit of part A in figure 1. As with TTL, fanout of the driving gate is reduced. Complementary metal oxide semicon- ductor (CMOS) logic, popular because of its low power requirement, may also be used as the LED driving clement. Several devices arc available which will sink 8 mA when used with a 10 to 12 V supply. Among these are the 74C901 and 34049 inverters. By taking advantage of the short circuit output current specification, the 74C00 NAND gate can be used to drive a LED using a 1000 O resistor at 9 V. Special Purpose LED Devices Light emitting diodes arc available in many forms other than the single lamp. Most of us arc familiar with the seven segment displays used in calculators and digital clocks. An interesting application of this device, using the popular MAN I, is the display of binary information as numerical ones and zeros without the use of decoding circuits. Details arc shown in figure 3. The b and c segments arc connected to be perman- ently on. Segments a, e, f and d arc connected in parallel and driven by the true data bit to be displayed. Thus when the data bit is false (logical zero) a numerical zero appears on the display. When the data bit is true (logical one) segments a, e, f and d are extinguished, leaving the b and c segments displaying numerical one. In addition to the popular red lamp, LEDs arc available which emit green and yellow light. And at least one manufacturer, Monsanto, produces a lamp having both a red diode and a green diode in the same package. This device forms the basis for a unique panel indicator, as shown in figure 4. Here, a single momentary switch is used to both start and stop an operation. The state of the controlled operation is displayed by the two-color LED. A red light indicates the operation is stopped, while a green light indicates it is running. A typical application would be the start and stop switch on a computer panel. Switch SI is normally in the center (off) position. A latching circuit composed of two TTL inverters serves as a run and halt flip flop and also debounccs the panel switch. Momentary operation of the switch to the stop position sets output A low and output B high. The two-color LED is connected across the latch outputs. When the latch is in the halt state (output B is high) the red LED is forward biased. Resis- tors R1 and R2 limit the diode current to about 10 mA. Momentarily activating the switch to the start position toggles the latch, back biasing the red diode and forward biasing the green diode. Dl is a 1N9I4 or equivalent diode which effectively shorts out R2, leaving R1 to limit the green diode's forward current to about 20.0 mA. The different currents are required because the green diode is not as bright as the red diode for the same current. The same manufacturer also offers a red bipolar lamp suitable for use as an AC line voltage indicator as shown in figure 5. The manufacturer recommends a resistor of 11 kO at 2 W for operation at 1 1 VAC. ■ NDEX NOTCH TO CONTROLLED LOGIC- HIGH LEVEL WHEN GREEN LED IS ON Figure 4: Two-color panel indicator. MV5094 (O) II. OK 2W -VWi — Figure 5: Panel indicator for A C operation. From: SystemsResearchJnc. A MODULAR MICROCOMPUTER SYSTEM THAT EVERYONE CAN AFFORD!!! — THE SRI-500 SERIES — SRI-F8 Microprocessor Board (Complete with 1K Words RAM,TTY $ 325 Interface, and a special DEBUG program in ROM called FAIRBUG) SRI-PWR Power Supply (+5V., +12V., -12V. Regulated) $ 55 SRI-CAS Casette Interface Board $ 45 SRI-SER-C RS-232, Keyboard Interface and System Control Board $ 35 SER-VI-A Video Interface Board (32 char, x 16 lines, R. F. and $ 175 Video out) SER-KBD Keyboard Assembly $ 100 SER-RAM-2 2K Words RAM Board (Additional Memory) $ 100 SRI-ENC Enclosure (Complete with main board, switches and $ 100 rear panel connectors) NOT A KIT - COMPLETELY ASSEMBLED AND TESTED We supply complete software support and offer many options . . . CALL OR WRITE FOR FREE INFORMATION (801) 942-1093 SystemsResearchJnc. RQ Box1512BD ■ Sale Lake City, Utah 84115 • (BOD 942-1093 57 William A Walde 28 Tuttle Dr Acton MA 01720 Build a TTL Pulse Catcher TO CIRCUIT j- ? o - UNDER TEST ~ L TEST PROBE GROUND O- ^V^T^p^)^!^ FALLING ICI = 7400 + 5 ICI LOOKING FROM THE TOP TOWARD SOCKET PIN I IS NEAR^ THE DOT^ 14 n I3 n I2 n II n I0 n 9 n 8 n ? 740C i • TO TEST 'PROBE I* PUSH TO l SIMULAT U U U U U U U I 2 3 4 5 6 7 E PULSE TESTING THE TESTER Figure I : The circuit diagram and parts list for the TTL pulse catcher design. While checking out the operation of some oneshots on the address latch board during the construction of my Mark-8 micro- processor, I discovered that my first home- made logic probe could not detect very short TTL logic pulses. Since my old probe would not work, I needed a quick and easy way to tell whether a short TTL pulse had arrived. I dreamt up this circuit which solved the problem by adding memory in the form of an RS flip flop wired from a NAND gate. This pulse catcher will detect pulses as short as the combined gate delays of the two NAND sections used to form the flip flop, approximately 10 to 30 ns. The circuit works by changing state at the start of a pulse, with an LED monitoring the flip flop output. There is no indication of the end of the pulse and there is no way to tell if multiple pulses have occurred. After a pulse has been detected, the circuit must be reset in order to detect the next pulse. The TTL pulse catcher is designed to work with either a positive or a negative going pulse as selected by a switch. Construction The original version of this test instru- ment was built using perforated board and flea clips. The circuit could also be made using a small printed circuit board. Lead dress is not critical, but the polarity of the LED must be observed. Select a value of the resistor R2 in the range 47 to 470 O such that good illumination is achieved with a current of approximately 20 mA. A typical resistance value is 220 O. The tester can be tested using a resistor, a bounceless push- button switch and the test circuit shown in figure 1. Label switch SI to identify which setting is the rising edge mode and which setting is the falling edge mode. A clever approach would be to build the pulse catcher inside a cylindrical enclosure, such as a pen or thin tube. Using the Pulse Catcher Connect the 5 VDC and ground terminals to a suitable power supply. If you use a power supply separate from the main system supply of the computer or logic device you 58 A POWERFUL SUPERIOR GRADE 8080 BASED MICROCOMPUTER SYSTEM REASONABLY PRICED. QUALITY FEATURES INCLUDE: • A commercial grade cabinet, made ol heavy gauge aluminum, custom designed lor this specific product. Rack mounting is available as a special option. • Lu cite display panel with a photographically reproduced legend and LED display mask. In addition to standard lights and switches, the heavy duty front panel has an extra 8 program controlled LED's. • Rugged commercial grade paddle switches backed up by reliable debouncing circuits. • (.old plated contacts on board edge connectors to assure corrosion free contact at all locations. • A heavy duty power supply to handle lots of extra cards, the power supply delivers up to 20 amperes at 8 volts, and 3 amps each at + 1 6 and -I 6 volts. • A sturdy card cage to properly support up to 22 printed circuit boards. • Plug removable front panel board that eliminates the normal wiring harness between front panel and back plane. For special dedicated uses, the front panel board may be removed from the unit altogether and used only when program changes are desired. • A lull line of peripheral devices to build truly powerful and complete systems. • An exclusive shared memory facility from the company that pioneered shared memory microprocessing. Shared memory facilities allow multiple microprocessors in the same cabinet to share the same memory, yet run different programs in parallel with each other. • A full compliment of board options. BASIC COMPUTER INCLUDES: 8080A Processor Board, front Panel Control Board, lights and switches, power supply, Expander Board, Cabinet,. . . and . . . Software (Assembler, Monitor, & Text Editor). PRICES: KIT... $439 ASSEMBLED ... $931 BASIC 8080 WITH 1 K RAM KIT... $499 ASSEMBLED ... $1009 OPTIONS: Rack mount, RAM & PROM Boards, Parallel & Serial I/O Boards, an 8 level Priority Interrupt/Clock Board, Shared Memory Boards, Interface Boards. PERIPHERALS: Floppy Disk Drives, 32 Column/125 LPM Printer, 80 Column/300 LPM Printer, 50 Megabyte Disk Drive, 30 character per second Printer with Plotting Mode. COMING SOON: Free BASIC and extended BASIC for registered IMSAI 8080 owners. TERMS: Check or Money Order, Bankamcricard, Master Charge, 25% deposit on COD orders. On all orders under $1,000, add 5% postage and handling. California residents add 6% tax. SEND FOR FREE CATALOG OF IMSAI MICROCOMPUTER PRODUCTS DEALER INQUIRIES INVITED SPECIAL NOTICE TO ALTAIR 8800 OWNERS: If you would like to step- up to the superior quality of an IMSAI 8080, you will be pleased to know that your ALTAIR 8800 boards are "plug-in" usable— without modification in the IMSAI 8080 cabinet, furthermore, by acquiring IMSAI's unique Memory Sharing Facility, your ALTAIR MPU board and IMSAI MPU board can co-exist in the same cabinet, operate in parallel with each other, and share all memory in common. This is the technology that laid the foundation for IMSAI's powerful HYPERCUBE Computer and Intelligent Disk systems (recently featured in Computerworld, Datamation and Electronics magazines). IMS ASSOCIATES, INC., 1922 REPUBLIC AVENUE SAN LEANDRO, CA 94577 (415) 483-2093 are testing, be sure to tie the grounds of the two supplies together. Connect the input probe to the line being tested and select the rising or falling edge mode via switch SI. Depress the reset button to extinguish the LED and arm the latch. If you are unable to cause the LED to stay off after releasing the reset, the following information is learned about the line being tested: It may have a steady state condition which is inconsistent with the mode of the test. Change S1 and try again. You may be observing a line which has regular clock transitions. The light will never go out when testing such a line. In normal operation, once the pulse catcher is reset, the LED will remain out until the first pulse comes along, after which it will stay on until reset by pushing the S2 button. Theory of Operation Gates IC1c and IC1d are cross-coupled to form the familiar RS flip flop that is used to remember when a pulse has occurred. Momentarily depressing SW2 grounds pin 9 of gate ICId, causing the flip flop to go into the reset mode. In this mode both sides of LED1 are high and it will not light up. In a similar manner, falling pulse at pin 13 of gate IClc will cause the flip flop to go into the set mode with gate ICId now becoming a current sink for LED1, causing it to illuminate. Switch SW1 is used to select between either a rising or a falling input pulse. The RS flip flop always needs a falling pulse to operate. In the case of a rising pulse, it is inverted by gate IC1 a, which is also used as a buffer. Gate IC1b is used to invert a falling pulse a second time to put the pulse back into its original form. Note that pin 1 of gate IC1a is held high so that the input (pin 2) will only present one standard TTL load to the circuit under test (as compared to gate ICIb where the 2 inputs are tied together). R1 is used as a pull up resistor to the pin 9 input to gate ICId for noise immunity. Resistor R2 is used as a current limiting resistor for LED1." Dressing up Front Panels Don R. Walters 3505 Edgewood Dr Ann Arbor Ml 48104 To dress up panels of equipment use press on lettering (available from stationery shops, college and university book stores, and from graphics arts supply shops) to label the various functions performed by the compo- nents which will be mounted on the panel (see figure 1). The lettering can be pressed on, wire brushed, chemically etched, or painted surfaces. The only caution is that the surface be free of dirt and grease before applying the lettering to the panel. When applying the lettering, if a mistake is made the mistake can be removed by gently scraping the lettering off the panel. After all the lettering is completed and you are satisfied with the job, lay the panel on a flat surface and carefully spray the panel with several (5 to 10) light coats of a clear plastic spray. Allow the surface to dry before applying the next coat. Also allow the sprayed surface to dry completely (over- night) before installing the components on the panel. The plastic spray protects the lettering from being rubbed or scraped off easily. -AFTER COMPLET- ING LETTERING, SPRAY ENTIRE PANEL WITH PLAS- TIC SPRAY FROM PRESS- ON LETTERING SHEET TO PAN- EL SURFACE A word of caution; let the spray dry thoroughly before mounting the com- ponents. Secondly, on each spraying put down only a light coat. Otherwise the letters will tend to move (float?) a little out of place. Also be careful when mounting com- ponents onto the panel so that the lettering and/or the panel's surface is not scratched. The end result of lettering and care will be a very good looking piece of equipment. 60 Classified Ads Available for Individuals and Clubs Readers who have equipment , software or other items to buy, sell or swap should send in a clearly typed or printed notice to that effect. The notices are free of charge and will he printed one time only on a space available basis. Insertions should be limited to no more than 100 words. Notices can be accepted from individuals or bona fide computer users' clubs only. Commercial advertisers should contact Virginia Peschke at BYTE for the latest rate card and terms. SELL OR SWAP: Boards and main frame for Uniscope 100. Keyboards. Kleinschmitt Line Printer, TTY BRPE11 Punch, TTY Type 270 reader. Misc. 7400 series ICs. PDP-8e interface design for HSR. And as they say, much more. Roger Geffen, 71 Moore Road, Wayland, MA 01778,617-358-2862. TRADE OR SELL: IBM 360 to NOVA interface board, DEC input-output boards, dial up modems 202's various types. Can use components, W/W proto cards, TEK 453 or 454. Larry Skibicki, PO Box 47, Hollis NY 11423. BUY OR SELL: Will sell one set of PC boards for SWTPC TV Typewriter I, or will buy one set of ICs and connectors for TVT-I. P.F. Curtis, 2146 Lost Tree Way, Bloomfield Hills Ml 48013. TVT 1 for sale, fully functional, half duplex operation 110 baud. Built in serial IO (RE Feb 75 pg 51) having cassette IO also. Also included telephone originate Modem 1070-1270 XMIT, 2025-2225 RCV. Two full pages of memory. (Southwest Tech) Keyboard mounted in attractive wooden box with power supply. Included all interconnecting cables and documentation. You only need a TV monitor. Asking $325 postpaid USA. Reason for sale: getting ASR-33 hard copy. Call or write C. Zalenski, PO Box 92, Johnson City NY 13790,607-797-5777. FOR SALE: Tally reader and punch. Model 420 and Model 424. Excellent condition, $150 for both. Lou Carbaugh PO Box 393, New Cumber- land PA 17070. FOR SALE: Teletype Corp 5-level 100 WPM (10 CPS) Typing Reperforator (Paper Tape Punch), 20 ma serial in, w/o motor, Model LBXD9, excel, condition $25. Teletype Corp 5-level 100 WPM (10 CPS) transmitter-distributor (PT reader) serial or parallel out, w/o motor, model LPR45, excel, cond., $25. Teletype Corp. 8-level punch model UPE800 for ASR33, like new, less than 20 hours use, $40. Friden Flexowriter automatic typewriter with 6-level PT reader and punch, upper and lower case, $100. A. Walker, 6000 N. 27th St, Arlington VA 22207. WANTED: Back issues of BYTE. I subscribed late and did not get issues No. 1 to No. 3. Make an offer. R. I. Demrow, 11 Linda Road, Andover MA 01810. Get it together! TYPICAL APPLICATION In aUnivue™ enclosure The 24xl2 1 /2x3" Univue keyboard and control center enclosure gives you dimensional flexibility with a modern low profile appearance. The blank 23x8" removable aluminum front panel is easily cut to accommodate virtually any keyboard/control arrangement. Over 200 cu. in. of space in the rear is available for housing additional circuitry, allowing a complete and handsome desk top unit. The Univue enclosure body is made of precision machined welded steel and is primed and surfaced light gray, ready for the color co-ordinated finish of your choice. Shipped complete with aluminum panel, heavy duty non-skid rubber feet, plated mounting hardware, and Money-Back Guaiantee. 29 95 plus $4.50 postage and handling Ohio res. add 4% sales tax - U.S. orders only - Sorry: no C.O.D. Send check or money order today to: MJ ADVANCED DATA SCIENCES P.O. DRAWER 1147 - MARION, OH 43302 TO BE 'FREE" Microcomputer pictured - with M6800 Microprocessor RAM, ROM, PIA, ACIA Expandable to 64,000 Bytes Directly Addressable Memory GIVEN TO ALL ATTENDEES at WINTEK'S "hands-on" microprocessing short courses offered in San Diego March 16-18, St. Petersburg March 31-April 2, and Austria April 5-7, 1976. Tuition $495. 902 N. 9th Street . Corp. Lafayette, IN 47904 (317) 742-6802 WIMTBK 61 TV Color Graphics Don Lancaster Synergetics A graphic display lets us add pictures, lines, and symbols to the basic letters and numbers of an ordinary TV typewriter so that it can be used in chess, for video art, for games, printed circuit layouts, logic dia- grams, charts, and so on. For many TVT and microcomputer uses, the ability to display several colors at once is very important; for others, it is simply a convenience that may not be worth the extra complexity. Dots or Vectors? There are two fundamentally different approaches to graphic displays. One is called the stroke method. The display is told where to start each symbol, which direction it should take, what color to display, and how far to go before stopping or changing direc- tion. On the other hand, dot matrix method breaks the display down into as many raster scanned boxes or dots as a display refresh memory can provide. These blocks are lit or not lit with a selected color as needed to form an image. The stroke method somehow sounds bet- ter, particularly if we are interested in curved figures and smooth edges on diagonal lines. But it has problems. Its most serious shortcoming is that it is not directly com- patible with either a stock black and white or a stock color TV set. A special display is thus needed, although an oscilloscope can be substituted for single color, low resolution use. Another limitation is that the display and memory bandwidths have to be ex- tremely wide, or else the display has to slow down its refresh rate as more and more sym- bols are added to the display. This can lead to unacceptable flicker even with a special tube phosphor. The raggedness of the dot matrix system can be minimized by using enough memory to increase the resolution, and by mini- mizing the curved or diagonal lines to be displayed. The dot matrix technique has one major advantage in that we can easily and efficiently mix graphics and alphanumerics, simply by using a TVT system in a graphic mode on one field and in an alphanumeric mode on the second, merging the two separate displays as one. Besides giving more pleasing characters, this approach has an efficiency advantage — only six bits are needed to store a character, but 35 or more bits are needed to store and display the extended dot matrix character in a 5 by 7 format. It turns out that a dot matrix display for graphics only is actually easier and simpler to build than an ordinary TVT; the character generator is no longer needed, and the high frequency timing is usually very much sim- plified. This type of display lends itself very well to existing microprocessor organization without extensive interface. One limitation of the graphics dot matrix approach is that quite a bit of memory is needed, one bit corresponding to each and every possible dot location. Some Television Limitations What are the limits to the matrix size we can display on a television set? First and foremost, this depends on the amount of memory available because one bit will be needed for each dot position, and a frac- tional part of a bit (more on this later) will be needed for that location's color informa- tion. If we are also interested in gray scale (brightness variations), more than one bit per dot position will probably be needed. Gray scale techniques may not be worth the added cost and complexity. Black and white sets can allow very dense 62 matrices. For instance, if we have a black and white set modified to display 72 charac- ters in a 7 by 9 dot matrix with two vacant dot positions between characters, we end up with a horizontal resolution of 648 dots over the active scan. (This takes direct video and some modifications.) The scan rate limits our dots vertically. Without interlace, we get 262, 262.5 or 264 dot resolutions. If we have to, we can go to full interlace and double these values. Thus, it is quite possible to have a 512 by 512 dot graphic display. The memory for this display would take 262,144 bits, or 32,768 eight bit bytes. At 0.1 cent per bit, such a memory costs around $264. Besides being expensive, the density pushes the line pair resolution of the TV. Black and white sets can handle just about anything we can afford to throw at them in the way of graphics. Color sets are much more restrictive, but still give us more than enough capability for very useful display matrices. An unmodified color TV has a maximum video bandwidth of 3 MHz brought about by the need to eliminate a 3.58 MHz subcarrier in the color processing video. Three MHz video is roughly equal to 6 million dots per second, which gives us around 380 or so dots per line. This doesn't include an allowance for horizontal retrace, so approximately 256 dots horizontally is a good limit. Similarly, if we don't use interlace, 256 dots vertically is also a reasonable limit. A 256 by 256 display contains 65,536 dot locations and costs us around $65 for a single color display at 0.1 cents per bit, and somewhat more if multiple colors are to be added. Even if we were to separate totally the luminance and chrominance channels on the color TV (A major job that eliminates use of the TV for anything else), we'd still be limited by the number of holes in the shadow mask to resolutions only somewhat better than we can get on an unmodified color TV. One very important thing to note is that the color bandwidth is far less than the dot resolution on a color TV set. In addition, the color bandwidth varies with the colors in use. The available bandwidth ranges from a high of 1.5 MHz for an orange cyan display to a low of 0.5 MHz for a red blue green tri-color display. Thus, with a high reso- lution display, it is not possible to change the color of each and every successive dot in the horizontal direction. For full color presentation, something less than 50 color changes across the screen is pretty much an upper limit, particularly if we are to mini- mize fringing and edge shading effects and are using saturated colors. ASCII INPUT 4071 (CMOS) 7432 (TTL) OR GATES OUTPUT LOAD CHARACTER GENERATOR GRAPHIC -r ;£> J A? -} r -MVIDEO OUT OUTPUT VIDEO REGISTER Figure J: An ordinary alphanumeric television typewriter can be converted into a simple (but limited) graphics display by adding four OR gates as shown here. The limited color bandwidth is both good and bad for graphics displays. The lower horizontal color resolution means that colors should remain constant for several dot posi- tions at a time in the horizontal direction and whenever possible, we should change colors on a black dot or blanked portion of the display. Since this is the best we can do we use only a fraction of a bit per dot to specify the clot color. This means that our color storage won't add much to the basic memory size and cost. For instance, on an eight bit word, two color bits can specify any of four colors to six different dot locations. Or one color bit could specify a choice of two colors to seven different dot locations. Fortunately, black dominates and counts as wide bandwidth luminance video rather than color, so we can shift between black and colors and back again at full tilt. Some Simple Graphics Displays An ordinary alphanumeric TVT can be converted into a very limited performance graphics display simply by adding one quad- ruple OR gate package as shown in figure 1. The OR gate goes between the character generator ROM outputs and the output video shift register. It monitors the leftmost dot output and makes the other dots 1 if the leftmost dot is a 1. If you type a space, you get a blank location. If you type a D for a dot, you get a white box at each and every character location specified. There's nothing magic about using a D; any character with all leftmost dots which are a 1 will do, such as B, E, F, H, K, L, M,etc. . . The resolution of your display depends on the original format, for you get one box 63 OUTPUT LOAD -o COLOR OUT CIRCUIT 4013 (CMOS) 7474 (TTL) -o VIDEO OUT 6 a— 5 o- 4 o- 3 o- 2o— I o- ASCII INPUT Figure 2: By using one of the six input lines to control the state of a flip flop, a two color display can be achieved. Use the color out line to drive the color modulator. per character. With a 32 character per line display of 16 lines, you get a total of 512 "black surround" boxes in your matrix. While this isn't very attractive or much in the way of resolution (What do you want for only 14 tc^o LEFTMOST DOT KCMOS) 52 (TTL) LATEST DOT TO OUTPUT -03 VIDEO SHIFT REGISTER MODE SELECT NORMAL ^h EARLIEST DOT 4>J l^ INV 4069ICM0S) 7404(TTL) Figure 3: Logic required to generate two possible boxes within one character position of a TV Typewriter. word specify the luminance (black or not black) of six dot locations; the final two bits specify the color of all six of those locations simultaneously. This gives us up to four colors plus black, and lowers the color change resolution enough that the color TV stays happy. In a Pong style game, the goal and sidelines can be one color and the opposing teams two additional colors, and the ball or marker yet another color. For chess, we can use a two-color chessboard with two-color opponents. While our first six bits could be arranged as six successive dots horizontally or ver- tically, a grouping of three horizontally by two vertically seems to work out well for HORIZONTAL VERTICAL SCAN I -COLOR O-BLACK BIT 1 BIT 2 BIT 3 BIT 4 BIT 5 BIT 6 L LUMINANCE .WORD DISPLAYED / <■ [00= 1st. COLOR ) 01= 2nd. COLOR "* — \ I0=3rd. COLOR I ll = 4th. COLOR (ENTIRE 3X2 GRID IS ONE COLOR) CHROMINANCE BIT 1 BIT 2 BIT 3 BIT 4 BIT 5 BIT 6 BIT 7 BIT 8 WORD STORED IN MEMORY Figure 4: Using one byte of memory to specify a 3 bit segment of two horizontal scan lines, with one of four colors. DIGITAL DATA RECORDER for Computer or Teletype Use Up to 2400 Baud $149.95 Uses the industry standard tape saturation method to beat all FSK systems ten to one. No modems or FSK decoders required. Loads 8K of memory in 34 seconds. This recorder enables you to back up your computer by loading and dumping programs and data fast as you go, thus enabling you to get by with less memory. Great for small business bookkeeping. IMAGINE! A year's books on one cassette. Thousands are in use in colleges and businesses all over the country. This new version is ideal for instructional, amateur, hobby and small business use. Ideal for use by servicemen to load test programs. Comes complete with prerecorded 8080 software program used to test the units as they are produced. (Monitor) SPECIFICATIONS: A. Recording Mode: Tape satura- tion binary. This is not an FSK or Home type recorder. No voice capability. No modem. B. Two channels (1) Clock, (2) Data. Or, two data channels pro- viding four (A) tracks on the cassette. Can also be used for NRZ, Bi-Phase. etc. C. Inputs: Two (2). Will accept TTY, TTL or RS 232 digital D. Outputs: Two (2). Board changeable from TTY, RS232 or TTL digital. E. Erase: Erases while recording one track at a time. Record new data on one track and preserve three or record on two and preserve two. F. Compalabilily: Will interface any computer using a UART or PIA board. (Altair, Sphere, M6800etc.) C. Other Data: 120 V - (50-60; Hz; 2 Wans total; UL listed #955D; three wire line cord; on/off switch; audio, meter and light operation monitors. Remote control of motor optional. Four foot, seven con- ductor remoting cable provided. H. Warrantee: 90 days. All units tested at 110 and 2400 baud before shipment. Test cassette with 8080 software program included. This cassette was recorded and played back during quality control. ONE DOLLAR brings operating and main- tenance manual with schematics. COMING NEXT MONTH - IN KIT FORM Hexadecimal Keyboard — Load pro- grams direct from keyboards' 16 keys and verifying display. Does not use Computer I/O. * I/O for use with Computer Aid or other digital recorders. Variable baud rate selectable on externally located unit by one knob. Can load computer or accept dumps without software. Turnkey Operation. For any 8 bit computer. * Record/Playback Amplifier. Expanded version of our Computer Aid board for use with your own deck (cassette or reel to reel). Go to 9600 baud on reel to reel. Digital in, digital out, serial format. * Interested in these? Send your name and address for brochure when released. Send check or money order for $149.95 plus $2.00 Shipping & Handling (N.J. Resi- dents add 5% Sales Tax) to: NATIONAL multiplex 3474 Rand Avenue, Box 288 South Plainfield, New Jersey 07080 CORPORATION 65 12 BITS/BLOCK X 8 SQUARES' 96 BITS HORIZONTALLY 12 BITS/BLOCK X 8 SQUARES* 96 BITS VERTICALLY - BORDER SETS COLOR OF SQUARE |—i , MEMORY BIT MEMORY WORD Figure 5: Setting a chess piece into a grid of colored squares of a color graphics display. For the chess board application, a grid of 8 by 8 = 64 squares is required. 60Hz REF PHASE LOCK LOOP 2.012160 MHz ,► -OVIDEO CLOCKING 20 KHz f- -o VIDEO LOAD bo'Hhz J^ -o HORIZ BLANKING 4-4/3 20 Hz P -o HORIZ SYNC MEMORY ADDRESS- ING a OUTPUT VIDEO SELECT -o VERT SYNC Figure 6: System timing for a 96 by 96 display grid. In this scheme, the phase lock loop is used to maintain synchronization with the 60 cycle line frequency. FROM MEMORY LOADS EVERY MEMORY ADDRESS OUTPUT TO COLOR GEN r£ 'UPPER BITS" SHIFT REGISTER T OUT — ►— A7 dR PAR IN PAR IN "LOWER BITS" SHIFT REGISTER OUT OUTPUT -o TO VIDEO COMBINER CLOCKS OUT AT 3X LOAD RATE 1 I CHANGES EVERY I SECOND SCAN I LINE DURING I RETRACE LOAD CLOCK J L Jl_LUJ_ UPPER /LOWER SELECT Figure 7: The video output circuitry for a graphic display is simpler than that of a character display. This logic implements the 3 by 2 format of figure 4. chess and many other games. The basic chess grid is shown in figure 5 and uses one eighth of the 96 elements in both directions. The choice of a rectangular grouping is also handy in games, for the ball or puck can be double size in both directions compared to the goal and foul lines and still be specified with only one memory word. Having picked our basic format, we can go on and design our system timing. We start with a vertical rate of 60 Hz and use a 262 line non-interlaced system, for a total of 192 active scan lines and 70 retrace and blanking lines in the vertical direction. Thus two vertical lines are used for each resolution box, and 96* 2= 192. Our horizontal frequency will be 60 * 262 = 15,720 Hz, equal to a 63.6 micro- second horizontal line. With a reasonable horizontal retrace, this gives us around 48 jus of live scan time for 96 elements. The time per element is thus a relatively lazy half microsecond. There are three display elements for each horizontal word, so memory clocking will be needed at 1.5 Ms intervals. One possible system timing setup is shown in figure 6. The output video circuitry is simpler than in an alphanumeric display since we don't need a character generator. Figure 7 shows one possible arrangement. The memory words are clocked once every 1.5 lis and three bits are loaded into a four bit shift register and clocked out at a 2.01216 MHz rate. The other three memory bits are loaded into a second identical shift register. At the same time, the two color bits are decoded and sent to the. color subcarrier system. The registers are selected on alternate scan lines. This automatically picks the first three bits for the upper three boxes and the second three for the lower three boxes of each memory. Note that we can use a data selector since we only change it during the horizontal retrace time. The whole job can not be done with selectors due to the glitch and settling time problems. Note also that we get the same memory words back in the same sequence for four consecutive scan lines, two to display the first three bits and two to display the second three bits. This is similar to the readdressing that takes place on an alphanumeric TVT when we get each horizontal line back at least seven times to produce an entire dot matrix character. The output of the data selectors is a video brightness signal which is routed to a typical video combiner. The color information is routed to the subcarrier circuit. Be sure that the color circuitry returns to the reference phase during the horizontal retrace time. Try to design the display so that most color 66 Figure 8: A set of chess men constructed using the video output circuitry of figure 7: The diagram shows a 6 bit ASCII subset character pattern to the right of each figure to show what should be loaded into the memory. © © ® © @ © © © DISPLAY (A) VACANT (B)ROOK © © * I * I - 7 DISPLAY ASCII DISPLAY (C) PAWN (D) BISHOP -- ■ / / - 7 7 - DISPLAY ASCI (E)KING (F)OUEEN z © 2 8' V S s S DISPLAY ASCII (6) KNIGHT = . 6 c 6 c ■t • 9 ASCII t I P p $ I < 9 ASCII 4 Y / / / - 7 changes take place on a black or blanked location. If color fringing becomes a prob- lem, a slight additional amount of video delay (with respect to the color changes) may minimize this effect. Using this circuitry, each chess piece requires 8 characters of memory. Figure 8 shows one possible arrangement of the chess- men for a chess display (along with 6 bit ASCII subset character codes). The program of figure 9 shows us the starting position for a chess game. A basic hockey or Pong setup is shown in figure 10 with its program. We can add scoring or other alpha- numerics most simply by using an ordinary TVT with the graphics display and alter- nating frames, as shown in figure 1 1 A, or by summing video as shown in figure 1 1 B. Both system timing circuits must be locked together and have the same number of horizontal lines, and the same amount of horizontal retrace must be provided in both modes if the television is to recognize a continuous program. Another possibility is to use simple box "stroke style" characters and store them directly in the memory matrix. Figure 12 shows several approaches to the third partitioning problem, the separation of often and seldom changing data. Most often, a graphics TVT display will be used in association with a microprocessor to get extensive game capabilities. This has a tre- mendous advantage over wired logic in that we can change rapidly a game format simply by changing programs. The object of memory partitioning is to trade off specialized timing against the total number of memory bits that have to be involved with every computation and up- C BLACK" ) R : .N'. B r'P.': K •B: N :R: •P-V P '. P;- p ■ p.;. P '■P- : P p P p •p; p ■P P P.. :R. N B Q :K: B N R ("WHITE") Figure 9: The starting con- figuration of a chess game is established by repeating the appropriate character patterns at selected places in the display memory and surrounding the piece pat- terns by the border pat- tern. If the "o" character is used to represent the 8 elements of the chess man selected from figure 8, then the pattern for each piece is: C o C o C o C o C o 9 8 G G < Each "°" should be re- placed by a character from one of the chess patterns of figure 8. Since the border pattern is fixed, moving a chess piece is accomplished by moving only the 8 characters in the center of each board position. Software for a chess display would ini- tialize the border pattern at the start of play. 67 Figure 10: Display pattern for a Pong style video game. This figure shows the contents of display refresh memory for the upper half of a playing field display. The lower half is a mirror image except for the location of the ball (which would be controlled by the software of your microcomputer.) The characters shown are 6-bit ASCII subset charac- ters which give the proper codes for the 3 by 2 format of the video graphic generator of figures 4 and 7. G G G G G G G G G G G G G G V G G G G G G G G G G G G G G @ @ @ @ J @ @ @ @ @ @ @ @ @ @ @ 1 @ @ @ @ @ J (3 @ @ J @ @ @ J @ @ @ @ @ 1 @ (S> @ @ @ @ @ (3 @ @ @ (3) @ @ J @ @ @ @ @ @ @ @ @ @ 1 @ @ @ @ @ @ @ @ @ @ @ @ @ J @ @ @ @ @ @ @ @ J @ @ J (3) @ @ J @ @ @ @ @ @ @ @ (a @ 1 @ @ @ @ @ @ 1 @ @ (3 (a @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ (3) @ 1 @ 1 @ (3 (3 @ @ @ @ @ @ @ @ @ @ 1 @ (3 (3 @ @ @ @ @ (ffl @ (a @ @ @ J @ @ @ @ @ @ @ @ (a <3> @ J @ @ @ @ @ @