The transformer is an electrical device that is used to step up or step down ac voltage. There are two…