1) In general, a device is a machine designed for a purpose. In a general context, a computer can be considered a device.
2) In the context of computer technology, a device is a unit of hardware , outside or inside the case or housing for the essential computer (processor, memory, and data paths) that is capable of providing input to the essential computer or of receiving output or of both. When the term is used generally (as in computer devices ), it can include keyboards, mouses, display monitors, hard disk drives, CD-ROM players, printers, audio speakers and microphones, and other hardware units. Some devices such as a hard disk drive or a CD-ROM drive, while physically inside the computer housing, are considered devices because they are separately installable and replaceable. With notebook and smaller computers, devices tend to be more physically integrated with the "non-device" part of the computer.
The term peripheral (a truncation of peripheral device ) is sometimes used as a synonym for device or any input/output unit.