- Joined
- Jul 10, 2010
- Messages
- 4
- Reaction score
- 0
Hi friends,
I am implementing booth's multiplier now a days. I want to know about the code needed to multiply -2 with a std_logic_vector. What i am doing is to just shift the vector by '1' on left and then taking its 2's complement. but by doing this, i cannot get the correct results. i am pasting the code here:
VP <= NOT(TEMP(ABIT-2 DOWNTO 0)&'0')+1; -- multiply by -2
VP <= NOT(TEMP)+1; -- multiply by -1
where ABIT is 32 in my design.
thanking all of you people in advance.
regards,
ashfaq ahmed
I am implementing booth's multiplier now a days. I want to know about the code needed to multiply -2 with a std_logic_vector. What i am doing is to just shift the vector by '1' on left and then taking its 2's complement. but by doing this, i cannot get the correct results. i am pasting the code here:
VP <= NOT(TEMP(ABIT-2 DOWNTO 0)&'0')+1; -- multiply by -2
VP <= NOT(TEMP)+1; -- multiply by -1
where ABIT is 32 in my design.
thanking all of you people in advance.
regards,
ashfaq ahmed