Shift left register using VHDL shift operator : sll trouble

Discussion in 'VHDL' started by Anviori, Apr 13, 2016.

  1. Anviori


    Apr 13, 2016
    Likes Received:
    I've implemented a shift left register with serial input and parallel output using a "slice" to implement the shift; but I can't figure out how to implement the same logic using an overloaded shift operator: 'sll' (shift left logical) operator. Thank you all for any help you can offer.

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

    entity shift_reg is
    d :instd_logic;
    clk :instd_logic;
    rst_bar :instd_logic;
    q : out std_logic_vector(7downto0));
    end shift_reg;

    architecture post_vhdl_08 of shift_reg isbegin

    process(clk, rst_bar)

    variable q_int :std_logic_vector(7downto0);

    if rst_bar ='0'then
    q_int :=(others=>'0');elsif rising_edge(clk)then
    q_int := q_int(6downto0)& d;
    end if;

    q <= q_int;

    end process;

    end post_vhdl_08;
    Anviori, Apr 13, 2016
    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.