Misplaced Pages

Input/output

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

In computing , input/output ( I/O , i/o , or informally io or IO ) is the communication between an information processing system, such as a computer , and the outside world, such as another computer system, peripherals, or a human operator. Inputs are the signals or data received by the system and outputs are the signals or data sent from it. The term can also be used as part of an action; to "perform I/O" is to perform an input or output operation .

#517482

58-403: I/O devices are the pieces of hardware used by a human (or other system) to communicate with a computer. For instance, a keyboard or computer mouse is an input device for a computer, while monitors and printers are output devices . Devices for communication between computers, such as modems and network cards , typically perform both input and output operations. Any interaction with

116-419: A disk drive , is considered I/O. The CPU and its supporting circuitry may provide memory-mapped I/O that is used in low-level computer programming , such as in the implementation of device drivers , or may provide access to I/O channels . An I/O algorithm is one designed to exploit locality and perform efficiently when exchanging data with a secondary storage device, such as a disk drive. An I/O interface

174-432: A monitor , mouse , keyboard , and speakers . By contrast, software is a set of written instructions that can be stored and run by hardware. Hardware derived its name from the fact it is hard or rigid with respect to changes, whereas software is soft because it is easy to change. Hardware is typically directed by the software to execute any command or instruction . A combination of hardware and software forms

232-428: A CPU is required. Higher-level operating system and programming facilities employ separate, more abstract I/O concepts and primitives . For example, most operating systems provide application programs with the concept of files . Most programming languages provide I/O facilities either as statements in the language or as functions in a standard library for the language. An alternative to special primitive functions

290-455: A GPU integrated into the motherboard. Most computers also have an external data bus to connect peripheral devices to the motherboard. Most commonly, Universal Serial Bus (USB) is used. Unlike the internal bus, the external bus is connected using a bus controller that allows the peripheral system to operate at a different speed from the CPU. Input and output devices are used to receive data from

348-479: A centralized memory that stored both data and programs, a central processing unit (CPU) with priority of access to the memory, and input and output (I/O) units . Von Neumann used a single bus to transfer data, meaning that his solution to the storage problem by locating programs and data adjacent to each other created the Von Neumann bottleneck when the system tries to fetch both at the same time—often throttling

406-590: A commensurate increase in energy use and cooling demand. The personal computer is one of the most common types of computer due to its versatility and relatively low price. Virtual hardware is software that mimics the function of hardware; it is commonly used in infrastructure as a Service (IaaS) and platform as a Service (PaaS). Embedded systems have the most variation in their processing power and cost: from an 8-bit processor that could cost less than USD $ 0.10, to higher-end processors capable of billions of operations per second and costing over USD$ 100. Cost

464-437: A cord, light or takes some kind of battery. Some companies, such as Dell and Apple , will recycle computers of their make or any other make. Otherwise, a computer can be donated to Computer Aid International which is an organization that recycles and refurbishes old computers for hospitals, schools, universities, etc. Side-effect (computer science) In computer science , an operation, function or expression

522-505: A device traditionally considered as an output device may provide status data (e.g., low toner, out of paper, paper jam). In computer architecture, the combination of the CPU and main memory , to which the CPU can read or write directly using individual instructions , is considered the brain of a computer. Any transfer of information to or from the CPU/memory combo, for example by reading data from

580-469: A representation that human users can understand. From the human user 's perspective, the process of reading or seeing these representations is receiving output; this type of interaction between computers and humans is studied in the field of human–computer interaction . A further complication is that a device traditionally considered an input device, e.g., card reader, keyboard, may accept control commands to, e.g., select stacker, display keyboard lights, while

638-414: A single piece of state, like condition codes, then the logic required to update that state sequentially may become a performance bottleneck. The problem is particularly acute on some processors designed with pipelining (since 1990) or with out-of-order execution . Such a processor may require additional control circuitry to detect hidden side effects and stall the pipeline if the next instruction depends on

SECTION 10

#1732848896518

696-421: A usable computing system, although other systems exist with only hardware. Early computing devices were more complicated than the ancient abacus date to the seventeenth century. French mathematician Blaise Pascal designed a gear-based device that could add and subtract, selling around 50 models. The stepped reckoner was invented by Gottfried Leibniz by 1676, which could also divide and multiply. Due to

754-400: A variety of plastics that are present in bulk in computers or other electronics can reduce the costs of constructing new systems. Components frequently contain copper , gold , tantalum , silver , platinum , palladium , and lead as well as other valuable materials suitable for reclamation. The central processing unit contains many toxic materials. It contains lead and chromium in

812-444: A very similar commodity . Profit margins have also been reduced. Even when the performance is not increasing, the cost of components has been dropping over time due to improved manufacturing techniques that have fewer components rejected at quality assurance stage. The most common instruction set architecture (ISA)—the interface between a computer's hardware and software—is based on the one devised by von Neumann in 1945. Despite

870-492: Is a growing movement to recycle old and outdated parts. Computer hardware contain dangerous chemicals such as lead, mercury, nickel, and cadmium. According to the EPA these e-wastes have a harmful effect on the environment unless they are disposed of properly. Making hardware requires energy, and recycling parts will reduce air pollution , water pollution, as well as greenhouse gas emissions. Disposing unauthorized computer equipment

928-427: Is a particular concern with these systems, with designers often choosing the cheapest option that satisfies the performance requirements. A computer case encloses most of the components of a desktop computer system. It provides mechanical support and protection for internal elements such as the motherboard, disk drives, and power supply, and controls and directs the flow of cooling air over internal components. The case

986-464: Is also part of the system to control electromagnetic interference radiated by the computer and protects internal parts from electrostatic discharge. Large tower cases provide space for multiple disk drives or other peripherals and usually stand on the floor, while desktop cases provide less expansion room. All-in-one style designs include a video display built into the same case. Portable and laptop computers require cases that provide impact protection for

1044-586: Is commonly used to produce side effects, to update a system's state. By contrast, declarative programming is commonly used to report on the state of system, without side effects. Functional programming aims to minimize or eliminate side effects. The lack of side effects makes it easier to do formal verification of a program. The functional language Haskell eliminates side effects such as I/O and other stateful computations by replacing them with monadic actions. Functional languages such as Standard ML , Scheme and Scala do not restrict side effects, but it

1102-413: Is customary for programmers to avoid them. Effect systems extend types to keep track of effects, permitting concise notation for functions with effects, while maintaining information about the extent and nature of side effects. In particular, functions without effects correspond to pure functions. Assembly language programmers must be aware of hidden side effects—instructions that modify parts of

1160-473: Is either true or false. Boolean algebra is now the basis of the circuits that model the transistors and other components of integrated circuits that make up modern computer hardware. In 1945, Turing finished the design for a computer (the Automatic Computing Engine ) that was never built. Around this time, technological advancement in relays and vacuum tubes enabled the construction of

1218-416: Is idempotent if multiple applications of the subroutine have the same effect on the system state as a single application, in other words if the function from the system state space to itself associated with the subroutine is idempotent in the mathematical sense . For instance, consider the following Python program: setx is idempotent because the second application of setx to 3 has the same effect on

SECTION 20

#1732848896518

1276-524: Is in fact illegal. Legislation makes it mandatory to recycle computers through the government approved facilities. Recycling a computer can be made easier by taking out certain reusable parts. For example, the RAM , DVD drive, the graphics card , hard drive or SSD , and other similar removable parts can be reused. Many materials used in computer hardware can be recovered by recycling for use in future production. Reuse of tin , silicon , iron , aluminum , and

1334-499: Is required whenever the I/O device is driven by a processor. Typically a CPU communicates with devices via a bus . The interface must have the necessary logic to interpret the device address generated by the processor. Handshaking should be implemented by the interface using appropriate commands (like BUSY, READY, and WAIT), and the processor can communicate with an I/O device through the interface. If different data formats are being exchanged,

1392-418: Is said to have a side effect if it has any observable effect other than its primary effect of reading the value of its arguments and returning a value to the invoker of the operation. Example side effects include modifying a non-local variable , a static local variable or a mutable argument passed by reference ; raising errors or exceptions; performing I/O ; or calling other functions with side-effects. In

1450-434: Is surrounded by cooling fluid) and direct-to-chip (where the cooling fluid is directed to each computer chip) can be more expensive but are also more efficient. Most computers are designed to be more powerful than their cooling system, but their sustained operations cannot exceed the capacity of the cooling system. While performance can be temporarily increased when the computer is not hot ( overclocking ), in order to protect

1508-466: Is the I/O monad , which permits programs to just describe I/O, and the actions are carried out outside the program. This is notable because the I/O functions would introduce side-effects to any programming language, but this allows purely functional programming to be practical. The I/O facilities provided by operating systems may be record-oriented , with files containing records , or stream-oriented, with

1566-489: Is the main component of a computer. It is a board with integrated circuitry that connects the other parts of the computer including the CPU , the RAM , the disk drives ( CD , DVD , hard disk , or any others) as well as any peripherals connected via the ports or the expansion slots . The integrated circuit (IC) chips in a computer typically contain billions of tiny metal–oxide–semiconductor field-effect transistors (MOSFETs). Components directly attached to or to part of

1624-401: The operating system to map virtual memory to different areas of the finite physical memory. Computer processors generate heat, and excessive heat impacts their performance and can harm the components. Many computer chips will automatically throttle their performance to avoid overheating. Computers also typically have mechanisms for dissipating excessive heat, such as air or liquid coolers for

1682-403: The CPU and GPU and heatsinks for other components, such as the RAM . Computer cases are also often ventilated to help dissipate heat from the computer. Data centers typically use more sophisticated cooling solutions to keep the operating temperature of the entire center safe. Air-cooled systems are more common in smaller or older data centers, while liquid-cooled immersion (where each computer

1740-548: The annual rate of improvement in hardware performance exceeded 50 percent, enabling the development of new computing devices such as tablets and mobiles. Alongside the density of transistors, DRAM memory as well as flash and magnetic disk storage also became exponentially more compact and cheaper. The rate of improvement slackened off in the twenty-first century. In the twenty-first century, increases in performance have been driven by increasing exploitation of parallelism . Applications are often parallelizable in two ways: either

1798-618: The atmosphere, landfill or waterways. While electronics consist a small fraction of total waste generated, they are far more dangerous. There is stringent legislation designed to enforce and encourage the sustainable disposal of appliances, the most notable being the Waste Electrical and Electronic Equipment Directive of the European Union and the United States National Computer Recycling Act. E-cycling ,

Input/output - Misplaced Pages Continue

1856-443: The design of the CPU, memory, and memory interconnect . Memory hierarchy ensures that the memory quicker to access (and more expensive) is located closer to the CPU, while slower, cheaper memory for large-volume storage is located further away. Memory is typically segregated to separate programs from data and limit an attacker's ability to alter programs. Most computers use virtual memory to simplify addressing for programs, using

1914-440: The design was incorporated into the earliest computers: punch cards for input and output, memory , an arithmetic unit analogous to central processing units , and even a primitive programming language similar to assembly language . In 1936, Alan Turing developed the universal Turing machine to model any type of computer, proving that no computer would be able to solve the decision problem . The universal Turing machine

1972-565: The device, each with a special purpose. The port numbers are in a separate address space from that used by normal instructions. Direct memory access (DMA) is a means for devices to transfer large chunks of data to and from memory independently of the CPU. Hardware (computing) Computer hardware includes the physical parts of a computer , such as the central processing unit (CPU), random access memory (RAM) , motherboard , computer data storage , graphics card , sound card , and computer case . It includes external devices such as

2030-626: The external world or write data respectively. Common examples include keyboards and mice (input) and displays and printers (output). Network interface controllers are used to access the Internet . USB ports also allow power to connected devices—a standard USB supplies power at 5 volts and up to 500 milliamps (2.5 watts ), while powered USB ports with additional pins may allow the delivery of more power—up to 6 amps at 24v. Global revenue from computer hardware in 2023 reached $ 705.17 billion. Because computer parts contain hazardous materials, there

2088-462: The file containing a stream of bytes. Channel I/O requires the use of instructions that are specifically designed to perform I/O operations. The I/O instructions address the channel or the channel and device; the channel asynchronously accesses all other required addressing and control information. This is similar to DMA, but more flexible. Port-mapped I/O also requires the use of special I/O instructions. Typically one or more ports are assigned to

2146-594: The first computers. Building on Babbage's design, relay computers were built by George Stibitz at Bell Laboratories and Harvard University 's Howard Aiken , who engineered the MARK I . Also in 1945, mathematician John von Neumann —working on the ENIAC project at the University of Pennsylvania —devised the underlying von Neumann architecture that has served as the template for most modern computers. Von Neumann's design featured

2204-461: The hardware from excessive heat, the system will automatically reduce performance or shut down the processor if necessary. Processors also will shut off or enter a low power mode when inactive to reduce heat. Power delivery as well as heat dissipation are the most challenging aspects of hardware design, and have been the limiting factor to the development of smaller and faster chips since the early twenty-first century. Increases in performance require

2262-442: The interface must be able to convert serial data to parallel form and vice versa. Because it would be a waste for a processor to be idle while it waits for data from an input device there must be provision for generating interrupts and the corresponding type numbers for further processing by the processor if required. A computer that uses memory-mapped I/O accesses hardware by reading and writing to specific memory locations, using

2320-413: The limitations of contemporary fabrication and design flaws, Leibniz' reckoner was not very functional, but similar devices ( Leibniz wheel ) remained in use into the 1970s. In the 19th century, Englishman Charles Babbage invented the difference engine , a mechanical device to calculate polynomials for astronomical purposes. Babbage also designed a general-purpose computer that was never built. Much of

2378-525: The lungs, liver, and kidneys. Computer components contain many toxic substances, like dioxins , polychlorinated biphenyls (PCBs), cadmium , chromium , radioactive isotopes and mercury . Circuit boards contain considerable quantities of lead-tin solders that are more likely to leach into groundwater or create air pollution due to incineration. Recycling of computer hardware is considered environmentally friendly because it prevents hazardous waste , including heavy metals and carcinogens, from entering

Input/output - Misplaced Pages Continue

2436-506: The metal plates. Resistors, semiconductors, infrared detectors, stabilizers, cables, and wires contain cadmium. The circuit boards in a computer contain mercury, and chromium. When these types of materials, and chemicals are disposed improperly will become hazardous for the environment. When e-waste byproducts leach into groundwater, are burned, or get mishandled during recycling, it causes harm. Health problems associated with such toxins include impaired mental development, cancer, and damage to

2494-443: The motherboard include: An expansion card in computing is a printed circuit board that can be inserted into an expansion slot of a computer motherboard or backplane to add functionality to a computer system via the expansion bus. Expansion cards can be used to obtain or expand on features not offered by the motherboard. Using expansion cards for a video processor used to be common, but modern computers are more likely to instead have

2552-509: The number of instructions the machines need to use. Based on a recognition that only a few instructions are commonly used, RISC shrinks the instruction set for added simplicity, which also enables the inclusion of more registers . After the invention of RISC in the 1980s, RISC based architectures that used pipelining and caching to increase performance displaced CISC architectures, particularly in applications with restrictions on power usage or space (such as mobile phones ). From 1986 to 2003,

2610-447: The presence of side effects, a program's behaviour may depend on history; that is, the order of evaluation matters. Understanding and debugging a function with side effects requires knowledge about the context and its possible histories. Side effects play an important role in the design and analysis of programming languages . The degree to which side effects are used depends on the programming paradigm. For example, imperative programming

2668-399: The processor state which are not mentioned in the instruction's mnemonic. A classic example of a hidden side effect is an arithmetic instruction that implicitly modifies condition codes (a hidden side effect) while it explicitly modifies a register (the intended effect). One potential drawback of an instruction set with hidden side effects is that, if many instructions have side effects on

2726-552: The recycling of computer hardware, refers to the donation, reuse, shredding and general collection of used electronics. Generically, the term refers to the process of collecting, brokering, disassembling, repairing and recycling the components or metals contained in used or discarded electronic equipment, otherwise known as electronic waste (e-waste). E-cyclable items include, but are not limited to: televisions, computers, microwave ovens, vacuum cleaners, telephones and cellular phones, stereos, and VCRs and DVDs just about anything that has

2784-435: The results of those effects. Absence of side effects is a necessary, but not sufficient, condition for referential transparency. Referential transparency means that an expression (such as a function call) can be replaced with its value. This requires that the expression is pure , that is to say the expression must be deterministic (always give the same value for the same input) and side-effect free. Side effects caused by

2842-411: The same assembly language instructions that computer would normally use to access memory. An alternative method is via instruction-based I/O which requires that a CPU have specialized instructions for I/O. Both input and output devices have a data processing rate that can vary greatly. With some devices able to exchange data at very high speeds direct access to memory (DMA) without the continuous aid of

2900-646: The same function is running across multiple areas of data ( data parallelism ) or different tasks can be performed simultaneously with limited interaction ( task parallelism ). These forms of parallelism are accommodated by various hardware strategies, including instruction-level parallelism (such as instruction pipelining ), vector architectures and graphical processing units (GPUs) that are able to implement data parallelism, thread-level parallelism and request-level parallelism (both implementing task-level parallelism). Microarchitecture , also known as computer organization, refers to high-level hardware questions such as

2958-505: The same value as the first application to -3. One common demonstration of side effect behavior is that of the assignment operator in C . The assignment a = b is an expression that evaluates to the same value as the expression b , with the side effect of storing the R-value of b into the L-value of a . This allows multiple assignment: Because the operator right associates , this

SECTION 50

#1732848896518

3016-405: The separation of the computing unit and the I/O system in many diagrams, typically the hardware is shared, with a bit in the computing unit indicating whether it is in computation or I/O mode. Common types of ISAs include CISC ( complex instruction set computer ), RISC ( reduced instruction set computer ), vector operations , and hybrid modes. CISC involves using a larger expression set to minimize

3074-488: The system by an interactor is an input and the reaction the system responds is called the output. The designation of a device as either input or output depends on perspective. Mice and keyboards take physical movements that the human user outputs and convert them into input signals that a computer can understand; the output from these devices is the computer's input. Similarly, printers and monitors take signals that computers output as input, and they convert these signals into

3132-414: The system state as the first application: x was already set to 3 after the first application, and it is still set to 3 after the second application. A pure function is idempotent if it is idempotent in the mathematical sense . For instance, consider the following Python program: abs is idempotent because the second application of abs to the return value of the first application to -3 returns

3190-445: The system's performance. Computer architecture requires prioritizing between different goals, such as cost, speed, availability, and energy efficiency. The designer must have a good grasp of the hardware requirements and many different aspects of computing, from compilers to integrated circuit design. Cost has also become a significant constraint for manufacturers seeking to sell their products for less money than competitors offering

3248-449: The time taken for an operation to execute are usually ignored when discussing side effects and referential transparency. There are some cases, such as with hardware timing or testing, where operations are inserted specifically for their temporal side effects e.g. sleep(5000) or for (int i = 0; i < 10000; ++i) {} . These instructions do not change state other than taking an amount of time to complete. A subroutine with side effects

3306-446: The unit. Hobbyists may decorate the cases with colored lights, paint, or other features, in an activity called case modding . Most personal computer power supply units meet the ATX standard and convert from alternating current (AC) at between 120 and 277 volts provided from a power outlet to direct current (DC) at a much lower voltage: typically 12, 5, or 3.3 volts. The motherboard

3364-451: Was a type of stored-program computer capable of mimicking the operations of any Turing machine (computer model) based on the software instructions passed to it. The storage of computer programs is key to the operation of modern computers and is the connection between computer hardware and software. Even prior to this, in the mid-19th century mathematician George Boole invented Boolean algebra —a system of logic where each proposition

#517482