Professional Documents
Culture Documents
Unit 1
Unit 1
Computer Organization refers to the operational units and their interconnections that realize the
architectural specifications. Examples are things that are transparent to the programmer:
control signals
interfaces between computer and peripherals
the memory technology being used
So, for example, the fact that a multiply instruction is available is a computer architecture issue. How
that multiply is implemented is a computer organization issue.
Instruction set, number of bits used for data representation, I/O mechanisms, addressing
techniques.
e.g. Is there a multiply instruction?
Computer Architecture is concerned with the way Computer Organization is concerned with the
hardware components are connected together to form a structure and behavior of a computer system as
computer system. seen by the user.
It acts as the interface between hardware and software. It deals with the components of a connection in a
system.
Computer Architecture helps us to understand the Computer Organization tells us how exactly all the
functionalities of a system. units in the system are arranged and
interconnected.
A programmer can view architecture in terms of Whereas Organization expresses the realization of
instructions, addressing modes and registers. architecture.
Computer Architecture deals with high-level design Computer Organization deals with low-level
issues. design issues.
Memory unit
o The Memory unit can be referred to as the storage area in which programs are kept
which are running, and that contains data needed by the running programs.
o The Memory unit can be categorized in two ways namely, primary memory and
secondary memory.
o It enables a processor to access running execution applications and services that are
temporarily stored in a specific memory location.
o Primary storage is the fastest memory that operates at electronic speeds. Primary
memory contains a large number of semiconductor storage cells, capable of storing a
bit of information. The word length of a computer is between 16-64 bits.
o It is also known as the volatile form of memory, means when the computer is shut
down, anything contained in RAM is lost.
o Cache memory is also a kind of memory which is used to fetch the data very soon.
They are highly coupled with the processor.
o The most common examples of primary memory are RAM and ROM.
o Secondary memory is used when a large amount of data and programs have to be
stored for a long-term basis.
o It is also known as the Non-volatile memory form of memory, means the data is
stored permanently irrespective of shut down.
o The most common examples of secondary memory are magnetic disks, magnetic
tapes, and optical disks.
Control unit
o The control unit is a component of a computer's central processing unit that
coordinates the operation of the processor. It tells the computer's memory,
arithmetic/logic unit and input and output devices how to respond to a program's
instructions.
o The control unit is also known as the nerve center of a computer system.
o Let's us consider an example of addition of two operands by the instruction given as
Add LOCA, RO. This instruction adds the memory location LOCA to the operand in
the register RO and places the sum in the register RO. This instruction internally
performs several steps.
Output Unit
o The primary function of the output unit is to send the processed results to the user.
Output devices display information in a way that the user can understand.
o Output devices are pieces of equipment that are used to generate information or any
other response processed by the computer. These devices display information that has
been held or generated within a computer.
o The most common example of an output device is a monitor.
1.4 BUSES
A bus is a high-speed internal connection. Buses are used to send control signals and
data between the processor and other components. Bus is a group of conducting
wires which carries information; all the peripherals are connected to microprocessor
through Bus.
Address bus - carries memory addresses from the processor to other components such as
primary storage and input/output devices. The address bus is unidirectional.
Data bus - carries the data between the processor and other components. The data
bus is bidirectional.
Control bus - carries control signals from the processor to other components. The control
bus also carries the clock's pulses. The control bus is unidirectional.
Memory read
Memory write
I/O read
I/O Write
Opcode fetch
If one line of control bus may be the read/write line.If the wire is low (no electricity
flowing) then the memory is read, if the wire is high (electricity is flowing) then the
memory is written.
(i) Daisy Chaining method: It is a simple and cheaper method where all the bus
masters use the same line for making bus requests. The bus grant signal serially
propagates through each master until it encounters the first one that is requesting
access to the bus. This master blocks the propagation of the bus grant signal,
therefore any other requesting module will not receive the grant signal and hence
cannot access the bus.
During any bus cycle, the bus master may be any device – the processor or any
DMA controller unit, connected to the bus.
Advantages:
Simplicity and Scalability.
The user can add more devices anywhere along the chain, up to a certain
maximum value.
Disadvantages:
The value of priority assigned to a device depends on the position of the master
bus.
Propagation delay arises in this method.
If one device fails then the entire system will stop working.
(ii) Polling or Rotating Priority method: In this, the controller is used to generate
the address for the master(unique priority), the number of address lines required
depends on the number of masters connected in the system. The controller generates
a sequence of master addresses. When the requesting master recognizes its address,
it activates the busy line and begins to use the bus.
Here all bus masters use the same line for bus request.
Here controller generates binary address for the master. (To connect 8 bus masters we
need 3 address lines.
In response to a bus request, the controller “polls” the bus masters by sending a
sequence of bus master address on address lines.
When requesting master recognizes its address, it activates the bus busy lines and
takes control of the bus.
Advantages –
This method does not favor any particular device and processor.
The method is also quite simple.
Priority flexible.
One module fails, entire system does not fail.
Disadvantages –
Adding bus masters is difficult as increases the number of address lines of the
circuit.
If one device fails then the entire system will not stop working.
(iii) Fixed priority or Independent Request method –
In this, each master has a separate pair of bus request and bus grant lines and each
pair has a priority assigned to it.
The built-in priority decoder within the controller selects the highest priority
request and asserts the corresponding bus grant signal.
All bus masters have their individual bus request and bus grant lines.
The controller thus knows which master has requested, so bus is granted t that master.
Priorities of the masters are predefined so on simultaneous bus requests, the bus is
granted based on the priority, provided the bus busy line is not active.
The controller consists of encoder and decoder logic for priorities.
Advantages –
This method generates a fast response.
Speed independent of no. of devices connected.
Disadvantages –
Hardware cost is high as a large no. of control lines is required.
A processor register may hold an instruction, a storage address, or any data (such as bit
sequence or individual characters).
The computer needs processor registers for manipulating data and a register for holding a
memory address. The register holding the memory location is used to calculate the address of
the next instruction after the execution of the current instruction is completed.
o The Memory unit has a capacity of 4096 words, and each word contains 16 bits.
o The Data Register (DR) contains 16 bits which hold the operand read from the
memory location.
o The Memory Address Register (MAR) contains 12 bits which hold the address for the
memory location.
o The Program Counter (PC) also contains 12 bits which hold the address of the next
instruction to be read from memory after the current instruction is executed.
o The Accumulator (AC) register is a general purpose processing register.
o The instruction read from memory is placed in the Instruction register (IR).
o The Temporary Register (TR) is used for holding the temporary data during the
processing.
o The Input Registers (IR) holds the input characters given by the user.
o The Output Registers (OR) holds the output after processing the input data.
A bus structure, on the other hand, is more efficient for transferring information between
registers in a multi-register configuration system.
A bus consists of a set of common lines, one for each bit of register, through which binary
information is transferred one at a time. Control signals determine which register is selected
by the bus during a particular register transfer.
Note: The number of multiplexers needed to construct the bus is equal to the number of bits in each
register. The size of each multiplexer must be 'k * 1' since it multiplexes 'k' data lines. For instance, a
common bus for eight registers of 16 bits each requires 16 multiplexers, one for each line in the bus. Each
multiplexer must have eight data input lines and three selection lines to multiplex one significant bit in the
eight registers.
The two selection lines S1 and S2 are connected to the selection inputs of all four
multiplexers. The selection lines choose the four bits of one register and transfer them into
the four-line common bus.
When both of the select lines are at low logic, i.e. S1S0 = 00, the 0 data inputs of all four
multiplexers are selected and applied to the outputs that forms the bus. This, in turn, causes
the bus lines to receive the content of register A since the outputs of this register are
connected to the 0 data inputs of the multiplexers.
Similarly, when S1S0 = 01, register B is selected, and the bus lines will receive the content
provided by register B.
Memory Transfer
Most of the standard notations used for specifying operations on memory transfer are stated
below.
o The transfer of information from a memory unit to the user end is called
a Read operation.
o The transfer of new information to be stored in the memory is called
a Write operation.
o A memory word is designated by the letter M.
o We must specify the address of memory word while writing the memory transfer
operations.
o The address register is designated by AR and the data register by DR.
o Thus, a read operation can be stated as:
1. Read: DR ← M [AR]
o The Read statement causes a transfer of information into the data register (DR) from
the memory word (M) selected by the address register (AR).
o And the corresponding write operation can be stated as:
1. Write: M [AR] ← R1
o The Write statement causes a transfer of information from register R1 into the
memory word (M) selected by address register (AR).
1.8 Processor organization
A instruction is of various length depending upon the number of addresses it
contain. Generally CPU organization are of three types on the basis of number of
address fields:
1. Single Accumulator organization
2. General register organization
3. Stack organization
In this type of CPU organization, the accumulator register is used implicitly for
processing all instructions of a program and storing the results into the accumulator.
The instruction format that is used by this CPU Organisation is the One address
field. Due to this, the CPU is known as One Address Machine.
The main points about Single Accumulator based CPU Organisation are:
1. In this CPU Organization, the first ALU operand is always stored into the
Accumulator and the second operand is present either in Registers or in the
Memory.
2. Accumulator is the default address thus after data manipulation the results are
stored into the accumulator.
3. One address instruction is used in this type of organization.
The format of instruction is: Opcode + Address
Opcode indicates the type of operation to be performed.
Mainly two types of operation are performed in a single accumulator based CPU
organization:
1. Data transfer operation –
In this type of operation, the data is transferred from a source to a destination.
For ex: LOAD X, STORE Y
Here LOAD is a memory read operation that is data is transferred from memory to
accumulator and STORE is a memory write operation that is data is transferred
from the accumulator to memory.
2. ALU operation –
In this type of operation, arithmetic operations are performed on the data.
For ex: MULT X
where X is the address of the operand. The MULT instruction in this example
performs the operation,
AC <-- AC * M[X]
AC is the Accumulator and M[X] is the memory word located at location X.
This type of CPU organization is first used in PDP-8 processors and is used for
process control and laboratory applications. It has been totally replaced by the
introduction of the new general register-based CPU.
Advantages –
One of the operands is always held by the accumulator register. This results in
short instructions and less memory space.
The instruction cycle takes less time because it saves time in instruction fetching
from memory.
Disadvantages –
When complex expressions are computed, program size increases due to the
usage of many short instructions to execute it. Thus memory size increases.
As the number of instructions increases for a program, the execution time
increases.
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.
Examples-
Examples-
ADD X will increment the value stored in the accumulator by the value stored at memory location X.
AC ← AC + [X]
ADD X will increment the value stored in the accumulator by the value stored at memory location
specified by X.
AC ← AC + [[X]]
Example-
ADD R will increment the value stored in the accumulator by the content of register R.
AC ← AC + [R]
NOTE-
It is interesting to note-
This addressing mode is similar to direct addressing mode.
The only difference is address field of the instruction refers to a CPU register instead of main memory.
Example-
ADD R will increment the value stored in the accumulator by the content of memory location specified
in register R.
AC ← AC + [[R]]
NOTE-
It is interesting to note-
This addressing mode is similar to indirect addressing mode.
The only difference is address field of the instruction refers to a CPU register.
7. Relative Addressing Mode-
Effective Address
NOTE-
Program counter (PC) always contains the address of the next instruction to be executed.
After fetching the address of the instruction, the value of program counter immediately increases.
The value increases irrespective of whether the fetched instruction has completely executed or not.
Effective Address
Effective Address
This addressing mode is a special case of Register Indirect Addressing Mode where-
= Content of Register
Example-
Assume operand size = 2 bytes.
Here,
After fetching the operand 6B, the instruction register R AUTO will be automatically incremented by 2.
Then, updated value of R AUTO will be 3300 + 2 = 3302.
At memory address 3302, the next operand will be found.
NOTE-
This addressing mode is again a special case of Register Indirect Addressing Mode where-
Example-
NOTE-