We demonstrate that a periodic binary fiber grating (PBFG) formed by a sequence of two alternating homogeneous layers can be designed to generate flat-top optical pulses by reflection. For this purpose, specific design criteria allow an exact PBFG reflectance that approaches a sinc function with linear phase. Our design provides large layer thicknesses (of around hundreds of microns) and it is robust under random defects in the structure, which represents an advantage from a technological viewpoint. Furthermore, the considered PBFG can be alternated with homogeneous fiber spans to generate precise sequences of flat-top pulses. Numerical examples of single and multiple flat-top pulse generation illustrate our results.