A computer is an electronic device that can be programmed to perform logical and arithmetic operations. It consists of a central processing unit (CPU) and memory. The CPU contains an arithmetic logic unit that performs calculations and a control unit that directs operations. Memory stores programs and data. Peripheral devices allow information to be input and output. Early computers were room-sized, while modern computers are integrated circuits that can fit into mobile devices. Personal computers are ubiquitous and embedded computers are in many devices.