Text content (OCR)
ISSUE NUMBER 10 JUNE 1976 $1.50
PRINTED IN USA the small systems journal
i = r
Mn NM NAR
My
—
= nnn ie Pg ecm
wf 1
at q r
LA
Wi
HH
oO,
WN, Ll
an
The Game of LIFE Played in Color
COMPARE
Feature Suulr? —6800 Theirs—Y our Choice
Processor— The best ‘Motorola MC6800", Two accumulators, automatic Some are almost as good in one respect or another.
vectoring, seven addressing modes and complete set of branch None can offer all of the features of a real MC6800.
instruction. The more powerful instruction set and memory
orientated architecture makes programming very straight for-
ward and easy to learn. Operates from a single +5 Volt supply,
Memory— Static 2102-1 type memories. Fast enough to allow the pro- Various types available. Often not included in the
cessor to run at full speed at al! times. No refresh cycles, no basic kit, and must be purchased as an extra cost
problems with glitches and flakey dynamic memories, option, (this is an option?)
Power Supply— 10 Amp. Capacity. More than enough to power a fully ex- | Some expand more than others with the supply
Panded system. Power supply uses a rugged 25 amp bridge provided, Check carefully.
rectifier and a 91,000 mfd computer grade filter. Regulators
on th dividual plug-in cards.
Expansion— Seven slots for processor and memory boards. Eight 1/0 slots. | Varies from “0” to 16, or more.
1/0's are programmable type. All decoding and clocking pro-
vided from mother board making additional interfaces very
inexpensive. Baud rates may be independently selected for
each interface card.
Start Up— Automatic start and reset provided by “Motorola” Mikbug® Anything from switch and status light to automatic
ROM. No fiddling with switches and status lights. Just push ROM loading. tf ROM is not a standard part, the
the button and go. Use of standard Motorola firmware makes software may be unique to that machine.
software 100% compatibie with Motorola evaluation module
programs,
Clock— Crystal controlled master clock oscillator with high power Anything from cheap dual monostable systems to
clock drivers, Insures reliable, consistant operation with no crystal control. Crystal oscillators are best. Dual
noise problems, Baud rate divider operating from the master one-shots can develop phase overlap problems and
clock Oscillator provides the various baud rates for the 1/0 are more susceptible to noise problems.
devices with crystal accuracy. No adjustments necessary to
lock everything in at the proper frequency,
Buffering— Tristate bi-directional buffers on ali data lines, address lines | Various—from full buffering to almost no buffering.
and clock lines on ALL boards. Insures trouble free noise Lack of full buffering can lead to noise problems,
immune operation.
Documentation— | very complete. Our own notebook, plus the ‘Motorola
Programming Manual and Applications Manual. Detailed
instructions along with sample programs help you to under-
stand programming. You will be ready and able to write your
own programs after mastering these instructions.
Price— $395.00 For the whole thing. You get the case, power sup- | As we said—COMPARE.
Bly,processor2K word memory and serial interface.
No extras to buy, Just connect a terminal and start
operating. © Registered Trademark Motorola
COMING ATTRACTIONS
CASSETTE INTERFACE—Our new AC-30 will make it possible to load and
dump programs to cassette tape using ordinary inexpensive recorders,
Uses the standard “Kansas City” recording format for compatibility.
LINE PRINTER—At last—hard copy at a reasonable price. Our new PR-40
printer will print program listings, or any other material you might want
to keep in printed form, A dot matrix printer at a price you are not going
to believe.
GRAPHICS TERMINAL—A universal—works with any computer—graphics
terminal. With this connected to your computer you can play games in
style. May be used with our CT-1024 to put both graphics and alpha-
numerics on the screen simultaneously.
PLEASE—Don't call or write. We will have details on these projects in our next
‘ad. Government regulations prevent us from giving prices, or taking orders
npuTeR
S9stem
yet.
SOFTWARE—The flood is near. Editor and assembler now available. BASIC
and more games right away. Yours for the cost of copying. WE DON'T
SELL SOFTWARE—WE GIVE IT TO YOU. ENJOY IT, COPY IT, WE
WON'T COMPLAIN. . .
Southwest Technical Products Corp., Box 32040, San Antonio, Texas 78284
Tu
In
PLAYING
cnun
LER
“he tS
Now your
color TV can be your
computer display terminal
Cromemco’s new computer/tv interface
circuit lets you have a full-color computer
display terminal for little more than a
black-and-white terminal.
The Cromemco interface also lets you do
vastly more with your color terminal than
you can do with ordinary black-and-whites.
We call our interface the TV Dazzler®. It
consists of two circuit boards that plug
directly into your Altair 8800 or IMSAI
8080 computer.
Alphanumerics plus action, and graphics
The Dazzier® maps your computer
memory content onto your color tv screen
in full color.
That doesn’t mean just that you see
alphanumerics in color. You can display any
information in memory, And do so in color.
LIFE in color
You can display computer games or
animated shows (rocket ships). What's more,
you can display business or technical
graphics — multi-colored charts, graphs,
histograms, educational material — all from
computer memory. -Even light shows. Not
TV DAZZLER
SOFTWARE
CONTEST
Write for details
even the biggest computer manufacturers
offer all this in color,
Needs only 2K memory,
Technically, the Dazzler® scans your
computer memory using direct-memory
access (DMA). It formats each memory bit
into a point on the ty screen to give a
128 x 128-element picture. Only a 2K-byte
computer memory is required (only 512
bytes for a 32 x 32 picture). The quality of
the pictures is evident in the photos.
The Dazzler® output is a video signal
that goes directly to the tv video amp or to
the antenna terminal through an inexpensive
commercially-available device.
Inexpensive — and so much better
You can see from the list below that the
Dazzler® is little if any more in price than
an ordinary b/w interface or tv typewriter,
But it does so much more.
Order now
By mail or at your computer store
If you're into computers (or want to be),
FORRES
qanary sizer
ONZZLE-URITER
RUNNING UITH
ek preroriit
alphanumeric display
generated with
Dazzle-Writer software
(see below)
to invent these beautiful
displays or games, or to plot colorful
if you want
material inexpensively at home or in
business, the Dazzler® is for you.
Not only is it reasonable, but it’s sold at
computer stores from coast to coast.
Or order directly by mail on your bank
card.
TV DAZZLER® (complete kit)... . . $215,
TV DAZZLER® (fully assembled
ee $350
SOFTWARE
(punched paper tape with documentation)
RARE MT ROE ee esi exe ace $16
KALEIDOSCOPE in full color ..... $15
DAZZLE-WRITER (for
alphanumeric displays in color)... . $15
Aga MATION (for computer-
ited animated displays... . . . $15
TIGTACTOE (you pley
the computer) 2... 2. $15
Shipped prepaid if fully paid with order.
California users add 6% sales tax,
Mastercharge and BankAmericard accepted
with signed order.
Delivery: from stock for immediate shipment.
LIFE ¢ DAZZLEMATION * DAZZLE-WRITER * TIC-TAC-TOE * KALEIDOSCOPE
SOME SEQUENCES FROM CROMEMCO SOFTWARE
Cromemco
Specialists in computer peripherals
One First St., Los Altos, CA 94022 » (415) 941-2967
enecoercnt.
8° MSRM. "C ISH2—_ 78123456789 * Tae. |
CABCOUEF CHE KL NMOPORSTUUMKYZEN3+— |
E°SSXE. °C FEL—_ /B12S456789 «5 <=!
CHE. NF
E"8S26."¢ 384,~_ 78123456789 * 5¢)
@ABCOEFCHI IKE MNOPORS' vz!
E“ S828" (384. ~ _/O1 23456789" 5
@ASCOUEF CHEM 0 3 eva)
What does it take to make your
microcomputer keep track of that
small spare time “moonlight” busi-
ness? For small businesses, one of the
biggest problems is all the paperwork
required of the entrepeneur. John A
Lehman provides an introduction to
the subject of automated accounting
procedures in his description of A
Small Business Accounting System.
Find out how to Build a Television
Display which can be interfaced to
your computer’s memory address
space by consulting CW Gantt Jr’s
article on a 15 IC controller for a 32
by 16 display.
Programming to a large extent is
organizing your ideas about what the
computer should do. Ronald T Her-
man gives some basic pointers on
Programming for the Beginner, con-
cerning the practice of structuring
Program designs into well defined
verbal descriptions, before you gen-
erate a single line of code. This prac-
tice makes programming easier and less
subject to nasty errors which interfere
with the goal of a working application.
page 16
!s your high school’s computing
budget crimped? Use Christopher
Lett’s experience with A High School
Computing System as a way to show
that a small budget does not neces-
sarily rule out getting a system.
A Systems Approach to a Personal
Microprocessor is the inaugural article
in a new series of detailed design
articles which is being prepared for
BYTE by Dr Robert Suding. In this
first instalment, you’ll find some of Dr
Suding’s views on the philosophy of
system design, to lay the groundwork.
Build a computer? Sure. Bob
Abbott shows you the circuitry and
some photos of a wire wrapped M6800
system in his article on Building an
M6800 Microcomputer.
In
This BUTE
One of the principal uses of a
computer is data processing. Phillip L
Hansford describes one simple data
processing application which he imple-
mented with minimal equipment: How
to Strike a MATCH between penpals
for his penpal club.
Last month, Bob Nelson introduced
“Chip” Off the Olde PDP 8/E. In Part
2, he discusses the interrupt structure,
control panel features and support
chips of the }*.tersil 1M6100 design.
One key component of system soft-
ware for any computer is a monitor
program. You can find out how to
program and Interact with an ELM
(Eloquent Little Monitor) by reading
G H Gable’s article on his design of a
handy piece of system software.
Techniques of developing the ef-
fective address for operands in mem-
ory vary with the choice of CPU. In
An Introduction to Addressing
Methods. John Zarrella discusses some
of the classical ways computers use to
calculate the address of operands in
memory. You can use this background
information in forming your own
opinion about the instruction sets of
the various microcomputers presently
available.
What's in a language? Nat Wads-
worth and Mark Arnold present some
information on their interpretive lan-
guage system, SCELBAL, in a product
description article.
BUTE +10
JUNE 1976
* >
Foreground
16 BUILD A TELEVISION DISPLAY PUBLISHERS
Hardware — Gantt Virginia Pesch ke
40 BUILDING AN M6800 MICROCOMPUTER Manfred Peschke
Hardware — Abbott EDITOR
48 STRIKE A MATCH Carl T Helmers, Jr
Applications Software — Hansford GENERAL MANAGER
66 INTERACT WITH AN ELM Manfred Peschke
Software — Gable PRODUCTION MANAGER
Judith Havey
Background PRODUCTION ASSISTANT
Elizabeth Alpaugh
8 A SMALL BUSINESS ACCOUNTING SYSTEM CIRCULATION
Applications — Lehman Deborah R Luhrs
22 PROGRAMMING FOR THE BEGINNER PUBLISHERS ASSISTANTS
Software — Herman prey Hi
28 A HIGH SCHOOL COMPUTER SYSTEM bang 2ecly
Review: Lets ADVERTISING
32 SYSTEMS APPROACH TO A PERSONAL MICROPROCESSOR Elizabeth alpaugh
System Design — Suding Virginia Peschke
58 “CHIP” OFF THE OLDE PDP 8/E—PART 2 TYPOGRAPHY
Hardware — Nelson Custom Marketing Resources, Inc
76 AN INTRODUCTION TO ADDRESSING METHODS Goodway Graphics
Hardware — Zarrella sll ed 3
82 SCELBAL aim) war
= ay PHOTOGRAPHY
Product Description — Wadsworth -Arnold fed Crebitree
Custom Marketing Resources, Inc
ART
Nucleus Bill Morello
2 In This BYTE PRINTING |
4 Toward a Parallel Interface Standard Custom Marketing Resouroes; Ing
‘The George Banta Company
5 Call for Papers ASSOCIATES
6 About the Cover Bob Baker
14, 73, Dan Fyistra
81, 95, 96, Don Lancaster
98,100,110 What's New? Harold A Mauch
36 The Albuquerque Happenings Chris Ryland
52 Letters
64 Components and Parts (Puzzle) BYTESiiaeheIne le pubuanea
87 Classified Ads monthly by BYTE Publica-
88 Book Reviews boreude New darnpsnire
90 Clubs, Newsletters 03458. Subscription rates are
94 Programming Quickies Two yeare, $32. Three years,
104 Software Bug of the Month 830, Second oes poste paid
1 fe 4
104 BYTE’s Bugs Sfive 03488 and at adaitional
a a ae
106 SystemsiofNots 803-324-7217. Entire contents
112 BOMB copyright 1976 BYTE Publica~
112 Reader's Service tions, Inc, Peterborough NH
03458. Address editorial cor
respondence to Editor, BYTE,
70 Main St, Peterborough NH
03458,
Toward
Articles Policy
BYTE is continually seek-
ing quality manuscripts writ-
ten by individuals who are
applying personal systems, or
who have knowledge which
will prove useful to our read-
ers, Manuscripts should have
double spaced _ typewritten
texts with wide margins, Num-
bering sequences should be
maintained separately for fig-
ures, tables, photos and list-
ings, Figures and tables should
be provided on separate sheets
of paper. Photos of technical
subjects should be taken with
uniform lighting, sharp focus
and should be supplied in the
form of clear glossy black and
white prints (if you do not
have access to quality photog-
raphy, items to be photo-
graphed can be shipped to us
in many cases). Computer list-
ings should be supplied using
the darkest ribbons possible
on new (not recycled) blank
white computer forms or bond
paper. Where possible, we
would like authors to supply a
short statement about their
background and experience.
Articles which are accepted
are typically acknowledged
with a binder check 4 to 8
weeks after receipt, Honorari-
ums for articles are based
upon the technical quality and
suitability for BYTE’s reader-
ship and are typically $15 to
$30 per typeset magazine
Page. We recommend that au- |-
thors record their name and
address information redun-
dantly on materials submitted,
and that a return envelope
with postage be supplied in
the event the article is not
accepted. .
PERSONAL COMPUTING ’76
Consumer Trade Fair
Atlantic City NJ
Personal Computing '76 will be the first
large industry wide show for the personal
computing field. It is being sponsored by the
Southern Counties Amateur Radio Associa-
tion of New Jersey, and will be held August
28 and 29 1976 at the Shelburne Hotel and
convention center on the Boardwalk at
Atlantic City. For information on exhibit
space and the show in general, contact:
John H Dilks III, chairman
Personal Computing '76
503 W New Jersey Av
Somers Point NJ 08244
Phone: (609) 927-6950.
© For reservations, contact:
Shelburne Hotel/Motel
Boardwalk & Michigan Av
PO Box 1138
Atlantic City NJ 08404
@ Manufacturers who provide products
for the personal computing market-
place are invited to attend.
© Aseries of seminars on subjects related
to small computer systems is being
arranged.
@ The show will be almost entirely
devoted to computers and related
products.
@ Admission to the general public will be
$7.50 at the door, $5 if ordered in
advance by individuals. Additional dis-
counts are possible for group pur-
chases by clubs, companies and other
organizations.
a Parallel Interface Standard
The idea of a parallel interface standard
which encourages interesting combinations
of peripherals and processors from different
manufacturers is one which in my opinion
should be pursued to help foster the growth
of the personal computing marketplace, a
growth which will provide a wider range of
options for both users and suppliers of
products.
The User’s Eye View
The need of a parallel interface standard
from the user’s point of view is readily
perceived. The parallel interface standard
will be the personal computing equivalent of
what exists in the audio equipment industry:
a widely manufactured, readily available
physical interconnection with logically and
electrically compatible signal definitions.
The plug of choice in the audio field is the
RCA style phono plug universally used to
interconnect low level audio signals via
shielded cables. This enables the purchaser
of brand X turntable to plug it into a brand
Y receiver using shielded cables of brand Z.
The ideal for the parallel interface defini-
tion in personal computing is similar. What is
needed is a definition which will allow the
owner of brand X processor to plug his
system physically, logically and electronical-
ly into a brand Y music synthesizer or brand
Editorial By Carl Helmers
Q graphics display, using brand Z cable
assemblies. The interface definition to be
created will at a minimum guarantee hard-
ware compatibility. The applications soft-
ware compatibility can be provided by the
peripherals manufacturer in the form of
simple relocatable routines with common
functional documentation and detail code
generation for the various microprocessor
instruction sets.
The user will see a much more highly
desirable product if it contains provision for
the standard interface, since he or she will
then be able to interface a wide variety of
specialized applications and systems oriented
peripherals without the necessity of per-
forming the systems engineering equivalent
of reinventing the wheel at the interface
level.
The Manufacturer’s Eye View
The manufacturer of a product for the
personal computing field has as a goal the
maximization of sales, and hopefully as a
result, the maximization of profits. This isa
simplistic economic analysis which ignores
the existence of specialized counter exam-
ples, but it is generally valid in most cases.
Continued on page 112
Call for Papers
PERSONAL COMPUTING '76 — Technical Session on Standards
As part of the Personal Computing '76
convention August 28—29, Atlantic City NJ,
BYTE magazine will coordinate a technical
session on areas of standardization for the
personal computing field. The purpose of
defining standards is to provide a consistent
and workable set of specifications for inter-
faces between different equipment which
permit combined operation as a system.
Standards are in the interest of manufactur-
ers who will find wider markets as a result,
and standards are in the interest of users
who will benefit from a wider choice of
compatible options.
The following technical areas are identi-
fied at this point in time:
Audio Cassette Standard
A provisional interchange standard for
audio media was defined by a working
meeting sponsored by BYTE magazine in
November 1975. This standard will be re-
viewed, and the idea of a higher performance
audio media standard should also be consid-
ered.
Parallel Interface Standard
The proposal here is to define a parallel
interface standard for the connection of
peripherals to central processors. The stan-
dard should specify logical interface, electri-
cal interface and possibly a set of preferred
physical plug and receptacle designs.
Software Interface Standard
The proposal here is to define several
byte sequential media independent record
formats for data involved in interchange
between systems. This standard will prove
useful to the development of software mar-
kets, and could be incorporated into the
firmware of operating systems and loaders
supplied with processors.
Arrangements
Individuals and firms wishing to partici-
pate in the discussions should send written
position papers on their area of interest to:
Carl Helmers
Editor, BYTE
70 Main St
Peterborough NH 03458
Attention: Technical Standards
Papers should be neatly typed camera ready
copy which will be used as is to create a
proceedings booklet to be distributed at the
technical session. It is suggested that draw-
ings be done using ink or felt tip pen, and
that film ribbon be used for typewritten
copy.
The standardization categories of audio
media, parallel interface definitions, and
software data formats should not be viewed
as exclusive. Identification of additional
areas where standards are appropriate will
also help the growth of the personal comput-
ing field.
It is expected that positions and propos-
als presented at the Personal Computing '76
show will be used as a starting point for the
second annual BYTE magazine symposium
on standards to be held later in the fall.
Questions regarding standards activities and
coordination of this session should be direct-
ed to Carl Helmers at BYTE at the above
address, or phone (603) 924-7217.8
Photo 1: Here is a black
and white reproduction of
a single frame of a wine
pouring animation — se-
quence created by Steve
Dompier using his Dazzle-
mation program, The
colors of the original re-
produce as shades of gray-
ness in this black and
white picture.
About the Cover
[This short account is
based upon materials supplied
by Harry Garland of Crom-
memco, ... CH]
Imagine being able to look inside your
computer memory, actually being able to see
the individual bits. With this sort of X ray
vision your computer memory could also
serve as your computer display. Messages
could be spelled out by lighting some bits
and darkening others. Games could be
played with clusters of bits forming game
pieces and markers. Space War might be
played with miniature rocket ship patterns
zooming in, out and around the visible
region of memory address space. The key
element of hardware required to actually
achieve this imagined result is a memory
module which has provisions to map its
contents onto a television screen. This is
precisely what Cromemco has done in
creating its TV Dazzler product, the results
of which were used to create this month’s
cover,
The TV Dazzler hardware features two
modes of operation providing high resolu-
tion and low resolution generation of a
television picture. Through software selec-
tion the TV Dazzler can be programmed
either as a 128 x 128 point black and white
display, or as a 64 x 64 point colored
display. The points of the display grid are
tiny square regions on the screen which map
into segments of the 2K byte memory of
the TV Dazzler module.
In the high resolution “bit mapped’”
mode, TV Dazzler uses its 2 K byte memory
as a means of storing 2l4 = 16,382 bits
required to generate a unique “on” or “off”
value for each location of a 128 x 128 grid.
This high resolution black and white mode is
very effective for alphanumeric displays and
detailed computer controlled images.
6
In the low resolution “‘nybble mapped”
mode, TV Dazzler uses its 2 K byte memory
as a means of storing 212 = 4096 four bit
nybbles of data needed to generate a color
display on a 64 x 64 grid. Each nybble
determines the color and intensity of the
corresponding picture element on the grid.
The most significant bit sets either high or
low intensity, and the next three bits inde-
pendently select the blue, green and red
channels of the color TV signal.
Like a metaphorical beachball, (see Janu-
ary 1976 BYTE editorial), the Dazzler pro-
vides the hardware for an incredible variety
of applications. This variety is realized
through the software for games and other
purposes developed by people who buy and
use this type of peripheral. One particular
application of the peripheral is a program
called Dazzlemation which was written by
Steve Dompier. The purpose of Dazzlema-
tion is to record an animated sequence of
TV frames in color, then play these back. In
order to make such a sequence, Dazzlema-
tion is used to color in the appropriate
regions of single frames which are stored in
memory. Steve’s standard demonstration se-
quence shows a carafe of red wine being
poured into a wine glass. One frame of the
carafe sequence is illustrated by photo 1.
This is just one of an endless variety of
computer generated animated displays which
is made possible by programs like
Dazzlemation.
A second application of the Dazzlemation
hardware was used to generate the pattern
which forms the main portion of the cover,
This is a program called Dazzler-LIFE which
was written by Ed Hall. John Conway’s
fascinating game of LIFE gains a new dimen-
sion when it is displayed in color. Watching
the patterns evolve can be intoxicating in
black and white, but becomes truly addictive
when color is used to illustrate the game
board. In the Dazzler-LIFE program, the
game begins in a drawing mode which allows
the user to draw an initial colony of cells on
the screen using controls from the ASCII
keyboard. Then the evolution process is
initiated with each succeeding generation
being displayed on the screen with colors
marking the health of each cell. Cells that
are too crowded, or too remote, turn a
flaming red color, then wither away. New-
born cells first appear in green, then grow up
to a mature blue color. The kaleidoscopic
result is fascinating to watch. One frame of a
colorful LIFE history was photographed for
the cover. .
Still another application of the Dazzler is
as a hardware game board for sophisticated
computer automated games. One example of
such an application is the Tic Tac Toe
software written by George Tate. Dazzler
Tic Tac Toe is written in BASIC, and
demonstrates how very well suited the MITS
BASIC is for creating colorful creations.
George’s program is one of a class of “man
versus computer” game applications, and is
reputed to be extremely competent at Tic
Tac Toe. A sample of the output is repro-
duced here in black and white as photo 2.
A useful utility program for the Dazzler,
which demonstrates the bit mapped mode
of operation is the Dazzlewriter software
created by Ed Hall. This program turns your
ASCII keyboard/computer/Dazzler combina-
tion into a TV typewriter by generating the
5 x 7 dot matrix display for each keyboard
character. A sample of Dazzlewriter activity
is shown in photo 3. Since the main memory
of the computer is used to store the charac-
ter generation information, there is no need
for any additional hardware beyond the
memory requirements of Dazzlewriter.
Another delightful application of the
display is an “idling” program you’ll pro-
bably want to leave in the computer system
when you’re not using it for another pur-
pose. This program is Li-Chen Wang’s color-
ful Kaleidoscope program. The program is
surprisingly short, just 127 bytes long, yet it
generates an unending sequence of captiva-
ting patterns.
These programs were created by some of
the first individuals who had access to the
Dazzler hardware. They are written for the
8080 instruction set (except George Tate’s
BASIC Tic Tac Toe) and are available in
paper tape form from Cromemco at $15
each.™
Photo 2; Here is the game board of George Tate’s Tic Tac Toe application,
written in MITS Altair BASIC with the TV Dazzler as its display peripheral.
PHEGUSSRy RNS
eapeeye T7239?
MEMORY SIZE?
TERMINAL WIDTH?
DAZZLE-WRITER
RUNNING WITH
8K BASIC! ! ff
Photo 3: Here is a sampling of outputs generated using Ed Hall's
Dazzlewriter program to turn the TV Dazzler/computer[/keyboard combina-
tion into the logical equivalent of a TV typewriter style display.
A Small Business Accounting System
The least sophisticated
form of bookkeeping is
single entry accounting; it
is not, however, generally
suitable for preparing fi-
nancial statements for
banks, investing brothers-
in-law, and so forth.
Double entry bookkeeping
has the advantage of incor-
porating redundancy and
error checking techniques.
It is the most common
form of business
accounting.
Or, How Your Microcomputer Can Take the Worry Out of Tax Time
John A Lehman
716 Hutchins #2
Ann Arbor MI 48103
Here's an outline of an accounting system
suitable for small business use on a micro-
computer. It is designed for a small, inexpen-
sive system having a central processor, Tele-
type IO, one or preferably two cassette tapes
for storage, and a high level language facility
such as BASIC. It could probably be written
in assembly language, but at a price of
inconvenience. The system is designed to be
used by an individual proprietorship (one
man business) or a small partnership. While
perhaps suitable as a bookkeeping system for
a small corporation, it is not intended to
produce the sort of reports which various
regulatory agencies may require of one. It is
designed to keep books, produce tax returns
(either Form 1040 schedule C for pro-
prietorships or Form 1065 for partnerships),
produce balance sheets which may be re-
quired either for management information
or for the information of banks and other
outside investors, and to be adaptable for
check reconciliation, cash budgets, pro
forma balance sheets and the like. Its use
requires about the same amount of time and
effort as keeping a journal would normally,
with the added advantage that the entries are
pretty much self checking. All other reports
are produced by the programs which would
be used. I'll try to describe the system in
enough detail so that anyone who is skilled
in BASIC and knows a little about account-
ing could write a program to do all of the
above.
First, however, it might be a good idea to
take a quick look at accounting systems and
what they’re used for.
Of the various systems available, the
8
simplest is the single entry system. A check
book is a good example; each time money
goes in or out, a notation is made of the
date, the amount, and any comments on
sources, uses, etc. This sort of system is
obviously very simple to keep, and has the
additional advantage of being accepted by
the IRS for preparing tax returns. However,
it has a number of disadvantages. The first is
that it is not self checking, as anyone who
has ever tried to balance a checkbook can
testify. Also, while capable of producing an
“income statement” (the generic term for
what a tax return amounts to), it is not
suitable for the preparation of other finan-
cial statements that may be required by
banks, investing brothers-in-law and so forth.
These disadvantages make a single entry
accounting system unsuitable for the system
under discussion here.
Double Entry Accounting
The other major accounting system is the
double entry system. It was invented about
600 years ago, and came into widespread use
because it was self checking. It is also quite a
bit more complicated than a single entry
system. The basic idea behind the double
entry system is that each transaction has two
parts: where money comes from and where
it goes. So each transaction is entered twice,
each time in a different account. The mech-
anism behind this is the idea of debits
(DR) and credits (CR). Very briefly, a debit
represents an addition to something which
you have (an asset) or to an expense. A
credit represents a subtraction from one of
these. On the other hand, a debit represents
a subtraction from something which you
owe or from a revenue, while a credit
represents an addition to one of these. All of
which can be very confusing.
As a quick example, suppose you pay
$100 on your BankAmericard and receive
$150 for some service which you performed,
You would debit accounts payable (sub-
tracting from what you owe) for $100, and
credit cash (subtracting from something you
have) for $100. Then you would debit cash
(adding to something you have) for $150,
and credit income or revenue (adding to
revenue) for $150. The self checking feature
is provided by the fact that debits must
always equal credits. It would probably be a
good idea to look through a beginning
accounting book to get more examples to
help explain accounting techniques. I've
listed some at the end of the article.
Besides being self checking, a double
entry system has the advantage of being able
to churn out all sorts of reports on what is
going on in the business in question. The
IRS approves of it; and in fact, large
companies have no choice — they have to
use it. Now that we’ve described the major
accounting systems, let’s get on to what they
do and how they can be used in a computer-
ized system.
The purpose of any accounting system is
to provide information (another purpose is
to provide employment for accountants, of
course). This information is of use to various
people. The owner of a business uses it to
see how well he’s doing, and more impor-
tant, where he’s not doing so well. Another
important user is your friendly local IRS
agent; anyone in business is required to
produce accounting reports to the Internal
Revenue Service’s specifications. Banks and
other investors also are likely to be quite
interested in this sort of information, espe-
cially when their services are requested for
loans rather than for deposits. Corporations
are also required to provide statements to
various government agencies, but we’re not
going to be concerned with that here.
The basic statements and reports were
mentioned earlier. The first is the balance
sheet such as the one shown in figure 1.
This represents the financial state of the
company at a particular time. The left hand
side (in the US at least) represents assets, or
what the firm has. The right hand side
represents liabilities and equities. (Liabilities
and Equities is accounting terminology for
where the stuff on the left came from.)
Liabilities are amounts owed; equities are
amounts contributed or earned by the own-
er(s). The second statement is the income
statement. As was mentioned above, a tax
return is a species of income statement. This
shows what happened over a period of time.
Other statements, such as the cash budget
and the pro forma balance sheet, show what
may happen in the future. These are the
ASSETS: LIABILITIES:
Cash 1000 Payables 2000
Receivables 2000 Notes from bank 1000
Equipment 4000
— Equity:
Total Proprietor 4000
Total 7000
Figure 1: The Balance Sheet. This document shows the current financial state
of a business operation, It is used by businesses large and small, and is one of
the end products of the automated accounting system.
EXPENSES (Debit to add, Credit to ASSETS (Debit to add, Credit to
subtract) subtract)
Return & Allowances RTN Cash cSH
Depreciation* DEP Receivables RBL
Business Taxes* TAX Inventory INV
Rent RNT Prepaid expenses PPD
Repairs* RPR Supplies suP
Salaries & Wages SAL Equipment EQT
Insurance INS Investments vs
Professional fees PRE Misc, ETC
Commissions com
Amortization* AMT LIABILITIES & EQUITY (Credit to add,
Pension/Profit sharing PEN debit to subtract)
Interest INT
Bad Debts BDB Payables PBL
Depletion ODPL Notes’ NOT
Other (specify if common, eg: MIS Long Term Payables LTP
Fuel FUL Proprietor PRP
Electricity PWR Drawing ORW
Telephone FON
Cost of Goods Sold which ccs REVENUES (Credit to add, Debit to
includes subtract)
Purchases PUR
Materials/supplies MAT Gross Receipts RCP
Other costs OTR Other Revenue REV
Labor (used for or directly
related to
Production — does not include
money paid to you) LAB
“Items for which the IRS requires supplementary schedules or statements
Figure 2: Account Files Example. When the double entry accounting system
is designed, one of the first steps is to create a list of accounts and their
corresponding mnemonic codes. The mnemonic codes are used internally by
the computer in order to save memory space. If you are lavish with memory,
texts of the long names could be looked up in a table when you generate
reports.
statements which our system is going to be
able to churn out. Now, having got an
overview of what we’re trying to do, let’s
take a look at our data base requirements.
The first thing we are going to need here
is a set of names for our accounts. This is a
“chart of accounts” to use the jargon of the
accounting trade. A small system such as
ours will need about 35 of these, selected for
the most part to make our output match
9
ACTIVITY
INPUT FROM
DAILY
a
JOURNAL,
IT
e0!
PROGRAM
JOURNAL
TAPE
SUMMARY
EoIT
fi
PROGRAM
LEDGER
EoIT
PROGRAM
i
DETAILED
LEOGER
REPORT
Figure 3: An Accounting
System Flow Chart. This is
a software system flow
chart which identifies the
major program com-
ponents of an accounting
system, The representation
assumes that tape files will
be used to maintain mass
storage on your personal
system; floppy disks with
sequential access file orga-
nizations could be used as
well,
FORECAST
PROGRAM
CASH
BUDGET
PRO FORMA
BALANCE
SHEET
what the IRS requires. In order to save
memory space in the programs, each of these
accounts is also given a three letter mne-
monic code. Two letters would be possible,
but some ease of use would be sacrificed.
Figure 2 gives a sample list of accounts and
mnemonics, broken down by classification.
A brief explanation of some of the accounts
might be in order. Returns and Allowances is
for goods which are returned for one reason
or another. Its purpose is to reduce the
amount in gross receipts while keeping the
amount of returns separate. The category
SAL includes only those wages paid which
are not included in cost of goods sold (CGS).
This would involve such things as clerical
10
help. INT is interest paid, not received. BDB
(bad debts) is used if we want to use the
specific charge off method of accounting for
such unfortunate happenings. The IRS also
allows use of another method, called the
reserve method, but it is more complicated.
DPL (depletion) is used for things like oil
wells and mines. DEP (depreciation) is used
for equipment, machines and the like, while
AMT (amortization) is used to charge part of
the cost of such things as organization
expense, capitalized research and develop-
ment and so forth. Some of these things can
be listed as assets when the money is first
spent, and the cost spread over several
periods. For details see the IRS books listed
at the end of the article. Cost of goods sold
(CGS) is the total of the costs incurred to
get something ready for sale; the breakdown
is listed below it. Cash (CSH) is mostly
checking account balances. Receivables
(RBL) are what customers owe you on
account. Payables (PBL) are what you owe
on account. Proprietor (PRP) is what you
put into the business and what it has earned
so far. Drawing (DRW) is the account you
use to take money out of the business for
personal uses. Notes (NOT) is money bor-
rowed from banks and other lenders. The
rest should be pretty much self explanatory.
These 35 or so accounts are the data files
which we're going to be working from; all of
the information we put into the system goes
into them and all of the output uses them as
building blocks. Now, having taken care of
all of the groundwork, we are ready to start
running information through the system.
Reference to the system flow chart of
figure 3 shows that the journal is the first
thing we produce. It’s shown being produced
on tape, since that way we can use it to
produce all of the other reports without
having to type in any more material, at least
until we come to the forecasts. Also, by
writing our journal entries onto tape as soon
as they’re checked by the editing program,
we save much memory space, since we need
keep only a little bit of data in memory at
any given time. So, in this automated sys-
tem, the journal is the only file we really
have to manipulate on a day by day basis.
To use it, first we enter the date. Then we
enter each transaction through the checking
program which makes sure we have two
entries for each amount and that the num-
bers we give the machine match. A sample of
a possible format is given as figure 4. We
debit the power expense account (re-
member, we debit an expense when we want
to add to it) for $58, and enter the comment
that this is for the month of March. Then we
credit cash (to decrease it), but reverse the
numbers. The program sees that the debits
do not equal the credits, and fires off an
error message, prompting us to enter a
correction. Note here that we include the
check number; this is very important when it
comes time to reconcile our records with
what the bank statement says. Also, the
editing program should provide the ability to
debit and credit unequal numbers of ac-
counts so long as the totals are equal. If this
would be too much of a demand on memo-
ry, amounts can be split up before entry.
Going on, the OK indicates that the entries
check, and at this point they should be
written onto the tape, Entries for the journal
can come from cash register tapes, bills, etc.
Up through this point our system is about as
much work as a manual system, but from
here on in things get much easier.
The next item on the system flow chart is
the ledger. This is a set of files which puts all
of the journal entries for each account
together. In our system, there are two types:
summary and detailed. In a more advanced
system, all of the ledgers would be detailed,
but this would require much more memory
than most small systems would have avail-
able. Basically, what we do at this point is
have the program read the journal entries
one by one and keep a running count of the
amount for each of the different-accounts in
use. Beginning balances may be read in
either via the Teletype or via a separate
ledger tape. The ending balances should be
printed on the Teletype if the user wishes to
see what they are, but they should also be
saved on tape for use in preparing the rest of
the statements. Detailed ledgers will require
a separate run for each one desired; they
might be run on a weekly or monthly basis.
The most important one is the cash ledger,
since this will provide a record of every
check written and every deposit made to the
checking account by date and number. This
should make balancing one’s checkbook a
fairly simple task. The one thing to be
careful of in this program is to be sure that
the rules for addition and subtraction of
debits and credits are carefully written into
the program. Otherwise all that will come
out is garbage.
Once we have the ledger, it’s fairly easy
to see how the balance sheet is generated. A
look back at figure 1 will show that there are
only about a dozen of the ledger accounts
which have to be put together. All of the
asset accounts are added together, and the
sum is listed at the bottom of the column as
total. Subtracting the sum of the liabilities
from the stm of the assets leaves what is left
for the owner. If the amount in the drawing
account is set beforehand, that leaves only
the Proprietor (PRP) account to be
“plugged,” which is to say, given whatever
value is necessary to make the two columns
come out equal. So, if the assets total
$7000, the liabilities total $3000 and there
are $500 in the drawing account, that leaves
7000—3000-—500=3500 for PRP. The only
other detail is that the program should either
write the date at the top, or it should be
filled in by hand. A balance sheet may be
prepared at any time; it will often be
required for getting a loan from a bank.
Besides being run on paper, it should be run
onto tape for use in preparing forecasts.
Probably the most important report
which our system will prepare is the income
statement. This is a report which shows what
has happened over a period; usually a year,
but often prepared on a quarterly or a
monthly basis. Its importance arises not so
much from the fact that people like to see
how much money they’ve made as from the
fact that the government is quite interested
in this information — so they can take their
cut, of course. The system being illustrated
produces an income statement patterned
The balance sheet is a
snapshot of the current
status of the business.
A mass storage file comes
in handy for business ac-
counting, since much of
the work involved is ac-
complished by reviewing
the same data with dif-
ferent criteria to produce
reports.
Figure 4: An Example of the Interactive Dialog with the Journal Edit
Program. The purpose of this program is to filter your own manual inputs
looking for certain known discrepancies which can be detected by the double
entry bookkeeping method. In this example, upper case letters are the
computer output to a Teletype (or video terminal) and the lower case letters
indicate manual keyboard inputs taken from daily activity records such as
receipts, checks written, etc.
OK
Interactive program for journal entries might read:
ENTER NAME OF ACCOUNT DEBITED,AMOUNT,AND COMMENTS SEPARATED BY COMMAS.
Pwr,58,march
ENTER ACCOUNT CREDITED,AMOUNT,AND COMMENTS SEPARATED BY COMMAS:
csh,85,check 346
DEBITS DO NOT EQUAL CREDITS—ENTER IF DR OR CR TO BE CHANGED:
cr
ENTER ACCOUNT CREDITED,AMOUNT,AND COMMENTS SEPARATED BY COMMAS:
csh,58,check 346
ENTER NAME OF ACCOUNT DEBITED,AMOUNT,AND COMMENTS SEPARATED BY COMMAS:
iam done
OK GOODBYE
W
Figure 5: The object of
much of this program ac-
tivity is filling out IRS
Schedule C for your small
business.
after Form 1040 Schedule C (figure 5), but
could produce Form 1065 for partnerships
with minor changes. As is fairly obvious to
those who can wade their way through the
governmentese, what we have to do here is
state all income and then subtract expenses.
The accounts which we have been working
with will do this on what is called an accrual
basis, which is to say future expenses and
revenues are included if they are certain and
we know how much money is involved. For
example, if we have charge customers, we
include what they are scheduled to pay us in
revenues. For a small business it is often
better to file a tax return on the cash basis in
which only cash in is considered revenue and
cash out is considered expense. This system
can prepare cash basis returns too; one must
eliminate receivables, payables, prepaid ex-
penses and materials and supplies not yet
part of cost of goods sold. The effect of all
of these should be taken out of the revenue
and expense accounts too,
That’s the basic system. Using this system
alone would be a pretty respectable account-
ing setup for a smal! business. But as long as
we’re using a personal microcomputer, we
might think of adding a few bells and
whistles. These would pretty much depend
on individual wants. We could have the
computer automatically calculate FICA de-
ductions when payroll expense is debited.
We might also have the machine figure our
depreciation and amortization schedules for
GLOSSARY
Accrual: Including payments and receipts in the
future.
Check reconciliation: Accounting buzzword for
balancing a checkbook.
Credit (CR): An addition to the righthand side of
the balance sheet or to income.
Debit (DR): An addition to the lefthand side of
the balance sheet or to an expense.
Journal: The accounting equivalent of a check
register.
Ledger: Book or file which contains the totals
from the journal broken down by categories.
Payables: Amounts which will have to be paid in
the future.
Pro forma: Buzzword used to describe reports
which show how things might be or might have
been rather than what they are.
Proprietorship: A one man business; one owner.
Receivables: Amounts which are not yet on hand
in cash but which will definitely be coming in in
the near future.
us. For this we would need (for each item or
class of items) initial value, estimated life
and age. For tax purposes we would want to
get our annual depreciation by taking two
divided by the life of the object and multi-
plying the total times the remaining value. In
more symbolic fori
(2/total life)*(initial — depreciation).
This would give us the depreciation to date
and the amount for this year, both of which
are needed for the flip side of the tax form.
We could also do forecasting with the
system. For this we would want an inter-
active program which would ask for esti-
mated expenses and receipts in afl the
different categories for x number of months.
Then we would prepare a (pro forma)
balance sheet for the end of the period if our
predictions were correct, so that we could
see where things would stand if the predic-
tions came true. It could also prepare a
month by month schedule to show whether
the firm would have enough on hand to
meet projected outflows, This is called a
cash budget, and is quite a handy thing to
have since it enables you to forecast cash
shortages far enough in advance to do
something about them, and also to compare
the results of different courses of action.
And there’s the system. While not very
fancy from either an accountant’s or a
system designer’s point of view, it ought to
be enough to handle much of the record-
keeping for those firms on the other end of
the spectrum from GM, IBM and ITT. It
might be too that the availability of a few
business oriented systems like this will help
increase the sales of microcomputers and
bring the prices down even more through
mass production.™
REFERENCES
1. Accounting Essentials, Margolis, Wiley and Sons
1972.
2. Elementary Accounting, College Outline Series
3. Management Accounting, Anthony and Reece,
Irwin, Inc, 1975 (Note: this is a college
accounting textbook — heavy reading).
4. Recordkeeping for a Small Business, |RS #583,
1976.
5. Tax Guide for Small Business, IRS #334, 1976
(complete handbook).
6. Tax Information on Accounting Periods and
Methods, \RS #538, 1975.
The last three are available free from any IRS
office.
MEET
THE DIGITAL
GROUP
If you're taking time to read
this ad, we already know a thing or two
about you. We know you're interested in
devouring everything you can get your hands on that
deals with microcomputer systems, and we also figure you're
‘out there shopping around . . . looking for the most sensible pro-
ducts to fit your needs and your budget.
That's why we think you should get to know us.
We're the Digital Group, a relatively small, 18-month-old organ-
ization obstinately dedicated to providing quality in every product
we offer. You may have already heard a little something about us
from a friend — our reputation does seem to be getting around
quickly, even though we've never advertised before.
We think it’s due to a number of important factors: state-of-the
art designs, a really complete systems philosophy, unexcetled quality,
reasonable software, three-week delivery, and no pre-announcements
until we're ready to deliver. Our products are not just a gleam in our
designers’ eyes; they are currently being delivered . . . fast!
The Advantages
Here are a few specific advantages of our product line:
@ We offer CPU's from different manufacturers which are inter-
changeable at the CPU card level. That way, your system won't be-
come instantly obsolete with each new design breakthrough. The
major portion of your investment in memory and I/O is protected.
@ Digital Group systems are complete and fully featured, so there's
no need to purchase bits and pieces from different manufacturers.
We have everything you need, but almost any other equipment can be
easily supported, too, thanks to the universal nature of our systems.
@ Our systems are specifically designed to be easy to use. With our
combination of TV, keyboard, and cassette recorder, you have a sys-
tem that is quick, quiet, and inexpensive. To get going merely power
on, load cassette and go!
@ Design shortcuts have been avoided — ali CPU's run at full maxi-
mum rated speed.
The Features
Digital Group Systems — CPU's currently being delivered:
8080A/9080A 6800 6500 by MOS Technology
All are completely interchangeable at the CPU card level. Standard
features with all systems:
Video-based operating system
@ Video/Cassette Interface Card
512 character upper & lower case video interface
100 character/second audio cassette interface
@ CPU Card
2K RAM, Direct Memory Access (DMA)
Vectored Interrupts
256 byte 1702A bootstrap loader
All buffering, CPU dependencies,
and housekeeping circuitry
@ Input/Output Card
Four 8-bit parallel Input ports
Four 8-bit parallel Output ports
| © Motherboard
Prices for standard systems as featured above, start at $425 for 8080
or 6800 and $375 for 6500.
More
Many options, peripherals, expansion capabilities, and accessories
are already available. They include rapid computer-controlled cassette
drives for mass storage, color graphics, memory, I/O, monitors, multi-
ple power supplies, prototyping cards, and others. Software packages
include Tiny BASIC Extended, games, ham radio applications, soft-
ware training cassettes, system packages, and more (even biorhythm).
Sounds neat — now what?
Now that you know a little about who we are and what we're doing,
we need to know more about you. In order for us to get more infor-
mation to you, please take a few seconds and fill in our mailing list
coupon. We think you'll be pleased with what you get back.
Ee eT)
I THE DIGITAL GROUP, Inc.
P.O, Box 6528
4 fl Denver, Colorado 80206
mmm (303) 861-1686
OK, I'd like to get to know you guys better. Send me the whole
package!
Name
Address
City/State/Zip
SS
Photo 1: Here is a pair of the new mN601 microNOVA chips which come in
40 pin dual in line ceramic packages. The performance of the microNOVA
processor is quite good as microcomputers go. The 16 bit accumulator to
accumulator addition time is quoted as 2.4 ws, and the accumulator load time
is quoted as 2.9 ps. This compares very favorably with the original Data
General NOVA minicomputer performance of several years ago.
14
16 Bits Doth a General Purpose Minicomputer Make
A new option in the high performance 16
bit microcomputer field has now arrived on
the scene. This is the Data General micro-
NOVA, introduced early in March as BYTE’s
June issue went to the press. Here is another
instance of a widely available minicomputer
architecture being made available in the
form of a relatively inexpensive micro-
computer,
For those who are new to the computer
field, the Data General NOVA line of mini-
computers is one of the oldest and most
widely used products in the conventional
minicomputer product area. NOVAs are
available with performance which now
ranges from the microcomputer chip level to
the complete general purpose data pro-
cessing systems represented by the top of
the line ECLIPSE computer. NOVAs have
long been an option used by persons who
purchased minicomputers as combination
business/pleasure computers, and the new
microNOVA product will expand this area
of use. Based on the product description
information supplied by Data General, here
is a summary of the microNOVA product’s
semiconductor line:
mN601: 40 pin package NMOS central
processor. The full NOVA instruction archi-
tecture is implemented in a single chip
design, which also includes several additional
features not generally found in NOVA
computers:
© hardware stack and frame pointer
@ SAVE and RETURN instructions for
efficient subroutine linkages
© 16 bit hardware multiply and divide
© real time clock
© memory management logic: memory
Photo 2: One of the
simplest systems products
above the chip set level is
the microNOVA computer
on a board product, Model
8563. This version of the
microNOVA one board
computer includes 4K
words of semiconductor
memory and the ability to
run software accumulated
during Data General's
eight year history with the
NOVA computer line.
control, timing and hidden refresh
logic for dynamic RAMs.
© device data channel contro!
mN603: 40 pin package, NMOS, IO
controller. This is an integrated circuit de-
signed to implement the standard NOVA 10.
instruction set via DMA operations.
System Buffer Elements: A family of
several integrated circuits designed to pro-
vide system expansion capabilities.
Data General provides a fully integrated line
of hardware packaging and software support
to accompany this microNOVA system.
Data General primarily orients its products
towards the OEM and systems integration
markets, so this product will probably prove
most attractive to a fairly sophisticated
personal computing user, or to the person
who works with OEM computing as part of
his or her professional activities. But for
those who know how to specify and pur-
chase a minicomputer system, a floppy disk
based microNOVA system with BASIC or
FORTRAN capabilities could prove to be a
quite powerful personal computing system
useful for both business and pleasure
pursuits.
Data General Corporation is located in
Southboro MA 01772. Sales and service
offices are located in major cities.=
Photo 3: For the do it yourself systems house, Data General provides a
complete line of modular components which can be integrated to form a
microNOVA system. One of the most interesting characteristics of the
microNOVAs integrated to the minicomputer level is a ‘Programmer's
Helper” remote console packaged in a calculator style case at the end of a
ribbon cable. The console is shown in its storage position in the front panel
assembly at the center of this picture,
MODEL CC-7 SPECIFICATIONS:
A. Recording Mode: Tape saturation binary.
This is not an FSK or Home type recorder.
No woice capability. No Modem. (NRZ)
B, Two channels (1) Clock, (2) Data. OR, Two
data channels providing four (4) tracks on
the cassette, Can also be used for Bi-Phase,
Manchester codes etc.
Inputs: Two (2). Will accept TTY, TTL or
RS 232 digital.
Outputs: Two (2). Board changeable from
RS 232 to TTY or TTL digital.
Runs at 2400 baud or less. Synchronous or
Asynchronous. Runs at 4800 baud or less,
Synchronous or Asynchronous. Runs at
3.1"'/sec. Speed regulation + 5%
9 9
F. Compatability: Will interface any computer
or terminal with a serial 1/0. (Altair, Sphere,
M6800, POPS, LSI 11, etc.)
G. Other Data: (110-220 V), (50-60 Hz); 3
Watts total; UL listed 955D; three wire line
cord; on/off switch; audio, meter and light
‘operation monitors, Remote control of mo-
tor optional, Four foot, seven conductor
remoting cable provided. Uses high grade
audio cassettes,
. Warrantee: 90 days. All units tested at 110
and 2400 baud before shipment. Test cas-
sette with 8080 software program included,
This cassette was recorded and played back
during quality control,
ALSO AVAILABLE: MODEL CC-7A with vari-
able speed motor. Uses electronic speed contro!
at 4" sec. or less, Regulation + .2%
Runs at 4800 baud Synchronous or Asynchro-
nous without external circuitry.
Recommended for quantity users who ex-
change tapes. Comes with speed adjusting tape
to set exact speed,
=
DIGITAL DATA RECORDER $149.95
FOR COMPUTER or TELETYPE USE,
Uses the industry standard tape satura-
NOW AVAILABLE
RECORD/PLAYBACK AMPLIFIER KIT
This expanded version of our Computer
Aid board can be used with your own deck
{cassette or reel to reel), Go to 9600 baud
‘on reel to reel with suitable heads, Digital
in, digital out, serial format. Kit includes all
parts, case and power supply. $59.95
COMING SOON — IN KIT FORM
Any baud rate up to 4800
* 1/0 Board 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, thus providing
Turnkey Operation, For any 8 bit compu-
tion method to beat all FSK systems ten to
‘one. No modems or FSK decoders required.
Loads 8K of memory in 17 seconds. This
recorder, using high grade audio cassettes,
enables you to back up your computer by
toading and dumping programs and data fast
as you go, thus enabling you to get by with
less memory. Can be software controlled.
Master Charge & BankAmericard accepted.
On orders for Recorders and Kits please add
$2.00 for Shipping & Handling.
(N.J. Residents add 5% Sales Tax)
NATIONAL multiplex
CORPORATION
3474 Rand Avenue, Box 288
South Plainfield, New Jersey 07080
(201) 561-3600
ter, Automatic semi DMA operation of
cassettes with automatic return to termi-
nal a 3810 board for a complete COS with
the Altair or Imsai.
$100 Kit. $150.00 wired and tested.
* Hexadecimal or Octal Keyboard — Load
Programs direct from keyboards’ 20 keys
and verifying display. Does not use Com-
puter 1/0, Can be wired Octal or Hex. —
‘Your choice,
* Interested in these? Send your name and
address for brochure when released.
Send One dollar for Cassette Operating and
Maintenance Manual with Schematics and
Software control data for 8080 and 6800.
Also applies to Kit above. (Postpaid)
15
Build a Television Display
C W Gantt Jr
6 Fieldpoint Rd
Aurora IL 60538
As a small system expands and becomes
more sophisticated, the limiting factor is
often the speed of input and output (10). In
addition to being noisy, mechanical, and
paper consuming, the slow clacking of a
TTY may account for a large percentage of
system time. Among the alternatives, the
display of characters on a standard TV set is
among the simplest and most economical
methods,
This TV display (TVD) is designed to
take data from 512 bytes of memory and
convert it into a video signal with 16 lines of
32 characters. This can be used to feed a
black and white or color TV. The data in the
TVD memory is in a six bit ASCII subset
and is updated by the CPU to create the
desired display. The processor addresses the
TVD memory just as it docs any other
portion of memory and can actually execute
instructions from the TVD memory if so
programmed. Of course, some provisions
FIRST LINE, SECOND FRAME
FIRST LINE,
FIRST FRAME
HORIZONTAL
RETRACE \
—~
HORIZONTAL
sone
Starrs
vertican
ReTRACE | ~
onizon aL,
SyanTs
vertican
Sine SIMPLIFIED INTERLACED RASTER SCAN
Figure 1: This shows how the electron beam is moved during an interlaced
scan in a television monitor. The dashed lines are quick retrace motions which
are normally invisible. The solid lines are periods during which the display
presents video information controlling brightness on the tube face.
16
must be made to prevent the CPU and TVD
from simultaneously accessing the TVD
memory (more about this below).
As designed, the TVD is strictly a display
device with the central processor of your
system doing all housekeeping (entering
characters, etc). This approach simplifies the
hardware at the expense of extra software,
but also allows the user to take advantage of
the flexibility offered by software data
manipulation and formatting.
At present one TVD is up and running in
my system, but the memory and central
processor interfaces are incomplete. The
remainder of this article therefore empha-
sizes the TVD design and only offers some
basic ideas on interfacing to processors.
Although simple items such as the power
supply and oscillators have been omitted,
the information furnished should be suffi-
cient for the more experienced readers to
assemble a working version. The straight
forward TVD design allows easy modifica-
tion to meet individual system requirements,
Television Raster Scanning
Before going too deeply into operation of
the TVD, a review of the basic television
scanning system will clarify some terms with
which pure digital designers may not be
familiar.
A television picture is formed by scanning
an electron beam across the face of the
picture tube, A TV line is one sweep of the
electron beam from the left of the picture
tube to the right (as viewed from the front
of the set) and is initiated by the horizontal
sync (see figure 1). The horizontal syne
pulse causes termination of a line, horizontal
retrace of the electron beam back to the left
side of the screen, and the start of a new
line. During the time of retrace the beam is
blanked so that the retrace will not be seen.
The time allotted for each complete line
(including retrace) is 63.5 microseconds. Of
this about 16% is taken by retrace, leaving
53.5 us of usable line. Video information in
the form of a voltage fed to the picture tube
controls the brightness of the beam as it is
swept across the screen.
To trace out a frame, the electron beam is
slowly deflected from the top of the screen
to the bottom as it rapidly sweeps horizontal
fines. This vertical sweep is allotted 16.67
milliseconds (60 Hz) so there are 262' lines
in one frame. In a manner similar to the
horizontal sync, the vertical sync causes the
beam to be returned to the top of the screen
to start a new frame. The beam is blanked
during vertical retrace which takes about
1250 us. This leaves 242 usable lines in each
frame.
A complete picture is formed by two
consecutive frames that are interlaced with
each other. Interlacing means that the hori-
zontal lines of one frame fit in between the
horizontal lines of the other frame. The
result is 30 complete pictures every second
of about 484 usable (525 total) lines each.
Because of the interlacing, however, the
screen is illuminated at a 60 Hz rate. This
eliminates an objectionable “flicker” that
would be seen if the screen were only
scanned at a 30 Hz rate.
The TV signal received at the antenna
terminals contains the information needed
to generate the vertical and horizontal sync,
blanking, and video. The TVD simulates a
TV signal by supplying a composite wave
form containing the same information nor-
mally present except sound. The full
schematic of this TVD design (except
memory) is shown in figure 2.
Character Generation
The scanning nature of the TV raster
requires that the video (or brightness) infor-
mation be sent in serial form to control the
electron beam as it sweeps lines across the _
screen. Suppose, for example, that the
character “‘H” is to be displayed as shown in
figure 3. The first line can be represented as
10001, ones signifying light spots (dots) and
zeros signifying dark spots. The remaining
six lines can similarly be represented as a
series of dots and dark spaces. When the
seven lines are displayed one above the
other, the character “‘H” is seen.
The tedious job of deciding where to put
the dots (ones versus zeros) to generate a
given character is done by the 2513 read
only memory, IC14. It has been mask
programmed at the factory with the bit
patterns required for 64 separate five by
seven dot matrix characters. The 2513 sup-
plies five bits of parallel output data repre-
senting one line of a given character. It
requires the six bit ASCII subset code of the
character and the three bit line number as
inputs. The five bit parallel output of the
2513 is converted to serial data by the
74165 shift register, 1C15. To produce one
line of video, five bits are required for each
character in the line, plus spacing bits. Note
7
Photo 1; This is a test
display pattern generated
by connecting the low
order outputs of the char-
acter and line counters to
the character generator
ROM'’s 6 input bits. The
\result presents every com-
bination of the character
set, so every character pat-
tern is visible on the
screen.
+8
SYSTEM
ADDRESS BUS
—
+5 36 1 2
+5
TOP OF PAGE
TOs : K
6
CINE AS AG AT AB COUNTER
4
wd sf ol sl
25
IcHaracTeR 2 4 vind
lad
TP6
UP 1c2 car 2
1c3 CARI
74192
rR 74193
A 8 cp
:
PAGE,
ONE SHOT
al el 7]
ROW
Ic13 PIN IS
MEM CTL
ADDRESS TO RAM
‘MEMORY BUSY
‘O=MEMORY AVAIL, *—
1C13 PINIZ
SYSTEM
ADDRESS BUS Me
——s c
Jo.1U09 pub Auy1n34J9 Uo}JoJauab asnq alUdt} ay] JO Sj/DJaP Sapnjrut wo.iboip sty, ‘Avjdsig AL ay) Jo wivsbojg 2oWAYIS :Z ainbly
*p ainbly ul Apjonjdaguos uMoys synd1J9 Kiowaul ayy) JO Buljim pal{oyap SYWIO If ‘uol.iauab Avjdsip uolsjaajay 404 2160p
a
DOT COUNTER 9
Ice
8
7490 IRccK ica RES 7400],
; 7492
lAcLK
10 MHz
CLOCK No ctky
[3 a) ls mnz
onl
+8
1248 MEM. CTL. 16. s
AQ AT A2 AS aa +9
15] iL iol oft
+5
ABCD OL
ja o
1c
74193 pall
ra
&
A Bo
32. ey
ad
ADORESS TO RAM
abe
CHARACTER
COUNTER
82 83
L=END OF VIDEO LINE
2MHz if ¥%s
iCi0o ONE SHOT ¢ 1ob
3 6
7400 5} 7400
y|270 ¥
7
RAM
$s DATA
z
COMPOSITE
SYNC
Icl6e TPS
=
=
owxfeeE0 191
orzofzeZo 9191
zoxhse)
Eo
207. 0N V2W
i
cL sHiET [—
rar)
74165
x ouwovad
sat)
ta] 151 16)
1 15T 16)
ROW FROM
Ic2, 74192
ea
RFC
T= BLANK
COMPOSITE
BLANKING
‘O=BLANK
VCs. PINIA
220, MODULATED.
5 RF OUT
Power Supply Connections for Integrated Circuits
Type
yar2i
74192
74193
7490
SV 12
No.
Ico
Ic10
1c
112
1c13
1c14
1c15
tc16
Type
7492
7400
74193,
74193,
MM5320
2513
74165
7404
6
16
8
24
16
“4
+8V GND SV -12v
oo.
1
nae .oon
8
that the TVD generates two identical inter-
laced frames to make a complete picture.
The result is that each character is actually
14 lines high.
Sync Generator
The MM5320 sync generator chip, IC13,
uses a single 2.0 MHz input to produce all
the syne and blanking signals needed for a
525 line interlaced raster. The same logic
could be wired using TTL but would require
considerably more hardware and probably
cost just as much. (The 5320 runs $4.95 ppd
from NEXUS Trading Co, Box 3357, San
Leandro CA 94578.) The only disadvantage
fund thus far with the 5320 is that it
prefers a square wave 2 MHz source. To this
end the 100 nanoseconds pulse from the
7490 “D” output is squared using two 7400
sections of 1C10 as a oneshot.
Line Generation
Horizontal drive (coincident with hori-
zontal sync) from the 5320 triggers a 74121
oneshot, IC1, to delay the start of each line
and establish the left hand margin on the
screen. The output of the oneshot serves
three purposes:
1. Triggers the 74192 row counter, 1C2.
2. Resets the 74193 character counters,
1C11 and 1C12.
3, Inhibits the dot counter, 1C9, until the
start of the line.
When the line oneshot output pulse ends,
the dot counter starts counting at S MHz. It
resets itself every seventh count to allow for
the five dots of the character plus a two dot
space between characters. When the dot
counter resets, it also loads the next charac-
ter into the 74165 shift register, IC15. (The
very first character of each line is all zeros
since the 74165 is not loaded until the dot
counter resets the first time.) The 74165
shifts out the two dot space and the five dot
character at a 5 MHz rate. As each character
is loaded, the 74193 character counter incre-
ments by one to change the address for the
RAM to the next character. When the 32nd
load pulse occurs, the 5 MHz input to the
dot counter is inhibited using the “B”
output of the second 74193 character
counter. The 74165 continues to shift out
the 32nd (last) character and then shifts out
a steady zero. When the character counters
are reset at the start of the next line, the
process repeats itself.
Line Counter
The 74192, IC2, counts each video line dis-
played. It counts to 10 for the seven lines of
character information plus a three line space.
BIT (DOT)
43 2 I
LINE | 10001
(ROW)
2 10001
3 10001
4 mi
5 WSS tooo1
6 10001
7 10001
5 DOT WIDE BY 7 DOT
HIGH CHARACTER
The A”, “B”’, and “C’’ outputs control the
row inputs to the 2513 character generator
chip. The first video line is all zeros since the
row input to the 2513 is zero. Lines 9 and
10 are blanked using output “D” of the
74192, resulting in a total of three lines
blanked. At the end of each complete line of
characters, the 74193 line counter, 1C3,
increments by one until, at the end of the
16th line, a carry pulse is produced. This
carry pulse resets the 7490, ICS, and signi-
fies the end of a page. Output “A” of the
7490 is used to inhibit the 7492 dot counter
and prevent the first line from being
repeated at the bottom of the page.
Page Control
The 7490, ICS, stays reset until the top
of the next page. Output “‘A’’ can be used to
tell the memory control circuits that the
TVD is not using the memory so that any
required updates may be made by the CPU.
Output “A” also inhibits the “B Clock”
input via the 7410. The “D” output inhibits
the line oneshot.
When a vertical drive pulse (coincident
with vertical sync) triggers the 74121 page
oneshot, IC6, the TV set syncs to the top of
the next frame. The page oneshot delays the
start of the first line to establish the top
margin. At the end of the oneshot’s output,
IC5, bit ‘A’ is clocked to a one. This tells
the memory control that the TVD needs to
resume control of the memory address and
also enables the ICS “B Clock” input via the
7410, 1C7. The ‘“‘B” section of the IC5 then
proceeds to count color burst gate pulses to
give the memory time to complete any
access already in progress. The color burst
gate was used only because it was convenient
and occurs at the same rate as the horizontal
drive — the horizontal drive could be used at
the expense of a buffer since the 5320 can
19
Figure 3: An example of a
dot matrix pattern gen-
erated by the television
display.
ADDRESS BUS
——~
S LINES SELECT
DECODE
TV
DISPLAY
T_oap
oaTA ADDRESS le—— READ / WRITE
PATA 0 AVAILABLE mem NeMoRY cpu
RAM > READ/WRITE | CTL READY
6 ORB LINES] 9 LINES ane
fbi x6 (oR 8)
RAM
CONTROL
f INFERe ACES
TRIZSTATE SUINES
BUFFER ate gus
Figure 4: System Diagram. This figure details how the TV display fits into a
central processor’s memory address space. The low order 9 lines of address go
directly to the line and character counters of the TVD; the memory array is
addressed by the outputs of the counters, which are connected logically to
the address bus when the load line demands central processor access. The high
order bits of the processor’s address are decoded separately and are used to
enable processor access if the TV display portion of address space is
referenced,
only drive one TTL load per output. When
output ‘‘C’’ of the ICS goes high, the line
counters are reset. When output ‘‘D’” goes
high the ‘'B clock” is inhibited via IC7b, and
the line oneshot is enabled. This allows the
first line to start.
Composite Video Generation
The video and sync are independently
adjusted and then added to produce com-
posite video. This can be piped directly into
a set (be sure not to touch a hot chassis!) or
used to modulate a low power RF source. A
signal generator works fine for tests. (See
“Television Interface’ by Don Lancaster,
page 20, October 1975 BYTE, for a
thorough discussion of the various tricks to
improve the interface.)
Memory Interface
Figure 4 illustrates how the TVD fits into
a larger system. It is intended that the
address outputs of the 74193 character and
line counters (IC3 and C11) be hard wired
to the address lines of a 512 or 1 K by 6
static random access memory using 2102s or
similar parts. The data outputs of low order
6 bits of this memory are the ASCII charac-
ter select inputs to the 2513 character
generator, 1C14, and can be gated back to
your system’s data bus if you want the CPU
to be able to read from the RAM. (Of
course, a 512 by 8 memory would be needed
if the CPU is to be able to use the RAM for
other tasks.) The data inputs of the RAM tie
20
to the data bus to allow the CPU to write
into the RAM.
To avoid breaking up the picture on the
display during access, the memory control
logic must use the “A” output of ICS to tell
when the CPU can use the RAM and when it
must signal a busy to the CPU at the start of
a page. There is more than ample time
between the “A” output and the line
counter reset to finish any access in progress.
To use this feature, the memory busy line
must be wired to your processor’s ‘‘memory
ready” line (possibly through an inverter if
the logic of your particular computet i%-
quires it). This method will work well for
any processor, like the 8008 or 8080, which
allows unlimited “memory busy” delays.
However, for dynamic processors such as the
6800, the maximum processor delay time of
about 5 us dictates use of an alternative
approach. One simple approach is to ignore
the effect of memory access on the display.
The result will be a short glitch in the
display corresponding to each computer
access. The nature of the glitch will be a
resetting of the line and character counters
to a new location, causing a scrambling of
the display for the remainder of the current
frame. A second approach is to wire the
memory ready line into a single bit input
port which can be tested as a status flag: If
the line indicates a retrace, then the memory
access software for the display will allow an
update to occur.
The CPU addresses the RAM through the
character and line counters (IC3 and IC11)
by tying their data inputs to the system
address bus and using the load control of pin
11. The 74193s can also be used as tem-
porary storage for the address in a system
with a common address and data bus. Note
that the TVD does not interfere with CPU
access to the remainder of the system’s
memory at any time and only delays the
CPU by one of the techniques discussed
above if it tries to access the TVD RAM
while a page is being displayed. The CPU has
the entire vertical retrace to make updates at
once every 16.67 milliseconds.
Lacking a memory for my initial testing,
the 2513 data inputs were temporarily tied
to the 74193 address outputs (2513 PIN 17
to character counter PIN 3, etc) to display
the complete 2513 repertoire every two lines
as in photo 1. The 74193 load lines must
also be connected to a ‘‘one.””
Modifications and Adjustments
1. There is one known bug so far and no
doubt more will show up when the TVD is
integrated into a system. The 7490 can, on
power up, hang in state with both the “C’’
and “D” outputs a one. This state con-
tinuously resets the 74192 row counter and
is nonrecoverable. A cure would be to
power-on-reset the 7490 “R9” which does
produce a recoverable state.
2. As mentioned before, the 5320 likes a
square wave input, so check the 7400
imitation of 1C10a and b oneshot, or better
yet use a 74121,
3. Using a separate oscillator for charac-
ter generation (5 MHz) would allow adjust-
able character width, but watch out for any
interaction with the 2 MHz — it shows up as
a torn, garbled display, as will most sync or
jitter problems. A crystal is best. (It is
possible to use 12 MHz and a 7492 in place
of IC8 to get 6 MHz for the characters and
2.MHz for the 5320.)
4, The prototype is wire wrapped on a
4% by 6 inch (11.43 by 15.24 cm) vector
board (see photo 2) with room to spare,
although a slightly larger board would
accommodate more interface goofs. Fulp’s
corollary says things like this always get
bigger. Also, the 44 pin connector planned
for the prototype is not large enough count-
ing the additional RAM address and data
lines.
5. The modulation levels for the radio
frequency modulator are fairly critical and
misadjustment of sync or video levels will
cause a torn display. Try setting video level
control for 1/2 of maximum and sync for
3/4 of maximum.
6. Harmonics from the 10 MHz tend to
leak into the TV so pick a higher channel (5
or 6) if herringbone is noticeable on your
display.
7. There are many causes for ghosting
and smeared characters including VSWR
{voltage standing wave ratio) on the cable to
the TV, misadjusted fine tuning, or a narrow
band width TV.
8. Character and line spacing can be
altered by modifying the dot and row
counters, respectively, to reset at different
counts. Be careful though, or the display will
not fit on the screen.
9. The unused bits C and D of the second
74193 character counter, 1C12, may be used
for the 512 and 1024 bits if a two or four
page RAM is desired. Some method of
controlling these bits during display time is
needed to select the page.
10. A light pen could strobe the present
RAM address into a latch to be read by the
CPU via the data bus.
11. The 5320 provides color sync gating
so how about color characters? The extra 2
bits available with an 8 bit wide RAM can
provide software control of many goodies
(like brightness, color, blinking, underlining,
black on white, etc).
The TVD as described can be used to
display one or more pages of ASCII charac-
ters and opens up many possibilities of
modernizing the IO portion of a small
system. My home brew computer will be a
complete microcomputer chip based system,
designed with the TVD as the main man
machine interface.@
21
Photo 2: Prototype Cir-
cuit. The large socket is
for the character genera-
tor. Test points are the 6
small rectangular objects
along the left hand side of
the board. A 7812 regula-
tor in a plastic package is
to the right of the charac-
ter generator, and is used
to provide the —12 V bias
for the ROM. A zener
diode with a dropping re-
sistor is used to create the
—5 V bias required for the
ROM.
Programming for the Beginner
A Structured Start
Ronald T Herman
Simpson Rd
RFD 1 Box 125
Windham NH 03087
A program can be viewed
as an edifice built from the
bricks of SEQUENCE
blocks, and the mortar of
IFTHENELSE, DOW-
HILE, DOUNTIL and
SELECT blocks.
For a number of years now the field of
computer programming has been moving
from the realm of a black art to an organized
and systematic process. A number of pro-
gramming techniques have evolved during
this change. This article will present the
basics of a technique known as structured,
top down programming. In the process of
applying these techniques in my own work,
it occurred to me that the basic concepts
could be useful to those just learning to
program, not to mention the veteran hackers
in the crowd. If learned at an early stage,
these techniques can lead to more rapid and
sound development of one’s programming
skills.
A structured approach to program devel-
opment has among its virtues the following
points:
e It allows the novice programmer to get
acquainted with programming logic
without having to be concerned with a
specific machine or programming lan-
guage. It allows him to grasp the flow
of a program without worrying about
bits and bytes.
e Followed correctly, structuring can
lead to a program that is relatively free
from logical errors the first time it is
coded and relatively easy to debug
once it is run on the machine.
e Pseudo code, a byproduct of struc-
turing, allows a means of exchanging
program ideas with others, regardless
of the machine with which they might
be familiar.
22
e Pseudo code provides a convenient
alternative to flow charts that can be
incorporated into a program listing as
comments for future reference and
explanation.
This process of getting things done in an
organized fashion has its drawbacks. How-
ever, most of these seem to be psychological.
Properly applied structured technology
tends to minimize one of the facets of
programming that has attracted many in the
past: the chance to see how cleverly and
concisely one can write a software routine.
This seems to have been replaced by the
challenge of trying to write a routine in a
straightforward manner and at the same time
trying to rigidly follow a set of fairly simple
rules.
What will be presented in this article are
some of the basic building blocks of struc-
tured programming and an example illus-
trating the design of a simple program using
these blocks.
The Building Blocks of Structure
So much for the sales pitch. What then is
structuring? Some number of years ago it
was shown that a program could be built
from a set of simple building blocks all
having the property of one input and one
output. While not everyone agrees on what
composes this set of building blocks, the one
in, one out property is common to all.
Presented here are a few of the most
common examples that should cover most
situations.
The SEQUENCE Block
Probably the simplest (and most trivial)
unit of structure is the SEQUENCE. This is
illustrated in figure 1 and is nothing more
than one process performed after another.
The IFTHENELSE Block
One of the powers of a computing ma-
chine is to make a decision based ona set of
conditions and take a specific action as a
result of that decision. This capability is
represented as the IFTHENELSE block
shown in figure 2. In the figure, “p” is an
expression or some set of conditions. In a
checking account, for example, one adds
deposits and subtracts checks written. An
IFTHENELSE statement of this fact would
appear as follows:
IF (transaction 19 2 deposit) THEN
i (add amount of trangaction to balance)
ELSE (eubtract anount of transaction from balance)
ENDIF
Here is our first example of writing a
program step in a machine independent
“pseudo code.” The format of pseudo code
is mostly a matter of taste. The punctuation
is optional, but the indentation is necessary
for readability where many complex
IFTHENELSE decisions are grouped to-
gether. Some people use asterisks (*) instead
of colons (:) to mark margins and some omit
the parentheses around descriptive phrases.
The ENDIF helps clarify the limit of opera-
tions within a more complex statement.
Each statement line represents a process to
be performed or a condition to be tested.
The statement or condition preferably
should not be continued on another line.
The DOWHILE Block
The decision making capability of com-
puters, combined with the ability to change
the order in which instructions are executed,
provides an even more powerful feature —
the ability to repeat a calculation or series of
operations many times. This capability is
represented in the DOWHILE building block
shown in figure 3. The DOWHILE is just a
special application of the IFTHENELSE
given earlier. In a DOWHILE block, a proc-
ess is done as long as a set of conditions “‘p”
is true. Note that the condition is tested first
before the process is performed. Suppose
you have 10 transactions to update into
your checking account, some checks written
and some deposits. In pseudo code this
becomes:
(set councer to nusber of teanaact ions)
10 WHILE (count ta non zero)
(process the transact ion)
(decrement the count)
exoD0
Note that the DOWHILE is terminated by an
ENDDO. The “(process transaction)” state-
ment could be the IFTHENELSE given
above. If combined, the result would be as
follows:
(wet counter to number of transactions)
Do MAILE (count is non zero)
1 ELSE (subtract asount of transaction from balance)
ENDIF
(decrement the count)
ENDD0
The DOUNTIL Block
The DOUNTIL block is shown in figure
4. It differs from the DOWHILE only
because the condition “p”’ is tested after the
process is performed. This can simplify the
writing of machine code from pseudo code.
Suppose one wanted to read characters from
a keyboard until a carriage return is en-
countered. It could be done with a
DOWHILE by saving the last character read
as follows:
(clear last character read)
DO WHILE (ase character not a carriage return)
(get a character from the keyboard)
2 (eave character in last character read)
eNpD0
SEQUENCE
;
PROCESS
8
END
IETHENELSE
STRUCTURE
THEN
PROCESS PROCESS
A 8
23
Using structured program-
ming concepts, many
logical errors and bugs can
be caught at an early stage
in the design process.
Figure 1: The SE
QUENCE structure is a
series of self contained
processing steps which are
executed one after anoth-
er. Flow in this diagram
begins at the top and pro-
ceeds down the diagram,
The number of steps de-
fined in a SEQUENCE
block is arbitrary; the
example here shows two
steps, A and B. In this
article’s figures, the nota-
tion BEGIN and END is
used to mark the well de-
fined extrance and exit
points of the structures
depicted. (NOTE: Proces-
ses A and B may be more
complex combinations of
the building blocks in all
of these figures.)
Figure 2: The IFTHEN-
ELSE structure is a con-
ditional test and two alter-
native SEQUENCE struc-
tures. The THEN alter-
native is executed if the
condition, P, is found to
be true. In this illustration,
the THEN alternative is
shown as a one step SE-
QUENCE structure called
B. The ELSE alternative is
executed if the condition
is found to be false. In this
itustration, the ELSE al-
ternative is shown as a one
step SEQUENCE structure
called A.
DOWHILE
STRUCTURE
DOUNTIL
STRUCTURE
PROCESS.
A
Figure 5: The SELECT
structure is a more com-
prehensive version of the
IFTHENELSE concept; it
allows data to be tested
for multiple cases. The re-
sult is the picking of one
of “N”’ cases, In this exam-
ple, N is 3, so there are
three SEQUENCE struc-
tures which might be exe-
cuted depending upon the
case determination.
PROCESS
A
Figure 3: The DOWHILE structure is a
looping form which repeats a specified SE-
QUENCE structure over and over again as
long as a condition, P, is true. DOWHILE
tests the condition prior to executing the
SEQUENCE structure for the first time.
Thus in this example, the SEQUENCE struc-
ture A could be executed 0, 1, 2...N
times, depending upon how soon the condi-
tion P becomes false as a result of A’s work.
Figure 4: The DOUNTIL structure is anoth-
er looping form which repeats a specified
SEQUENCE structure over and over again
until the condition, P, is true. DOUNTIL, in
contrast lo DOWHILE, tests the condition
after executing the SEQUENCE structure.
Thus in this example, the SEQUENCE struc-
lure A could be executed 1, 2, 3... N times
depending upon how soon the condition P
becomes true as a result of A’s work,
SELECT
STRUCTURE
SS 4
| DETERMINE |
A case i
(se
PROCESS
a
case 2 PROCESS
8
CASE 3 PROCESS
c
24
This would require an extra instruction or
two when translated into machine code,
since the “last character read” must first be
initialized to contain something other than a
carriage return. [Implemented as a DOUNTIL
it is simply:
The SELECT Block
Sometimes it is necessary to select one of
many possible processes based on some
quantity that may take on any number of
values. Suppose, in addition to updating
your checking account balance, you decided
to keep a tally of money spent on each of
several budget items such as food, medical,
car, electric and so forth. This could be done
with a string of IFTHENELSEs as follows on
the next page. Two possible methods are
shown but both are somewhat awkward to
follow.
IF (check was veitten to super market) THEN
(244 anount to food total)
IF (check vas veteten to doctor) THEN
(add anount to medical total)
ELse.
IF (check written to auto repair shop) THE
(add arount to car total)
ELSE
TF (check written to electric company) THEN
: (add anount to electric total)
Alternate method:
(check uritten to super market) THEN
‘add amount to food total)
IF (check written to doctor) THEN
2 (add amount to medical cotal)
ENDIF
TF (check written to auto repair shop) THEN
(adé amount to car total)
ENDIF
IP (check written co electric company) THEN
{add anount to electric total)
ENDIF
A more concise and meaningful way to
describe this process is with the SELECT
block shown in figure 5. Note that although
there are many paths through the block,
there is only one entrance and only one exit.
Our bookkeeping example now becomes:
SELECT (based on vho check written to)
(CASE (written to super marker)
2 (add amount to food total)
CASE (written to doctor)
: (add amount to medical total)
SE (uritten to auto repair shop)
(aad amount to car total)
CASE (uritten Co elect ric company)
2: (add amount to electric coral)
ENDSELECT
These then are the building blocks of a
structured program. Others could be in-
vented, but these should suffice for most
situations. In any case, each should exhibit
one entry point and one exit point. It should
be noted that none of the building blocks
transfer control (jump) into another, never
to return. This so called GOTO is a definite
“no no" in structured programming. All
processes are either done in line or are called
as subroutines that are presented elsewhere.
Frequent jumping around in a program
results in a maze of paths that becomes
difficult to follow and even more difficult to
deal with in the event that a change in one is
necessary.
Building From the Top Down
Earlier when the subject of structure was
intraduced, the term “top down”’ was used.
If you wanted to build a computer, you
could start by getting the processor, then
some memory and |O devices and a power
supply. Then you would have to try to
determine how to connect all the parts
together. On the other hand, you could start
by deciding what the specifications for the
machine are to be, such as word length and
speed, what the IO ports look like and what
controls and devices are to be attached.
From there the problem is to select or design
the components and parts to do the job.
So it is with software. In the past the
tendency has been to first develop the pieces
like Teletype handlers, tape read/write sub-
routines and others. Then the pieces would
be fitted together into a functioning module,
hopefully without having to make any major
changes to the pieces already developed. The
experience of many people in the profes-
sional software field has indicated that this is
not an efficient way to design a software
module. Instead the approach is to start ata
high level of abstraction to describe the basic
function to be performed. From there each
unit of this description is broken into more
detailed modules. Once designed, the pro-
gram is coded and debugged a piece at a time
starting at the topmost level. Subordinate
levels of code are temporarily replaced by
dummy “stubs” which do nothing. Then as
each level is coded and incorporated into the
program, any problems that develop usually
can be isolated to the modules just added.
As an example of this approach and the
use of pseudo code, let us design a simple
editor program, This editor reads a. line of
text from an input device (paper tape reader
or magnetic tape recorder). The line is saved
in memory and displayed on a video monitor
or typed on a Teletype printer. A limited
number of responses from the input key-
board allow changes, deletions, and inser-
tions to be made. Upon completion, the line
is written to the output device (punch or
another magnetic tape recorder). The proc-
ess continues until the end of tape is reached
on the input device. Changes and insertions
are made by typing the character on the
Teletype directly below the input line.
Inserts are indicated by terminating the line
with a carriage return (CR) and changes by a
line feed (LF). The Teletype carriage or
video display cursor is positioned using a
“Control P” character (holding the CON-
TROL key down while striking the “!
key). This is not a sophisticated editor, but
should serve as a good example of how to
use the techniques described.
The topmost abstraction level of the
editor program can be described in pseudo
code as follows:
DO UNTIL (end of input cape)
(get Line from Input and eype on printer)
(get response Line from keyboard, store and echo (t)
IF (only CR or LF entered) THEN
2 _ (do nothing)
ELSE
: IF (last character ts LF) THEN
(do character changes and output 1ine)
ELSE (do character inserts and output Line)
2 ENDIF
ENDIF
ENDDO
This then is our editor in its most abstract
form. Note that an input line is deleted by
entering only a carriage return or line feed.
Now let us refine the description by de-
scribing each process identified above.
Getting a line from the input device
requires turning on the input device, reading
characters, and storing them until a line feed
or carriage return has been recognized. The
stored line is terminated with a zero (null)
character so that the end of the line is more
easily recognized later.
(set inpur Line pointer co first address of Line)
(urn on input device)
DO UNTIL (a LF oF CR is read)
(gee characcer from device)
(Store character @ input line potncer)
(advance input line pointer one posit ton)
Gend character to printer)
DDO
(clear a character at the pointer address)
(eurn off Input device)
Likewise getting the response from the
keyboard is similar except that Control P
characters are echoed as spaces on the
Teletype printer.
(set keyboard Line pointer to first address of Line)
D0 UNTIL (LF or CR ts typed)
(get character from keyboard)
IP (character {8 not a LF or C8) THEN
: (Store character @ keyboard Line pointer)
(advance keyboard Line pointer)
IF (character is aot Control P) THEN
(echo the character on printer)
ELSE (echo a space)
2 ENDIF
ENDIF
ENoDo
(clear a byte @ keyboard line pointer)
Character replaces and inserts are done by
using the Control P characters on the key-
board to indicate where the changes are to
be made. For each Control P character in the
response, an input line character is sent to
the output. When a character other than
Control! P is encountered, it is cither inserted
into the output or replaces a character about
25
For a number of years, the
field of computer program-
ming has been moving
from the realm of a black
art to an organized and
systematic process.
“Top down - structured
programming” is a verit-
able buzzword in the data
processing and computer
science fields.
Structured programming is
a systematic way of think-
ing about processes, the
result of which is a well
designed and under-
standable program specif-
ication,
This article concerns or-
ganizing and planning a
program, which is ex-
pressed in a_ structured
“pseudo code.” The next
step after the plan is
created is to translate the
pseudo code into the de-
tailed machine code of
your personal computer.
to be outputted depending on the last
character from the keyboard (line feed or
carriage return). Thus the replace operation
becomes:
(set Input Line pointer to start of input Line)
(set keyboard Line pointer to start of keyboard line)
(curn on output device)
PO UNTIL (end of keyboard Line)
(get keyboard line character ® keyboard Tine polncer)
TP (character (8 Control P) TH
(get character @ Inout Ite pointer and send to output)
2 _ (echo character on teletype printer)
ELSE (send the keyboard character to the output)
(echo the keyboard character on printer)
ENDIF
{advance keyboard Line pointer)
£ Cadvance input Line potnter)
ENDO
{put out _cest of characters In Input Line)
(turn off output device)
Note that the resulting output is echoed on
the Teletype to enable verification of the
operation.
The insert operation is given below:
(set Input Iine pointer to start of input Line)
(set keyboard Tae pointer to start of kevboard Lae)
(turn on output device)
WO UNTIL Cond of keyboard iIne)
rd
(cranafer character @ faput Line pointer to output)
(echo character on teletype printer)
rest of input line characters)
ff output device)
The routine that “puts out the rest of the
input line characters” is:
PO UNTIL (tnput Line pointer points to a null)
(get character @ toput Line pointer)
IF (character 1s noe a null) THEN
(put character to output device) Z
{echo character on printer)
(advance Input line pointer)
+ ENDIF
ENDO
Finally the routines to get a character
from the input device and keyboard in this
simple system are identical except for the
address of the device referenced.
Do UNTIL (input device ready flag 1s on)
(get input device ready flag)
ENDDO
(get character from device dita port)
The character output and type routines are
likewise the same.
DO UNTIL (output device ready (lag Is on)
(get output device ready flag)
ENDO
(Bend character to output device data port)
We have now arrived at such a level of
detail that the code could be written with-
out much difficulty from the pseudo code
on an almost one for one basis. Each module
except for the top level description could
and probably would be written as a separate
26
subroutine. Note that each module can be
read starting on the first line and ending on
the last. No transfers are made out of any
module to another without returning to the
line following. Modules should be kept short
(no more than a page) so that they can be
read without constantly flipping pages back
and forth.
Conclusion
What has been presented in this article is
a description of a systematic approach to
program design and a means of describing it
so that almost any individual should be able
to understand it. The resulting program
when coded will have been well thought out
and may even have been reviewed and
partially debugged by other individuals not
intimately familiar with the machine upon
which it will ultimately be executed.
Much discussion has occurred about
standards for data exchange between various
computer hobbyists. On a higher level, the
pscudo code approach makes possible a
standard way to exchange program ideas. In
fact, higher level languages have been de-
veloped that, at least in part, resemble the
pseudo code language used here. Using this
approach, programs might be written to
convert pseudo code into machine instruc-
tions for the 8080, 6800, 6502 or other
CPUs as they become available. All hobby-
ists could then share programs in a higher
level language, each doing the necessary
conversion on his own machine.
There are a number of references on the
subject of structured programming. The idea
has been discussed extensively in computer
science circles in recent years, to the point
that “structured programming” has become
a buzz word in the business. This writer is
familiar with the two texts given in the
bibliography. The IBM te
Showing the first 100000 of 394600 characters.