A system and method for a logic device is disclosed. A first substrate, a second substrate and a third substrate is provided. A first input nanomagnet is disposed over the first substrate, a second input nanomagnet is disposed over the second substrate, and a third input nanomagnet is disposed over the third substrate. The easy axis of the first input nanomagnet, the second input nanomagnet, and the third input nanomagnet are in a first direction perpendicular to the first substrate, the second substrate and the third substrate. A spacer layer is disposed over the first input nanomagnet, the second input nanomagnet, and the third input nanomagnet. A first ferromagnetic layer is disposed over the spacer layer.