Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help for VHDL code, wrong answer

Status
Not open for further replies.
How did you solve it?
 

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 .
 
  • Like
Reactions: siasia

    siasia

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top