Csa Unit 1
Csa Unit 1
3) The address bus carries the address location of the data or instruction.
4) The data bus carries data from one component to another and the control bus carries the
control signals.
5) The system bus is the common communication path that carries signals to/from CPU, main
memory and input/output devices.
6) The input/output devices communicate with the system bus through the controller circuit
which helps in managing various input/output devices attached to the compute r.
Bus Structure
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 a time only
one pair of devices can use this bus to communicate with each other successfully.
A bus is a subsystem that is used to connect computer components and transfer data
between them. For example, an internal bus connects computer internals to the motherboard. A
“bus topology” or design can also be used in other ways to describe digital connections. A bus
may be parallel or serial.
There are three types of bus lines: Data bus, Address bus, and Control bus. Communication
over each bus line is performed in cooperation with another. The data bus is a signal line for
exchanging the data between the CPU and the memory, and between the CPU and I/O, and
handles the data stored in the specified location.
A bus may be parallel or serial. Parallel buses transmit data across multiple wires. Serial buses
transmit data in bit-serial format.
Bus (hardware structure)-
A bus was originally an electrical parallel structure with conductors connected with identical or
similar CPU pins, such as a 32-bit bus with 32 wires and 32 pins. The earliest buses, often
termed electrical power buses or bus bars, were wire collections that connected peripheral
devices and memory, with one bus designated for peripheral devices and another bus for
memory. Each bus included separate instructions and distinct protocols and timing.
Parallel bus standards include advanced technology attachment (ATA) or small computer system
interface (SCSI) for printer or hard drive devices. Serial bus standards include universal serial
bus (USB), FireWire or serial ATA with a daisy-chain topology or hub design for devices,
keyboards or modem devices.
Computer bus types are as follows:
(1) System Bus: A parallel bus that simultaneously transfers data in 8-, 16-, or 32-bit
channels and is the primary pathway between the CPU and memory.
(2) Internal Bus: Connects a local device, like internal CPU memory.
(3) External Bus: Connects peripheral devices to the motherboard, such as scanners or
disk drives.
(4) Expansion Bus: Allows expansion boards to access the CPU and RAM.
(5) Frontside Bus: Main computer bus that determines data transfer rate speed and is
the primary data transfer path between the CPU, RAM and other motherboard devices.
(6)Backside Bus: Transfers secondary cache (L2 cache) data at faster speeds, allowing
more efficient CPU operations.
The bus can be discussed based on different engineering models. For example, there is the
parallel bus and the serial bus, as mentioned above, and the different types of buses that you
would encounter on the motherboard of a computer, for example, a system bus, address bus or
input-output bus.
We can also talk about buses in the form of data transfer rates. Here the “bus speed” or rate may
be listed in megahertz, or in megabytes per second. For example, 100 MHz is said to correspond
to perhaps 6400 MB per second in some architectures.
In general, the kinds of speed achieved by modern processors include bus speeds of typically
under 10,000 MB or 10 GB per second.
Then there’s also the designation of a bus specific to where it is located on the circuit board. The
front-side bus is typically considered the fastest bus on the motherboard.
Addressing Modes:
The operation field of an instruction specifies the operation to be performed.And this operation
must be performed on some data.So each instruction need to specify data on which the
operation is to be performed.But the operand(data) may be in accumulator, general purpose
register or at some specified memory location.So, appropriate location (address) of data is need
to be specified, and in computer, there are various ways of specifying the address of data.These
various ways of specifying the address of data are known as “Addressing Modes”
And in computer the address of operand i.e., the address where operand is actually found is
known as
“Effective Address”.
Now, in addition to this, the two most prominent reason of why addressing modes are so
important are:
1. First, the way the operand data are chosen during program execution is
dependent on the addressing mode of the instruction.
2. Second, the address field(or fields) in a typical instruction format are relatively
small and sometimes we would like to be able to reference a large range of locations,
so here to achieve this objective i.e., to fit this large range of location in address field,
a variety of addressing techniques has been employed. As they reduce the number of
field in the addressing field of the instruction.
Thus, Addressing Modes are very vital in Instruction Set Architecture(ISA).Now, before
discussing various addressing modes, we will give here some notations that will use in
addressing mode .These are:
Implied Addressing Mode also known as "Implicit" or "Inherent" addressing mode is the
addressing mode in which, no operand(register or memory location or data) is specified
in the instruction. As in this mode the operand are specified implicit in the definition of
instruction.
As an example: The instruction :
“Complement Accumulator” is an Implied Mode instruction because the operand in the
accumulator register is implied in the definition of instruction.In assembly language it is
written as:
In Immediate Addressing Mode operand is specified in the instruction itself.In other words,
an immediate mode instruction has an operand field rather than an address field,
which contain actual operand to be used in conjunction with the operand specified in the
instruction.That is, in this mode, the format of instruction is:
The instruction format for direct and indirect addressing mode is shown below:
It consists of 3-bit opcode, 12-bit address and a mode bit designated as( I).The mode bit (I)
is zero for Direct Address and 1 for Indirect Address. Now we will discuss about each
in detail one by one.
Direct Addressing Mode:
Direct Addressing Mode is also known as “Absolute Addressing Mode”.In this mode the
address of data(operand) is specified in the instruction itself.That is, in this type of
mode, the operand resides in memory and its address is given directly by the address
field of the instruction.
Means, in other words, in this mode, the address field contain the Effective Address of
operand
i.e., EA=A
As an example: Consider the instruction:
ADD A Means add contents of cell A to accumulator .
In this mode, the address field of instruction gives the memory address where on, the
operand is stored in memory.That is, in this mode, the address field of the instruction
gives the address where the “Effective Address” is stored in memory.
i.e., EA=(A)
Means, here, Control fetches the instruction from memory and then uses its address part to
access memory again to read Effective Address.
As an example: Consider the instruction:
ADD (A) Means adds the content of cell pointed to contents of A to Accumulator.
i.e., (A)=1350=EA
In Register Addressing Mode, the operands are in registers that reside within the CPU.That
is, in this mode, instruction specifies a register in CPU, which contain the operand.It is
like Direct Addressing Mode, the only difference is that the address field refers
to a register instead of memory location.
i.e., EA=R
In Register Indirect Addressing Mode, the instruction specifies a register in CPU whose
contents give the operand in memory.In other words, the selected register contain the
address of operand rather than the operand itself.That is,
i.e., EA=(R)
Means, control fetches instruction from memory and then uses its address to access Register
and looks in Register(R) for effective address of operand in memory.
It look like as:
Here, the parentheses are to be interpreted as meaning contents of.
From above example, it is clear that, the instruction(MOV AL, [BX]) specifies a
register[BX], and in coding of register, we see that, when we move register
[BX], the register contain the address of operand(1000H) rather than address
itself.
5.Auto-increment and Auto-decrement Addressing Modes :
These are similar to Register indirect Addressing Mode except that the register is
incremented or decremented after(or before) its value is used to access memory.
These modes are required because when the address stored in register refers to a table of
data in memory, then it is necessary to increment or decrement the register after every
access to table so that next value is accessed from memory.Thus, these addressing
modes are common requirements in computer.
Subroutine-
In computer programming, a function or subroutine is a sequence of program instructions that
performs a specific task, packaged as a unit. This unit can then be used in programs wherever
that particular task should be performed.
1. Subroutine:
A set of instructions that are used repeatedly in a program can be referred to as Subroutine.
Only one copy of this Instruction is stored in the memory. When a Subroutine is required it can
be called many times during the Execution of a particular program. A call Subroutine
Instruction calls the Subroutine. Care Should be taken while returning a Subroutine as
Subroutine can be called from a different place from the memory.
The content of the PC must be Saved by the call Subroutine Instruction to make a correct
return to the calling program.
PARAMETER PASSING:-
SUBROUTINES IN COMPUTER ORGANIZATION PARAMETER PASSING:- When calling
a subroutine, a program must provide to the subroutine the parameters, that is, the operands or
their addresses, to be used in the computation. Later, the subroutine returns other parameters, in
this case, the results of the computation.
This exchange of information between a calling program and a subroutine is referred to as
parameter passing. Parameter passing may be accomplished in several ways.
The parameters may be placed in registers or in memory locations, where they can be accessed
by the subroutine.
Alternatively, the parameters may be placed on the processor stack used for saving the return
address. The purpose of the subroutines is to add a list of numbers.
Instead of passing the actual list entries, the calling program passes the address of the first
number in the list. This technique is called passing by reference.
The second parameter is passed by value, that is, the actual number of entries, n, is passed to the
subroutine.
Instruction Format-
A standard machine which can be directly decoded and executed by the CPU is called instruction
format. It is a sequence of bits in a machine instruction that defines the layout of the instruction.
The format of instruction provides specific information to the CPU regarding the information to
be performed.
The address field in the instruction is not there in a stack-based computer. ALU operands are
only used on stack data in this organization. This means that both ALU operations must be
present in the stack at all times. As the destination, the same stack is used. Only one end of the
stack, generally referred to as the top of the stack, can be useful for inserting and deleting data.
So there is no need for an address in this format because the TOS becomes the default location.
For data manipulation, we use an inferred ACCUMULATOR register. One of the ALU operands
is always present in the accumulator in this arrangement. The destination is the same
accumulator as the source. In the register or memory, another ALU operand is present. Because
there is only one accumulator in the CPU, it becomes the default position.
This is a regular occurrence in commercial computers. The instruction can provide two addresses
in this scenario. Unlike in the past, when the result of a single address instruction was there in the
accumulator, the result can now be present in numerous locations rather than just accumulators.
However this requires a larger number of bits to represent the address. Two Address Instruction
Format is the computable instruction format for the register to memory reference CPU.
Three Address Instruction Formats :
This has three address fields, each of which can be useful to indicate a register or memory
location. The size of the programs written is significantly less, but the number of bits each
instruction is increasing. These instructions make program construction considerably easier. But
this does not imply that programs will run faster because each micro operation (changing the
content of a register, loading an address into the address bus, etc.) will take a single cycle.
This format includes an opcode for each of the four address fields. Because PC is a necessary
register in the CPU design, it is there to store the address of the next instruction. As a result, the
four-instruction format is no longer in use.
Processor -
CPU is the brain of the computer. All types of data processing operations and all the important
functions of a computer are performed by the CPU. It helps input and output devices to
communicate with each other and perform their respective operations. It also stores data which
is input, intermediate results in between processing, and instructions.
Now, the CPU consists of 3 major units, which are:
1. Memory or Storage Unit
2. Control Unit
3. ALU(Arithmetic Logic Unit)
Let us now look at the block diagram of the computer:
Bus Architecture-
A bus is a common pathway through which information flows from one component to another.
This pathway is used for communication purpose and can be established between two or more
computer components. We are going to review different computer bus architectures that are used
in computers.
Different Types of Computer Buses Functions of Buses in Computers The functions of buses can
be summarized as below:
1. Data sharing - All types of buses found on a computer must be able to transfer data between
the computer peripherals connected to it.
2 . The data is transferred in in either serial or parallel, which allows the exchange of 1, 2, 4 or
even 8 bytes of data at a time. (A byte is a group of 8 bits). Buses are classified depending on
how many bits they can move at the same time, which means that we have 8-bit, 16-bit, 32-bit or
even 64-bit buses.
A unidirectional pathway –
Address bus
information can only flow one way
A bi-directional pathway –
Data bus
information can flow in two directions
Advantages
Versatility:
New devices can be
added easily.
Peripherals can be moved
between computer.
Low Cost:
A single set of wires is
shared in multiple ways.
3. Addressing - A bus has address lines, which match those of the processor. This
allows data to be sent to or from specific memory locations.
4. 3. Power - A bus supplies power to various peripherals that are connected to it. 4.
Timing - The bus provides a system clock signal to synchronize the peripherals attached
to it with the rest of the system. The expansion bus facilitates the easy connection of
additional components and devices on a computer for example the addition of a TV
card or sound card.
5. Expansion Bus Types These are some of the common expansion bus types that
have ever been used in computers: ISA - Industry Standard Architecture
6. EISA - Extended Industry Standard Architecture
7. MCA - Micro Channel Architecture
8. VESA - Video Electronics Standards Association
9. PCI - Peripheral Component Interconnect
10. PCMCIA - Personal Computer Memory Card Industry Association (Also called
PC bus)
AGP - Accelerated Graphics Port
Instruction Cycle
A program residing in the memory unit of a computer consists of a sequence of instructions.
These instructions are executed by the processor by going through a cycle for each instruction.
In a basic computer, each instruction cycle consists of the following phases:
1. Fetch instruction from memory.
2. Decode the instruction.
3. Read the effective address from memory.
4. Execute the instruction.
Control Unit
Control Unit is the part of the computer’s central processing unit (CPU), which directs the
operation of the processor. It is the responsibility of the Control Unit to tell the computer’s
memory, arithmetic/logic unit and input and output devices how to respond to the instructions
that have been sent to the processor. It fetches internal instructions of the programs from the
main memory to the processor instruction register, and based on this register contents, the
control unit generates a control signal that supervises the execution of these instructions.
A control unit works by receiving input information to which it converts into control signals,
which are then sent to the central processor. The computer’s processor then tells the attached
hardware what operations to perform. The functions that a control unit performs are dependent
on the type of CPU because the architecture of CPU varies from manufacturer to manufacturer.
Examples of devices that require a CU are:
Control Processing Units(CPUs)
Graphics Processing Units(GPUs)
Sequence Control
Sequence control refers to user actions and computer logic that initiate, interrupt, or
terminate transactions. Sequence control governs the transition from one transaction to the
next.
There is a five-step procedure for controlling processes that will help you set, measure and tweak
your business activities—whether that's production, packaging, delivery or another business
process.
In a computer, the control unit often steps through the instruction cycle successively. This
consists of fetching the instruction, fetching the operands, decoding the instruction,
executing the instruction, and then writing the results back to memory.
Hardwired Control
The Hardwired Control organization involves the control logic to be implemented with gates,
flip-flops, decoders, and other digital circuits.
The following image shows the block diagram of a Hardwired Control organization.
o A Hard-wired Control consists of two decoders, a sequence counter,
and a number of logic gates.
o An instruction fetched from the memory unit is placed in the
instruction register (IR).
o The component of an instruction register includes; I bit, the operation
code, and bits 0 through 11.
o The operation code in bits 12 through 14 are coded with a 3 x 8
decoder.
o The outputs of the decoder are designated by the symbols D0 through
D7.
o The operation code at bit 15 is transferred to a flip-flop designated by
the symbol I.
o The operation codes from Bits 0 through 11 are applied to the control
logic gates.
o The Sequence counter (SC) can count in binary from 0 through 15.
Micro-programmed Control
The Microprogrammed Control organization is implemented by using the
programming approach.
In Microprogrammed Control, the micro-operations are performed by
executing a program consisting of micro-instructions.
The following image shows the block diagram of a Microprogrammed Control
organization.
o The Control memory address register specifies the address of the
micro-instruction.
o The Control memory is assumed to be a ROM, within which all control
information is permanently stored.
o The control register holds the microinstruction fetched from the
memory.
o The micro-instruction contains a control word that specifies one or
more micro-operations for the data processor.
o While the micro-operations are being executed, the next address is
computed in the next address generator circuit and then transferred
into the control address register to read the next microinstruction.
o The next address generator is often referred to as a micro-program
sequencer, as it determines the address sequence that is read from
control memory.
Microinstruction format
A microinstruction format includes 20 bits in total. They are divided into four elements as
displayed in the figure. F1, F2, F3 are the micro-operation fields. They determine micro-
operations for the computer. CD is the condition for branching.
A microinstruction format includes 20 bits in total. They are divided into four elements as
displayed in the figure.
F1, F2, F3 are the micro-operation fields. They determine micro-operations for the computer.
CD is the condition for branching. They choose the status bit conditions.
BR is the branch field. It determines the type of branch.
AD is the address field. It includes the address field whose length is 7 bits.
The micro-operations are divided into three fields of three bits each. These three bits can define
seven different micro-operations. In total there are 21 operations as displayed in the table.
Symbols with their Binary Code for Microinstruction Fields
Name: Code Symbol
001 AC ← AC + DR ADD
010 AC ← 0 CLRAC
F1
Name: Code Symbol
101 PC ← PC + 1 INCPC
110 PC ← AR ARTPC
As shown in the table, each microinstruction can have only three micro-operations, one from
each field. If it uses less than three, it will result in more than one operation using the no
operation binary code.
Condition Field
A condition field includes 2 bits. They are encoded to define four status bit conditions. As stated
in the table, the first condition is always a 1, with CD = 0. The symbol that can indicate this
condition is ‘U’. The table displays the multiple condition fields and their summary in an easy
manner.
Condition Field Symbols and Descriptions
Condition Symb Comments
ol
11 AC = 0 Z Zero value in AC
As shown in the table, when condition 00 is connected with BR (branch) field, it results in an
unconditional branch operation. Then the execution is read from memory the indirect bit I is
accessible from bit 15 of DR. The status of the next bit is supported by the AC sign bit. If all the
bits in AC are 1, then it is indicated as Z (its binary variable whose value is 1). The symbols U,
I, S, and Z can indicate status bits while writing microprograms.
Branch Field
The BR (branch) field includes 2 bits. It can be used by connecting with the AD (address) field.
The reason for connecting with the AD field is to select the address for the next
microinstruction. The table illustrates the various branch fields and their functions.
Branch Field Symbols and Descriptions
B Symb Comments
R ol
CAR←CAR + 1 if condition = 0
CAR←CAR + 1 if condition = 0