Problem with Octal to Binary in VHDL
It seems like you want the if B8 = XX literals to be octal, not decimal. Try using the octal literal notation: if B8 = 8#XX#.

Your input range is max 16:

B8  : in  integer range 0 to 16;


But you're comparing against values up to 17:

elsif B8 = 17 then


Try increasing your input range to 0 to 17 or 0 to 8#17# depending on whether you want that to be octal or decimal.

Also take a look at this answer about converting integer to std_logic_vector. Octal is just a notation, if you're not actually changing the underlying signal's value you can do this:
VHDL: Converting from an INTEGER type to a STD_LOGIC_VECTOR