5 Bit Multiplier
5 Bit Multiplier
5 Bit Multiplier
Submitted by:
Devendra S. Bilaye
2013H123158P
M.E. Microelectronics
5 BIT MULTIPLIER
Contents
1.
2.
3.
4.
5.
VHDL code......3
Simulation results .......9
Area report9
Timing report......10
Power report...10
VHDL code
5 BIT MULTIPLIER
Code for package:
library IEEE;
library WORK;
use IEEE.STD_LOGIC_1164.all;
package mul_pack is
procedure HA ( variable s : out bit;
variable c : out bit;
variable a: in bit;
variable b: in bit);
bit;
5 BIT MULTIPLIER
------------------------------------------BODY
package body mul_pack is
procedure HA ( variable s : out bit;
variable c : out bit;
variable a: in bit;
variable b: in bit) is
begin
s := a xor b;
c := a and b;
end HA;
g0 := a0 and b0;
5 BIT MULTIPLIER
p0 := a0 xor b0;
--HA(p0,g0,a0,b0);
g1 := a1 and b1;
p1 := a1 xor b1;
--HA(p1,g1,a1,b1);
c1 := (c0 and p0) or (g0);
c2 := (c0 and p0 and p1) or (g0 and p1) or (g1);
s0 := p0 xor c0;
s1 := p1 xor c1;
end cla2;
bit;
: out bit) is
begin
y := (d0 and (not s1) and (not s0)) or (d1 and (not s1) and s0) or
(d2 and s1 and (not s0)) or (d3 and s1 and s0);
end mux41;
5 BIT MULTIPLIER
yj_out := yj_in;
mux41 (tp,xi_in,yi_in,si_in,xj_in,yj_in,fa_cin);
FA(sout,cout,sin,cin,fa_cin);
end cell1;
entity mul5_main is
5 BIT MULTIPLIER
port (x,y : in bit_vector (4 downto 0); p : out bit_vector (9 downto 0));
end mul5_main;
begin
xv := x;
yv := y;
sin:='0';
cin(1) := '0'; cin(2) := '0'; cin(3) := '0'; cin(4) := '0'; cin(5) := '0';
cj := '0';
-----------------------row 1
cell2 (xi(1),yi(1),si(1),cj_n(1),cout2(1),sout2(1),pv(0),sin,xv(0),yv(0),cin(1),cj);
cell1 (xi(2),yi(2),si(2),xj(1),yj(1),cout(1),pv(1),sin,xv(1),yv(1),cin(2),xi(1),yi(1),si(1));
cell1 (xi(3),yi(3),si(3),xj(2),yj(2),cout(2),sout(2),sin,xv(2),yv(2),cin(3),xi(2),yi(2),si(2));
cell1 (xi(4),yi(4),si(4),xj(3),yj(3),cout(3),sout(3),sin,xv(3),yv(3),cin(4),xi(3),yi(3),si(3));
5 BIT MULTIPLIER
cell1 (xiw,yiw,siw,xj(4),yj(4),cout(4),sout(4),sin,xv(4),yv(4),cin(5),xi(4),yi(4),si(4));
-------------------------row 2
cell2 (xi(5),yi(5),si(5),cj_n(2),cout2(2),sout2(2),xiyi(2),sout(2),xj(1),yj(1),cout(1),cj_n(1));
cell1 (xi(6),yi(6),si(6),xj(5),yj(5),cout(5),sout(5),sout(3),xj(2),yj(2),cout(2),xi(5),yi(5),si(5));
cell1 (xi(7),yi(7),si(7),xj(6),yj(6),cout(6),sout(6),sout(4),xj(3),yj(3),cout(3),xi(6),yi(6),si(6));
cell1 (xiw,yiw,siw,xj(7),yj(7),cout(7),sout(7),sin,xj(4),yj(4),cout(4),xi(7),yi(7),si(7));
---------------------row 3
cell2 (xi(8),yi(8),si(8),cj_n(3),cout2(3),sout2(3),xiyi(3),sout(6),xj(5),yj(5),cout(5),cj_n(2));
cell1 (xi(9),yi(9),si(9),xj(8),yj(8),cout(8),sout(8),sout(7),xj(6),yj(6),cout(6),xi(8),yi(8),si(8));
cell1 (xiw,yiw,siw,xj(9),yj(9),cout(9),sout(9),sin,xj(7),yj(7),cout(7),xi(9),yi(9),si(9));
-----------------------row 4
cell2 (xi(10),yi(10),si(10),cj_n(4),cout2(4),sout2(4),xiyi(4),sout(9),xj(8),yj(8),cout(8),cj_n(3));
cell1 (xiw,yiw,siw,xj(10),yj(10),cout(10),sout(10),sin,xj(9),yj(9),cout(9),xi(10),yi(10),si(10));
----------------------------row 5
cell2 (xiw,yiw,siw,cjw,coutw,sout2(5),xiyi(5),sin,xj(10),yj(10),cout(10),cj_n(4));
cla_cin := '0';
cla2 (pv(3),pv(2),cla_cout1,sout(5),cout2(2),sout2(2),xiyi(2),cla_cin);
cla2 (pv(5),pv(4),cla_cout2,sout(8),cout2(3),sout2(3),xiyi(3),cla_cout1);
cla2 (pv(7),pv(6),cla_cout3,sout(10),cout2(4),sout2(4),xiyi(4),cla_cout2);
FA (pv(8),pv(9),sout2(5),xiyi(5),cla_cout3);
p <= pv;
end process;
end Behavioral;
Simulation Result:
5 BIT MULTIPLIER
Area Report:
Timing Report:
5 BIT MULTIPLIER
Power Report:
10