Incorrect simulation of a shift register in multiplication

Discussion in 'VHDL' started by Joseph, Apr 13, 2011.

  1. Joseph

    Joseph Guest

    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
     
    Joseph, Apr 13, 2011
    #1
    1. Advertising

  2. Joseph

    jeppe

    Joined:
    Mar 10, 2008
    Messages:
    348
    Location:
    Denmark
    Hi Joseph

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

    Regards
    Jeppe
     
    jeppe, Apr 13, 2011
    #2
    1. Advertising

  3. On 13 Apr., 09:00, Joseph <> 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
     
    Thomas Stanka, Apr 13, 2011
    #3
  4. Joseph

    Andy Guest

    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
     
    Andy, Apr 13, 2011
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roberto Gallo

    Shift - byte[] buf shift

    Roberto Gallo, Jan 27, 2004, in forum: Java
    Replies:
    3
    Views:
    2,246
    Thomas Schodt
    Jan 27, 2004
  2. Wenjie
    Replies:
    3
    Views:
    1,091
    Ron Samuel Klatchko
    Jul 11, 2003
  3. William Hughes
    Replies:
    13
    Views:
    1,271
    Ben Bacarisse
    Mar 15, 2010
  4. ashfaq2419
    Replies:
    3
    Views:
    2,843
    ashfaq2419
    Jun 2, 2011
  5. apakhira
    Replies:
    3
    Views:
    4,649
    jeppe
    Oct 18, 2011
Loading...

Share This Page