def address_width_from_data_templates(templates):
    """
    Find the number of bits needed to address all the templates.

    Args:
        templates (list(DataTemplate)): The data templates to be
            addressed.
    Returns:
        (int): The width in bits of the largest address
    """

    return max([len(template.address_range) for template in templates])