0% found this document useful (0 votes)
22 views41 pages

Unit2 PDF

The document discusses computer hardware components and the instruction cycle. It describes: 1. The main hardware components of a computer including the central processing unit (CPU), memory, and input/output devices. The CPU fetches and executes instructions and performs calculations. 2. Memory stores instructions, data, and results. The instruction cycle involves fetching an instruction from memory, decoding it, fetching any operands, and executing the instruction. 3. Exceptions can occur during the instruction cycle if things like invalid memory addresses are encountered. The CPU continually repeats the instruction cycle to run programs stored in memory.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
22 views41 pages

Unit2 PDF

The document discusses computer hardware components and the instruction cycle. It describes: 1. The main hardware components of a computer including the central processing unit (CPU), memory, and input/output devices. The CPU fetches and executes instructions and performs calculations. 2. Memory stores instructions, data, and results. The instruction cycle involves fetching an instruction from memory, decoding it, fetching any operands, and executing the instruction. 3. Exceptions can occur during the instruction cycle if things like invalid memory addresses are encountered. The CPU continually repeats the instruction cycle to run programs stored in memory.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 41

The Computer System Hardware

UNIT 2
Overview
3
The Computer System Hardware
• Introduction (Computer hardware definition. Different hardware components. )
• Central Processing Unit (CPU) CPU and its functions. Different
components of CPU: arithmetic logic unit, registers, control unit
• Memory Unit Memory and its functions. Cache memo
• Instruction Format What is instruction format? Concept of operation ,
primary memory, and secondary memory. code and operand code.
• Instruction Set Definition and example of instruction set.
• Instruction Cycle Fetching, decoding, executing, and storing steps of instruction
cycle.
• Microprocessor What is microprocessor? RISC and CISC architecture. Concept of
pipeline and parallel processing.
• Interconnecting the Units of a Computer Concept and types of bus. Concept of
external ports.
• Inside a Computer Cabinet Concept of different components inside a computer
cabinet like motherboard, ports and interfaces, expansion slots, memory chips,
processor, hard disk etc.
Computer hardware definition
• Computer Hardware is the physical part of a
computer, as distinguished from the computer
software that executes or runs on the hardware.
• The hardware of a computer is infrequently
changed, while software and data are modified
frequently.
• The term soft refers to readily created, modified,
or erased.
• These are unlike the physical components within
the computer which are hard.
Different hardware components.
• Input hardware
• Process hardware
• Output hardware
• Memory hardware
Input hardware
Process hardware (CPU)

• The Central Processing Unit (CPU; sometimes


just called processor) is a machine that can
execute computer programs.
• It is sometimes referred to as the brain of the
computer.
Functions of CPU
• Controlling all other parts of the machine and
sending timing signals.
• Transferring data between memory and I/O
devices
• Fetching data and instructions from memory
• Decoding instruction
• Performing arithmetical and logical operations
• Executing programs stored in memory
• Performing communication among the I/O
devices etc.
• There are four steps that nearly all CPUs use in their
operation: fetch, decode, execute, and writeback.
• The first step, fetch, involves retrieving an instruction
from program memory.
• In the decode step, the instruction is broken up into
parts that have significance to other portions of the
CPU.
• During the execute step various portions of the CPU,
such as the arithmetic logic unit (ALU) and the floating
point unit (FPU) are connected so they can perform the
desired operation.
• The final step, writeback, simply writes back the results
of the execute step to some form of memory.
Function of CPU
• Controlling all other parts of the machine and
sending timing signals.
• Transferring data between memory and I/O
devices
• Fetching data and instructions from memory
• Decoding instruction
• Performing arithmetical and logical operations
• Executing programs stored in memory
• Performing communication among the I/O
devices etc.
• The Arithmetic Logic Unit:
• The Arithmetic Logic Unit (ALU) actually
executes the instructions and performs all the
calculations and decisions.
• The data is held in the primary storage unit and
transferred to the ALU whenever needed.
• Data can be moved from the primary storage to
the arithmetic logic unit a number of times
before the entire processing is complete.
• After the completion, the results are sent to the
output storage section and the output devices.
• The Control Unit :
• The Control Unit controls the operations of
the entire computer system.
• The control unit gets the instructions from
the programs stored in primary storage unit
interprets these instruction an subsequently
directs the other units to execute the
instructions.
• Thus it manages and coordinates the
entire computer system.
• Registers :
• Registers are used to retain information
temporarily.
• These are special memory units which are not
actual parts of the main memory, but allow
efficient movement of information between
the various units of the computer system.
• The registers receive information, hold it
temporarily and make it available as and when
required.
• A computer uses a number of registers,
where each register performs a specific
function.
• Some of the common registers are :
• 1.Memory Address Register (MAR): The function of this
register is to hold the address of the current or active
memory location.
• 2. Memory Buffer Register (MBR): This register holds the
contents of the address from which data is read or to
which data has been written.
• 3. Program Control Register : It holds the address of the
next instruction to be executed.
• Accumulator Register: It holds the initial data, the
intermediate results and the final data of the program
under execution.
• 4. Instruction Register: This register holds the current
instruction being executed.
• 5. Input/output Register: The function of this register is
to communicate with the Input/output devices.
Memory and its functions.
Memory or Storage Unit Functions of memory unit are:
• This unit can store instructions, data and intermediate results.
• This unit supplies information to the other units of the computer
when needed.
• It is also known as internal storage unit or main memory or primary
storage or Random access memory(RAM).Its size affects speed,
power and capability.
• Primary memory and secondary memory are two types of
memories in the computer.
✓ Functions of memory unit are:
✓ It stores all the data and the instructions required for
processing.
✓ It stores intermediate results of processing.
✓ It stores final results of processing before these results are
released to an output device.
✓ All inputs and outputs are transmitted through main memory.
Instruction Set
• What is instruction format? Concept of
operation code and operand code
• Instruction Set
• Instruction set size – It tells the total number
of instructions defined in the processor.
• CPU Manufacturer design Hardware circuit
together with Instruction set for that
hardware circuit.
• Example: 8085 has 246 instructions.
Instruction Cycle
• The instruction cycle (also known as the Fetch–Decode–Execute
cycle or the fetch-execute cycle) is the basic operational process
of a computer system.
• The time taken for the execution of an instruction is known as
Instruction Cycle.
• It is the process by which a computer retrieves a program
instruction from its memory, determines what actions the
instruction describes, and then carries out those actions.
• This cycle is repeated continuously by a computer's central
processing unit (CPU), from boot-up until the computer has
shut down.
• In simpler CPUs, the instruction cycle is executed sequentially,
each instruction being processed before the next one is started.
• But in most modern CPUs the instruction cycles are instead
executed concurrently and often in parallel.
The Instruction Cycle

• The Instruction Cycle


– Basic
– Intermediate
– Exceptions
The Instruction Cycle - Basic View

• Once the computer has been


started (bootstrapped) it Start
continually executes instructions
(until the computer is stopped)
• Different instructions take Fetch
different amounts of time to Instruction
execute (typically)
• All instructions and data are
contained in main memory
Execute
Instruction
The Instruction Cycle - Intermediate View
Start

• A complete instruction consists of


– operation code Fetch
– addressing mode Instruction
– zero or more operands
• immediately available data Decode
(embedded within the Instruction
instruction)
• the address where the data can
be found in main memory Fetch
Operand

Execute
Instruction
The Instruction Cycle - Exceptions
Start

• Exceptions, or errors, may occur at


various points in the instruction cycle, Possible Fetch
for example: Exception? Instruction

Possible Decode
Exception? Instruction

Possible Fetch
Exception? Operand

Possible Execute
Exception? Instruction
The Instruction Cycle - Exceptions
Start

• Exceptions, or errors, may occur at


various points in the instruction cycle, Fetch
for example: Instruction

– Addressing - the memory does not exist


Decode
or is inaccessible
Instruction

Fetch
Operand

Execute
Instruction
The Instruction Cycle - Exceptions
Start

• Exceptions, or errors, may occur at


various points in the instruction cycle, Fetch
for example: Instruction

– Operation - the operation code does


Decode
not denote a valid operation
Instruction

Fetch
Operand

Execute
Instruction
The Instruction Cycle - Exceptions
Start

• Exceptions, or errors, may occur at


various points in the instruction cycle, Fetch
for example: Instruction

– Execution - the instruction logic fails,


Decode
typically due to the input data
Instruction
• divide by zero
• integer addition/subtraction
overflow Fetch
Operand
• floating point underflow/overflow

Execute
Instruction
Instruction Architecture - Software Design

• Each computer CPU must be designed to accommodate and understand instructions according to specific
formats.
• Examples:
– All instructions must have an operation code specified
– NOP no operation
– TSTST test and set

OpCode
Instruction Architecture - Software Design

• Each computer CPU must be designed to accommodate and understand instructions according to specific
formats.
• Examples:
– Most instructions will require one, or more, operands
– These may be (immediate) data to be used directly
– or, addresses of memory locations where data will be found (including the address of yet another location)

OpCode Operand (Address)


Instruction Architecture - Software Design
• Sometimes the instruction format requires a code, called the Mode, that specifies a particular addressing format to be distinguished from other
possible formats
– direct addressing
– indirect addressing
– indexed addressing
– relative addressing
– doubly indirect addressing
– etc.

OpCode Mode Op. (Addr.) Mode Op. (Addr.)


Instruction Architecture - CPU
• The CPU must be designed to accommodate the instructions and
data to be processed

I/O 1 I/O 2 I/O n

System Bus
CPU RAM

System Bus

ALU Regs

Address Bus
Control Bus

Data Bus
PC
CU
IR
Internal
PSW
CPU Bus
Microprocessor
• What is microprocessor? RISC and CISC
architecture. Concept of pipeline and parallel
processing.
Instruction Architecture - Hardware
Circuits
• Everything that the computer can do is the result of designing and
building devices to carry out each function – no magic!

• At the most elementary level the devices are called logic gates.
– There are many possible gate types, each perform a specific Boolean
operation (e.g. AND, OR, NOT, NAND, NOR, XOR, XNOR)

• ALL circuits, hence all functions, are defined in terms of the basic
gates.

• We apply Boolean Algebra and Boolean Calculus in order to design


circuits and then optimize our designs.
Instruction Architecture - Hardware
Circuits
• Data is represented by various types of “signals”, including
electrical, magnetic, optical and so on. Data “moves” through the
computer along wires that form the various bus networks (address,
data, control) and which interconnect the gates.

• Combinations of gates are called integrated circuits (IC).

• All computer functions are defined and controlled by IC’s of varying


complexity in design. The manufacture of these may be scaled
according to size/complexity:
– LSI large scale integration
– VLSI very large scale integration
– ULSI ultra large scale integration
Instruction Architecture - CU

• The control unit must decode instructions, set up for


communication with RAM addresses and manage the data stored in
register and accumulator storages.

• Each such operation requires separate circuitry to perform the


specialized tasks.

• It is also necessary for computer experts to have knowledge of the


various data representations to be used on the machine in order to
design components that have the desired behaviours.
Instruction Architecture - ALU

• All instructions together are called the instruction set


– CISC complex instruction set
– RISC reduced instruction set

• Each ALU instruction requires a separate circuit, although some


instructions may incorporate the circuit logic of other instructions

You might also like