Help for VHDL code, wrong answer

Status
Not open for further replies.
How did you solve it?
I used a trick , use 2 new variable that it's 16 bit and and use the bit sign + 15 lower bit of all array of matrics :
sum <= sum + x_reg(mm,kk);
x_sum(15) <= sum(31) ;
x_sum(14 downto 0)<= sum(14 downto 0) ;
and use (x_sum) instead matrix

- - - Updated - - -

now x_sum it's 16 bit
 

why are you using the lower 15-bits? That removes the most significant information, which isn't scaling.
 
the number that i used , could show just by 15 bit , i didn't need another bit .
by the way if i need more just i can used 32 bit or 64 bits , and did same job as i did it for assurance , it means i changed all inputs and output to 32 bit . and when new variable (x_sum) that i used it's 64 bit then i used lower 31 bit and sign bit just for assurance .
and worked , i get wright answer .
 
Reactions: siasia

    siasia

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…