What is the component of the processor that performs basic calculations and comparison operations?

The processor is an important part of a computer architecture, without it nothing would happen. It is a programmable device that takes input, perform some arithmetic and logical operations and produce some output. In simple words, a processor is a digital device on a chip which can fetch instruction from memory, decode and execute them and provide results.

Basics of a Processor –
A processor takes a bunch of instructions in machine language and executes them, telling the processor what it has to do. Processors performs three basic operations while executing the instruction:

  1. It performs some basic operations like addition, subtraction, multiplication, division and some logical operations using its Arithmetic and Logical Unit (ALU). 
  2. Data in the processor can move from one location to another.
  3. It has a Program Counter (PC) register that stores the address of next instruction based on the value of PC.

A typical processor structure looks like this.

What is the component of the processor that performs basic calculations and comparison operations?
Figure \(\PageIndex{1}\): Von Neumann Architecture. ("File:Computer Systems - Von Neumann Architecture Large poster anchor chart.svg" by BotMultichillT, Wikimedia Commons is licensed under CC BY-NC-SA 4.0)

Basic Processor Terminology

  • Control Unit (CU)
    A control unit (CU) handles all processor control signals. It directs all input and output flow, fetches the code for instructions and controlling how data moves around the system.
  • Arithmetic and Logic Unit (ALU)
    The arithmetic logic unit is that part of the CPU that handles all the calculations the CPU may need, e.g. Addition, Subtraction, Comparisons. It performs Logical Operations, Bit Shifting Operations, and Arithmetic Operation.
  • Main Memory Unit (Registers) 
    1. Accumulator (ACC): Stores the results of calculations made by ALU.
    2. Program Counter (PC): Keeps track of the memory location of the next instructions to be dealt with. The PC then passes this next address to Memory Address Register (MAR).
    3. Memory Address Register (MAR): It stores the memory locations of instructions that need to be fetched from memory or stored into memory.
    4. Memory Data Register (MDR): It stores instructions fetched from memory or any data that is to be transferred to, and stored in, memory.
    5. Current Instruction Register (CIR): It stores the most recently fetched instructions while it is waiting to be coded and executed.
    6. Instruction Buffer Register (IBR): The instruction that is not to be executed immediately is placed in the instruction buffer register IBR.
  • Input/Output Devices – Program or data is read into main memory from the input device or secondary storage under the control of CPU input instruction. Output devices are used to output the information from a computer.
  • Buses – Data is transmitted from one part of a computer to another, connecting all major internal components to the CPU and memory, by the means of Buses. Types:
    1. Data Bus (Data): It carries data among the memory unit, the I/O devices, and the processor.
    2. Address Bus (Address): It carries the address of data (not the actual data) between memory and processor.
    3. Control Bus (Control and Timing): It carries control commands from the CPU (and status signals from other devices) in order to control and coordinate all the activities within the computer.

Memory attached to the CPU is used for storage of data and instructions and is called internal memory The internal memory is divided into many storage locations, each of which can store data or instructions. Each memory location is of the same size and has an address. With the help of the address, the computer can read any memory location easily without having to search the entire memory. when a program is executed, it’s data is copied to the internal memory and is stored in the memory till the end of the execution. The internal memory is also called the Primary memory or Main memory. This memory is also called as RAM, i.e. Random Access Memory. The time of access of data is independent of its location in memory, therefore this memory is also called Random Access memory (RAM).

The method that is used to transfer information between main memoryand external I/O devices is known as the I/O interface, or I/O modules. The CPU is interfaced using special communication links by the peripherals connected to any computer system. These communication links are used to resolve the differences between CPU and peripheral. There exists special hardware components between CPU and peripherals to supervise and synchronize all the input and output transfers that are called interface units.

The binary information that is received from an external device is usually stored in the memory unit. The information that is transferred from the CPU to the external device is originated from the memory unit. CPU merely processes the information but the source and target is always the memory unit. Data transfer between CPU and the I/O devices may be done in different modes.

Data transfer to and from the peripherals may be done in any of the three possible ways

  1. Programmed I/O:  is the result of the I/O instructions written in the program's code. Each data transfer is initiated by an instruction in the program. Usually the transfer is from a CPU register and/or memory. In this case it requires constant monitoring by the CPU of the peripheral devices.
  2. Interrupt- initiated I/O: using an interrupt facility and special commands to issue an interrupt request signal whenever data is available from any device. In the meantime the CPU can proceed processing other programs. The interface meanwhile keeps monitoring the device. When it is determined that the device is ready for a data transfer it initiates an interrupt request signal to the CPU. Upon detection of an external interrupt signal the CPU momentarily stops the task it was processing, and  services program that was waiting on the interrupt to process the I/O transfer> Once the interrupt is satisfied, the CPU then return to the task it was originally processing.
  3. Direct memory access( DMA): The data transfer between a fast storage media such as magnetic disk and main memory is limited by the speed of the CPU. Thus we can allow the peripherals directly communicate with each other using the memory buses, removing the intervention of the CPU. This type of data transfer technique is known as direct memory access, or DMA. During DMA the CPU is idle and it has no control over the memory buses. The DMA controller takes over the buses to manage the transfer directly between the I/O devices and the memory unit.

CPU expands to Central Processing Unit. CPU as a Unit refers to main components interconnected within a Box called Cabinet. Cabinet houses components such as Power Supply, Motherboard, Processor, RAMs, Harddisk Drive & other components as per requirements.Inside CPU on Motherboard with a special designed socket the BRAIN of the Computer lies called Processor/MicroProcessor. The Processor is designed that is fabricated as a single unit comprises of Control Unit & Arithmetic/Logic Unit (ALU).Control Unit executes all Instructions related part whereas ALU performs all Mathematical & Logical Operations.

🏠

Home

Subjects

Math

🧪

Science

🏛️

History

📺

Arts & Humanities

🤝

Social Studies

💻

Engineering & Technology

💰

Business

📚

Other

Resources

📓

Study Guides

🏆

Leaderboard

💯

All Tags

Unanswered

🔀

Random Tags

📱

Computers

Comparisons

An arithmetic-logic unit is the part of a central processing unit that carries out arithmetic and logic operations on the operands in computer instruction words.

In some processors, the ALU is divided into two units: an arithmetic unit (AU) and a logic unit (LU). Some processors contain more than one AU -- for example, one for fixed-point operations and another for floating-point operations.

In computer systems, floating-point computations are sometimes done by a floating-point unit (FPU) on a separate chip called a numeric coprocessor.

How does an arithmetic-logic unit work?

Typically, the ALU has direct input and output access to the processor controller, main memory (random access memory or RAM in a personal computer) and input/output devices. Inputs and outputs flow along an electronic path that is called a bus.

The input consists of an instruction word, sometimes called a machine instruction word, that contains an operation code or "opcode," one or more operands and sometimes a format code. The operation code tells the ALU what operation to perform and the operands are used in the operation.

For example, two operands might be added together or compared logically. The format may be combined with the opcode and tells, for example, whether this is a fixed-point or a floating-point instruction.

The output consists of a result that is placed in a storage register and settings that indicate whether the operation was performed successfully. If it isn't, some sort of status will be stored in a permanent place that is sometimes called the machine status word.

In general, the ALU includes storage places for input operands, operands that are being added, the accumulated result (stored in an accumulator) and shifted results. The flow of bits and the operations performed on them in the subunits of the ALU are controlled by gated circuits.

The gates in these circuits are controlled by a sequence logic unit that uses a particular algorithm or sequence for each operation code. In the arithmetic unit, multiplication and division are done by a series of adding or subtracting and shifting operations.

There are several ways to represent negative numbers. In the logic unit, one of 16 possible logic operations can be performed -- such as comparing two operands and identifying where bits don't match.

The design of the ALU is a critical part of the processor and new approaches to speeding up instruction handling are continually being developed.

What type of functions do ALUs support?

In computer science, ALUs serve as a combinational digital circuit that performs arithmetic and bitwise operations on binary numbers. This is a foundational building block of arithmetic logic circuits for numerous types of control units and computing circuits including central processing units (CPUs), FPUs and graphics processing units.

Long before modern PCs, ALUs first helped to support microprocessors and transistors in the 1970s.

The following are a few examples of bitwise logical operations and basic arithmetic operations supported by ALUs:

  • Addition. Adds A and B with carry-in or carry-out sum at Y.
  • Subtraction. Subtracts B from A or vice versa with the difference at Y and carry-in or carry-out.
  • Increment. Where A or B is increased by one and Y represents the new value.
  • Decrement. Where A or B is decreased by one and Y represents the new value.
  • AND. The bitwise logic AND of A and B is represented by Y.
  • OR. The bitwise logic OR of A and B is represented by Y.
  • Exclusive-OR. The bitwise logic XOR of A and B is represented by Y.

ALU shift functions cause A or B operands to shift, either right or left, with the new operand represented by Y. Complex ALUs utilize barrel shifters to shift A or B operands by any number of bits in a single operation.