def __init__(self, parent, start_address=0, allocated_memory=100, memory_input='00', architecture_class='None'):
    if (type(memory_input) != str):
        raise TypeError(('Incorrect type for memory input to create virtual memory. type: ' + str(type(memory_input))))
    if (type(start_address) != int):
        if (type(start_address) == str):
            if (len(start_address) > 3):
                if (start_address[0:2] == '0x'):
                    start_address = int(start_address, 16)
            elif (len(start_address) <= 2):
                if ('0x' in start_address):
                    raise ValueError('Input for starting address of virtual memory contains no hex after the 0x')
                else:
                    raise TypeError('Incorrect type for starting address to create virtual memory.')
            else:
                raise TypeError('Incorrect type for starting address to create virtual memory.')
    if ('0x' in memory_input):
        if (memory_input[0:2] == '0x'):
            memory_input = memory_input[2:]
    if (len(memory_input) > (allocated_memory * 2)):
        raise IndexError('Memory inputted for creation of virtual memory exceeds the length allowed by the allocated memory')
    elif (len(memory_input) < (allocated_memory * 2)):
        memory_input = (memory_input + ('0' * ((allocated_memory * 2) - len(memory_input))))
    self.parent = parent
    self.start_address = start_address
    self.memory = findall('..', memory_input)
    self.allocated_memory = allocated_memory
    self.architecture_class = architecture_class
def __init__(self, parent, start_address=0, allocated_memory=100, memory_input='00', architecture_class='None'):
    if (type(memory_input) != str):
        raise TypeError(('Incorrect type for memory input to create virtual memory. type: ' + str(type(memory_input))))
    if (type(start_address) != int):
        if (type(start_address) == str):
            if (len(start_address) > 3):
                if (start_address[0:2] == '0x'):
                    start_address = int(start_address, 16)
            elif (len(start_address) <= 2):
                if ('0x' in start_address):
                    raise ValueError('Input for starting address of virtual memory contains no hex after the 0x')
                else:
                    raise TypeError('Incorrect type for starting address to create virtual memory.')
            else:
                raise TypeError('Incorrect type for starting address to create virtual memory.')
    if ('0x' in memory_input):
        if (memory_input[0:2] == '0x'):
            memory_input = memory_input[2:]
    if (len(memory_input) > (allocated_memory * 2)):
        raise IndexError('Memory inputted for creation of virtual memory exceeds the length allowed by the allocated memory')
    elif (len(memory_input) < (allocated_memory * 2)):
        memory_input = (memory_input + ('0' * ((allocated_memory * 2) - len(memory_input))))
    self.parent = parent
    self.start_address = start_address
    self.memory = findall('..', memory_input)
    self.allocated_memory = allocated_memory
    self.architecture_class = architecture_class