A computer is a collection of digital electronic circuits which carry out logical and computational operations. Digital circuits consider only extreme values of the voltages applied in the circuit.Typical values of the applied voltages are 0 volts and 5 volts; many systems also work on 0 and 3 volts. In a digital system, the high value of voltage may be coded as 1, while the low value may be coded as 0. This notation makes the use of binary number system possible in programming. Figure shows the major components of a computer and various connections between them.
The digital circuits used for computer applications are very large and are generally connected together. These are manufactured on small chips made of semi conducting materials. The circuits embedded on different chips carry out different functions. The main chip in a computer is the microprocessor chip, which is also known as the CPU (central processing unit). Figure shows the inside structure of a typical computer microprocessor. This chip is considered to be the controlling chip of a computer system since it controls the activities of other chips as well as outside devices connected to the computer, such as monitor and printer. In addition, it can also perform logical and computational tasks. Microprocessors work on a parallel system, which implies that if it is a 32-bit system (which is the most commonly used system these days), there would be 32 parallel circuits on the chip for processing data. Also, if input and output terminals are different, then the chip will contain 32 terminals for input and 32 terminals for output. Similarly, in a 64-bit system, the number would increase to 64; inside the chip there would be 64 parallel circuits, one for each bit. There would be more terminals for control, for interruptions, and for connections to various other devices. Thus, you would find a large number of terminals on a CPU. Figure shows a typical structure of one of the first-generation microprocessors. The recent ones possess greater complexity, although the basic design concept has not changed much.
The various activities that a microprocessor performs, such as storing data, doing arithmetic calculations (addition, subtraction, multiplication, division, etc), are the result of instructions given to the CPU in the form of sequences of Os and 1s, which are ultimately converted to indicate the application of appropriate set of voltages on the appropriate circuit terminals. Since these voltages are either 0 volts or say 5 volts, we can devise a code to denote the high voltage as 1 and low voltage as 0. In this manner we can express an instruction to a CPU as a set or sequence of Os and 1s. Microprocessors are designed to carry out a large number of instructions and all the instructions may be represented by different sequences of Os and 1s. Each instruction is represented by a unique set of Os and 1s. The output of the microprocessor is also represented in the form of set of voltages on output terminals. Some terminals will be at 5 volts, while some will be at 0 volts. Therefore, the output generated from a microprocessor may also be coded as a set of Os and 1 s, representing a binary number. Thus, we see that all inputs to a microprocessor are in the form of binary numbers and outputs are also in the form of binary numbers; we can therefore safely conclude that all computers work on binary numbers. Some sequences of these numbers are interpreted (coded) as letters such as A, B, etc., while others are interpreted as digits or operators such as +, -, *, etc. Still others are instructions that may be used for control and manipulation of data. In order to ensure that every computer behaves in a uniform manner, the character representations are standardized as per ASCII (pronounced as as-key) code. This is a universal code. The details of this code are given in Appendix A. In different computer languages, these codes are used along with some specific codes of the language itself to enable writing of computer programs. A computer program forms a part of the software without which the computer cannot perform any function.
The internal structure of a typical CPU consists of circuits which form a number of registers (the typical number is 16), an arithmetic unit for carrying out arithmetic operations, a logic unit, and a control unit. It contains a large number of terminals for connection to external devices (for instance, a typical CPU has as many as 478 terminals; another dual core processor has about 775 terminals). Out of these, a group of terminals is used for data input, another group of terminals for data output, another group for memory addresses, and still another group for control purposes. Besides, some terminals are reserved for interrupt service. An interrupt service may be explained as follows: Suppose you are busy with some work and someone rings the door bell. You stop your work and attend to the person at the door. After that, you return and resume your work. In the same way, consider that some program is being executed on the computer, when a signal on the interrupt line is detected. In such a scenario, the computer first saves the ongoing program status, attends to the item on the interrupt, and after finishing work on it, the computer resumes the ongoing program.
Every CPU supports a set of instructions designed by its manufacturer. The manufacturer supplies the codes of instructions in the form of sequences of Os and Is or in the form of assembly codes discussed in the following section. The circuit designs of different manufacturers are different and hence the codes for carrying out different processes on the data are also different. The sets of instructional codes for a CPU are called machine language codes or simply machine language.
The CPU is mounted on a printed circuit board called the main board or mother board. The main board connects the CPU to other chips and ports, such as parallel port, serial port, USB port, etc. External devices such as mouse, keyboard, printer, pen drive, etc., are connected to the CPU through these ports. The mother (or main) board, in general, also contains circuits called modems to enable connection to display devices such as monitors, internet, sound systems, etc.