----------------------------------------------------------------------------------
-- Company: 
-- Engineer: 
-- 
-- Create Date: 06/02/2018 07:51:28 PM
-- Design Name: 
-- Module Name: divider - Behavioral
-- Project Name: 
-- Target Devices: 
-- Tool Versions: 
-- Description: 
-- 
-- Dependencies: 
-- 
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
-- 
----------------------------------------------------------------------------------


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;

-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;

entity divider is
    Port ( dividend : in std_logic_vector(7 downto 0);
           quotient : out integer);
end divider;

architecture Behavioral of divider is

begin
    with dividend select
        quotient <= 12000000 when "00000101",
                    6000000 when "00001010",
                    4000000 when "00001111",
                    3000000 when "00010100",
                    2400000 when "00011001",
                    2000000 when "00011110",
                    1714286 when "00100011",
                    1500000 when "00101000",
                    1333333 when "00101101",
                    1200000 when "00110010",
                    1090909 when "00110111",
                    1000000 when "00111100",
                    923077 when "01000001",
                    857143 when "01000110",
                    800000 when "01001011",
                    750000 when "01010000",
                    705882 when "01010101",
                    666667 when "01011010",
                    631579 when "01011111",
                    600000 when "01100100",
                    571429 when "01101001",
                    545455 when "01101110",
                    521739 when "01110011",
                    500000 when "01111000",
                    480000 when "01111101",
                    461538 when "10000010",
                    444444 when "10000111",
                    428571 when "10001100",
                    413793 when "10010001",
                    400000 when "10010110",
                    387097 when "10011011",
                    375000 when "10100000",
                    363636 when "10100101",
                    352941 when "10101010",
                    342857 when "10101111",
                    333333 when "10110100",
                    324324 when "10111001",
                    315789 when "10111110",
                    307692 when "11000011",
                    300000 when "11001000",
                    0 when others;
end Behavioral;
