VHDL code spi and logic