Course Code: Course Title: Credit Structure (L-T-P-C) :: CS403 Computer Organization and Architecture 3-1-0-4
Course Code: Course Title: Credit Structure (L-T-P-C) :: CS403 Computer Organization and Architecture 3-1-0-4
Course Code: Course Title: Credit Structure (L-T-P-C) :: CS403 Computer Organization and Architecture 3-1-0-4
Course Title:
Computer Organization and
Architecture
Credit Structure (L-T-P-C): 3-1-0-4
• There are two basic types of electrical signals, namely, analog and digital. The
analog signals are continuous in nature and digital signals are discrete in nature.
• The electronic device that works with continuous signals is known as analog device
and the electronic device that works with discrete signals is known as digital device.
• Computer architecture refers to those parameters of a computer system that are visible to a
programmer or those parameters that have a direct impact on the logical execution of a
program.
• Examples of architectural attributes include the instruction set, the number of bits used to
represent different data types, I/O mechanisms, and techniques for addressing memory.
• Computer organization refers to the operational units and their interconnections that
realize the architectural specifications.
1. Machine language
2. Assembly language
• Machine language is the language written as stings of binary 1’s & 0’s. it is the only
language which a computer can understands without a translation program.
• A machine language instruction has two parts.
1. Operation code: Which tells the computer what function to perform
2. Operand: Which tells the computer on which the function is operating & storing (Register
or memory & so on)
3. It is prone to errors
4. It is difficult to modify
• It is a low level programming language that allows the user to write a program using
alphanumeric mnemonic codes, instead of numeric codes for a set of instructions.
• It requires a translator known as Assembler to convert assembly language into machine
language.
• It assembles the machine language program in the main memory of the computer and makes
it ready for execution.
• Source code : It is the input or the programming instructor of a procedural language. The
compiler translates the source code into machine level language which is known as object
code. Object code can be saved and executed as and when desired by the user.
Interpreter : It is a translator used for translating high level language into the desired
output. It takes one statement, translates it into machine language instructions and
then immediately executes the result. Its output is the result of program execution.
• Register addressing is similar to direct addressing. The only difference is that the
address field refers to a register rather than a main memory address.
EA = R
• The advantages of register addressing are that only a small address field is needed in
the instruction and no memory reference is required. The disadvantage of register
addressing is that the address space is very limited.
Types of Operations
1. Data Transfer
2. Arithmetic
3. Logical
4. Input Output [ I/O ]
5. System Control
6. Transfer Control
• Input (Read): Transfer data from specified I/O port or device to destination (e.g., main
memory or processor register)
• Output (Write): Transfer data from specified source to I/O port or device.
• Start I/O: Transfer instructions to I/O processor to initiate I/O operation.
• Test I/O: Transfer status information from I/O system to specified destination
• System control instructions are those which are used for system setting and it can be used
• Typically, these instructions are reserved for the use of operating systems.
Registers and their contents can be viewed and represented in various ways
A register can be viewed as a single entity:
MAR
Registers may also be represented showing the bits of data they contain
15 0 15 8 7 0
R2 PC(H) PC(L)
Numbering of bits Subfields
• 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.
• 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).
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.
• 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).
• We have used labels to make it more convenient for you to understand the
input-output configuration of a Bus system for four registers. For instance,
output 1 of register A is connected to input 0 of MUX1.
• A bus system can also be constructed using three-state gates instead of multiplexers.
• The three state gates can be considered as a digital circuit that has three gates, two of which are signals
equivalent to logic 1 and 0 as in a conventional gate. However, the third gate exhibits a high-impedance
state.
• The most commonly used three state gates in case of the bus system is a buffer gate.
• The graphical symbol of a three-state buffer gate can be represented as:
• The below table shows the 14 operations perform by the Arithmetic Logic Unit:
• The first 8 are arithmetic operations which are selected by S3 S2 = 00
• The next 4 are logic operations which are selected by S3 S2 = 01
• The last two are shift operations which are selected by S3 S2 = 10 & 11
1. It stores all the data and the instructions required for processing.
2. It stores intermediate results of processing.
3. It stores the final results of processing before these results are released to
an output device.
4. All inputs and outputs are transmitted through the main memory.
Saturday, May 4, 2024 77
CPU structure and functions
Control Unit
This unit controls the operations of all parts of the computer but does not carry
out any actual data processing operations.
Functions of this unit are −
1. It is responsible for controlling the transfer of data and instructions among
other units of a computer.
2. It manages and coordinates all the units of the computer.
3. It obtains the instructions from the memory, interprets them, and directs the
operation of the computer.
4. It communicates with Input/Output devices for transfer of data or results
from storage.
5. It does not process or store data.
Power bus: If it is carrying clock pulse, power signals it is known as a power bus, and so on.
Assembly Program:
Label Op-code operand LC value(Location counter)
JOHN START 200
MOVER R1, ='3' 200
MOVEM R1, X 201
L1 MOVER R2, ='2' 202
LTORG 203
X DS 1 204
END 205
1. Concept of Memory.
2. Cache Memory.
3. Memory Management
4. Virtual memory
The memory of computer is broadly categories into two categories:
RAM:
• The RAM integrated circuit chips are further classified into two possible
operating modes, static and dynamic.
• The primary compositions of a static RAM are flip-flops that store the
binary information. The nature of the stored information is volatile, i.e. it
remains valid as long as power is applied to the system.
• The static RAM is easy to use and takes less time performing read and
write operations as compared to dynamic RAM.
• The dynamic RAM consumes less power and provides large storage
capacity in a single memory chip.
• A 128 * 8 RAM chip has a memory capacity of 128 words of eight bits
(one byte) per word. This requires a 7-bit address and an 8-bit
bidirectional data bus.
• The 8-bit bidirectional data bus allows the transfer of data either from
memory to CPU during a read operation or from CPU to memory during
a write operation.
• The read and write inputs specify the memory operation, and the two
chip select (CS) control inputs are for enabling the chip only when the
microprocessor selects it.
• The bidirectional data bus is constructed using three-state buffers.
• The output generated by three-state buffers can be placed in one of the
three possible states which include a signal equivalent to logic 1, a
signal equal to logic 0, or a high-impedance state.
• From the functional table, we can conclude that the unit is in operation only when CS1 = 1
and CS2 = 0. The bar on top of the second select variable indicates that this input is enabled when it
is equal to 0.
• A ROM chip has a similar organization as a RAM chip. However, a ROM can only
perform read operation; the data bus can only operate in an output mode.
• The 9-bit address lines in the ROM chip specify any one of the 512 bytes stored in it.
• The value for chip select 1 and chip select 2 must be 1 and 0 for the unit to operate.
Otherwise, the data bus is said to be in a high-impedance state.
• Non-volatile Data
• Method of Data Writing
• Mask ROM
• Data written during chip fabrication
• PROM
• Fuse ROM: Non-rewritable
• EPROM: Erase data by UV rays
• EEPROM: Erase and write through
electrical means
• Speed 2-3 times slower than RAM
• Upper limit on write operations
• Flash Memory – High density, Low Cost
Holds the programs and data that the processor is actively working with.
If the MAR is k-bit long, then the total addressable memory location will be 2k.
If the MDR is n-bit long, then the n bit of data is transferred in one memory cycle.
• The binary cells are kind of storage cells that are capable of storing one binary
digit or binary character. They are used to store information in digital electronics.
• When a cell is read, it saves one bit of binary data, and before it can be accessed,
it must be set to store a 1 and then reset to a 0.
Multi-Program
The memory is partitioned into equal fixed size chunks that are relatively
small. This chunk of memory is known as frames or page frames.
Each process is also divided into small fixed chunks of same size. The
chunks of a program is known as pages.
At a given point of time some of the frames in memory are in use and
some are free. The list of free frame is maintained by the operating system.
Direct mapping
Associative mapping
Set-Associative mapping
2. Processor Communication
3. Device Communication
4. Data Buffering
5. Error Detection
The control of the transfer of data from an external device to the processor might
involve the following sequence of steps –
1. The processor interacts with the I/O module to check the status of the attached
device.
2. The I/O module returns the device status.
3. If the device is operational and ready to transmit, the processor requests the
transfer of data, by means of a command to the I/O module.
4. The I/O module obtains a unit of data from external device.
5. The data are transferred from the I/O module to the processor.
Saturday, May 4, Saturday,
2024 May 4, 2024 175 175
Input/output Modules
2. Processor & Device Communication
During the I/O operation, the I/O module must communicate with the
processor and with the external device
Processor communication involves the following:
Command decoding
Data
Status Reporting
Address Recognition
Saturday, May 4, Saturday,
2024 May 4, 2024 176 176
Input/output Modules
2. Data :Data are exchanged between the processor and the I/O module
5. Error Detection
Another task of I/O module is error detection and for subsequently
reporting error to the processor.
One class or error includes mechanical and electrical malfunctions
reported by the device (e.g. paper jam).
Another class consists of unintentional changes to the bit pattern as it is
transmitted from devices to the I/O module.
Saturday, May 4, Saturday,
2024 May 4, 2024 180 180
Block diagram of I/O Module
There are three ways that computer buses can be used to communicate
with memory and I/O:
1. Use two separate buses, one for memory and the other for I/O.
2. Use one common bus for both memory and I/O but have separate
control lines for each.
3. Use one common bus for memory and I/O with common control lines.
Memory-mapped I/O
Isolated or I/O mapped I/O
• Since I/O devices are included in the same memory address space, so
the status and address registers of I/O modules are treated as memory
location by the processor.
• In this scheme, the full range of addresses may be available for both.
I/O device.
3 Due to addition of I/O addressable memory become All address can be used by the memory
less for memory
4 Same instructions can control both I/O and Memory Separate instruction control read and write operation
in I/O and Memory
5 Normal memory address are for both In this I/O address are called ports.
• Address register – It contains the address to specify the desired location in memory.
• Word count register – It contains the number of words to be transferred.
• Control register – It specifies the transfer mode.
Explanation:
• The CPU initializes the DMA by sending the given information through the data bus.
• The starting address of the memory block where the data is available (to read) or where
data are to be stored (to write).
• It also sends word count which is the number of words in the memory block to be read or
write.
• Control to define the mode of transfer such as read or write.
• A control to begin the DMA transfer.
1. Synchronous : All devices derive the timing information from common clock line.
2. Asynchronous: No common clock
Require control signals
1. Strobe Pulse
2. Handshaking
Destination initiated strobe: In the below block diagram, you see that the strobe initiated by destination,
and in the timing diagram, the destination unit first activates the strobe pulse, informing the source to provide
the data.
Block Diagram
Timing Diagram
Sequence of events
Block Diagram
Timing Diagram
Sequence of events
Programmed I/O
Read : Causes the I/O module to obtain an item of data from the
peripheral and place it in the internal buffer.
Write : Causes the I/O module to take an item of data ( byte or word )
from the data bus and subsequently transmit the data item to the
peripheral.
Pipelined Execution
Example of pipelining
Flow-chart
Where,
• Single Instruction, Multiple Data (SIMD) system: A single machine instruction controls the simultaneous execution
of a number of processing elements on a lockstep basis. Each processing element has an associated data memory,
so that each instruction is executed on a different set of data by the different processors. Vector and array
processors fall into this category
• Multiple Instruction, Single Data (MISD) system :A sequence of data is transmitted to a set of processors, each
of which executes a different instruction sequence. This structure has never been implemented.
• Multiple Instruction, Multiple Data (MIMD) system: A set of processors simultaneously execute different
instruction sequences on different data sets. SMPs, clusters, and NUMA systems fits into this category.