1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
| ----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 20:56:57 03/16/2015
-- Design Name:
-- Module Name: projj - Behavioral
-- Project Name:
-- Target Devices:
-- Tool versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use ieee.numeric_std.all;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity projj is
Port ( a : in unsigned(7 downto 0);
b : in unsigned(7 downto 0);
o : out unsigned(15 downto 0));
end projj;
architecture Behavioral of projj is
component faa is
port(a:in std_logic;
b:in std_logic;
c:in std_logic;
s:out std_logic;
co:out std_logic);
end component;
component haa is
port(a:in std_logic;
b:in std_logic;
s:out std_logic;
c:out std_logic);
end component;
component comp63 is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
d : in STD_LOGIC;
e : in STD_LOGIC;
f : in STD_LOGIC;
o1 : out STD_LOGIC;
o2 : out STD_LOGIC;
o3 : out STD_LOGIC);
end component;
component comp53 is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
d : in STD_LOGIC;
e : in STD_LOGIC;
o1 : out STD_LOGIC;
o2 : out STD_LOGIC;
o3 : out STD_LOGIC);
end component;
component comp43 is
Port ( a : in STD_LOGIC;
b : in STD_LOGIC;
c : in STD_LOGIC;
d : in STD_LOGIC;
o1 : out STD_LOGIC;
o2 : out STD_LOGIC;
o3 : out STD_LOGIC);
end component;
component rcadder_8 is
PORT( A1, B1 : IN unsigned (7 downto 0);
Cforce : IN std_logic ;
Sum1 : OUT unsigned(7 downto 0);
Cout : OUT std_logic ) ;
end component;
component vedicmul is
Port ( a : in unsigned(3 downto 0);
b : in unsigned(3 downto 0);
o : out unsigned(7 downto 0));
end component;
component saveadder is
Port (a : in unsigned(7 downto 0);
b : in unsigned(7 downto 0) ;
s : in unsigned(7 downto 0);
o1 : out unsigned(7 downto 0);
o2 : out unsigned(7 downto 7));
end component;
signal p : unsigned(7 downto 0);
signal q : unsigned(7 downto 0);
signal r : unsigned(7 downto 0);
signal s : unsigned(7 downto 0);
signal c : unsigned(7 downto 0);
signal z : unsigned(7 downto 0);
signal zs : unsigned (7 downto 0);
signal zc : unsigned (7 downto 0);
signal zc1 : unsigned(7 downto 0);
signal o1 : unsigned (7 downto 0);
signal u : unsigned(3 downto 0);
signal u1 : unsigned(7 downto 0);
signal v1 : unsigned(7 downto 0);
signal v:unsigned(3 downto 0);
signal zc2:unsigned (7 downto 0);
signal zs2:unsigned (7 downto 0);
signal zc3:unsigned (7 downto 0);
signal o2:unsigned(7 downto 0);
signal x:unsigned(3 downto 0);
signal y:unsigned(3 downto 0);
signal cout1:std_logic;
signal cout2:std_logic;
signal cin1 :std_logic;
signal cout3:std_logic;
begin
cin1<='0';
cout1 <=zc(7);
cout2<= zc2(7);
u(3 downto 0) <= o1(7 downto 4);
v(3 downto 0)<= p(7 downto 4);
v1 <= '0'&'0'&'0'&'0' &v;
u1 <= "0000"&u;
x(3 downto 0)<=o1(3 downto 0);
y(3 downto 0) <= p(3 downto 0);
zc1 <= zc(6)&zc(5)&zc(4)&zc(3)&zc(2)&zc(1)&zc(0)&'0';
zc3 <= zc2(6)&zc2(5)&zc2(4)&zc2(3)&zc2(2)&zc2(1)&zc2(0)&'0';
g1:vedicmul port map(a(3 downto 0),b(3 downto 0),p(7 downto 0));
g2:vedicmul port map(a(3 downto 0),b(7 downto 4),q(7 downto 0));
g3:vedicmul port map (a(7 downto 4),b(3 downto 0),r(7 downto 0));
g4:vedicmul port map(a(7 downto 4),b(7 downto 4),s(7 downto 0));
g5:saveadder port map(q(7 downto 0),r(7 downto 0),v1(7 downto 0),zs(7 downto 0),zc(7 downto 0));
g6:rcadder_8 port map(zs(7 downto 0),zc1(7 downto 0),cin1,o1(7 downto 0),cout1);
g7:saveadder port map(u1(7 downto 0),s(7 downto 0),z(7 downto 0),zs2(7 downto 0),zc2(7 downto 0));
g8:rcadder_8 port map(zs2(7 downto 0),zc3(7 downto 0),cout2,o2(7 downto 0),cout3);
o <= o2&x&y;
end Behavioral; |