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-3

Exercise 1.3.1-3

not stated yet in Lean solution written

Rating02
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.3.1 of Volume 1. Companion chapter: Description of MIX

The task

Give the field specifications (L:R)(L:R) of the four parts of a MIX instruction word.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Write the layout of an instruction word, from the sign to byte 5 (formula (3) of Section 1.3.1).

Solution

Show the solution

The word has the form ± A A I F C\pm\, A\,A\, I\, F\, C. The sign and bytes 1 and 2 hold the address ±AA\pm AA. Byte 3 holds the index II. Byte 4 holds the field FF. Byte 5 holds the operation code CC. So the specifications are:

  • address: (0:2)(0:2);
  • index: (3:3)(3:3);
  • field: (4:4)(4:4);
  • operation code: (5:5)(5:5).

Check

The four fields do not overlap and together they cover (0:5)(0:5): bytes 0..20..2, 33, 44, 55 are 3+1+1+1=63 + 1 + 1 + 1 = 6 positions, which are the sign and the five bytes.

Remarks

This is why STJ has the normal field (0:2)(0:2): it replaces the address part of an instruction (Section 1.3.1).

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.