[editor : Carl T. Helmers Jr.] [publisher : Virginia Londoner (Virginia Londner), Gordon R Williamson] [art : Ellen Bingham, Wai Chiu Li, Christine Dixon] [cover : Robert Tinney] #Magazine
#Abstract
This month's cover painting by Robert Tinney is called "Infinite Regression" - an appropriate way to introduce you to several articles in this issue dealing with computer simulation."
The term "simulation" can have a bewildering variety of meanings; we have restricted ourselves herein to simulations of galaxy projections, digital circuits, celestial mechanics, and an ideal two-dimensional gas - all using your personal computer or programmable calculator.
By adding special controls to a micro computer, a user can input special information or information in particular forms. The addition of four switches and four colored lights allows your computer to play a memory game such as the ones found in department stores. Steve Ciarcia tells how The Toy Store Begins at Home. page 10
There is more than one way to peel an Apple, or in this case to interface an Apple II. Richard Campbell gets to the core of the problem in Cross-Pollinating the Apple II. page 20
One fascinating use of a computer is performing experiments quickly and easily. The experimenter can define properties and change parameters in a program rather than having to rebuild equipment. Mark Zimmermann discusses Simulation of Physical Systems, specifically The TwoDimensional Ideal Gas. page 26
An important area of numerical calculations is the control of errors: rounding errors, truncation errors, and so on. Daniel R Buskirk has some comments on this very necessary study in Sources of Numerical Error. page 46
Wouldn't it be nice to have a type of memory in your computer that would answer questions such as, "Which of my employees are over 35 and make more than $20,OOO?" Such a memory is known as an associative memory. Randy Smith introduces us to the world of Smart Memory in part 1 of this 2 part series. page 54
Have you ever wondered what our galaxy looks like from one million light years away? Perhaps you want to study the formarion of the Andromeda galaxy or incorporate a known star cluster into a space war game. In either case you'll want to have A Simulated View of the Galaxy as discussed by Mark Dahmke. page 66
Delmer D Hinrichs presents a combination three-dimensional Mars lander and introduction to celestial mechanics in Marsport Here I Come: The ThreeDimensional Celestial Mechanics Simulation for the HP 67/97. page 84
The Standard Data Encryption Algorithm by Robert V Meushaw discusses its implementation on the basic KIM-1 system. A detailed description. of the algorithm and generalized flowcharts are also given. page 110
In everyday life we wait in lines before we can do particular things. The same happens with computers. The study of waiting, called Queuing Theory, and how computers handle the situation is discussed by Len Gorney. page 132
The pocket calculator can be used to encipher and decipher messages. John Costas provides us with working examples of Cryptography in the Field, Part 2 : Using the Pocket Calculator. page 144
Randy Soderstrom provides a quick and simple Life program for the 8080 in his article Life Can Be Easy. page 166
When working with trigonometric quantities, it is not always necessary to arrive at the precise value. Often a relationship between the desired value and the entire range of allowable values is sufficient. Robert Grappel discusses such an implementation in An Easy Way to Calculate Sines and Cosines. page 170
In The Power of the HP-67 Programmable Calculator, Part 2, Robert C Arp Jr concludes his discussion of the HP-67 with a practical applications program for solving simultaneous equations. page 176
The ability to microprogram a processor increases the power and usefulness of that processor to a particular user. Microprogramming allows one machine to appear as several different processors while using the same hardware. Ben E Cline gives us An Introduction to Microprogramming and shows how it can be used. page 210
Could you use a pocket-size alphanumeric terminal? One of the main problems with this type of device is the size of the video screen used for output. By using 7 segment displays, Daniel Chester has thought of a way to make A Digital Alphanumeric Display. page 218
Is it practical to use microcomputers for timesharing? In Microcomputer Timesharing, Kenneth J Johnson reviews some of the techniques developed for large computers with an eye toward utilizing them on a microcomputer. page 224
Artificial intelligence (AI) on a programmable calculator? Why not? A Binary Guessing Game shows you how. Authors Mark Zimmermann and James Blodgett describe a pattern recognition algorithm that tries to outguess the operator, often with remarkable success. page 236
[author : Carl Helmers] #Edito #Listing #Pascal
Extract : « The other day I had a problem using my computer system which many readers may have had. The lesson to be learned from my experience forms the subject of this essay.
This problem is one of zapping the file structure of a disk. Sooner or later everyone who uses a small computer system will encounter a similar situation. One could be tempted to think, naively, that such problems are limited to large computer systems with large sensitive flying head disk media, but this is by no means the case. Floppy disks can be logically zapped just as easily.
I, like many of our readers with systems, have not been letting my system lie idle in the house. In the years since starting this publication with my associates in 1975, I have been suffering withdrawal symptoms from big computers and associated time sharing software. In my case it was everyone's favorite target of criticism, TSO running on a large IBM 360 system. Well, finally small computers got to the point where they could support my style of language, Pascal. Last summer, I bought the Northwest Microcomputer Systems model 85/P with UCSD Pascal as its operating system, filing system, editor and high level language package. [...] »
Build a challenging musical game in BASIC
[author : Steve Ciarcia] #Electronic #Algorithm #Listing #BASIC #Audio #Game
Extract : « [...] Some time ago I was in a stuffy business meeting. When it became apparent to the chairman that most of the attendees were asleep, he pulled out a saucer shaped object with four colored areas on it and slid it along the table. It stopped in front of me and went "beep" and lit a red light. Instructed to respond in kind, I pressed the red area which turned out to be an oversized lighted push- button. The saucer replied "beep-boop" and lit the red and green lights sequentially. It became immediately apparent that the plastic saucer was a game and the object was to duplicate the sequential tones it played. The task became increasingly difficult as it added another note each time around. If missed, it made a sound like a "raspberry" before starting a new game.
This "game" turned out to be Simon, from Milton Bradley Corporation. It uses a microprocessor to synthesize the tones, light the lights, and generate the sequence. [...] »
Experiment with physical models on your computer
[author : Mark Zimmennann] #Simulation #Graphics #Listing #BASIC #Assembly #Book #Physics
Extract : « Computers are becoming increasingly valuable in the sciences, for data reduction and analysis and for the simulation of physical systems. With a machine to do the repetitious work, an astronomer can follow the orbits of hundreds or thousands of stars as they are affected by their mutual gravitational fields and move to make a globular cluster or a spiral galaxy. A chemist can follow molecules in a liquid as they attract and repel and undergo chemical reactions. A physicist can watch the atoms of a gas moving from a low entropy, highly ordered state toward a more probable chaotic configuration, and can follow the random walk motion of any specific particle as it suffers collisions with the rest of the gas.
How does one go about setting up a physical simulation? It's necessary to determine the most important laws that govern the system under investigation. A star cluster, for example, is controlled mainly by Newton's law of gravitation. The nuclear reactions which power individual stars are interesting, but probably not very important to the structure of the cluster as a whole. (An exception might be a cluster of extremely massive stars; such stars could run out of fuel and blow up before there was time for their orbits to settle down.)
The first step in programming any physical system is to cut away all the features except those which are crucial to it — in other words, to make a model. [...] »
Learn how to control errors from rounding and truncating
[author : Daniel R Buskirk] #Method #Mathematics #Book
Extract : « A growing number of microcomputer enthusiasts are finding the need to perform control operations, evaluate complicated mathematical expressions and analyze statistical data. In short, many hackers want to tackle problems conventionally left to larger computers. To do this, they must become acquainted with error analysis.
Programmers need to be concerned about errors in any program involving the evaluation of a function or algebraic expression, or one which involves a large number of simple but repetitive operations. Even in control applications, it is often critical to be aware of the potential for error. [...] »
Pilot a spaceship to a soft landing on the Martian surface
[author : D D Hinrichs] #Algorithm #Listing #HP #GameRacingPiloting #Simulation
Extract : « The motion of a freely falling body in a gravity field has many interesting characteristics. One of the better methods of showing this is with a simulation, in this case written for the Hewlett-Packard HP-67 or HP-97 programmable calculator.
Lunar lander simulation programs, in which the application of thrust is used to counteract gravity, have become quite popular. Extending the lunar lander concept to two dimensions allows study of the motion of bodies in orbit. Further extension to three dimensions, as in this program, makes it possible to investigate orbital plane changes. Since Mars has a much stronger gravity field than the moon, the effect of gravity is accentuated. [...] »
The Standard Data Encryption Algorithm on a KIM-1 computer. Part 2 of two parts.
[author : R V Meushaw] #Cryptography #Algorithm #Listing #Assembly #BASIC #Book
Extract : « [...] When I began the design, I knew that there were many possible approaches. However, I also knew that the one hard constraint I faced was the amount of memory available on the basic KIM-1 computer. This constraint was the determining factor in the design, and, as a consequence, in the efficiency and speed of the implementation. In order to determine how much memory I would have for the program, I began to estimate the amount of storage I would need to hold all of the tables I needed. My preliminary estimate was that for each entry in each permutation table I would need one byte (I actually needed slightly more, as you will see). This assumption meant that I would need 312 bytes — almost one third of the memory available to me. I next looked at the Select S1 thru S8 function. There are eight separate tables with 64 entries each. However, since each table entry required only four bits instead of eight (the entries range from hexadecimal to F), I knew that if I was clever I could get away with half a byte per entry. I would still need 256 bytes for these tables, of course. So before I even started on the program, one half my available memory was committed.
The impact of the above results became clear when I looked at the memory requirements for subkeys K1 thru K16. Each subkey would require 6 to 8 bytes (depending on how data was represented), giving a possible total storage requirement of 128 bytes. Since I would be left with only about 128 bytes for the program (and I didn't think that was enough) I made the decision to generate each subkey as I needed it. [...] »
Waiting lines are so important that an entire area of mathematics is devoted to their study
[author : Len Gorney] #Method #Listing #BASIC
Extract : « How many times have you waited in a line? Do you always get to a supermarket checkout counter without having to wait? Is the pump at the gas station always open and ready for you as you drive into the service area? It's difficult to imagine anyone going anywhere and not having to wait in a line.
Since we're computer oriented, let's define a waiting line by its proper name — that is, a queue.
A queue is a waiting line controlled by some service mechanism. A customer enters a queue at the tail of the queue, waits in line until he or she arrives at the head of the queue, is serviced at the head of the queue, and, finally, leaves the queue. At the supermarket a customer pushes a cart to one of the lines formed at the checkout area and waits in a line until finally arriving at the cash register at the head of that line. After checking out the purchases, that customer leaves the queue. [...] »
An example solution of simultaneous equations
[author : Robert C Arp, Jr] #Listing #HP #Book #Mathematics
Extract : « Last month I described the features and performance of the Hewlett-Packard HP-67 and HP-97 programmable calculators. This month I conclude with a practical application program. I have chosen for an example a program which uses the more powerful HP-67 operations. Likewise, I have chosen to write a program which will provide the solution to a general set of simultaneous equations, traditionally one of the most laborious mathematical solutions to obtain, yet one of the most useful solutions in electrical engineering.
The HP Math Pac contains a program to solve four simultaneous equations in four unknowns by Gaussian elimination, and the Standard Pac contains a program to solve three simultaneous equations in three unknowns by matrix operations. The program shown in listing 1 solves any system of up to nine simultaneous equations in nine unknowns by the method of "Gaussian elimination using the largest pivots." [Because of its efficiency, the Guassian elimination pivot method is a popular method for solving simultaneous equations. The term "pivot" refers to the (r, r), a diagonal element of the coefficient matrix during the rth step of the process. This method is discussed in a number of numerical methods books. See also the reference at the end of this article... CM] The primary utility of this program would be in calculator aided design. [...] »
Add an Intel 8251 programmable communications interface
[author : Richard Campbell] #Interface #Listing #Assembly #Electronic
Extract : « I have an Apple II personal computer, which I like a great deal. I have noticed that most construction articles dealing with custom interfaces for the Apple assume that one must use Motorola or MOS Technology peripheral integrated circuits. Since I use the Intel 8080 family of devices in my work, and want to add a serial interface to my Apple, I've decided to try a little crossbreeding. The interface was designed to be RS-232 compatible and to allow receiving and transmitting with the ability to add modem control signals easily in the future.
Circuit Design
The heart of the interface is the Intel 8251 programmable communications interface. The 8251 performs serial-to-parallel and parallel-to-serial conversion. The operating characteristics and mode of the 8251 are programmable by sending the proper bytes to it from the Apple bus. The interface is set up to handle asynchronous communications. National Semiconductor's 1488 and 1489 integrated circuits handle the RS-232 and TTL (transistor-transistor logic) level conversions. Since I am using only one of four buffers per chip, many other RS-232 signals could easily be added such as Data Set Ready and Clear To Send. [...] »
The concept of associative ("smart") memory is discussed
[author : Randy C Smith] #Memory #HowItWorks #Book
Extract : « There is a useful distinction being made today between two types of display terminals: so-called "dumb" terminals perform the necessary functions of data reception, transmission, and display. Their intelligent counterparts, however, are capable of performing sophisticated data manipulations on their own, relieving the host processor of some of the routine burden. The same distinction could be drawn from memory systems. In most machines the memory component forms a passive blackboard: its function, the principal one of any memory, is to remember. Yet memory systems can be built which take a more active processing role.
What kinds of things could a smart memory do? The normal random access memory has unique addresses for its cells, and an address must be provided to read or write information, one cell at a time. The concept of address or location as a necessary attribute of content may be difficult for beginning programmers to grasp. A far more palatable idea to the human thinker is that words, shapes,- or sounds serve to "call up" the information associated with them. [...] »
Viewing constellations from other parts of the galaxy, and related matters
[author : Mark Dahmke] #Graphics #Astronomy #Glossary
Extract : « At one time or another, each of us lets our imagination wander; perhaps to places familiar to us, or places we have never been and can only dream about exploring. Often, my imagination leads me to the questions: "What does our sun look like from neighboring stars?" and "What do our familiar constellations look like from other points of view?" Have you ever wished that you could travel anywhere in the universe whenever you wanted to? With the help of computers and graphics displays we can begin to answer some of these questions and have fun exploring what we know about the galaxy at the same time. [...] »
Using a pocket calculator to implement a field cipher
[author : John P Costas] #Listing #HP #Algorithm #Cryptography #Book
Extract : « As mentioned in part 1 of this article (March 1979 BYTE, page 56), afield cipher is a technique for encoding plaintext so that it can be easily decoded with pencil and paper (or calculator) in the field, so to speak. The calculator program of listing 1 when used with the procedures described offers the user an effective field cipher capability. Unlike most field cipher machines, which perform substitution only, the program Crypto (listing 1) offers both transposition and substitution. The transposition operation is mandatory and provides the main strength of the cipher. Substitution may be added for further protection if desired. The basic principles of operation are first described, including detailed instructions for usage. Following this, a discussion of program organization is given.
Since Crypto performs both transposition and (optionally) substitution, a transposition table and substitution key are involved in the processing of each character. [...] »
A simple implementation of Life
[author : Randy Soderstrom] #Listing #Assembly #Simulation
Extract : « I've written a fairly short and simple program (about 220 bytes) to play Life on an 8080 based system. You need only two pages of memory for the program and the playing board. When this was originally written, I had only 1 K bytes of memory in my Altair, so this version is a simple one. A few extensions are suggested, but they are not necessary to enjoy Life.
The playing board is a 16 by 16 grid taking one page (256 bytes) of memory. Only the two least significant bits of each byte are used, and the leftmost column and top row are used as a border. If you don't use the border, the top of the board is next to the bottom, and the right edge is next to the left edge. [...] »
Relative sine and cosine values in one byte
[author : Robert Grappel] #Listing #Assembly #Mathematics
Extract : « The instruction set of a typical 8 bit processor can be quite confining at times. Any task requiring more than simple integer addition and subtraction can become a nuisance. There are reference books from which multiplication and division routines can be obtained, and square root and other functions can be built by using expansion, iteration, or other well-known methods. Implementing these algorithms on a microprocessor uses much space and programming time. Trigonometric functions are among this class of difficult functions. However, if one can tolerate accuracy of one part in 100, and allow about 1 ms per computation, the routine described in this article will provide sine and cosine values in a very simple 40 byte routine. I have coded it for a Motorola M6800 processor but it could easily be converted to any other processor. [...] »
The fundamental level of control
[author : Ben E Cline] #Initiation #Programming #Book
Extract : « Many computer users have not been exposed to the subject of microprogramming although it was introduced more than 25 years ago. With the advent of microprogrammed microprocessors, though, more and more people are gaining access to the world of microprogramming. The purpose of this article is to provide an introduction to the subject.
The word microprogramming was introduced in 1951 by M V Wilkes to describe a method of implementing the control circuits of a digital computer that differed from the conventional hardwired logic approach. The actions of a microprogrammed processor during the execution of an instruction are determined by a program in high speed memory called the control store. The data paths, memory units, and arithmetic and logic circuits of the processor are directly controlled by bits in a microinstruction held in the control store. Each machine instruction results in the execution of one or more microinstructions. [...] »
A 7 segment display
[author : Daniel Chester] #Display #Encoding
Extract : « The demand for microprocessors for personal use is growing phenomenally. If these personal computers are to be more than fancy desk calculators, however, they need to be able to receive and display letters of the alphabet as well as numbers. While there are numerous terminals on the market that make such communications possible, they are so expensive that a complete computer system is still prohibitively priced. How can the costs of inputting and outputting alphabetical characters be reduced? [...] »
Designing multiuser systems
[author : Kenneth J Johnson] #OperatingSystem #HowItWorks #Book
Extract : « Until I read Steve Ciarcia's article "Having a 'Private Affair' with your Computer" in April 1977 BYTE, page 18, I had not envisaged my 6800 or my 8080 as the basis of a timesharing system. Then I asked myself, "Why not? Why shouldn't a microprocessor be capable of supporting a timesharing system?" I subsequently had the opportunity at the ONLINE conference held in London England on May 14 1977 to see Robert Uiterwyk's 6800 based multiuser system. This prompted me to search back through the literature (especially that of the time when timesharing systems were first being introduced) to check on the problems their designers encountered and their solutions. This article is the outcome. It does not set out to specify in detail how a timesharing system can be established, but it does deal with the main problems involved. Perhaps it will provide a starting point for readers' systems development. [...] »
Calculator pattern recognition
[author : Mark Zimmermann and James Blodgett] #Game #Listing #HP
Extract : « Humans and animals do not as a rule behave at random: instinct and past experience play too important a role. In the computer, a good pseudorandom string of digits isn't hard to produce, but to get genuinely unpredictable output is tremendously difficult.
This article introduces pattern recognition and gives a sample program that recognizes patterns with better than random accuracy. The program is in game format to add to the fun, but it can be easily adapted to other purposes.
We will look only at binary patterns (ie: sequences of 0s and 1s). This is not a limitation, since any string of symbols can be encoded into a corresponding binary sequence using a suitable conversion code such as ASCII, and, of course, neurons and flip flops are binary devices. (One could encode the text of this article up to this point in binary, and attempt to predict the rest of what we are going to say; if you want to try, good luck!) [...] »
#Book
Extract : « Adaptive Information Processing: An Introductory Survey by Jeffrey R Sampson, Springer-Verlag, New York, 1976, 214 pages, $14.80 [...]
BASIC Programming for Scientists and Engineers by Wilbert N Hubin, Prentice-Hall Inc, Englewood Cliffs, NJ, 1978, $9.95 paperbound [...] »
#Association