Professional Documents
Culture Documents
//
// Declarations
//
case(Booth)
4'b0000 : S <= Hi; // Prod <= (Prod + 0*A) >> 2;
4'b0001 : S <= Hi + A; // Prod <= (Prod + 1*A) >> 2;
4'b0010 : S <= Hi + A; // Prod <= (Prod + 1*A) >> 2;
4'b0011 : S <= Hi + {A, 1'b0}; // Prod <= (Prod + 2*A) >> 2;
4'b0100 : S <= Hi - {A, 1'b0}; // Prod <= (Prod - 2*A) >> 2;
4'b0101 : S <= Hi - A; // Prod <= (Prod - 1*A) >> 2;
4'b0110 : S <= Hi - A; // Prod <= (Prod - 1*A) >> 2;
4'b0111 : S <= Hi; // Prod <= (Prod - 0*A) >> 2;
4'b1000 : S <= Hi; // Prod <= (Prod + 0*A) >> 2;
4'b1001 : S <= Hi + A; // Prod <= (Prod + 1*A) >> 2;
4'b1010 : S <= Hi + A; // Prod <= (Prod + 1*A) >> 2;
4'b1011 : S <= Hi + {A, 1'b0}; // Prod <= (Prod + 2*A) >> 2;
4'b1100 : S <= Hi - {A, 1'b0}; // Prod <= (Prod - 2*A) >> 2;
4'b1101 : S <= Hi - A; // Prod <= (Prod - 1*A) >> 2;
4'b1110 : S <= Hi - A; // Prod <= (Prod - 1*A) >> 2;
4'b1111 : S <= Hi; // Prod <= (Prod - 0*A) >> 2;
endcase
end
// Double Length Product Register
// Multiplier, R, is loaded into the least significant half on
load, Ld.
// Shifted right two places as the product is computed
iteratively.