COA Solved Model Paper
COA Solved Model Paper
2022 Scheme)
Third Semester B.E. Degree Examination
Subject Title: COMPUTER ORGANISATION
& ARCHITECTURE
Time :03 Hours Max Marks:100
Note: Answer any FIVE full questions, choosing at least ONE question
from each MODULE.
Solution:
A computer consists of five functionally independent main parts input, memory, arithmetic
logic unit (ALU), output and control unit.
Input unit: -
The source program/high level language program/coded information/simply data is fed to a computer
through input devices keyboard is a most common type. Whenever a key is pressed, one corresponding
word or number is translated into its equivalent binary code over a cable & fed either to memory or
processor.
Joysticks, trackballs, mouse, scanners etc are other input devices.
Memory:
1. Primary memory: - Is the one exclusively associated with the processor and operates at the
electronics speeds programs must be stored in this memory while they are being executed.Memory in
which any location can be reached in a short and fixed amount of time after specifying its address is
called random- access memory (RAM).
Memory which is only readable by the user and contents of which can’t be altered is called read only
memory (ROM) it contains operating system.
Arithmetic logic unit (ALU):-
Most of the computer operators are executed in ALU of the processor like addition, subtraction,
division, multiplication, etc. the operands are brought into the ALU from memory and stored in high
speed storage elements called register. Then according to the instructions the operation is performed in
the required sequence.
The control and the ALU are may times faster than other devices connected to a computer system. This
enables a single processor to control a number of external devices such as key boards, displays,
magnetic and optical disks, sensors and other mechanical controllers.
Output unit:-
These actually are the counterparts of input unit. Its basic function is to send the processed results to
the outside world.
Examples:- Printer, speakers, monitor etc.
Control unit:-
It effectively is the nerve center that sends signals to other units and senses their states. The actual
timing signals that govern the transfer of data between input unit, processor, memory and output unit
are generated by the control unit.
1c. With a neat diagram, discuss the operation concepts in a computer highlighting the role of
PC, MAR, MDR & IR.
Solution:
2a. Explain the IEEE standard used for single & double precision floating point number
representation with examples.
Solution:
There are three binary floating-point basic formats (encoded with 32, 64 or 128 bits) and two
decimal floating-point basic formats (encoded with 64 or 128 bits). The binary32 and binary64 formats
are the single and double formats of IEEE 754-1985 respectively.
Single Precision: Single Precision is a format proposed by IEEE for the representation of floating-
point numbers. It occupies 32 bits in computer memory.
Double Precision: Double Precision is also a format given by IEEE for the representation of the
floating-point number. It occupies 64 bits in computer memory.
SKIP
In single precision, 32 bits are used to represent In double precision, 64 bits are used to represent
floating-point number. floating-point number.
This format, also known as FP32, is suitable for This format, often known as FP64, is suitable to
calculations that won’t be adversely affected by represent values that need a wider range or more exact
some approximation. computations.
In single precision, 23 bits are used for mantissa. In double precision, 52 bits are used for mantissa.
Range of numbers in single precision : 2^(- Range of numbers in double precision : 2^(-
126) to 2^(+127) 1022) to 2^(+1023)
This is used where precision matters less. This is used where precision matters more.
3a. Describe the following addressing modes with an example i) Register ii) Direct iii) Indirect iv)
Index
Solution:
Register Mode
• The operand is the contents of a register.
• The name (or address) of the register is given in the instruction.
• Registers are used as temporary storage locations where the data in a register are accessed.
• For example, the instruction
Move R1, R2 ;Copy content of register R1 into register R2.
Direct addressing is a scheme in which the address specifies which memory word or register contains
the operand.
For example:
1) LOAD R1, 100 Load the content of memory address 100 to register R1.
2) LOAD R1, R2 Load the content of register R2 to register R1.
Indirect Mode
• The EA of the operand is the contents of a register(or memory-location).
• The register (or memory-location) that contains the address of an operand is called a Pointer.
• We denote the indirection by
→ name of the register or
→ new address given in the instruction.
E. g: Add (R1),R0 ;The operand is in memory. Register R1 gives the effective-
address (B) of the operand. The data is read from location B and
added to contents of register R0.
• To execute the Add instruction in fig 2.11 (a), the processor uses the value which is in register
R1, as the EA of the operand.
• It requests a read operation from the memory to read the contents of location B. The value
read is the desired operand, which the processor adds to the contents of register R0.
• Indirect addressing through a memory-location is also possible as shown in fig 2.11(b). In
this case, the processor first reads the contents of memory-location A, then requests a second
read operation using the value B as an address to obtain the operand.
Index mode
• The operation is indicated as X(Ri)
where X=the constant value which defines an offset(also called a displacement).
Ri=the name of the index register which contains address of a new location.
• The effective-address of the operand is given by EA=X+[Ri]
• The contents of the index-register are not changed in the process of generating the
effective- address.
• The constant X may be given either
→ as an explicit number or
→ as a symbolic-name representing a numerical value.
• Fig(a) illustrates two ways of using the Index mode. In fig(a), the index register, R1, contains
the address of a memory-location, and the value X defines an offset(also called a displacement)
from this address to the location where the operand is found.
3b. Define Stack, Explain push & pop operations on stack with neat diagram and examples
Solution:
STACKS
• A stack is a special type of data structure where elements are inserted from one end and
elements are deleted from the same end. This end is called the top of the stack (Figure:
2.14).
• The various operations performed on stack:
1) Insert: An element is inserted from top end. Insertion operation is called push operation.
2) Delete: An element is deleted from top end. Deletion operation is called pop operation.
• A processor-register is used to keep track of the address of the element of the stack that is at
the top at any given time. This register is called the Stack Pointer (SP).
Solution:
SUBROUTINES
• A subtask consisting of a set of instructions which is executed many times is called a Subroutine.
• A Call instruction causes a branch to the subroutine (Figure: 2.16).
• At the end of the subroutine, a return instruction is executed
• Program resumes execution at the instruction immediately following the subroutine call
• The way in which a computer makes it possible to call and return from subroutines is
referred to as its Subroutine Linkage method.
• The simplest subroutine linkage method is to save the return-address in a specific
location, which may be a register dedicated to this function. Such a register is called the
Link Register.
PARAMETER PASSING
• The exchange of information between a calling-program and a subroutine is referred to as
Parameter Passing (Figure: 2.25).
• The parameters may be placed in registers or in memory-location, where they can be
accessed by the subroutine.
• Alternatively, parameters may be placed on the processor-stack used for saving the return-address.
• Following is a program for adding a list of numbers using subroutine with the
parameters passed through registers.
4c. Explain memory operations with examples
Solution:
MEMORY OPERATIONS
• Two memory operations are:
1) Load (Read/Fetch) &
2) Store (Write).
• The Load operation transfers a copy of the contents of a specific memory-location to the processor.
The memory contents remain unchanged.
• Steps for Load operation:
1) Processor sends the address of the desired location to the memory.
2) Processor issues „read‟ signal to memory to fetch the data.
3) Memory reads the data stored at that address.
4) Memory sends the read data to the processor.
• The Store operation transfers the information from the register to the specified memory-location.
This will destroy the original contents of that memory-location.
• Steps for Store operation are:
1) Processor sends the address of the memory-location where it wants to store data.
2) Processor issues „write‟ signal to memory to store the data.
3) Content of register(MDR) is written into the specified memory-location.
5a. Define interrupt. Point out & explain the various ways of enabling & disabling interrupts
Solution:
An interrupt is an event which suspends the execution of one program and begins the
execution of another program.
In program controlled I/O, a program should continuously check whether the I/O device is
free. By this continuous checking the processor execution time is wasted. It can be
avoided by I/O device sending an ‘interrupt’ to the processor, when I/O device is free.
The interrupt invokes a subroutine called Interrupt Service Routine (ISR), which
resolves the cause of interrupt.
The occurrence of interrupt causes the processor to transfer the execution control from
user program to ISR.
The arrival of interrupt request from external devices or from within a process, causes the
suspension of on-going execution and start the execution of another program.
Interrupt arrives at any time and it alters the sequence of execution. Hence the
interrupt to be executed must be selected carefully.
All computers can enable and disable interruptions as desired.
When an interrupt is under execution, other interrupts should not be invoked. This is
performed in a system in different ways.
The problem of infinite loop occurs due to successive interruptions of active INTR signals.
There are 3 mechanisms to solve problem of infinite loop:
1) Processor should ignore the interrupts until execution of first instruction of the ISR.
2) Processor should automatically disable interrupts before starting the execution of the
ISR.
3) Processor has a special INTR line for which the interrupt-handling circuit.
3) Interrupts are disabled by changing the control bits in the processor status register
(PS).
4) The device is informed that its request has been recognized.
Direct Memory Access is the process of transferring the block of data at high speed in
between main memory and external device (I/O devices) without continuous intervention of
CPU.
This operation is performed by the control circuit, called as DMA controller.
DMA controller is a part of the I/O interface.
The data transfer operation in DMA is processed by the help of DMA controller.
To initiate Directed data transfer between main memory and external devices DMA controller
needs parameters from the CPU.
These 3 Parameters are:
In the sample architecture shown above, the DMA controller connects two external devices
namely disk 1 and disk 2 to system bus.
The DMA controller also interconnects high speed network devices to system bus as shown in the
above fig.
Let us consider direct data transfer operation by means of DMA controller without the
involvement of CPU in between main memory and disk 1.
To establish direct data transfer operation between main memory and disk 1.
After receiving these 3 parameters from processor, DMA controller directly transfers block of data
between main memory and external devices (disk 1) depending on the operation.
This information is informed to CPU by setting respective bits in the status and controller
register of DMA controller.
These are 2 types of request with respect to system bus
1). CPU request.
2). DMA request.
Highest priority will be given to DMA request.
The I/O device is connected to interrupt request line by means of switch, which is
grounded as shown in the fig.
When all the switches are open the voltage drop on interrupt request line is equal to the
VDD and INTR value at process is 0.
This state is called as in-active state of the interrupt request line.
Solution:
For example the DATA IN is the address of input buffer associated with
the keyboard instruction.
This instruction reads the data from location DATAIN to register R0.
Similarly output can be implemented as,
Solution:
VECTORED INTERRUPT
• A device requesting an interrupt identifies itself by sending a special-code to
processor over bus.
• Then, the processor starts executing the ISR.
• The location pointed to by the interrupting-device is used to store the staring address
to ISR.
• The staring address to ISR is called the interrupt vector.
• Processor
• Then, I/O-device responds by sending its interrupt-vector code & turning off the
INTR signal.
• The interrupt vector also includes a new value for the Processor Status Register
7a. With a neat diagram, explain the principal of working of magnetic disk
Soultion:
MAGNETIC DISK
• Magnetic Disk system consists of one or more disk mounted on a common spindle.
• A thin magnetic film is deposited on each disk (Figure 8.27).
• Disk is placed in a rotary-drive so that magnetized surfaces move in close proximity to
R/W heads.
• Each R/W head consists of 1) Magnetic Yoke & 2) Magnetizing-Coil.
• Digital information is stored on magnetic film by applying current pulse to the magnetizing-
coil.
• Only changes in the magnetic field under the head can be sensed during the Read-operation.
• Therefore, if the binary states 0 & 1 are represented by two opposite states,
then a voltage is induced in the head only at 0-1 and at 1-0 transition in the bit stream.
• A consecutive of 0‟s & 1‟s are determined by using the clock.
• Manchester Encoding technique is used to combine the clocking information with data.
• R/W heads are maintained at small distance from disk-surfaces in order to achieve high bit
densities.
• When disk is moving at their steady state, the air pressure develops b/w disk-surfaces &
head.
This air pressure forces the head away from the surface.
• The flexible spring connection between head and its arm mounting permits the head to fly at
the
desired distance away from the surface.
Winchester Technology
• Read/Write heads are placed in a sealed, air–filtered enclosure called the Winchester
Technology.
• The read/write heads can operate closure to magnetic track surfaces because
the dust particles which are a problem in unsealed assemblies are absent.
Advantages
• It has a larger capacity for a given physical size.
• The data intensity is high because
the storage medium is not exposed to contaminating elements.
• The read/write heads of a disk system are movable.
• The disk system has 3 parts:
1) Disk Platter (Usually called Disk)
2) Disk-drive (spins the disk & moves Read/write heads)
3) Disk Controller (controls the operation of the system. )
7b. Explain the internal organization of 2M x 8 DRAM chip with neat diagram
Solution:
The 4 bit cells in each row are divided into 512 groups of 8 (Figure 5.7).
• 21 bit address is needed to access a byte in the memory. 21 bit is divided as follows:
1) 12 address bits are needed to select a row.
i.e. A8-0 → specifies row-address of a byte.
2) 9 bits are needed to specify a group of 8 bits in the selected row.
During Read/Write-operation,
→ row-address is applied first.
→ row-address is loaded into row-latch in response to a signal pulse on RAS’ input of chip.
(RAS = Row-address Strobe CAS = Column-address Strobe)
• When a Read-operation is initiated, all cells on the selected row are read and refreshed.
• Shortly after the row-address is loaded, the column-address is
→ applied to the address pins &
→ loaded into CAS’.
• The information in the latch is decoded.
• The appropriate group of 8 Sense/Write circuits is selected.
R/W’=1(read-operation) Output values of selected circuits are transferred to data-lines D0-
D7.
R/W’=0(write-operation) Information on D0-D7 are transferred to the selected circuits.
• RAS‟ & CAS‟ are active-low so that they cause latching of address when they change from
high
to low.
• To ensure that the contents of DRAMs are maintained, each row of cells is accessed
periodically.
• A special memory-circuit provides the necessary control signals RAS‟ & CAS‟ that govern
the timing.
• The processor must take into account the delay in the response of the memory.
Solution:
STATIC RAM (OR MEMORY)
• Memories consist of circuits capable of retaining their state as long as power is applied are
known.
Advantages:
1) It has low power consumption „.‟ the current flows in the cell only when the cell is active.
2) Static RAM‟s can be accessed quickly. It access time is few nanoseconds.
Disadvantage: SRAMs are said to be volatile memories „.‟ their contents are lost when
power
is interrupted.
Solution:VIRTUAL MEMORY
• It refers to a technique that automatically move program/data blocks into the main-memory
when
they are required for execution (Figure 8.24).
• The address generated by the processor is referred to as a virtual/logical address.
• The virtual-address is translated into physical-address by MMU (Memory Management
Unit).
• During every memory-cycle, MMU determines whether the addressed-word is in the
memory.
If the word is in memory.
Then, the word is accessed and execution proceeds.
Otherwise, a page containing desired word is transferred from disk to memory.
• Using DMA scheme, transfer of data between disk and memory is performed.
VIRTUAL MEMORY ADDRESS TRANSLATION
• All programs and data are composed of fixed length units called Pages (Figure 8.25).
The Page consists of a block-of-words. The words occupy contiguous locations in the
memory.
The pages are commonly range from 2K to 16K bytes in length.
• Cache Bridge speed-up the gap between main-memory and secondary-storage.
• Each virtual-address contains
1) Virtual Page number (Low order bit) and
2) Offset (High order bit).
Virtual Page number + Offset specifies the location of a particular word within a page.
• Page-table: It contains the information about
→ memory-address where the page is stored &
→ current status of the page.
• Page-frame: An area in the main-memory that holds one page.
• Page-table Base Register: It contains the starting address of the page-table.
• Virtual Page Number + Page-table Base register Gives the starting address of the page if
that page
currently resides in memory.
• Control-bits in Page-table: The Control-bits is used to
1) Specify the status of the page while it is in memory.
2) Indicate the validity of the page.
3) Indicate whether the page has been modified during its stay in the memory
9a. Explain Single bus organization of the datapath inside a processor with neat diagram
9b.Develop the complete control sequence for the execution of instruction Add (R3), R1
Solution:
HARDWIRED CONTROL
• Hardwired control is a method of control unit design (Figure 7.11).
• The control-signals are generated by using logic circuits such as gates, flip-flops, decoders
etc.
• Decoder/Encoder Block is a combinational-circuit that generates required control-outputs
depending on state of all its inputs.
• Instruction Decoder
It decodes the instruction loaded in the IR.
If IR is an 8 bit register, then instruction decoder generates 28 (256 lines); one for each
instruction.
It consists of a separate output-lines INS1 through INSm for each machine instruction.
According to code in the IR, one of the output-lines INS1 through INSm is set to 1, and all
other lines are set to 0.
• Step-Decoder provides a separate signal line for each step in the control sequence.
• Encoder
It gets the input from instruction decoder, step decoder, external inputs and condition codes.
It uses all these inputs to generate individual control-signals: Yin, PCout, Add, End and so
on.
For example (Figure 7.12), Zin=T1+T6.ADD+T4.BR
;This signal is asserted during time-slot T1 for all instructions.
during T6 for an Add instruction.
during T4 for unconditional branch instruction
• When RUN=1, counter is incremented by 1 at the end of every clock cycle.
When RUN=0, counter stops counting.
• After execution of each instruction, end signal is generated. End signal resets step counter.
• Sequence of operations carried out by this machine is determined by wiring of logic circuits,
hence
the name “hardwired”.
• Advantage: Can operate at high speed.
• Disadvantages:
1) Since no. of instructions/control-lines is often in hundreds, the complexity of control unit is
very high.
2) It is costly and difficult to design.
3) The control unit is inflexible because it is difficult to change the design
1b. Explain little Endian and big Endian byte address assignment with a neat diagram.
Show how the number 34761395 is stored using these methods.
Solution:
BIG-ENDIAN & LITTLE-ENDIAN ASSIGNMENTS
• There are two ways in which byte-addresses are arranged (Figure 2.3).
1) Big-Endian: Lower byte-addresses are used for the more significant bytes of
the word.
2) Little-Endian: Lower byte-addresses are used for the less significant bytes of
the word
• In both cases, byte-addresses 0, 4, 8................ are taken as the addresses of successive
words in the
memory.
3c. Consider a register R1 to size 16-bits with initial data 5876d. With neat diagram,
depict the output in each case after performing the following operations
i) LshiftL #2,R1 ii)AshiftR #1,R1 iii) RotateR #1,R1
4a. Consider a database of marks scored by students in 3 tests stored in memory starting
at address LIST. Each student record consists of student ID followed by marks in 3 tests.
Assume each of there to be 4 bytes in size. There are 50 students in the class & this value
is stored at location NUM
i) Sketch the memory map showing all details
ii) Develop an ALP using indexed addressing mode to compute
the sum of scores by all the students in Test 2 and store the
results in location SUM. Write appropriate comments
2b. Perform the subtraction on the following pairs of numbers using 5-bit signed 2’s
complement format. Determine about overflow in each case
i) +12 and +9 ii) -15 and -9 iii) +10 and -8