VHDL sll shift question

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

  1. ohaqqi

    ohaqqi

    Joined:
    Oct 15, 2006
    Messages:
    1
    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. Advertising

  2. ohaqqi

    kadwadhp

    Joined:
    Oct 16, 2006
    Messages:
    2
    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. Advertising

  3. ohaqqi

    srishankar

    Joined:
    Oct 21, 2006
    Messages:
    1
    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
    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
    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
    remember that the "sll" operator is only apply to bit_vector data type.
     
    tranhuuthu991990, May 13, 2012
    #6
    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. slacK_
    Replies:
    1
    Views:
    951
    Moz Champion
    Jul 19, 2004
  2. Alexander Fischer

    Ctrl-Shift-Enter

    Alexander Fischer, Sep 19, 2004, in forum: Firefox
    Replies:
    3
    Views:
    1,213
    .brian.
    Sep 20, 2004
  3. becool_nikks
    Replies:
    0
    Views:
    2,039
    becool_nikks
    Mar 6, 2009
  4. kapsy_27
    Replies:
    0
    Views:
    1,393
    kapsy_27
    Sep 9, 2011
  5. deepak21

    shift left/shift right in VHDL

    deepak21, May 6, 2012, in forum: Software
    Replies:
    0
    Views:
    1,649
    deepak21
    May 6, 2012
Loading...

Share This Page