The CPU is the central processing unit of a computer and performs most data processing. It consists of three main parts: the control unit, arithmetic logic unit (ALU), and registers. The control unit directs operations, the ALU performs calculations, and registers temporarily store data. A stack uses a last-in, first-out approach to storing data and is useful for evaluating arithmetic expressions in postfix notation.