The function of a ground fault interrupter (GFI) is to disconnect the power if a current leakage to ground is…