def num2vhdl_slv(num, width=4):
    """ Creates a VHDL slv (standard_logic_vector) string from
        a number. The width in bytes can be specified.
        
        Examples:
            num2vhdl_slv(10, width=1) => x"0A"
            num2vhdl_slv(0x10, width=2) => x"0010"
    """
    return ('x"%0' + str(width * 2) + 'X"') % num