The period-adding bifurcations in a discontinuous system with a variable gap are observed for two control parameters. Various period-adding bifurcations are found by simulations. The bifurcation diagram can be divided into two different zones: chaos and period. The period attractor takes up a considerable part of the parameter space, and all of them show stable period attractors. The periodic zone can also be divided into three different zones: stable period-5 attractor, period-adding bifurcations on the right side of period-5 attractor, and period-adding bifurcations on the right side of period-5 attractor. We choose various control parameters to plot the cobweb of period attractor, and find that it will exhibit a border-collision bifurcation and the period orbit loses its stability, once the position of iteration reaches discontinuous boundary. The discontinuous system has two kinds of border-collision bifurcations: one comes from the gap on the right side, and the other from the gap on the left side. The results show that the period-adding phenomena are due to the border-collision bifurcation at two boundaries of the forbidden area. In order to determine the condition of the period orbit existence, we also choose various control parameters to plot the cobweb of period attractor. The results show that the iteration sequence of period trajectory has a certain sequence with different iteration units. The period trajectory of period-adding bifurcation on the left side of period-5 attractor consists of period-4 and period-5 iteration units, forming period-9, period-13 and period-14 attractor. The period trajectory of period-adding bifurcation on the right side of period-5 attractor consists of period-6 and period-5 iteration units, forming period-11, period-16 and period-21 attractor. All attractors can be easily shown analytically, owing to the piecewise linear characteristics of the map. We analyze its underlying mechanisms from the viewpoint of border-collision bifurcations. The result shows that the period attractor can be determined by two border-collision bifurcations and the condition of stability. Based on the theoretical and iteration unit, the border-collision bifurcations, two border collision bifurcation curves are obtained analytically. The result shows that the theoretical and numerical results are in excellent agreement.