VHDL sll shift question

Discussion in 'Hardware' started by ohaqqi, Oct 16, 2006.

  1. ohaqqi

    ohaqqi

    Joined:
    Oct 15, 2006
    Messages:
    1
    Likes Received:
    0
    I'm working on a small project, 16 bit shifter. When CODE = '10000', registe
    r A must shift by integer value of register B -- this is why I made them bid
    irectional ports. Here's some snippets:

    libraries:
    library IEEE;
    use IEEE.std_logic_1164.all;
    use IEEE.numeric_std.all;

    entity alu16 is
    port (A,B: inout std_logic_vector(15 downto 0);
    CODE: in std_logic_vector(4 downto 0);
    C: out std_logic_vector(15 downto 0);
    overflow: out std_logic);
    end alu16;

    I tried:

    A <= A sll to_integer(signed(B)) when (CODE(4) = '1' and CODE(3) = '0' and C
    ODE(2) = '0' and CODE(1) = '0' and CODE(0) = '0');

    and get the same error:

    ** Error: alu16.vhd(40): No feasible entries for infix operator "sll".
    ** Error: alu16.vhd(40): Type error resolving infix expression "sll".

    Any help for a VHDL newbie?
     
    ohaqqi, Oct 16, 2006
    #1
    1. Advertisements

  2. ohaqqi

    kadwadhp

    Joined:
    Oct 16, 2006
    Messages:
    2
    Likes Received:
    0
    Hi Ohaqqi,
    Even I am new to VHDL...But still as far as I Know sll is a bit operator and doesn't operate on STD_LOGIC_VECTORS.Try converting all operands to bit_vector .
    Best Regards,
    Kadwadhp
     
    kadwadhp, Oct 18, 2006
    #2
    1. Advertisements

  3. ohaqqi

    srishankar

    Joined:
    Oct 21, 2006
    Messages:
    1
    Likes Received:
    0
    hi i am doing a pong game using vhdl. do you knw how to make the paddle and ball move simultaneously
     
    srishankar, Oct 21, 2006
    #3
  4. ohaqqi

    Nirmala

    Joined:
    Nov 10, 2006
    Messages:
    4
    Likes Received:
    0
    u can manually perform left shift operation...but code will be lengthy
     
    Nirmala, Nov 11, 2006
    #4
  5. ohaqqi

    power_hf2005

    Joined:
    Sep 23, 2009
    Messages:
    1
    Likes Received:
    0
    instead of using "sll" operator, u can use another way to solve your problem.
    I was in problem with it, and I made a function for shiftleft (sll) to replace opeator sll. here is the code for SL. Good luck!( I'm a Vietnamese so my E is not good:oops: )
    subtype vao is std_logic_vector(7 downto 0);
    function sl(input: vao) return vao is
    variable k: std_logic_vector(7 downto 0);
    begin
    for i in 1 to 7 loop
    k(i):=input(i-1);
    end loop;
    k(0):=input(7);
    return k;
    end sl;
     
    power_hf2005, Sep 29, 2009
    #5
  6. ohaqqi

    tranhuuthu991990

    Joined:
    May 13, 2012
    Messages:
    1
    Likes Received:
    0
    remember that the "sll" operator is only apply to bit_vector data type.
     
    tranhuuthu991990, May 13, 2012
    #6
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.