Simple Computer Design

CPU basics and organization

We already know that a computer must manipulate binary-coded data and that memory is used to store both data and program instructions. The program must be executed and the data must be processed correctly. The central processing unit (CPU) is responsible for fetching program instructions, decoding each instruction that is fetched, and performing the indicated sequence of operations on the correct data.
All computers have a CPU that can be divided into two pieces. The first is the datapath, which is a network of storage units (registers) and arithmetic and logic units (for performing various operations on data) connected by buses (capable of moving data from place to place) where the timing is controlled by clocks. The second CPU component is the control unit, a module responsible for sequencing operations and making sure the correct data are where they need to be at the correct time. Together, these components perform the tasks of the CPU: fetching instructions, decoding them, and finally performing the indicated sequence of operations. The performance of a machine is directly affected by the design of the datapath and the control unit.

The Registers

Registers are used in computer systems as places to store a wide variety of data, such as addresses, program counters, and data necessary for program execution. Registers are located on the processor so information can be accessed very quickly; they are actually the fastest type of memory but also the most expensive. D flip-flops can be used to implement registers. One D flip-flop is equivalent to a 1-bit register, so a collection of D flip-flops is necessary to store multi-bit values. For example, to build a 16-bit register, we need to connect 16 D flip-flops together. These collections of flip-flops must be clocked to work in unison. At each pulse of the clock, input enters the register and cannot be changed (and thus is stored) until the clock pulses again. Data processing on a computer is usually done on fixed-size binary words stored in registers. Therefore, most computers have registers of a certain size. The number of registers in a machine varies from architecture to architecture, but is typically a power of 2, with 16, 32, and 64 being most common. Registers can contain data, addresses, control information, or instructions. Information is written to registers, read from registers, and transferred from register to register.
In modern computer systems, there are many types of specialized registers: registers to store information or instructions, registers to shift values, registers to compare values, and registers that count. Most computers have register sets, and each set is used in a specific way.

The ALU

The arithmetic logic unit (ALU) carries out the logic operations (such as comparisons) and arithmetic operations (such as add or multiply) required during the program execution. Generally, an ALU has two data inputs and one data output. Operations performed in the ALU often affect bits in the status register (bits are set to indicate actions such as whether an overflow has occurred). The ALU knows which operations to perform because it is controlled by signals from the control unit.

The Control Unit

The control unit is the “policeman” or “traffic manager” of the CPU. It monitors the execution of all instructions and the transfer of all information. The control unit extracts instructions from memory, decodes these instructions (making sure data are in the right place at the right time), tells the ALU which registers to use, services interrupts, and turns on the correct circuitry in the ALU for the execution of the desired operation. The control unit uses a program counter register to find the next instruction for execution and a status register to keep track of overflows, carries, borrows, and the like.

The Bus

The CPU communicates with the other components via a bus. A bus is a set of wires that acts as a shared but common datapath to connect multiple subsystems within the system. It consists of multiple lines, allowing the parallel movement of bits. At any one time, only one device (be it a register, the ALU, memory, or some other component) may use the bus. The speed of the bus is affected by its length as well as by the number of devices sharing it. A bus can be point-to-point, connecting two specific components or it can be a common pathway that connects a number of devices, requiring these devices to share the bus - referred to as a multipoint bus.

Because of this sharing, the bus protocol is very important. A typical bus consists of data lines, address lines, control lines and power lines. Often the lines of a bus dedicated to moving data are called the data bus. These data lines contain the actual information that must be moved from one location to another. Control lines indicate which device has permission to use the bus and for what purpose (reading or writing from memory or from an input/output [I/O] device, for example). Control lines also transfer acknowledgments for bus requests, interrupts, and clock synchronization signals. Address lines indicate the location (e.g., in memory) that the data should be either read from or written to. The power lines provide the electrical power necessary. Typical bus transactions include sending an address (for a read or write), transferring data from memory to a register (a memory read), and transferring data to the memory from a register (a memory write). In addition, buses are used for I/O reads and writes from peripheral devices. Each type of transfer occurs within a bus cycle, the time between two ticks of the bus clock.

The work performed by an individual computer system within the IT system can be characterized by input, processing, and output. This characterization is often represented by the input–process–output (IPO) model. Storage is also represented within this model. Alternatively, storage can be interpreted as output to be saved for use as future input. Actually, all IT systems can ultimately be characterized by the same basic IPO model at all levels, from a single computer to a complex aggregation of computers, although the complexity of large systems may obscure the model and make it more difficult to determine the actual inputs, outputs, and processing operations.

A system is a group of interacting or interrelated elements that work together according to a set of rules to form a unified whole. Systems can be found everywhere, from natural ecosystems to human-made structures like computer systems or organizations. The system concept refers to a structured set of interrelated components that work together to achieve a common goal. This concept is widely applicable across various fields, including science, engineering, sociology, and management. Systems can be open (interacting with their environment) or closed (isolated from their environment).

« Previous Next »