Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Incorrect simulation of a shift register in multiplication

Reply
Thread Tools

Incorrect simulation of a shift register in multiplication

 
 
Joseph
Guest
Posts: n/a
 
      04-13-2011
Hi all,

I am synthesizing a well known add-shift multiplication routine. I have theMultiplier register Q ,an addition register A and a Carry register C (the carry of the adder) which are concatenated together to give the multiplication results. For the shifting part I am writing the following code:

Q <= A(0) & Q(3 downto 1);
A <= C & A(3 downto 1);

That should perform a right shift in both A and Q. This is being done in a clocked process so registers are being created (that is working). When synthesizing using Xilinx and simulating using ISIM the right shift is being performed but the LSB of Q never has the correct value.

Am I coding it incorrectly in Xilinx?

Regards,

Joseph
 
Reply With Quote
 
 
 
 
jeppe jeppe is offline
Senior Member
Join Date: Mar 2008
Location: Denmark
Posts: 348
 
      04-13-2011
Hi Joseph

Perhaps should you post some more code - the statements posted seems to be ok.

Regards
Jeppe
 
Reply With Quote
 
 
 
 
Thomas Stanka
Guest
Posts: n/a
 
      04-13-2011
On 13 Apr., 09:00, Joseph <(E-Mail Removed)> wrote:
> Q <= A(0) & Q(3 downto 1);
> A <= C & A(3 downto 1);
>
> That should perform a right shift in both A and Q. This is being done in a clocked process so registers are being created (that is working). When synthesizing using Xilinx and simulating using ISIM the right shift is being performed but the LSB of Q never has the correct value.


This code snipplet has to less information. Actually there are plenty
of reasons why a vhdl code simulates different than the synthesis
result of this code. Without further information it is not predictabel
which reason is your problem.
You can not "code it incorrect in Xilinx". But you can easily write
vhdl code which has "misleading" simulation result compared to the
netlist you get after synthesis independend of the used tools.

bye Thomas
 
Reply With Quote
 
Andy
Guest
Posts: n/a
 
      04-13-2011

Not enough info. Are the other bits getting "correct" values? How can
you tell that Q(0) is not getting the "correct" value? (What is the
correct value?)

Andy
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
8bit Shift Add Multiplication Algorithm in VHDL: not synthesizing apakhira VHDL 3 10-18-2011 06:22 PM
Multiplication using shift-add technique ashfaq2419 VHDL 3 06-02-2011 11:41 AM
Source of term "multiplication" in matrix multiplication William Hughes C Programming 13 03-15-2010 02:04 PM
Shift - byte[] buf shift Roberto Gallo Java 3 01-27-2004 04:26 PM
left shift then right shift an unsigned int Wenjie C++ 3 07-11-2003 08:22 PM



Advertisments