PACKAGE array_example IS
  TYPE data_bus IS ARRAY(0 TO 31) OF BIT;
  TYPE small_bus IS ARRAY(0 TO 7) OF BIT;
END array_example;

USE WORK.array_example.ALL;
ENTITY extract IS
  PORT (data : IN data_bus;
        start : IN INTEGER;
        data_out : OUT small_bus);
END extract;

ARCHITECTURE test OF extract IS
BEGIN
  PROCESS(data, start)
  BEGIN
    FOR i IN 0 TO 7 LOOP
      data_out(i) <= data(i + start);
    END LOOP;
  END PROCESS;
END test;


