1. A device ( 500 , 600 , 700 ) comprising: an electrode ( 301 , 303 ); an alloy electrode ( 502 , 602 , 702 ); and an active region ( 510 , 610 , 710 ) sandwiched between the electrode and the alloy electrode, the alloy electrode forms dopants in a sub-region of the active region adjacent to the alloy electrode such that the dopant can be selectively positioned within the active region to control the flow of charge carriers between the electrode and the alloy electrode.