Unit-1-1
Unit-1-1
Unit- I
Input Unit: The input unit consists of input devices that are
attached to the computer. These devices take input and convert it
2 Functional Components of a Computer
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
4 Functional Components of a Computer
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.
Bus
Bus is a group of conducting wires which carries information; all the
peripherals are connected to microprocessor through Bus.
2. Control bus
It is a group of conducting wires, which is used to generate timing and
control signals to control all the associated peripherals, microprocessor
uses control bus to process data that is what to do with selected memory
location. Some control signals are:
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.
Bus Arbitration
Bus arbitration refers to the process by which the current bus master
accesses and then leaves the control of the bus and passes it to the another
bus requesting processor unit. The controller that has access to a bus at an
instance is known as Bus master.
A conflict may arise if the number of DMA controllers or other controllers
or processors try to access the common bus at the same time, but access
can be given to only one of those. Only one processor or controller can be
Bus master at the same point of time. To resolve these conflicts, Bus
Arbitration procedure is implemented to coordinate the activities of all
devices requesting memory transfers. The selection of the bus master must
take into account the needs of various devices by establishing a priority
system for gaining access to the bus. The Bus Arbiter decides who would
become current bus master.
There are two approaches to bus arbitration:
1. Centralized bus arbitration – A single bus arbiter performs the
required arbitration.
2. Distributed bus arbitration – All devices participate in the
selection of the next bus master.
6 Functional Components of a Computer
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 is depends on the position
of master bus.
Propagation delay is arises in this method.
If one device fails then 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 address. When the requesting master recognizes its address, it
activates the busy line and begins to use the bus.
Unit-1 7
Advantages –
This method does not favor any particular device and processor.
The method is also quite simple.
If one device fails then entire system will not stop working.
Disadvantages –
Adding bus masters is difficult as increases the number of address
lines of the circuit.
(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.
8 Functional Components of a Computer
Advantages –
This method generates fast response.
Disadvantages –
Hardware cost is high as large no. of control lines are required.
Distributed BUS Arbitration
In this, all devices participate in the selection of the next bus master. Each
device on the bus is assigned a 4bit identification number. The priority of
the device will be determined by the generated ID.
Bus and Memory Transfers
A digital system composed of many registers, and paths must be provided
to transfer information from one register to another. 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. The following block diagram shows a Bus system for four
registers. It is constructed with the help of four 4 * 1 Multiplexers each
having four data inputs (0 through 3) and two selection inputs (S1 and S2).
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.
Unit-1 9
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.
The following function table shows the register that is selected by the bus
for each of the four possible binary values of the Selection lines.
PROCESSOR ORGANIZATION
Figure below is a simplified view of a processor, indicating its connection
to the rest of the system via the system bus.
12 Functional Components of a Computer
The ALU does the actual computation or processing of data. The control
unit controls the movement of data and instructions into and out of
the processor and controls the operation of the ALU. In addition, the figure
shows a minimal internal memory, consisting of a set of storage locations,
called registers.
Figure below depicts is a slightly more detailed view of the processor.
The data transfer and logic control paths are indicated, including an
element labeled internal processor bus. This element is needed to transfer
data between the various registers and the ALU because the ALU in fact
operates only on data in the internal processor memory. The figure also
shows typical basic elements of the ALU. Note the similarity between the
internal structure of the computer as a whole and the internal structure of
the processor. In both cases, there is a small collection of major
elements (computer: processor, I/O, memory; processor: control unit,
ALU, registers) connected by data paths.
General Register based CPU Organization
When we are using multiple general purpose registers, instead of single
accumulator register, in the CPU Organization then this type of
organization is known as General register based CPU Organization. In this
type of organization, computer uses two or three address fields in their
instruction format. Each address field may specify a general register or a
memory word. If many CPU registers are available for heavily used
Unit-1 13
ALU Micro-Operations
Micro- SELA SELB SELD OPR Control Word
operation
R1 ← R2 – R2 R3 R1 SUB 010 011 001 00101
R3
R4 ← R4 ∨ R4 R5 R4 OR 100 101 100 01010
R5
R6 ← R6 + - R6 R1 INCA 110 000 110 00001
R1
R7 ← R1 R1 - R7 TSFA 001 000 111 00000
Output ← R2 R2 – None TSFA 010 000 000 00000
Output ← Input - None TSFA 000 000 000 00000
Input
R4 ← shl R4 R4 - R4 SHLA 100 000 100 11000
R5 ← 0 R5 R5 R5 XOR 101 101 101 01100
The stack pointer includes 6 bits, because 26 = 64, and the SP cannot
exceed 63 (111111 in binary). After all, if 63 is incremented by 1, therefore
the result is 0(111111 + 1 = 1000000). SP holds only the six least
significant bits. If 000000 is decremented by 1 thus the result is 111111.
Therefore, when the stack is full, the one-bit register ‘FULL’ is set to 1. If
the stack is null, then the one-bit register ‘EMTY’ is set to 1. The data
register DR holds the binary information which is composed into or
readout of the stack.
Unit-1 17
The stack pointer is incremented by 1 and the address of the next higher
word is saved in the SP. The word from DR is inserted into the stack using
the memory write operation. The first element is saved at address 1 and the
final element is saved at address 0. If the stack pointer is at 0, then the
stack is full and ‘FULL’ is set to 1. This is the condition when the SP was
in location 63 and after incrementing SP, the final element is saved at
address 0. During an element is saved at address 0, there are no more
empty registers in the stack. The stack is full and the ‘EMTY’ is set to 0.
A new element is deleted from the stack if the stack is not empty (if EMTY
= 0). The pop operation includes the following sequence of micro-
operations −
DR←K[SP] It can read an element from the top of the
stack
SP ← SP – 1 It can decrement the stack pointer
If (SP = 0) then (EMTY Check if stack is empty
← 1)
FULL ← 0 Mark the stack not full
The top element from the stack is read and transfer to DR and thus the
stack pointer is decremented. If the stack pointer reaches 0, then the stack
is empty and ‘EMTY’ is set to 1. This is the condition when the element in
location 1 is read out and the SP is decremented by 1.
The advantages of Stack based CPU organization –
Efficient computation of complex arithmetic expressions.
18 Functional Components of a Computer
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.
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.
20 Functional Components of a Computer
Note:
1. PC relative and 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
1. To give programmers to facilities such as Pointers, counters for loop
controls, indexing of data and program relocation.
2. To reduce the number bits in the addressing field of the Instruction.