Unsigned Multipliers
Create a square array of cells:
a[n/m][n/m]
Assign functions to each cell:
for(i = 0, i < n/m, i++)
for(j = 0, j < n/m, j++)
a[i][j] = A //all cells are of type A
end
end
Two's Complement Multipliers
Create a square array of cells:
a[n/m][n/m]
Assign functions to each cell:
a[0][0] = B //upper left cell is of type B
for(i = 1, i < n/m, i++)
a[0][i] = A //the rest of the row is of type A
end
for(i = 1, i < n/m - 1, i++) //iterate through the inner rows
a[i][0] = D //the first cell of each inner row is of type D
for(j = 1, j < n/m, j++)
if(j = i)
a[i][j] = C //the diagonal positions are of type C
else
a[i][j] = A //all others are of type A
end
end
end
a[n/m - 1][0] = H //the lower left corner is of type H
a[n/m - 1][n/m - 1] = E //the lower right corner is of type E
for(i = 1, i < n/m - 1, i++)
a[n/m][i] = F //all of the others are of type F
end
No comments:
Post a Comment