A simple Mathematica code based on the differential realization of hard-core boson operators for finding exact solutions of the periodic-N spin-1/2 systems with or beyond nearest neighbor interactions is proposed, which can easily be used to study general spin-1/2 interaction systems. As an example, The code is applied to study XXX spin-1/2 chain with nearest neighbor interaction in a uniform transverse field. It shows that there are [N/2] level-crossing points in the ground state, where N is the periodic number of the system and [x] stands for the integer part of x, when the interaction strength and magnitude of the magnetic field satisfy certain conditions. The quantum phase transitional behavior in the ground state of the system in the thermodynamic limit is also studied.