The device used to convert alternating current to direct current is a rectifier. The rectifier takes the AC, which can flow in two directions, and runs it through diodes so power reaches the device through one direction only.
The rectifier is a specific circuit set up to connect the diodes in a pattern that provides the type of DC electricity needed. With a single diode connected, only half of the AC power is passed through. With the addition of a transformer and a second diode, all of the AC can be passed, providing positive and negative connections. Two additional diodes may be used in the place of the transformer.