CS 208: Computer Organization and Architecture

Multiplication on the PDP-8/E

Write a multiplication subroutine for the PDP8. When the subroutine is called via a JMS call, memory locations 0174 and 0175 should contain the 12-bit two's complement factors to be multiplied. After the subroutine is done, location 0176 should contain the low-order word and 0177 the high-order word of the product. Your multiplication routine should take both overflow and sign into account.

One more constraint. I don't want you to use the "Add A to itself B times" algorithm. The running time for that algorithm is proportional to B itself. Instead, I want you to use the traditional paper-and-pencil algorithm, where you shift A to the left at each stage, and add the shifted A to the running total as you go. This algorithm runs in constant time, with at most 12 iterations of the loop. The "Add A to itself B times" algorithm can take as many as 4096 or 2048 iterations with 12-bit integers.

If that all doesn't make sense, come to class. We'll talk about it there.