Contemporary hardware builds on semiconductor logic. One of the basic elements of the semiconductor logic is a transistor, which can act as an active switching element, creating a connection between its collector and emitter pins when current is injected into its base pin. The transistor can be used to build gates that implement simple logical functions such as AND and OR, as sketched below.
Note that the principal illustration uses bipolar transistors in place of more practical field effect transistors, and a simplified composition out of individual transistors in place of more practical direct gate construction.
Gates that implement simple logical functions can be used to construct more complex functions, such as buffers, shifters, decoders, arithmetic units and other circuits. The illustration of constructing a flip flop, which in fact represents a single bit of memory, is below.
Note that besides well known construction patterns of useful circuits, approaches to design a circuit given the required logical function are also very well established. In fact, many circuits are sold as designs rather than chips, the designs are merged depending on the application and only then embedded in multipurpose chips.
References.Â
Ken Bigelow: Play Hookey Digital Logic Tutorial. http://www.play-hookey.com/digital