Digit0001
Member level 1
Hi
Ok, Can someone tell me when creating the booth multiplier would you create two processes, one for testing of lower bits and the other for the state transitions?
Description of lab below:
This is what i had in mind.
For the state transition how many would you have if i was doing a 8 x 8? would it be 17 states like a normal 2's complement multiplier or less?
P.S
Ok, Can someone tell me when creating the booth multiplier would you create two processes, one for testing of lower bits and the other for the state transitions?
Description of lab below:
The objective of this part of the lab is to design and simulate a multiplier for signed numbers binary using Booth’s algorithm. Negative numbers should be represented using by their twos complement. Booths algorithm works as follows assuming each number is n bits : Use an (n + 1) –bit register for the accumulator (A) so the sign bit will not be lost is an overflow occurs. Also, use an (n + 1)-bit register to hold the multiplier and an n-bit register (C) to hold the multiplicand.
1. Clear A ( the accumulator), load into the upper n bits of B, clear B0, and load the multiplicand into C.
2. Test the lower two bits of B (B1 B0).
a. If B1 B0 = 01 , then add C to A ( C should be the sign-extended to n + 1 bits and added to A using an (n + 1)– bit adder).
b. If B1 B0 = 10 , then add the twos complement of C to A
c. If B1 B0 = 11 or 00 skip this step
3 Shift A and B right one place with sign extended
4. Repeat steps 2 and 3 , n-1 more times
5. Product will be in A and B , ignore B0
This is what i had in mind.
Code:
generic(n : integer := 7);\mathrm{d}
signal A : std_logic_vector(n+1 downto 0);
signal B : std_logic_vector(n+1 downto 0);
signal C : std_logic_vector(n downto 0);
Condition:process(A,B)
begin
B(1 downto 0) <= lower_B;
for i in 1 to n-1 loop
if(lower_B = "01") then
A <= A + C(n+1 downto 0) & '0';
elsif(lower_B = "10") then
A <= ((not C) + '1');
else
A <= A;
end if;
end loop;
end process Condition;
For the state transition how many would you have if i was doing a 8 x 8? would it be 17 states like a normal 2's complement multiplier or less?
P.S