taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.3.1-25

Exercise 1.3.1-25

not stated yet in Lean solution written

Rating30
KindInformal: the exercise has no formal statement, so Lean does not state it from the written solution
SectionSection 1.3.1 of Volume 1. Companion chapter: Description of MIX

The task

Suggest improvements that an extended machine could offer while still running all MIX programs unchanged.

The exact wording is in your copy of the book.

Solution

Show the solution

A program is correct on the old machine only if it uses defined features. So the new machine may give a meaning to everything that MIX leaves undefined. Four kinds of undefined things exist, and each gives a place for an improvement.

First, the I-field takes the values 00 to 66. The values from 77 up to the byte size are free. They could stand for indirect addressing, for the use of the address of a second index register, or for index registers with an index of J. For example, I=7⋅i+jI = 7 \cdot i + j with two index numbers could say that MM is the sum of the address and two registers.

Second, the address MM is limited to 0≤M≤39990 \le M \le 3999 for memory references. The values above could make a larger memory possible, to b2−1b^2 - 1 words. For the index registers and rJ, a longer register of five bytes could be offered, with the old two-byte registers as a special case. Overflow of index registers is undefined, so an extension may do anything.

Third, the field FF and the operation code have unused combinations. The op C=5C = 5 has the fields 0,1,20, 1, 2, and 33 to 6363 are free for new special operations such as bitwise and, or, exclusive or, and count of ones. The shift operator C=6C = 6 has the fields 00 to 55, so other shifts, such as binary shifts or rotations of single words, could come. MOVE with F=0F = 0 does nothing now; a negative count could move backwards. The jump operator C=39C = 39 has the fields 00 to 99, so jumps on an odd or even rA, and jumps on the sign of rX could come. An "execute" instruction, which performs the instruction in cell MM and goes on, would be one more variant of C=5C = 5.

Fourth, the machine around the core. More and faster input-output units, a real-time clock in a special address, an interrupt system with negative addresses, and a protected mode for several programs. All of them leave the old programs unchanged, provided that the old programs do not use the addresses that are now special, and the old programs cannot do that because they are undefined.

A design is only good if it does not change the time of old instructions in a way that old programs notice, so a faster implementation is also an improvement. A new feature that changes the meaning of a defined word is not allowed.

Remarks

The extension idea is an instance of upward compatibility: the new machine runs the old programs and adds new ones. Compare Section 1.4.4 for interrupts.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

not stated yet The exercise is not stated in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.