A BETTER WAY TO MULTIPLY Ismet has pointed out that there is a simpler multiplication algorithm that may not require you to design and implement as many machine instructions. The basic idea is to process the bits of the multiplier from LEFT to RIGHT (rather than from right to left, as I had described in class). Pseudo-code is given below. Input: unsigned integers A and B (each a tyte, or 10-bit number) Output: if AB < 1024, compute C = AB and set "return code" to 0. otherwise, set the return code to 1 (and C is arbitrary). C = 0; R = A; /* R will get shifted left ten times */ for (i=0; i<10; i++) { /* so each bit will shift off the end */ C = C + C; /* Double the running sum */ if (overflow) return (1); R = R + R /* shift R left one more bit position */ if (overflow) { /* if a "1" was shifted off the end, */ C = C + B; /* ... then add B into running sum */ if (overflow) return (1); } } return(0); Note: You may modify this algorithm is you wish, as long as your program doesn't take too long. For instance, you might want to count down from 10 to 0 (instead of counting up from 0 to 10) since it might require one fewer register.