In phased array antenna arrays and reconfigurable intelligent metasurfaces,due to the difficulty in achieving simulated compensation phase,most current methods use digital quantization phase to achieve compensation phase.How-ever,to achieve better performance,more diodes need to be used on each unit.This paper analyzes and proposes a quasi N-bit design method,where each unit uses a diode to achieve 180° phase switching.Through particle swarm opti-mization algorithm,the position of the unit's pre-phase distribution is optimized to achieve near accurate compensation phase sidelobe performance.The simulation results show that in a 10×10 array,the quasi 3-bit scheme can still achieve sidelobe indicators below-10 dB.