0% found this document useful (0 votes)
45 views20 pages

Module-I Notes

This document provides an overview of computer architecture, detailing the functional components of a computer including the CPU, memory, and input-output subsystems. It explains the instruction set architecture, the role of registers, the instruction execution cycle, and the interconnection between components. Additionally, it covers the organization of instructions, addressing modes, and the common bus system used for data transfer within the computer.

Uploaded by

tempidforshorts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views20 pages

Module-I Notes

This document provides an overview of computer architecture, detailing the functional components of a computer including the CPU, memory, and input-output subsystems. It explains the instruction set architecture, the role of registers, the instruction execution cycle, and the interconnection between components. Additionally, it covers the organization of instructions, addressing modes, and the common bus system used for data transfer within the computer.

Uploaded by

tempidforshorts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

UNIT -1 Overview of computer Architecture

MODULE I Overview of Computer Architecture 9 hours


Functional blocks of a computer: CPU, memory, input-output
subsystems, control unit. Instruction set architecture of a CPU:
Registers, instruction execution cycle, register transfer
logic(RTL) interpretation of instructions, addressing modes,
instruction set.

Functional Components of a Computer

Computer: A computer is a combination of hardware and


software resources which integrate together and provides various
functionalities to the user. Hardware are the physical components of a
computer like the processor, memory devices, monitor, keyboard etc.
while software is the set of programs or instructions that are required by
the hardware resources to function properly.
There are a few basic components that aids the working-cycle of a
computer i.e. the Input- Process- Output Cycle and these are called as the
functional components of a computer. It needs certain input, processes
that input and produces the desired output. The input unit takes the input,
the central processing unit does the processing of data and the output unit
produces the output. The memory unit holds the data and instructions
during the processing.
Digital Computer: A digital computer can be defined as a programmable
machine which reads the binary data passed as instructions, processes this
binary data, and displays a calculated digital output. Therefore, Digital
computers are those that work on the digital data.
Details of Functional Components of a Digital Computer

● Input Unit :The input unit consists of input devices that are attached
to the computer. These devices take input and convert it into binary
language that the computer understands. Some of the common input
devices are keyboard, mouse, joystick, scanner etc.
● Central Processing Unit (CPU) : Once the information is entered into
the computer by the input device, the processor processes it. The CPU
is called the brain of the computer because it is the control center of
the computer. It first fetches instructions from memory and then
interprets them so as to know what is to be done. If required, data is
fetched from memory or input device. Thereafter CPU executes or
performs the required computation and then either stores the output or
displays on the output device. The CPU has three main components
which are responsible for different functions – Arithmetic Logic Unit
(ALU), Control Unit (CU) and Memory registers
● Arithmetic and Logic Unit (ALU) : The ALU, as its name suggests
performs mathematical calculations and takes logical decisions.
Arithmetic calculations include addition, subtraction, multiplication
and division. Logical decisions involve comparison of two data items
to see which one is larger or smaller or equal.
● Control Unit : The Control unit coordinates and controls the data flow
in and out of CPU and also controls all the operations of ALU,
memory registers and also input/output units. It is also responsible for
carrying out all the instructions stored in the program. It decodes the
fetched instruction, interprets it and sends control signals to
input/output devices until the required operation is done properly by
ALU and memory.
● Memory Registers : A register is a temporary unit of memory in the
CPU. These are used to store the data which is directly used by the
processor. Registers can be of different sizes(16 bit, 32 bit, 64 bit and
so on) and each register inside the CPU has a specific function like
storing data, storing an instruction, storing address of a location in
memory etc. The user registers can be used by an assembly language
programmer for storing operands, intermediate results etc.
Accumulator (ACC) is the main register in the ALU and contains one
of the operands of an operation to be performed in the ALU.
● Memory : Memory attached to the CPU is used for storage of data and
instructions and is called internal memory The internal memory is
divided into many storage locations, each of which can store data or
instructions. Each memory location is of the same size and has an
address. With the help of the address, the computer can read any
memory location easily without having to search the entire memory.
when a program is executed, it’s data is copied to the internal memory
and is stored in the memory till the end of the execution. The internal
memory is also called the Primary memory or Main memory. This
memory is also called as RAM, i.e. Random Access Memory. The
time of access of data is independent of its location in memory,
therefore this memory is also called Random Access memory (RAM).
Read this for different types of RAMs
● Output Unit : The output unit consists of output devices that are
attached with the computer. It converts the binary data coming from
CPU to human understandable form. The common output devices are
monitor, printer, plotter etc.
Interconnection between Functional Components
A computer consists of input unit that takes input, a CPU that processes
the input and an output unit that produces output. All these devices
communicate with each other through a common bus. A bus is a
transmission path, made of a set of conducting wires over which data or
information in the form of electric signals, is passed from one component
to another in a computer. The bus can be of three types – Address bus,
Data bus and Control Bus.
Following figure shows the connection of various functional
components:

The address bus carries the address location of the data or instruction. The
data bus carries data from one component to another and the control bus
carries the control signals. The system bus is the common communication
path that carries signals to/from CPU, main memory and input/output
devices. The input/output devices communicate with the system bus
through the controller circuit which helps in managing various
input/output devices attached to the computer.
Instruction set architecture of a CPU
An Instruction Set Architecture (ISA) is part of the abstract model of a
computer that defines how the CPU is controlled by the software. The
ISA acts as an interface between the hardware and the software,
specifying both what the processor is capable of doing as well as how it
gets done.
Register:
What are Computer Registers in Computer Architecture?
Computer registers are high-speed memory storing units. It is an
element of the computer processor. It can carry any type of
information including a bit sequence or single data.
A register should be 32 bits in length for a 32-bit instruction
computer. Registers can be numbered relies upon the processor design
and language rules.
The instructions in a computer are saved in memory locations and
implemented one after another at a time. The function of the control unit
is to fetch the instruction from the memory and implement it. The control
does the similar for all the instructions in the memory in sequential order.
A counter is needed to maintain a path of the next instruction to be
implemented and evaluate its address. The figure shows the registers
with their memories. The memory addresses are saved in multiple
registers. These requirements certainly state the use for registers in a
computer.
The following table shows the registers and their functions.

Register Number of Register Name Function


Symbol Bits

OUTR 8 Output register OIt holds output


character.

INPR 8 Input register It holds input


character.

PC 12 Program It holds the address of


Counter the instruction.

AR 12 Address It holds an address for


Register memory.
Register Number of Register Name Function
Symbol Bits

DR 16 Data Register It holds memory


operand.

AC 16 Accumulator It’s a processor


register.

IR 16 Instruction It holds an instruction


Register code.

TR 16 Temporary It holds temporary


Register data.

The description for each of the registers determined in the figure is as


follows −
● The data register holds the operand read from the memory.
● The accumulator is a general-purpose register need for processing.
● The instruction register holds the read memory.
● The temporary data used while processing is stored in the temporary
register.
● The address register holds the address of the instruction that is to be
implemented next from the memory.
● The Program Counter (PC) controls the sequence of instructions to
be read. In case a branch instruction is detected, the sequential
execution does not arise. A branch execution calls for a transfer to
an instruction that is not in sequence with the instructions in the PC.
● The input register (INPR) and output register (OUTPR) are the
registers used for the I/O operations. The INPR receives an 8-bit
character from the input device. It is similar to the OUTPR.
Instruction Execution cycle

The instruction cycle (also known as the fetch–decode–execute cycle,


or simply the fetch-execute cycle) is the cycle that the central
processing unit (CPU) follows from boot-up until the computer has
shut down in order to process instructions.
A program consisting of the memory unit of the computer includes a
series of instructions. The program is implemented on the computer by
going through a cycle for each instruction.
In the basic computer, each instruction cycle includes the following
procedures −
● It can fetch instruction from memory.
● It is used to decode the instruction.
● It can read the effective address from memory if the instruction has
an indirect address.
● It can execute the instruction.
After the following four procedures are done, the control switches back
to the first step and repeats the similar process for the next instruction.
Therefore, the cycle continues until a Halt condition is met. The figure
shows the phases contained in the instruction cycle.

As display in the figure, the halt condition appears when the device
receive turned off, on the circumstance of unrecoverable errors, etc.
Fetch Cycle
The address instruction to be implemented is held at the program counter.
The processor fetches the instruction from the memory that is pointed by
the PC.
Next, the PC is incremented to display the address of the next instruction.
This instruction is loaded onto the instruction register. The processor
reads the instruction and executes the important procedures.
Execute Cycle
The data transfer for implementation takes place in two methods are as
follows −
● Processor-memory − The data sent from the processor to memory
or from memory to processor.
● Processor-Input/Output − The data can be transferred to or from a
peripheral device by the transfer between a processor and an I/O
device.
In the execute cycle, the processor implements the important operations
on the information, and consistently the control calls for the modification
in the sequence of data implementation. These two methods associate
and complete the execute cycle.
State Diagram for Instruction Cycle
The figure provides a large aspect of the instruction cycle of a basic
computer, which is in the design of a state diagram. For an instruction
cycle, various states can be null, while others can be visited more than
once.
● Instruction Address Calculation − The address of the next
instruction is computed. A permanent number is inserted to the
address of the earlier instruction.
● Instruction Fetch − The instruction is read from its specific
memory location to the processor.
● Instruction Operation Decoding − The instruction is interpreted
and the type of operation to be implemented and the operand(s) to
be used are decided.
● Operand Address Calculation − The address of the operand is
evaluated if it has a reference to an operand in memory or is
applicable through the Input/Output.
● Operand Fetch − The operand is read from the memory or the I/O.
● Data Operation − The actual operation that the instruction contains
is executed.
● Store Operands − It can store the result acquired in the memory or
transfer it to the I/O.

Register transfer logic :


The term Register Transfer refers to the availability of hardware logic
circuits that can perform a given micro-operation and transfer the result of
the operation to the same or another register.

Most of the standard notations used for specifying operations on various


registers are stated below.

o The memory address register is designated by MAR.


o Program Counter PC holds the next instruction's address.
o Instruction Register IR holds the instruction being executed.
o R1 (Processor Register).
o We can also indicate individual bits by placing them in parenthesis.
For instance, PC (8-15), R2 (5), etc.
o Data Transfer from one register to another register is represented in
symbolic form by means of replacement operator. For instance, the
following statement denotes a transfer of the data of register R1
into register R2.
1. R2 ← R1
o Typically, most of the users want the transfer to occur only in a
predetermined control condition. This can be shown by following
if-then statement:
If (P=1) then (R2 ← R1); Here P is a control signal generated in the
control section.
o It is more convenient to specify a control function (P) by separating
the control variables from the register transfer operation. For
instance, the following statement defines the data transfer operation
under a specific control function (P).

1. P: R2 ← R1

The following image shows the block diagram that depicts the transfer of
data from R1 to R2.

Here, the letter 'n' indicates the number of bits for the register. The 'n'
outputs of the register R1 are connected to the 'n' inputs of register R2
A load input is activated by the control variable 'P' which is transferred to
the register R2.

Interpertation of instructions

While a Program, as we all know, is, A set of instructions that specify the
operations, operands, and the sequence by which processing has to
occur. An instruction code is a group of bits that tells the computer to
perform a specific operation part.

Instruction Code: Operation Code

The operation code of an instruction is a group of bits that define


operations such as add, subtract, multiply, shift and compliment. The
number of bits required for the operation code depends upon the total
number of operations available on the computer. The operation code must
consist of at least n bits for a given 2^n operations. The operation part of
an instruction code specifies the operation to be performed.

Instruction Code: Register Part

The operation must be performed on the data stored in registers. An


instruction code therefore specifies not only operations to be performed
but also the registers where the operands(data) will be found as well as
the registers where the result has to be stored.

Stored Program Organisation

The simplest way to organize a computer is to have Processor


Register and instruction code with two parts. The first part specifies the
operation to be performed and second specifies an address. The memory
address tells where the operand in memory will be found.

Instructions are stored in one section of memory and data in another.


Computers with a single processor register is known as Accumulator
(AC). The operation is performed with the memory operand and the
content of AC.

Common Bus System

The basic computer has 8 registers, a memory unit and a control unit.
Paths must be provided to transfer data from one register to another. An
efficient method for transferring data in a system is to use a Common
Bus System. The output of registers and memory are connected to the
common bus.

Load(LD)

The lines from the common bus are connected to the inputs of each
register and data inputs of memory. The particular register
whose LD input is enabled receives the data from the bus during the
next clock pulse transition.

Before studying about instruction formats lets first study about the
operand address parts.

When the 2nd part of an instruction code specifies the operand, the
instruction is said to have immediate operand. And when the 2nd part of
the instruction code specifies the address of an operand, the instruction is
said to have a direct address. And in indirect address, the 2nd part of
instruction code, specifies the address of a memory word in which the
address of the operand is found.

Computer Instructions

The basic computer has three instruction code formats. The Operation
code (opcode) part of the instruction contains 3 bits and remaining 13 bits
depends upon the operation code encountered.

There are three types of formats:

1. Memory Reference Instruction


It uses 12 bits to specify the address and 1 bit to specify the addressing
mode (I). I is equal to 0 for direct address and 1 for indirect address.

2. Register Reference Instruction


These instructions are recognized by the opcode 111 with a 0 in the left
most bit of instruction. The other 12 bits specify the operation to be
executed.

3. Input-Output Instruction
These instructions are recognized by the operation code 111 with a 1 in
the left most bit of instruction. The remaining 12 bits are used to specify
the input-output operation.

Format of Instruction

The format of an instruction is depicted in a rectangular box symbolizing


the bits of an instruction. Basic fields of an instruction format are given
below:

1. An operation code field that specifies the operation to be


performed.
2. An address field that designates the memory address or register.
3. A mode field that specifies the way the operand of effective address
is determined.
Computers may have instructions of different lengths containing varying
number of addresses. The number of address field in the instruction
format depends upon the internal organization of its registers.

Addressing mode

The addressing mode specifies a rule for interpreting or modifying the


address field of the instruction before the operand is actually
executed. The 8086 memory addressing modes provide flexible access to
memory, allowing you to easily access variables, arrays, records, pointers,
and other complex data types.
Addressing Modes
● Difficulty Level : Easy
● Last Updated : 04 Sep, 2019
 Read
 Discuss
Addressing Modes– The term addressing modes refers to the way in
which the operand of an instruction is specified. The addressing mode
specifies a rule for interpreting or modifying the address field of the
instruction before the operand is actually executed.
Addressing modes for 8086 instructions are divided into two
categories:
1) Addressing modes for data
2) Addressing modes for branch
The 8086 memory addressing modes provide flexible access to memory,
allowing you to easily access variables, arrays, records, pointers, and
other complex data types. The key to good assembly language
programming is the proper use of memory addressing modes.
An assembly language program instruction consists of two parts

The memory address of an operand consists of two components:


IMPORTANT TERMS
● Starting address of memory segment.
● Effective address or Offset: An offset is determined by adding any
combination of three address elements: displacement, base and
index.
● Displacement: It is an 8 bit or 16 bit immediate value given
in the instruction.
● Base: Contents of base register, BX or BP.
● Index: Content of index register SI or DI.
According to different ways of specifying an operand by 8086
microprocessor, different addressing modes are used by 8086.
Addressing modes used by 8086 microprocessor are discussed below:
● Implied mode:: In implied addressing the operand is specified in the
instruction itself. In this mode the data is 8 bits or 16 bits long and data
is the part of instruction.Zero address instruction are designed with
implied addressing mode.

Example: CLC (used to reset Carry flag to 0)


● Immediate addressing mode (symbol #):In this mode data is present
in address field of instruction .Designed like one address instruction
format.
Note:Limitation in the immediate mode is that the range of constants
are restricted by size of address field.

Example: MOV AL, 35H (move the data 35H into AL register)
● Register mode: In register addressing the operand is placed in one of
8 bit or 16 bit general purpose registers. The data is in the register that
is specified by the instruction.
Here one register reference is required to access the data.

Example: MOV AX,CX (move the contents of CX register to AX


register)
● Register Indirect mode: In this addressing the operand’s offset is
placed in any one of the registers BX,BP,SI,DI as specified in the
instruction. The effective address of the data is in the base register or
an index register that is specified by the instruction.
Here two register reference is required to access the data.

The 8086 CPUs let you access memory indirectly through a register
using the register indirect addressing modes.
● MOV AX, [BX](move the contents of memory location s
addressed by the register BX to the register AX)
● Auto Indexed (increment mode): Effective address of the operand is
the contents of a register specified in the instruction. After accessing
the operand, the contents of this register are automatically incremented
to point to the next consecutive memory location.(R1)+.
Here one register reference,one memory reference and one ALU
operation is required to access the data.
Example:
● Add R1, (R2)+ // OR
● R1 = R1 +M[R2]
R2 = R2 + d
Useful for stepping through arrays in a loop. R2 – start of array d –
size of an element
● Auto indexed ( decrement mode): Effective address of the operand is
the contents of a register specified in the instruction. Before accessing
the operand, the contents of this register are automatically
decremented to point to the previous consecutive memory
location. –(R1)
Here one register reference,one memory reference and one ALU
operation is required to access the data.
Example:
Add R1,-(R2) //OR
R2 = R2-d
R1 = R1 + M[R2]
Auto decrement mode is same as auto increment mode. Both can also be
used to implement a stack as push and pop . Auto increment and Auto
decrement modes are useful for implementing “Last-In-First-Out” data
structures.
● Direct addressing/ Absolute addressing Mode (symbol [ ]): The
operand’s offset is given in the instruction as an 8 bit or 16 bit
displacement element. In this addressing mode the 16 bit effective
address of the data is the part of the instruction.
Here only one memory reference operation is required to access the
data.

Example:ADD AL,[0301] //add the contents of offset address 0301 to


AL
● Indirect addressing Mode (symbol @ or () ):In this mode address
field of instruction contains the address of effective address.Here two
references are required. 1st reference to get effective address.
2nd reference to access the data.
Based on the availability of Effective address, Indirect mode is of two
kind:
1. Register Indirect:In this mode effective address is in the register,
and corresponding register name will be maintained in the address
field of an instruction.
Here one register reference,one memory reference is required to
access the data.
2. Memory Indirect:In this mode effective address is in the memory,
and corresponding memory address will be maintained in the
address field of an instruction.
Here two memory reference is required to access the data.
● Indexed addressing mode: The operand’s offset is the sum of the
content of an index register SI or DI and an 8 bit or 16 bit
displacement.
Example:MOV AX, [SI +05]
● Based Indexed Addressing: The operand’s offset is sum of the
content of a base register BX or BP and an index register SI or DI.
Example: ADD AX, [BX+SI]

Based on Transfer of control, addressing modes are:


● PC relative addressing mode: PC relative addressing mode is
used to implement intra segment transfer of control, In this mode
effective address is obtained by adding displacement to PC.
● EA= PC + Address field value
PC= PC + Relative value.
● Base register addressing mode:Base register addressing mode is
used to implement inter segment transfer of control.In this mode
effective address is obtained by adding base register value to
address field value.
● EA= Base register + Address field value.
● PC= Base register + Relative value.
Note:
1. PC relative nad based register both addressing modes are
suitable for program relocation at runtime.
2. Based register addressing mode is best suitable to write
position independent codes.
Advantages of Addressing Modes
0. To give programmers to facilities such as Pointers, counters for loop
controls, indexing of data and program relocation.
1. To reduce the number bits in the addressing field of the Instruction.

instruction set
● An example of an instruction set is the x86 instruction set, which
is common to find on computers today. Different computer
processors can use almost the same instruction set while still having
very different internal design. Both the Intel Pentium and AMD
Athlon processors use nearly the same x86 instruction set.

You might also like