fahim1
Member level 4
- Joined
- Jun 4, 2015
- Messages
- 75
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 8
- Activity points
- 517
hi
i write the modified booth multiplier code like this...
I defined the signals but it has a syntax error ,I dont know why??
in the for loop if I want to do this for i=0 and i=2,did i express it correct?
for i in 0 to 2 loop
.
.
.
i=i+2;
end loop;
--------------code-----------------
thanks
i write the modified booth multiplier code like this...
I defined the signals but it has a syntax error ,I dont know why??
in the for loop if I want to do this for i=0 and i=2,did i express it correct?
for i in 0 to 2 loop
.
.
.
i=i+2;
end loop;
--------------code-----------------
if someone have another code for modified booth multiplier code,I would appreciate if put it in the comments...library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
------------------------------
entity mdboothmul is
port(mpcd,mplr : in std_logic_vector(3 downto 0);
result : out std_logic_vector(7 downto 0);
clk : in std_logic);
end entity;
--------------------------
architecture mdboothmul_arch of mdboothmul is
signal acc : std_logic_vector(7 downto 0):="00000000";
signal tmpcd : std_logic_vector(7 downto 0);
tmpcd(7 downto 4) <= (others => '0'); ---???
tmpcd(3 downto 0) <= mpcd;
signal tmplr : std_logic_vector(4 downto 0);
tmplr <= mpcd & '0' ; ---??
begin
process(clk)
--variable tmpcd : std_logic_vector(7 downto 0);
--tmpcd(7 downto 4) := (others => '0');
--tmpcd(3 downto 0) := mpcd;
--variable tmplr : std_logic_vector(4 downto 0);
--tmplr := mpcd & '0' ;
variable temp : std_logic_vector(7 downto 0):="00000000";
begin
if (clk'event and clk='1') then
for i in 0 to 2 loop ---?
if (tmplr(i+2 downto i) = ("000" or "111")) then temp := "00000000";
elsif (tmplr(i+2 downto i) = ("001" or "010")) then temp := tmpcd;
elsif(tmplr(i+2 downto i) = "011") then temp := tmpcd(6 downto 0) & '0';
elsif(tmplr(i+2 downto i) = ("101" or "110")) then temp := tmpcd(6 downto 0) & '0';
elsif (tmplr(i+2 downto i) = ("101" or "110")) then temp := not(tmpcd)+'1';
elsif (tmplr(i+2 downto i) = "100") then temp := not(tmpcd(6 downto 0) & '0') + '1';
end if;
i:=i+2; ---??
end loop;
acc <= acc+temp;
end if;
end process;
result <= acc ;
end mdboothmul_arch;
thanks