Various VHDL functions