need help with sll shifter

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

  1. ohaqqi

    ohaqqi

    Joined:
    Oct 15, 2006
    Messages:
    6
    I accidentally posted this in the forum...I'm such a noob :musicus:

    I'm working on a small project, 16 bit shifter...part of an alu I'm trying to design learning VHDL. 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

    ohaqqi

    Joined:
    Oct 15, 2006
    Messages:
    6
    I also read that format sll(arg1, arg2) can be used, so I also tried this:

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

    I assume this should shift A by the integer value of B, give that CODE = '10000'...here is the error vcom gives me:

    Error: alu16.vhd(41): near "sll": syntax error

    It just stops there doesn't give me any errors for these lines, even though it did before I made the above change:

    A <= A srl to_integer(signed(B)) when (CODE(4) = '1' and CODE(3) = '0' and CODE(2) = '0' and CODE(1) = '0' and CODE(0) = '1');
    A <= A sla to_integer(signed(B)) when (CODE(4) = '1' and CODE(3) = '0' and CODE(2) = '0' and CODE(1) = '1' and CODE(0) = '0');
    A <= A sra to_integer(signed(B)) when (CODE(4) = '1' and CODE(3) = '0' and CODE(2) = '0' and CODE(1) = '1' and CODE(0) = '1');
    ohaqqi, Oct 17, 2006
    #2
    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. Bailee
    Replies:
    2
    Views:
    402
    Bailee
    Jul 8, 2003
  2. a_Conan

    HDL AUTHOR and SLL problem!

    a_Conan, May 11, 2006, in forum: VHDL
    Replies:
    5
    Views:
    2,650
  3. Frank Buss
    Replies:
    5
    Views:
    10,211
    Duane Clark
    Jul 1, 2006
  4. Volker

    problem with sll

    Volker, Feb 2, 2007, in forum: VHDL
    Replies:
    4
    Views:
    5,674
    VHDL_HELP
    Mar 10, 2007
  5. VHDL_HELP

    help for "sll" shift left logical

    VHDL_HELP, Mar 6, 2007, in forum: VHDL
    Replies:
    4
    Views:
    745
Loading...

Share This Page