PRINCIPLES OF DIGITAL COMPUTING
Either circuit is capable of adding two binary digits together. The mathematical ”rules”of how to add bits together are intrinsic to the hard-wired logic of the circuits. If we wantedto perform a different arithmetic operation with binary bits, such as multiplication, we would have to construct another circuit. The above circuit designs will only perform one function: add two binary bits together. To make them do something else would take re-wiring, and perhaps different componentry.
In this sense, digital arithmetic circuits aren’t much different from analog arithmetic (operational amplifier) circuits: they do exactly what they’re wired to do, no more and no less. We are not, however, restricted to designing digital computer circuits in this manner. It is possible to embed the mathematical ”rules” for any arithmetic operation in the form of digital data rather than in hard-wired connections between gates. The result is unparalleled flexibility in operation, giving rise to a whole new kind of digital device: the programmable computer.
While this chapter is by no means exhaustive, it provides what I believe is a unique and interesting look at the nature of programmable computer devices, starting with two devices
often overlooked in introductory textbooks: look-up table memories and finite-state machines.
16.2 Look-up tables
Having learned about digital memory devices in the last chapter, we know that it is possible to store binary data within solid-state devices. Those storage ”cells” within solid-state memory
devices are easily addressed by driving the ”address” lines of the device with the proper binary value(s). Suppose we had a ROM memory circuit written, or programmed, with certain data,
such that the address lines of the ROM served as inputs and the data lines of the ROM served as outputs, generating the characteristic response of a particular logic function. Theoretically, we could program this ROMchip to emulate whatever logic function we wanted without having
to alter any wire connections or gates.
Consider the following example of a 4 x 2 bit ROM memory (a very small memory!) programmed with the functionality of a half adder:
16.2. LOOK-UP TABLES
If this ROM has been written with the above data (representing a half-adder’s truth table), driving the A and B address inputs will cause the respective memory cells in the ROM chip to
be enabled, thus outputting the corresponding data as the _ (Sum) and Cout bits. Unlike the half-adder circuit built of gates or relays, this device can be set up to perform any logic function
at all with two inputs and two outputs, not just the half-adder function. To change the logic function, all we would need to do is write a different table of data to another ROM chip. We
could even use an EPROM chip which could be re-written at will, giving the ultimate flexibility in function.
It is vitally important to recognize the significance of this principle as applied to digital circuitry. Whereas the half-adder built from gates or relays processes the input bits to arrive at a specific output, the ROM simply remembers what the outputs should be for any given combination of inputs. This is not much different from the ”times tables” memorized in grade school: rather than having to calculate the product of 5 times 6 (5 + 5 + 5 + 5 + 5 + 5 = 30),
school-children are taught to remember that 5 x 6 = 30, and then expected to recall this product from memory as needed. Likewise, rather than the logic function depending on the functional
arrangement of hard-wired gates or relays (hardware), it depends solely on the data written into the memory (software).
Such a simple application, with definite outputs for every input, is called a look-up table, because the memory device simply ”looks up” what the output(s) should to be for any given combination of inputs states.
This application of a memory device to perform logical functions is significant for several reasons:
• Software is much easier to change than hardware.
• Software can be archived on various kinds of memory media (disk, tape), thus providing an easy way to document and manipulate the function in a ”virtual” form; hardware can only be ”archived” abstractly in the form of some kind of graphical drawing.
• Software can be copied from one memory device (such as the EPROM chip) to another, allowing the ability for one device to ”learn” its function from another device.
• Software such as the logic function example can be designed to perform functions that would be extremely difficult to emulate with discrete logic gates (or relays!).
The usefulness of a look-up table becomes more and more evident with increasing complexity of function. Suppose we wanted to build a 4-bit adder circuit using a ROM. We’d require a ROM with 8 address lines (two 4-bit numbers to be added together), plus 4 data lines (for the signed output)
0 Comments