Professional Documents
Culture Documents
Codigo en VHDL de Multiplicador de 4 Bits Por 4 Bits
Codigo en VHDL de Multiplicador de 4 Bits Por 4 Bits
library ieee;
use ieee.std_logic_1164.all;
entity mult4bits is
port(
A,B: in std_logic_vector(3 downto 0); --numeros entrada
m: out std_logic_vector(7 downto 0) -- multiplicacion
);
end mult4bits;
begin
ci<='0';
ro<= A(0) AND B(0); -- multiplicacion de numero por numero
g(1)<=A(0) AND B(1) ;
g(2)<=A(0) AND B(2) ;
g(3)<=A(0) AND B(3) ;
g(4)<= '0';
i(1)<= s(1);
i(2)<= s(2);
i(3)<= s(3);
i(4)<= c1;
k(1)<=q(1);
k(2)<=q(2);
k(3)<=q(3);
k(4)<=c2;
--resultado de la multiplicacion.
m(0)<=ro;
m(1)<=s(0);
m(2)<=q(0);
m(3)<=r(0);
m(4)<=r(1);
m(5)<=r(2);
m(6)<=r(3);
m(7)<=co;
end mmm;
Sumador:
library ieee;
use ieee.std_logic_1164.all;