help with multiplier

OP #2333360
Rate this post
• ▲ useful
▼ not useful
the program is for a  simple multiplier using addition of the partial 
products. i find problem only with final addition part pls help me out
1
architecture Behavioral of new_twin1 is
2
type arr is array (3 downto 0) of std_logic_vector(3 downto 0);
3
type arr2 is array(4 downto 0) of std_logic_vector(7 downto 0);
4
signal and_1:arr:=("0000","0000","0000","0000");
5
signal t6:arr2:=("00000000","00000000","00000000","00000000","00000000");
6
signal temp:std_logic_vector(3 downto 0);
7
signal sum:std_logic_vector(7 downto 0):="00000000";
8
begin
9
process(clk)
10
variable z,t,k:integer;
11
variable t2:std_logic_vector(3 downto 0):="0000";
12
variable t7:std_logic_vector(7 downto 0);--:="00000000";
13
begin
14
for i in 0 to 3 loop
15
t6(i)(7 downto 0)<=("00000000");
16
end loop;
17
for i in 0 to 3 loop
18
 for j in 0 to 3 loop
19
  and_1(i)(j)<=(x(i) and y(j));
20
 end loop;
21
end loop;
22
t6(3)<=  "0000" & and_1(0);
23
k:=0; 
24
for i in 2 downto 0 loop
25
 t6(i)<=t2( i downto 0) & and_1(k+1) & t2(k downto 0);
26
 k:=k+1;
27
end loop;
28
for i in 0 to 3 loop
29
 t6(4)<=t6(4)+t6(i);
30
end loop
31
----just tried this alternative which too dint work---
32
--  t6(4)<=t6(0);
33
--  t6(4)<=t6(4)+t6(1);
34
--  t6(4)<=t6(4)+t6(2);
35
--  t6(4)<=t6(4)+t6(3);
36
end process;
37
end Behavioral;

the final for loop for addition is giving me a gig-up.when i try to 
access one variable inside the array am able to retrieve it but while 
adding to the same, the total value tends to undefined(XXXXXXXX).
please suggest any modification
thanks in advance
Moderator (Company: Titel) #2333591
Rate this post
• ▲ useful
▼ not useful
> process(clk)
Your process isn't sensitive to the clock.
So your sensitivity list is WRONG and therfore the whole simulation is 
completely WRONG.


> moreover i solved it by changing the data types for t6 to variable
> rather using signal
Sounds like "I'm digging for gold, but don't know where"....
OP #2333626
Rate this post
• ▲ useful
▼ not useful
Lothar Miller wrote:
>> process(clk)
> Your process isn't sensitive to the clock.
> So your sensitivity list is WRONG and therfore the whole simulation is
> completely WRONG.
>
>
>> moreover i solved it by changing the data types for t6 to variable
>> rather using signal
> Sounds like "I'm digging for gold, but don't know where"....

SORRRY MORE OR LESS THE SAME :)

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.