Computer Hardware
Computer Hardware
Computer Hardware
Computer hardware includes the physical parts of a computer, such as the case, central
processing unit (CPU), monitor, mouse, keyboard, computer data storage, graphics card, sound
card, speakers and motherboard.
By contrast, software is the set of instructions that can be stored and run by hardware. Hardware
is so-termed because 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 a usable computing system, although other
systems exist with only hardware.
Inside a custom-built computer: power supply at the bottom has its own cooling fan
The personal computer is one of the most common types of computer due to its versatility and
relatively low price. Desktop personal computers have a monitor, a keyboard, a mouse, and
a computer case. The computer case holds the motherboard, fixed or removable disk drives for
data storage, the power supply, and may contain other peripheral devices such as modems or
network interfaces. Some models of desktop computers integrated the monitor and keyboard into
the same case as the processor and power supply. Separating the elements allows the user to
arrange the components in a pleasing, comfortable array, at the cost of managing power and data
cables between them.
The computer case encloses most of the components of the system. It provides mechanical
support and protection for internal elements such as the motherboard, disk drives, and power
supplies, and controls and directs the flow of cooling air over internal components. The case 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 the unit.
Hobbyists may decorate the cases with colored lights, paint, or other features, in an activity
called case modding.
A power supply unit (PSU) converts alternating current (AC) electric power to low-voltage
direct current (DC) power for the computer. Laptops can run on built-in rechargeable
battery.[7] The PSU typically uses a switched-mode power supply (SMPS), with power
MOSFETs (power metal–oxide–semiconductor field-effect transistors) used in the converters
and regulator circuits of the SMPS.[8]
Motherboard
The motherboard 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 the motherboard include:
The CPU (central processing unit), which performs most of the calculations which enable a
computer to function, and is referred to as the brain of the computer. It takes program
instructions from random-access memory (RAM), interprets and processes them and then sends
back results so that the relevant components can carry out the instructions. The CPU is
a microprocessor, which is fabricated on a metal–oxide–semiconductor (MOS) integrated
circuit (IC) chip. It is usually cooled by a heat sink and fan, or water-cooling system. Most newer
CPU includes an on-die graphics processing unit (GPU). The clock speed of CPU governs how
fast it executes instructions and is measured in GHz; typical values lie between 1 GHz and
5 GHz. Many modern computers have the option to overclock the CPU which enhances
performance at the expense of greater thermal output and thus a need for improved cooling.
The chipset, which includes the north bridge, mediates communication between the CPU and
the other components of the system, including main memory; as well as south bridge, which is
connected to the north bridge, and supports auxiliary interfaces and buses; and, finally, a Super
I/O chip, connected through the south bridge, which supports the slowest and most legacy
components like serial ports, hardware monitoring and fan control.
Random-access memory (RAM), which stores the code and data that are being actively
accessed by the CPU. For example, when a web browser is opened on the computer it takes up
memory; this is stored in the RAM until the web browser is closed. It is typically a type
of dynamic RAM (DRAM), such as synchronous DRAM (SDRAM), where MOS memory chips
store data on memory cells consisting of MOSFETs and MOS capacitors. RAM usually comes
on dual in-line memory modules (DIMMs) in the sizes of 2GB, 4GB, and 8GB, but can be much
larger.
Read-only memory (ROM), which stores the BIOS that runs when the computer is powered on
or otherwise begins execution, a process known as Bootstrapping, or "booting" or "booting up".
The ROM is typically a nonvolatile BIOS memory chip, which stores data on floating-gate
MOSFET memory cells.
The BIOS (Basic Input Output System) includes boot firmware and power management
firmware. Newer motherboards use Unified Extensible Firmware Interface (UEFI) instead of
BIOS.
Buses that connect the CPU to various internal components and to expand cards for graphics and
sound.
The CMOS (complementary MOS) battery, which powers the CMOS memory for date and time
in the BIOS chip. This battery is generally a watch battery.
The video card (also known as the graphics card), which processes computer graphics. More
powerful graphics cards are better suited to handle strenuous tasks, such as playing
intensive video games or running computer graphics software. A video card contains a graphics
processing unit (GPU) and video memory (typically a type of SDRAM), both fabricated on MOS
integrated circuit (MOS IC) chips.
Power MOSFETs make up the voltage regulator module (VRM), which controls how
much voltage other hardware components receive.
Expansion cards
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.
Storage devices
A storage device is any computing hardware and digital media that is used for storing, porting
and extracting data files and objects. It can hold and store information both temporarily and
permanently and can be internal or external to a computer, server or any similar computing
device. Data storage is a core function and fundamental component of computers.
Fixed media
Data is stored by a computer using a variety of media. Hard disk drives (HDDs) are found in
virtually all older computers, due to their high capacity and low cost, but solid-state
drives (SSDs) are faster and more power efficient, although currently more expensive than hard
drives in terms of dollar per gigabyte, so are often found in personal computers built post-
2007. SSDs use flash memory, which stores data on MOS memory chips consisting of floating-
gate MOSFET memory cells. Some systems may use a disk array controller for greater
performance or reliability.
Removable media
To transfer data between computers, an external flash memory device (such as a memory
card or USB flash drive) or optical disc (such as a CD-ROM, DVD-ROM or BD-ROM) may be
used. Their usefulness depends on being readable by other systems; the majority of machines
have an optical disk drive (ODD), and virtually all have at least one Universal Serial Bus (USB)
port.
Input and output peripherals
Input and output devices are typically housed externally to the main computer chassis. The
following are either standard or very common to many computer systems.
Input device
Input devices allow the user to enter information into the system, or control its operation. Most
personal computers have a mouse and keyboard, but laptop systems typically use
a touchpad instead of a mouse. Other input devices include webcams, microphones, joysticks,
and image scanners.
Output devices
Output devices are designed around the senses of human beings. For example, monitors display
text that can be read, speakers produce sound that can be heard.[12] Such devices also could
include printers or a Braille embosser.
Classification of computers
Computers can be classified either by their capacity/size, purpose or type of data they process.
Classification By Capacity/Size
1. Supercomputer: A supercomputer is the giant of the computer world. It is usually the most
expensive and can be afforded by very few bodies like an organization, countries and
research institutions. It is used for large amount of mathematical calculations. It is reputed
to have more than fifty times the speed of microcomputers. Just like the Mainframe
computer, it requires a dust free and a cool environment for optimal performance and
maintenance.
2. Mainframe Computer: Mainframe computers are large computers that have variety of
network terminals making it possible for more than one user to operate on it at the same
time. Mainframe computers are very expensive to purchase and maintain. They are usually
used by large organizations like Banks, government of countries and large businesses. They
are housed in dust free, cool environment and other regular computer maintenance culture.
3. Minicomputer: Minicomputers are medium sized computers. They perform same
functions like the Mainframe computers both on a smaller scale and larger capacity.
Minicomputer is also a multi-user device with different network interfaces just like the
Mainframe but lesser in the number of networks and size. The Minicomputer does not have
any special environmental requirement like the Mainframe computer, so they can be
located conveniently at different offices in an organization. However, normal computer
maintenance practices should be carried out.
4. Microcomputer: This is the commonest computer seen everywhere in Schools for learning
purposes, Offices and homes. The Microcomputer derives its name from its use of a
microprocessor located in one integrated micro chip or circuit. Unlike large computers that
use more than one chip for its processing activities. Micro computers are the smallest in
size and they come in different forms such as Laptop computer, Desktop, Palm Top
computer, Notebook etc. Generally, they use one central Processing unit and are usually
used by one person at a time.
5. Micro Controller Unit: A Microcontrollers unit (MCU) is is a small computer on a
single integrated circuit (chip) used to control electronic devices. Hence they are also called
embedded systems; they usually embedded in devices such as microwave ovens, remote
controllers, digital or programmable TVs, Sound Systems, Washing machines Telephones
etc. They contain the logic that controls the performance of these devices.
Depending on the flexibility of operations, computers are divided into special or general purpose.
Classification By Type
There are three major types of computer System namely: The analogue, Digital and Hybrid
Computer. Each is explained below:
1. The Analogue Computer: The analogue computers are computer System that measure
variation in quantities such as temperature, voltage, speed, etc. For example, the
speedometer in a car measures the changes or variation in speed as the car moves. The
Thermometer takes readings in accordance to changes in temperature. These are examples
of analogue computers. Hence analogue computers can be said to measure data that vary
continuously. More examples of analogue computers are Voltmeter and ammeter.
2. Digital Computers: Digital computers count things in contrast to analogue computer that
measure things. This has to do with the manipulation of discontinuous numbers and letters
which are represented by the binary digits (bits). A digital computer uses the binary
arithmetic concept when numbers and letters are represented by combinations of zero’s and
one’s only. The figures are manipulated in a discrete form from one state to the other. Zeros
and one’s are used to represent all figures and information in a digital form. In other words
texts and graphics are treated numerically. Majority of the computers in use today are
digital computers. Examples of digital computers are Desktop or personal computers, work
stations, Tablet PC etc.
3. Hybrid Computer: Hybrid computer System possesses the attributes of both analogue and
digital computer. They can convert from analogue to digital and digital to analogue signals.
This provides an economic way of dealing with both digital and analogue conversions.
Example of hybrid computer is the electrocardiogram (ECG) machine the hospital uses. It
can convert the analogue record of a heartbeat into a digital form.
Major types of computer system to some analysts are synonymous with Classifications of
Computer systems. However, for the sake of simplicity, Classification of computer system
has been discussed separately. Each of the above types of computers has different variants
especially with the emergence of latest technology in computing.
Computer Hardware Upgrade
When using computer hardware, an upgrade means adding new or additional hardware to a
computer that improves its performance, increases its capacity, or adds new features. For
example, a user could perform a hardware upgrade to replace the hard drive with a faster one or
a Solid State Drive (SSD) to get a boost in performance. The user may also install more Random
Access Memory (RAM) so the computer can store additional temporary data, or retrieve such
data at a faster rate. The user may add a USB 3.0 expansion card to fully use USB 3.0 devices, or
could upgrade the Graphics Processing Unit (GPU) for cleaner, more advanced graphics, or
more monitors. Performing such hardware upgrades may be necessary for aged computers to
meet a new, or updated program's system requirements.
Computer recycling
Because computer parts contain hazardous materials, there 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 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, aluminium, and 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.
Toxic computer components
The central processing unit contains many toxic materials. It contains lead and chromium in the
metal plates. Resistors, semi-conductors, 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.
LOGICAL SYSTEMS DESIGN
Basic organization of the circuitry of a digital computer.
All digital computers are based on a two-valued logic system—1/0, on/off, yes/no
Computers perform calculations using components called logic gates, which are made up
of integrated circuits that receive an input signal, process it, and change it into an output signal.
The components of the gates pass or block a clock pulse as it travels through them, and the
output bits of the gates control other gates or output the result. There are three basic kinds of
logic gates, called “and,” “or,” and “not.” By connecting logic gates together, a device can be
constructed that can perform basic arithmetic functions.
LOGIC GATES
Logic gates are the basic building blocks of any digital system. It is an electronic circuit having
one or more than one input and only one output. The relationship between the input and the output
is based on a certain logic. Based on this, logic gates are named as AND gate, OR gate, NOT
gate etc.
AND Gate
A circuit which performs an AND operation is shown in figure. It has n input (n >= 2) and one
output.
Logic diagram
Truth Table
OR Gate
A circuit which performs an OR operation is shown in figure. It has n input (n >= 2) and one
output.
Logic diagram
Truth Table
NOT Gate
NOT gate is also known as Inverter. It has one input A and one output Y.
Logic diagram
Truth Table
NAND Gate
A NOT-AND operation is known as NAND operation. It has n input (n >= 2) and one
output.
Logic diagram
Truth Table
NOR Gate
A NOT-OR operation is known as NOR operation. It has n input (n >= 2) and one output.
Logic diagram
Truth Table
XOR Gate
XOR or Ex-OR gate is a special type of gate. It can be used in the half adder, full adder
and subtractor. The exclusive-OR gate is abbreviated as EX-OR gate or sometime as X-
OR gate. It has n input (n >= 2) and one output.
Logic diagram
Truth Table
XNOR Gate
XNOR gate is a special type of gate. It can be used in the half adder, full adder and
subtractor. The exclusive-NOR gate is abbreviated as EX-NOR gate or sometime as X-
NOR gate. It has n input (n >= 2) and one output.
Logic diagram
Truth Table
Five basic functional units of a computer are i.e. input unit, a processing unit
(Arithmetic and logic), a memory to store final or intermediate results, a
controlling unit that coordinates functions of every unit, and finally an output
unit. In this article, we will discuss all the functional units of the computer.
Input Unit
The input to the computer is either a data or instruction, that guides the
arithmetic and logic unit about what operations have to be performed and also
controls the movement of data between the computer and its I/O devices.
Now, the input i.e. data or instruction are accepted with the help of input units
such as a keyboard, mouse, touchpad, joystick, and trackball. The most familiar
device that we use to accept input is the ‘keyboard’ and ‘mouse’. All of these
input devices are graphic input devices and you can see their effect on the
display unit.
Whenever you strike any key on the keyboard it gets converts to the binary code
and is handed over to the processor which would interpret the code and perform
the appropriate action.
For audio and video input, microphones and cameras are used respectively.
Now a day, the internet can also be used to issue an input to a computer from
other computers or databases.
Memory Unit
A memory unit is required to store the programs that have the set of instructions
that instructs Arithmetic and logic unit which operation has to be performed. It
also stores the data associated with the program. The memory can further be
classified into three types:
1. Primary Memory
Primary memory is also known as the main memory or the random-access memory
(RAM). It is the fastest accessible memory of the computer. If a program has to be
executed it first needs to be placed in the primary memory. Then the instructions of the
program are fetched one at a time by the processor for execution.
The memory is organized in such a way that in one basic operation, one-word can be
retrieved from the memory or one word can be stored to the memory. A word length
could be 16, 32, or 64 bits.
The primary memory is expensive as well as faster. But primary memory is volatile in
nature it does not retain its content when the power gets off.
2. Secondary Memory
Secondary memory is the hard disk of your system, it also includes flash drive, optical
disks, magnetic disk. The secondary memory is slower and less expensive as compared
to primary memory. It doesn’t lose its contents even if the supply of power gets off.
We require secondary memory to store a large volume of data or program permanently or
the data that is less likely to be retrieved.
3. Cache Memory
Cache memory can be accessed much faster as compared to primary memory and it is
even smaller in size. It is stored with the data that is required frequently by the processor.
As we know the program to be executed and the data associated with it is brought to the
primary memory and the processor fetches the program instructions from there. The
process also places a copy of the instructions and associated data in the cache memory.
Now, the instructions that are required to be executed repeatedly such as loops are
retrieved from the cache memory to improve the execution rate.
Arithmetic Logic Unit
All the arithmetic operations are performed by the arithmetic logic unit of the processors.
Arithmetic operations such as addition, subtraction, division, multiplication, comparison between
the numbers, etc.
The ALU unit performs the operations present in the instruction and stores the result into the
memory. It also stores the intermediate results of the operation in the registers.
The arithmetic operation is performed on the operands. The operands are placed into the registers
which store one word at a time which is sufficient for an operand. Retrieval of the data form
registers is even faster than the cache memory.
Output Unit
A computer is a functional unit and as it has an input unit to accept the input it also has the
output unit to provide the generated output by the system. The most familiar device used to
output a result is a printer.
A display screen is also an output unit as it displays the generated result, but it also displays the
input provided to the system. That’s why the display screen is termed as the ‘I/O unit’ because of
its dual function.
Control Unit
The functions of input, ALU, memory, and output unit must be coordinated so that everything
goes in sequence i.e. the processor accepts input, place it in memory, processes the stored input,
and generates output. This entire sequence is coordinate by the control unit.
In this way, the functional units of computers cooperate to generate useful output. We have
discussed each of the functional units of the computer in brief and understood their functional
behaviour.
BASIC OPERATIONAL CONCEPTS OF COMPUTER
To perform a given task an appropriate program consisting of a list of instructions is
stored in the memory. Individual instructions are brought from the memory into the
processor, which executes the specified operations. Data to be stored are also stored in
the memory.
Examples: - Add LOCA, R0
This instruction adds the operand at memory location LOCA, to operand in
register R0 & places the sum into register. This instruction requires the performance of
several steps,
1. First the instruction is fetched from the memory into the processor.
2. The operand at LOCA is fetched and added to the contents of R0
3. Finally the resulting sum is stored in the register R0
The preceding add instruction combines a memory access operation with an ALU
Operations. In some other type of computers, these two types of operations are performed
by separate instructions for performance reasons.
Load LOCA, R1
Add R1, R0
Transfers between the memory and the processor are started by sending the
address of the memory location to be accessed to the memory unit and issuing the
appropriate control signals. The data are then transferred to or from the memory.
CONTROL
ALU
…
n- GPRs
Fig b : Connections between the processor and the memory
The fig shows how memory & the processor can be connected. In addition to the
ALU & the control circuitry, the processor contains a number of registers used for several
different purposes.
The instruction register (IR):- Holds the instructions that is currently being executed.
Its output is available for the control circuits which generates the timing signals that
control the various processing elements in one execution of instruction.
The program counter PC:-
This is another specialized register that keeps track of execution of a program. It
contains the memory address of the next instruction to be fetched and executed.
Besides IR and PC, there are n-general purpose registers R0 through Rn-1.
MAR
PC
IR
MEMORY
MDR
R0
R1
…
…
…
The other two registers which facilitate communication with memory are: -
1. MAR – (Memory Address Register):- It holds the address of the location to be
accessed.
2. MDR – (Memory Data Register):- It contains the data to be written into or read
out of the address location.
Operating steps are
1. Programs reside in the memory & usually get these through the I/P unit.
2. Execution of the program starts when the PC is set to point at the first instruction
of the program.
3. Contents of PC are transferred to MAR and a Read Control Signal is sent to the
memory.
4. After the time required to access the memory elapses, the address word is read out
of the memory and loaded into the MDR.
5. Now contents of MDR are transferred to the IR & now the instruction is ready to
be decoded and executed.
6. If the instruction involves an operation by the ALU, it is necessary to obtain the
required operands.
7. An operand in the memory is fetched by sending its address to MAR & Initiating
a read cycle.
8. When the operand has been read from the memory to the MDR, it is transferred
from MDR to the ALU.
9. After one or two such repeated cycles, the ALU can perform the desired
operation.
10. If the result of this operation is to be stored in the memory, the result is sent to
MDR.
11. Address of location where the result is stored is sent to MAR & a write cycle is
initiated.
12. The contents of PC are incremented so that PC points to the next instruction that
is to be executed.
Normal execution of a program may be preempted (temporarily interrupted) if
some devices require urgent servicing, to do this one device raises an Interrupt signal.
An interrupt is a request signal from an I/O device for service by the processor.
The processor provides the requested service by executing an appropriate interrupt
service routine.
The Diversion may change the internal stage of the processor its state must be
saved in the memory location before interruption. When the interrupt-routine service is
completed the state of the processor is restored so that the interrupted program may
continue.
Bus structures
Bus structures in computer plays important role in connecting the internal components of the
computer. The bus in the computer is the shared transmission medium. This means multiple
components or devices use the same bus structure to transmit the information signals to each
other.
At a time only one pair of devices can use this bus to communicate with each other successfully.
If multiple devices transmit the information signal over the bus at the same time the signals
overlap each other and get jumbled.
Data lines coordinate in transferring the data among the system components. The data lines are
collectively called data bus. A data bus may have 32 lines, 64 lines, 128 lines, or even more
lines. The number of lines present in the data bus defines the width of the data bus.
Each data line is able to transfer only one bit at a time. So the number of data lines in a data bus
determines how many bits it can transfer at a time. The performance of the system also depends
on the width of the data bus.
2. Address Lines
The content of the address lines of the bus determines the source or destination of the data
present on the data bus. The number of address lines together is referred to as address bus. The
number of address lines in the address bus determines its width.
The width of the address bus determines the memory capacity of the system. The content of
address lines is also used for addressing I/O ports. The higher-order bits determine the bus
module and the lower ordered bits determine the address of memory locations or I/O ports.
Whenever the processor has to read a word from the memory it simply places the address of the
corresponding word on the address line.
3. Control Lines
The address lines and data lines are shared by all the components of the system so there must
some means to control the use and access of data and address lines. The control signals placed on
the control lines control the use and access to address and data lines of the bus. The control
signal consists of the command and timing information. Here the command in the control signal
specify the operation that has to be performed. And the timing information over the control
signals specify till when the data and address information is valid .
• Memory Write: This command causes the data on the data bus to be placed over the addressed
memory location.
• Memory Read: This command causes the data on the addressed memory location to be placed on the
data bus.
• I/O Write: The command over this control line causes the data on the data bus to be placed over the
addressed I/O port.
• I/O Read: The command over this control line causes the data from the addressed I/O port to be placed
over the data bus.
• Transfer ACK: This control line indicates the data has been received from the data bus or is placed over
the data bus.
• Bus Request: This control line indicates that the component has requested control over the bus.
• Bus Grant: This control line indicates that the bus has been granted to the requesting component.
• Interrupt Request: This control line indicates that interrupts are pending.
• Interrupt ACK: This control line provides acknowledgment when the pending interrupt is serviced.
• Clock: This control line is used to synchronize the operations.
• Reset: The bit information issued over this control line initializes all the modules.
If a component connected to the bus wishes to send data to another connected component, it first
has to acquire control over the bus, and then it can transfer the data to another component over
the bus. The same happen when a component request data from another component.
During the transfer of data between two components, one component act as a master and other
act as a slave. The device initiating the data transfer is referred to as master and usually, it is a
processor, or sometimes it may be some other device or component. The component addressed
by the master component is referred to as a slave.
Timing in Bus
As we have seen that the control lines of the bus also provide timing information along with the
command. Well, the way of deriving the timing information over the control line can be
categorized in two ways:
1. Synchronous Bus
With the synchronous bus scheme, all the devices or components connected to the bus derive
timing information over the control line referred to as the bus clock. Over the bus clock line, the
clock transmits an alternating sequence of 1s and 0s at a regular interval. Here a single 1-0
transmission is considered as a clock cycle or bus cycle.
All the devices or components connected to the bus can read this bus clock line and all the events
start at the starting the clock cycle. Here the transmitting component and the receiving
component are synchronized using the clock. The data is sent or received at a constant rate and
therefore used for high-speed transmission.
2. Asynchronous Bus
In this asynchronous bus scheme, the transmitter and the receiver component are not
synchronized by the clock. Instead, the data transfer is controlled using a handshake protocol
between the master component and the slave component.
Here, the component initiating the data transfer i.e. master component when gets ready for data
transfer indicates this by activating its master-ready line and places the address and command
information over the bus.
Then all the connected component decodes the address on the address line to recognize which
component is being addressed by the master component.
Now the addressed component performs the required operation and notifies the processor by
activation its slave ready-line. Once the master recognizes the activated slave ready-line it
removes its control over the bus.
In this way occurrence of one event on the bus is followed by and depends on the occurrence of a
previous event.
The processor issues read/write operation over the control lines of the bus and the data
corresponding to the read and write operation is transmitted over the data lines of the bus.
Consider that we have an input device keyboard and some data from the keyboard has to be
issued to the processor, the machine instruction for the same is:
Here the DATAIN is the data register of the Keyboard. This instruction reads the content from
DATAIN register of the keyboard and transfers the content to the R2 register of the processor.
Similarly, the instruction below:
Here consider that the DATAOUT register is the data register of a display device. So, this
instruction will transfer the content of register R2 of the processor to the data register of the
display device.
The control register and the status register of the I/O device interface have information relevant
to the operation performed on or by the I/O device. The address decoder, control circuitry and
the registers of the I/O interface coordinate in transferring the content to or from the I/O device.
So, this is all about the bus structure in computer architecture. We have seen how the bus plays a
vital role in data transfer.
Pipelining in Computer Architecture
The instruction is divided into 5 subtasks: instruction fetch, instruction decode, operand fetch,
instruction execution and operand store. The instruction fetch subtask will only perform the
instruction fetching operation, instruction decode subtask will only be decoding the fetched
instruction and so on the other subtasks will do.
In this section, we will discuss the types of pipelining, pipelining hazards, its advantage. So let us
start.
Introduction
Types of Pipelining
Pipelining Hazards
Advantages
Key Takeaways
Introduction
Have you ever visited an industrial plant and see the assembly lines over there? How a product
passes through the assembly line and while passing it is worked on, at different phases
simultaneously. For example, take a car manufacturing plant. At the first stage, the automobile
chassis is prepared, in the next stage workers add body to the chassis, further, the engine is
installed, then painting work is done and so on.
The group of workers after working on the chassis of the first car don’t sit idle. They start
working on the chassis of the next car. And the next group take the chassis of the car and add
body to it. The same thing is repeated at every stage, after finishing the work on the current car
body they take on next car body which is the output of the previous stage.
Here, though the first car is completed in several hours or days, due to the assembly line
arrangement it becomes possible to have a new car at the end of an assembly line in every clock
cycle.
Similarly, the concept of pipelining works. The output of the first pipeline becomes the input for
the next pipeline. It is like a set of data processing unit connected in series to utilize processor up
to its maximum.
Instruction Division
In the fourth, arithmetic and logical operation are performed on the operands to execute the
instruction.
Now, understanding the division of the instruction into subtasks. Let us understand, how the n
number of instructions in a process, are pipelined.
Look at the figure below the 5 instructions are pipelined. The first instruction gets completed in 5
clock cycle. After the completion of first instruction, in every new clock cycle, a new instruction
completes its execution.
Pipelining Instructions
Observe that when the Instruction fetch operation of the first instruction is completed in the next
clock cycle the instruction fetch of second instruction gets started. This way the hardware never
sits idle it is always busy in performing some or other operation. But, no two instructions can
execute their same stage at the same clock cycle.
Types of Pipelining
In 1977 Handler and Ramamoorthy classified pipeline processors depending on their
functionality.
1. Arithmetic Pipelining
2. Instruction Pipelining
Here, the number of instruction are pipelined and the execution of current instruction is
overlapped by the execution of the subsequent instruction. It is also called instruction lookahead.
3. Processor Pipelining
Here, the processors are pipelined to process the same data stream. The data stream is processed
by the first processor and the result is stored in the memory block. The result in the memory
block is accessed by the second processor. The second processor reprocesses the result obtained
by the first processor and the passes the refined result to the third processor and so on.
The pipeline performing the precise function every time is unifunctional pipeline. On the other
hand, the pipeline performing multiple functions at a different time or multiple functions at the
same time is multifunction pipeline.
The static pipeline performs a fixed-function each time. The static pipeline is unifunctional. The
static pipeline executes the same type of instructions continuously. Frequent change in the type
of instruction may vary the performance of the pipelining.
Scalar pipelining processes the instructions with scalar operands. The vector pipeline processes
the instruction with vector operands.
Pipelining Hazards
Whenever a pipeline has to stall due to some reason it is called pipeline hazards. Below we have
discussed four pipelining hazards.
1. Data Dependency
Data Dependency
In the figure above, you can see that result of the Add instruction is stored in the register R2 and
we know that the final result is stored at the end of the execution of the instruction which will
happen at the clock cycle t4.
But the Sub instruction need the value of the register R2 at the cycle t3. So the Sub instruction
has to stall two clock cycles. If it doesn’t stall it will generate an incorrect result. Thus depending
of one instruction on other instruction for data is data dependency.
2. Memory Delay
When an instruction or data is required, it is first searched in the cache memory if not found then
it is a cache miss. The data is further searched in the memory which may take ten or more cycles.
So, for that number of cycle the pipeline has to stall and this is a memory delay hazard. The
cache miss, also results in the delay of all the subsequent instructions.
3. Branch Delay
Suppose the four instructions are pipelined I1, I2, I3, I4 in a sequence. The instruction I1 is a
branch instruction and its target instruction is Ik. Now, processing starts and instruction I1 is
fetched, decoded and the target address is computed at the 4th stage in cycle t3.
But till then the instructions I2, I3, I4 are fetched in cycle 1, 2 & 3 before the target branch
address is computed. As I1 is found to be a branch instruction, the instructions I2, I3, I4 has to be
discarded because the instruction Ik has to be processed next to I1. So, this delay of three cycles
1, 2, 3 is a branch delay.
Branch Delay
Prefetching the target branch address will reduce the branch delay. Like if the target branch is
identified at the decode stage then the branch delay will reduce to 1 clock cycle.
Branch Delay reduced 1
4. Resource Limitation
If the two instructions request for accessing the same resource in the same clock cycle, then one
of the instruction has to stall and let the other instruction to use the resource. This stalling is due
to resource limitation. However, it can be prevented by adding more hardware.
Advantages
Key Takeaways
Pipelining divides the instruction in 5 stages instruction fetch, instruction decode, operand fetch,
instruction execution and operand store.
The pipeline allows the execution of multiple instructions concurrently with the limitation that
no two instructions would be executed at the same stage in the same clock cycle.
All the stages must process at equal speed else the slowest stage would become the bottleneck.
This is all about pipelining. So, basically the pipelining is used to improve the performance of
the system by improving its efficiency.
RISC Processor
RISC processor is implemented using the hardwired control unit. The hardwired control unit
produces control signals which regulate the working of processors hardware. RISC architecture
emphasizes on using the registers rather than memory.
This is because the registers are the ‘fastest’ available memory source. The registers are
physically small and are placed on the same chip where the ALU and the control unit are placed
on the processor. The RISC instructions operate on the operands present in processor’s
registers.
Observe one thing here, we don’t have the “microprogram control store” or the “control
memory” like we have seen in the CISC architecture in our previous content.
It is just because all instructions in RISC are simple and execute one instruction per cycle. So,
here the instructions are hardwired and there is no need for control store. For each operation,
we will have as defined hardwire. Making an instruction hardwired is making a function or
operation in instruction permanent using connected circuits.
RISC instructions are simple and are of fixed size. Each RISC instruction engages a single
memory word. RISC instructions operate on processor registers only. The instructions that have
arithmetic and logic operation should have their operand either in the processor register or
should be given directly in the instruction.
Add R2, R3
But initially, at the start of execution of the program, all the operands are in memory. So, to
access the memory operands, the RISC instruction set has Load and Store instruction.
The Load instruction loads the operand present in memory to the processor register. The load
instruction is of the form:
The load instruction above will load the operand present at memory location A to the processor
register R2.
The Store instruction stores the operand back to the memory. Generally, the Store instruction is
used to store the intermediate result or the final result in the memory. It is of the form:
The Store instruction above will store the content in register R2 into the A a memory location.
You can observe that in the example of Load and Store instruction operand side of both
instructions appears the same as R2, A. But, the source and destination order of Store instruction
is reversed in Load instruction.
RISC instruction has simple addressing modes. Below we have a list of RISC instruction
type addressing modes. Let us discuss them one by one.
Immediate addressing mode: This addressing mode explicitly specifies the operand in the
instruction. Like
The above instruction will add 200 to the content of R2 and store the result in R4.
Register addressing mode: This addressing mode describes the registers holding the operands.
The above instruction will add the content of register R4 to the content of register R3 and store
the result in R3.
Absolute addressing mode: This addressing mode describes a name for a memory location in
the instruction. It is used to declare global variables in the program.
Integer A, B, SUM;
Register Indirect addressing mode: This addressing mode describes the register which has
the address of the actual operand in the instruction. It is similar to pointers in HLL.
This instruction will load the register R2 with the content, whose address is mentioned in register
R3.
Index addressing mode: This addressing mode provides a register in the instruction, to which
when we add a constant, obtain the address of the actual operand. It is similar to the array of
HLL.
This instruction will load the register R2 with the content present at the location obtained by
adding 4 to the content of register R3.
Pipelining in RISC
As we know the RISC instructions are simple and engage one word in the memory. Even the
‘location of operands’ within the’ word’ is the same for the different instructions. Among all the
instruction the Load and Store are the operations that accesses memory operand.
Most of the RISC instructions are register to register. If we consider the arithmetic and logic
instructions, then we have two stages as follow:
If we are considering the Load and Store instruction i.e. register to memory or memory to
register, then three stages are required as follow.
A <- B + C
1. RISC instruction size is reduced but more instructions are required to perform an
operation when compared with CISC. So, we can say that the length of the program is
increased.
2. The machine instructions are hardwired in RISC so, it would cost if any instruction
needs modification.
3. It finds is difficulty in processing complex instruction and complex addressing mode.
4. RISC instructions do not allow direct memory to memory transfer, it requires Load and
Store instructions to do so.
MIPS, SPARC, IBM POWER instruction set, Alpha, RISC-V, ARM architecture.
Key Takeaways
This is all about the RISC processor and its instruction set architecture. RISC architecture is now
used worldwide in cellular telephones, computer tables and even supercomputers.
References