variable i : integer range b_n'RIGHT to b_n'LEFT := b_n'RIGHT; -- 3 downto 0 in my program
begin
if reset = '1' then
state <= IDLE;
STOP <= '1';
else if clk'event and clk = '1' then
in your code , last line should be replaced with
elsif clk'event and clk = '1' then
I have compiled this code , and after including library, it compiled successfully.
put below lines at top of your code --
library ieee;
use ieee.std_logic_1164.all;
Let me know if you still get some error.
Rahul