A thermodynamically efficient garment for cooling andor heating a human body. The programmable structure comprises placing heating elements in close proximity to the programmable structure to heat the programmable structure during programming. Threshold voltages of MOS transistors that constitute the memory cell, are set higher than those of MOS transistors constituting the peripheral circuit. The frame member is primarily formed with an extruded component that is bent into a U-shape.