Design of a High-Density and Low-Power Nonvolatile Logic Element Using MTJ Devices