Computer Hardware

Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

COMPUTER HARDWARE AND ARCHITECTURE

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.

Von Neumann architecture


Von Neumann architecture and Stored-program computer

Von Neumann architecture scheme


The template for all modern computers is the Von Neumann architecture, detailed in a 1945
paper by Hungarian mathematician John von Neumann. This describes a design architecture for
an electronic digital computer with subdivisions of a processing unit consisting of an arithmetic
logic unit and processor registers, a control unit containing an instruction register and program
counter, a memory to store both data and instructions, external mass storage, and input and
output mechanisms.[3] The meaning of the term has evolved to mean a stored-program
computer in which an instruction fetch and a data operation cannot occur at the same time
because they share a common bus. This is referred to as the Von Neumann bottleneck and often
limits the performance of the system.
Personal computer
Basic hardware components of a personal computer, including a monitor, a motherboard, a CPU,
a RAM, two expansion cards, a power supply, an optical disc drive, a hard disk drive,
a keyboard and a mouse

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.

Types of computer systems

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.

Some of the key features of a microcontrollers include the following:

• Microprocessor – usually small and simple


• Input/output interfaces such as serial ports, pad and LED
• Peripherals such as timers and watchdog circuits
• RAM for data storage
• ROM program storage

Classification By Purpose/ Use

Depending on the flexibility of operations, computers are divided into special or general purpose.

1. Special-Purpose or Dedicated computers: These are computers that are designed to


perform specific tasks. In this case, a set of instructions that the computer follows to solve
a problem may be built into the hardware. For example, automobiles have one or more
computers to control such activities as to control fuel consumption, speed measurement
and so on. Many home appliances such as refrigerators, TVs, heaters, microwave ovens
contain small computers to control the appliance.
2. General-Purpose Computers: These are designed to solve a wide range of problems. They
can perform any task required simply by changing the application program stored in their
main memory. This makes it possible to use such computers for task as accounting,
scientific analysis etc. For example, a desktop computer can be used to play games, write
letters, draw pictures, solve mathematical problems, listen to music/radio, and watch
movies/TV.

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

Arithemetic- Logic Unit


An arithmetic logic unit (ALU) is a digital circuit used to perform arithmetic and logic
operations. It represents the fundamental building block of the central processing unit (CPU) of a
computer. Modern CPUs contain very powerful and complex ALUs. In addition to ALUs,
modern CPUs contain a control unit (CU).
Most of the operations of a CPU are performed by one or more ALUs, which load data from
input registers. A register is a small amount of storage available as part of a CPU. The control
unit tells the ALU what operation to perform on that data and the ALU stores the result in an
output register. The control unit moves the data between these registers, the ALU, and memory

Floating point number representation:


Fixed point numbers represents integers and floating point numbers represent real numbers.
Numeric Format: A number expressed in scientific notation has a sign, a fraction or significant
( or mantissa) and an exponent. Ex: The number is : -1234.5678
Scientific notation is: -1.2345678 * 103 . Here the sign is negative, the significant is 1.2345678
and exponent is 3 and the base is 10. Computers use base as 2.
Disadvantages of Scientific notation:
Most of the numbers can be expressed in many different ways. Ex: -1.2345678*103 = -
1234567.8* 10-3 = etc. Computers are more efficient and have much simpler hardware if each
number is uniquely represented.
Normalization as Solution to the problem:
The floating point number must be normalized, that is, each number’s significant is a fraction
with no leading zeros. Thus the only valid floating point representation for - 1234.5678 is -
.12345678* 104. Note IEEE 754 uses an exception for this rule. Special cases: The number zero
has only zeros in its significand and cannot be normalized. For this reason, a special value is
assigned to zero. Arithmetic algorithms must explicitly check for zero values and treat them as
special cases. +∞ and - ∞ also have special representation and require special treatment. NaN:
NaN means Not a Number. It represents the result of illegal operations, such as ∞ ÷ ∞ or taking
the square root of a negative number. As with zero and infinity, NaN requires a special treatment
in floating point arithmetic algorithms. A predefined format for computer storage of floating
point number: Each number is stored in it’s normal form. Take the number: X = - 1234.5678;
That is X= XS XFXE XS is the sign of X; XF is it’s significand and XE is it’s exponent Since the
radix point is located to the left of the most significant bit of the significand, the radix point is
not stored. Thus the value X = -1234.5678 would be stored as XS = 1, XF = 12345678 and XE =
4 Biasing: In the above representation foe exponent, there is no sign bit for exponent. We can use
2’s complement form but prevalent practice is to use biasing. If XE has 4 bits, then it can
represent 16 items. That is the numbers from -8 to +7. To do this, a set bias value is added to the
actual exponent. The result is ten stored in XE. For this the bias should be set to 8. The smallest
possible exponent, -8, is represented as -8+bias = -8+8=0 or 0000 in binary. The largest possible
exponent, +7, is represented as +7+ bias =+7+8= 15= 1111 in binary. The arithmetic algorithms
must account for the bias when generating their results.
Characteristics of floating point numbers:
The characteristics are
1.Precision: It characterizes how precise a floating point value can be. It is defined as the
number of bits in the significand. The greater the number of bits in the significand, the greater is
the CPU’s precision and the more precise is it’s value. Many CPUs have 2 representations for
floating point numbers. They are called single precision and double precision here double
precision has twice the number of bits.
2. Gap: The gap is the difference between two adjacent values. It’s value depends on the value
of the exponent. Take the number: X = .10111010 * 23. It’s adjacent values are: .10111001 * 23
and .10111011* 23 . Each number produce a gap of .00000001* 23. In general the gap for
floating point value X can be expressed as 2 ( Xe-precision).
3. Range: The range of a floating point representation is bounded by it’s smallest and largest
possible values. Overflow and underflow; Overflow occurs when an operation produces a result
that cannot be stored in computers’ floating point registers. Underflow occurs when an operation
produces a result between zero and either the positive or negative smallest possible value.
IEEE 754 Floating point standard: This standard specifies 2 precisions for floating point
numbers which are called single precision and double precision floating point representations.
Single Precision Format: This format has 32 bits. 1 bit for sign; 8 bits for the exponent; 23 for
the significand. The significand also includes an implied 1 to the left of its radix point (except for
special values and denormalized numbers).
Every functional system incorporates some functional parts that constitute a
consumable product. Similarly, there are some functional units of the computer
that constitute in producing logical outputs.

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.

Functional Unit of Computer


The functional units of a computer i.e. input unit, arithmetic and logic unit,
memory, control unit, output unit all are connected with the interconnection
network that helps them in exchanging the information as you can see in the
image below. Now, let us explore each functional unit separately.

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.

Functional Units of the Computer

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.

Bus Structure in Computer Architecture


A system bus has typically from fifty to hundreds of distinct lines where each line is meant for a
certain function. These lines can be categories into three functional groups i.e., data lines,
address lines, and control lines. Let us discuss them one by one each.
1. Data Lines

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 .

The control lines include the lines for:

• 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.

I/O Interface of Input Device Connected to Bus


In the section ahead we will discuss how these three things over the bus are decoded by the I/O
interface.
Each I/O device interface has a set of registers with unique addresses. Whenever the processor
puts an address over the address line of the bus, it is examined by all the devices connected to the
bus. Whichever device recognizes this address responds to the control operations issued on the
control lines of the bus.

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:

LOAD R2, DATAIN

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:

STORE R2, DATAOUT

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

6th September 2019 by Neha T 4 Comments

Pipelining organizes the execution of the multiple instructions simultaneously. Pipelining


improves the throughput of the system. In pipelining the instruction is divided into the subtasks.
Each subtask performs the dedicated task.

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.

Content: Pipelining in Computer Architecture

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.

An instruction in a process is divided into 5 subtasks likely,

Instruction Division

In the first subtask, the instruction is fetched.

The fetched instruction is decoded in the second stage.

In the third stage, the operands of the instruction are fetched.

In the fourth, arithmetic and logical operation are performed on the operands to execute the
instruction.

In the fifth stage, the result is stored in memory.

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

It is designed to perform high-speed floating-point addition, multiplication and division. Here,


the multiple arithmetic logic units are built in the system to perform the parallel arithmetic
computation in various data format. Examples of the arithmetic pipelined processor are Star-100,
TI-ASC, Cray-1, Cyber-205.

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.

4. Unifunction Vs. Multifunction Pipelining

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.

5. Static vs Dynamic Pipelining

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.

Dynamic pipeline performs several functions simultaneously. It is a multifunction pipelining.

6. Scalar vs Vector 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

Consider the following two instructions and their pipeline execution:

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

Pipelining improves the throughput of the system.

In every clock cycle, a new instruction finishes its execution.

Allow multiple instructions to be executed concurrently.

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.

Whenever a pipeline has to stall for any reason it is a pipeline hazard.

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 is an abbreviation of Reduced Instruction Set Computer. RISC processor has


‘instruction sets’ that are simple and have simple ‘addressing modes’. A RISC style instruction
engages “one word” in memory. Execution of the RISC instructions are faster and take one
clock cycle per instruction.
RISC Processor Architecture (Block diagram)

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.

Below we have the block diagram for the RISC architecture.

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 Instruction Sets

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.

Like in both the instructions below we have the operands in registers

Add R2, R3

Add R2, R3, R4

The operand can be mentioned directly in the instruction as below:

Add R2, 100

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:

Load destination, Source

Example Load R2, A // memory to register

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:

Store source, destination

Example Store R2, A // register to memory

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

Add R4, R2, #200

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.

Add R3, R3, R4

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;

This instruction will allocate memory to variable 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.

Load R2, (R3)

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.

Load R2, 4(R3)

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:

Instruction Fetch (IF): Fetching the instruction

Instruction Execute (IE): ALU operation with the register

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.

Instruction Fetch (IF): Fetching the instruction

Instruction Execute (IE): Calculate memory address

Memory Store (M): register to register operation or memory to memory operation

Now consider the following instruction:

A <- B + C

Advantages of RISC Processor

1. RISC instructions are simpler machine instruction.


2. RISC instructions are hardwired to fasten the execution.
3. There are very fewer instructions in s RISC instruction set.
4. RISC instruction has simple addressing modes.
5. RISC instruction executes faster because most of instruction operates on processor
register and there is no need to access memory for each instruction.
6. It is easy to pipeline RISC instruction as all instruction is of fixed size and opcode and
operand are located in the same position in the word.
7. RISC instructions execute one instruction per clock cycle.

Disadvantages of RISC Processor

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.

Examples of RISC processors

MIPS, SPARC, IBM POWER instruction set, Alpha, RISC-V, ARM architecture.

Key Takeaways

• RISC instructions are simple and engages one word in memory.


• RISC instructions are of fixed size, the opcode and the operands in the instruction are
located in the same position within a word in different instructions.
• One instruction in RISC architecture executes in one clock cycle.
• The instruction size is reduced but, it has increased the program length.
• The pipelining of RISC instruction is easier.
• The machine instructions in RISC architecture are hardwired.
• RISC instruction operates only on register operands.
• RISC instruction executes faster as registers are placed in the processor chip which is
faster available memory resource.
• RISC instruction performs memory to memory transfer via Load and Store instruction.

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

1. ^ Jump up to:a b PC hardware : a beginner's guide. Osborne/McGraw-Hill.


pp. 21. ISBN 9780072129908.
2. ^ "Parts of computer". Microsoft. Archived from the original on 27 November 2013.
Retrieved 5 December 2013.
3. ^ von Neumann, John (1945). "First Draft of a Report on the EDVAC" (PDF). Archived
from the original (PDF) on 9 August 2013. Retrieved 6 December 2013.
4. ^ Markgraf, Joey D. (2007). "The Von Neumann bottleneck". Archived from the originalon 9
June 2011. Retrieved 24 August 2011.
5. ^ "Desktop computer vs. Laptop computer". www.computerhope.com. 30 December 2019.
Retrieved 15 January 2020.
6. ^ Cipriani, Jason (29 May 2020). "Best 2-in-1 Detachable Laptops 2020: The Best Tablet-
Laptop Hybrids". IGN. Retrieved 20 July 2020.
7. ^ "How long should a laptop battery last?". Computer Hope. Archived from the original on
21 December 2013. Retrieved 9 December 2013.
8. ^ Jump up to:a b Harding, Scharon (17 September 2019). "What Is a MOSFET? A Basic
Definition". Tom's Hardware. Retrieved 7 November 2019.
9. ^ "13 Sextillion & Counting: The Long & Winding Road to the Most Frequently Manufactured
Human Artifact in History". Computer History Museum. 2 April 2018. Retrieved 28 July2019.
10. ^ Domingo, Joel. "SSD vs. HDD: What's the Difference?". PCMag. Archived from the
original on 19 March 2017. Retrieved 24 March 2017.
11. ^ Edwards, Benj (17 January 2012). "Evolution of the Solid-State
Drive". PCWorld. Archived from the original on 25 March 2017. Retrieved 24 March 2017.
12. ^ PC hardware : a beginner's guide. Osborne/McGraw-Hill. 2001.
pp. 20. ISBN 9780072129908.
13. ^ Henderson, Rebecca M.; Newell, Richard G., eds. (2011). Accelerating energy innovation :
insights from multiple sectors. Chicago: University of Chicago Press. p. 180. ISBN 978-
0226326832.
14. ^ Inc, Chris Keenan - Newtech Recycling. "Newtech Recycling Specializes in Computer
Disposal, Laptop Disposal, Desktop Disposal Mainframe Disposal and Server
Disposal". www.newtechrecycling.com. Archived from the original on 29 March 2017.
Retrieved 18 April 2017.
15. ^ "The Toxic Components of Computers and Monitors". Archived from the original on 27
April 2017. Retrieved 26 April 2017.
16. ^ "What's Going On with Electronic Waste? – Electronics TakeBack Coalition". Archivedfrom
the original on 27 April 2017. Retrieved 26 April 2017.
17. ^ "Wire Recycling". All-Recycling-Facts.com. Archived from the original on 10 July 2017.
Retrieved 5 May 2017.

You might also like