barrel shifter

Discussion in 'Programmer's Corner' started by Infinity1, Apr 16, 2009.

  1. Infinity1

    Thread Starter Member

    Jan 11, 2009
    16
    0
    Hello Everyone
    i wrote a code for a barrel shifter and it passes the compilation
    but in the simulation it gives me nothing in the output
    here is the code:

    library ieee;
    use ieee.std_logic_1164.all;

    Entity barrel_shifter is
    Generic(n: integer := 8);
    port(inp: in std_logic_vector (7 downto 0);
    shifter: in integer range 0 to 1;
    outp:eek:ut std_logic_vector (7 downto 0)
    );
    end barrel_shifter;
    architecture behave of barrel_shifter is

    signal tmp: std_logic_vector(7 downto 0);
    begin
    process(inp,shifter)
    begin
    if (shifter = 0) then
    tmp <= inp;
    else
    tmp(0)<='0';
    for i in 1 to inp'HIGH loop --for i in 1 to 7 loop;
    tmp(i)<=inp(i-1);
    end loop;
    end if;
    end process;
    outp<=tmp;
    end behave;

    can someone explain me why it shows nothing in the simulation?
     
  2. DrNick

    Active Member

    Dec 13, 2006
    110
    2
    what input vector are you providing to the simulation?
     
  3. tuborggg

    Active Member

    Jan 3, 2009
    37
    0
    It won't show you anything if you won't give it something (a.k.a test-bench which simulate input).
     
Loading...