6. Add input-output instructions and a direct memory access facility.
7. Suggest modifications to the DMgpa to improve the capability to implement Cgr. (E.g., add 4 to 8 registers as part of DMgpa.) Does DMar do it better?
8. Carry out a similar conversion task for the DEC PDP-11 based on the ISP description in the PDP-11 manual.
SIMPLE DESK CALCULATOR
KEYWORDS: Desk calculator, BCD, arithmetic, programmable
This problem is the design of a simple desk calculator. The problem was given successfully as a laboratory exercise to juniors at Carnegie-Mellon University. The calculator should be capable of adding, subtracting, multiplying, and possibly dividing. Input numbers can be limited to two decimal digits while output may be up to four decimal digits. Since this is to be a decimal calculator, binary input and output is unacceptable. For example, to input the number 12v10 from the switches the BCD form, 0012v16, should be used rather than the binary form, 000Av16. A Users Manual for the design should be written so that someone unfamiliar with digital systems could use the calculator. The conventional T(lights and switches) may be used to encode the BCD input and output.
Perhaps the first major decision in the design is whether data should be represented in binary or BCD form within the calculator. Since RTM's already use the binary representation for addition and subtraction, there is some merit to using binary, although a BCD to binary conversion routine is required. The BCD to binary conversion operation usually uses the division operation. Thus the division operation might be available within the calculator at almost no extra cost.
Various design objective functions need to be set, i.e., should the calculator perform at high speed, should it have low cost, or should it have features to make it easy to use (sophistication)? Consider for example, the speed, cost, sophistication trade-off. For high speed a fast multiply algorithm (e.g., those in Chapter 4) might be used. These are usually more costly than the algorithm which simply adds the multiplicand to itself while decrementing the multiplier. But the increased speed is hardly required, since at most 100 additions need be performed in the adding multiply algorithm. In any case, multiplication would - appear instantaneous to the user as long as it takes less than 100,000 microseconds. On the other hand, a fast multiply design might enable the sine function to be calculated rapidly using polynomial expansion. Again, an analysis might show that the number of operations required to achieve four decimal digit accuracy (all that can be represented under the design constraints of the problem) might be small enough to negate the advantages of a high speed multiplier.
Other features of the calculator also exhibit similar design trade-offs. The decimal display, signed number representation, and decimal point influence the complexity of the calculator. Negative number operations are desirable and relatively easy to implement, while the inclusion of a decimal point is more difficult. Error indications such as overflow or division by zero are very helpful. A structure whereby the results of the previous operation is used as one of the operands in the next operation is very convenient from a user's viewpoint (essentially necessary for, say, adding a column of figures).