A computer has four main functions: input, processing, output, and storage. It has five key components that enable these functions: the central processing unit (CPU), memory, input units, output units, and storage. The CPU contains the control unit which directs the flow of data and signals, and the arithmetic logic unit which performs basic math and logic operations.