Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
KTU
B.TECH - FOURTH SEMESTER EXAMINATION, MAY-2017
PART-A PART-B
Note: Answer all questions. Each carries 3 marks. Note: Answer any two question. Each carries 9 marks.
Ques 1) Write notes on condition codes. (03) Ques 5 a) Briefly explain the memory access
instruction and addressing modes of ARM processor.
Ans: Condition Code (04)
The condition code flags are used to store the results of
certain condition when certain operations are performed Ans: Memory Access Instructions of ARM
during execution of the program. The condition code flags 1) LDR and STR (immediate offset): Load and Store
are stored in the status registers. The status register is also with immediate offset, pre-indexed immediate offset,
referred to as flag register. or post-indexed immediate offset.
2) LDR and STR (register offset): Load and Store with
ALU operations and certain register operations may set or
register offset, pre-indexed register offset, or post-
reset one or more bits in the status register. Status bits lead
indexed register offset.
to a new set of microprocessor instructions. These
instructions permit the execution of a program to change 3) LDR and STR, unprivileged: Load and Store, with
flow on the basis of the condition of bits in the status User mode privilege.
register. So the condition bits in the status register can be 4) LDR (PC-relative) The address is an offset from the
used to take logical decision within the program. Some of PC.
the common condition code flags are:
1) Carry/Borrow 5) LDR (register-relative): The address is an offset
2) Zero from a base register.
3) Negative/Sign 6) ADR (PC-relative): Load a PC-relative address.
4) Auxiliary Carry
5) Overflow flag 7) ADR (register-relative): Load a register-relative
6) Parity address.
8) PLD, PLDW, and PLI: Preload an address for the
Refer Unit-5 Question No.- 5 Page No.-61 future.
9) LDM and STM: Load and Store Multiple Registers.
Ques 2) Explain indirect addressing with an example. 10) PUSH and POP: Push low registers, and optionally
(03) the LR, onto the stack. Pop low registers, and
optionally the PC, off the stack.
Ans: Indirect Addressing 11) RFE: Return From Exception.
Refer Unit-1 Question No.- 16 Page No.-16
12) ERET: Exception Return.
Ques 3) Draw the flow chart for Booths Multiplication 13) SRS: Store Return State.
algorithm. (03)
14) LDREX and STREX: Load and Store Register
Ans: Flowchart for Booths Multiplication Algorithm Exclusive.
Refer Unit-2 Question No.- 18 Page No.-30 15) CLREX: Clear Exclusive.
16) SWP and SWPB: Swap data between registers and
Ques 4) Explain the process of storing a word in
memory.
memory using a single bus organisation. Specify which
all control signals will be activated. (03)
Addressing Modes of ARM
This section summarizes the modes used for addressing
Ans: Process of Storing a Word in Memory
instruction operands. ARM uses four main modes:
Refer Unit-2 Question No.- 5 Page No.-24-25
register, immediate, base, and PC-relative addressing.
Most other architectures provide similar addressing
* *
2 Computer Organisation and Architecture (KTU) Solved Paper
modes, so understanding these modes helps you easily memory location, and the processor stack grows toward
learn other assembly languages. Register and base lower addresses, it is possible that too many PUSH or
addressing have several submodes described below. The CALL operations without a sufficient number of
first three modes (register, immediate, and base intervening POP or RET operations result in the overflow
addressing) define modes of reading and writing operands. of stack. For example, assume that read/write memory
The last mode (PC-relative addressing) defines a mode of allocated in the system for stack has address range from
writing the program counter (PC). Table 1 summarizes 2000H to 27FFH. In this case, if stack grows beyond
and gives examples of each addressing mode. 2000H then it is called overflow of stack. Care must be
taken in memory allocation and program design to prevent
Data-processing instructions use register or immediate this.
addressing, in which the first source operand is a register
and the second is a register or immediate, respectively. Stack Frame
ARM allows the second register to be optionally shifted by The stack can be used to pass the parameters. The main
an amount specified in an immediate or a third register. program places the parameters on the stack by using
Memory instructions use base addressing, in which the PUSH instructions. These parameters together with return
base address comes from a register and the offset comes addresses are stored on the stack, which is called stack
from an immediate, a register, or a register shifted by an frame. The stack frame is shown in figure 1.
immediate. Branches use PC-relative addressing in which
the branch target address is computed by adding an offset The subroutine pops the return address from the stack and
to PC + 8. saves it in internal register or reserved memory location.
The subroutine pops the parameters from the stack as
Table 1: ARM operand addressing modes needed. When all the parameters are removed and
Operand Addressing Example Description processed, the subroutine pushes the return address back
Mode onto the stack and executes a return instruction.
Register
Register-only ADD R3, R2, R3 R2 + R1 Main Subroutine
R1 PUSH B POP H
Immediate-shifted SUB R4, R5, R4 R5 (R9 >> PUSH D SHLD Address
register R9, LSR #2 2)
PUSH H :
Register-shifted 0RR R0, R10, R0 R10 | (R2
register R2, ROR R7 R0R R7) CALL Sub :
Immediate SUB R3, R2, R3 R2 25 ADD B LHLD Address
#25 : PUSH H
Base : RET
Immediate offset STR R6, [R11, mem [R11+77]
#77) R6
Register offset LDR R12, [R1, R12 mem[R1
R5] R5]
Immediate-shifted LDR R8, [R9, R8 mem[R9 +
register offset R2, LSL #2) (R2 << 2)]
AddrL
PC-Relative B LABEL1 Branch to
LABEL1 SP 6 AddrH
The frame pointer keeps track of the fixed base address of Part-C
the current stack frame; this allows to the stack frame
content using a fixed offset. Note: Answer all questions. Each carries 3 marks.
Ques 7) Draw and explain the flow charts for floating Ques 8) Differentiate between programmed I/O and
point multiplication and division. (09) interrupt driven I/O. (03)
Ans: Floating Point Multiplication Ans: Difference between Programmed I/O and
Interrupt Driven I/O
Multiply
Refer Unit-3 Question No.- 10 Page No.-44
No No Ques 9) Define the terms: (03)
x = 0? x = 0? Add
Exponents i) Latency
Yes Yes
ii) Bandwidth
z0 Subtract Bias iii) Memory cycle time
No Bandwidth
Refer Unit-4 Question No.- 1 Page No.-49
Exponent Yes Report
Underflow? Underflow
Memory Cycle Time
No Refer Unit-4 Question No.- 1 Page No.-49
Multiply
Significands Ques 10) Why do dynamic RAMs need constant
refreshing? How is this done? (03)
Normalise
Ans: Need of Refreshing to Dynamic Memory
Refer Unit-4 Question No.- 8 Page No.-52-53
Round RETURN
x = 0? No No
x = 0? Subtract Burst Mode DMA
Exponents
Yes Yes
Refer Unit-3 Question No.- 11 Page No.-44
z 0 z Add Bias Part-D
* *
4 Computer Organisation and Architecture (KTU) Solved Paper
Ques 12 b) Write notes on set associative cache All this can be done by exposing the chip to
mapping. (05) ultraviolet light for certain period. It is non-volatile
memory. One cannot modify or re-program it until all
Ans: Set Associative Cache Mapping current information has been completely erased.
Refer Unit-4 Question No.- 16 Page No.-56-58
3) EEPROM: EEPROM stands for Electrically
Ques 13 a) Distinguish between synchronous and Erasable Programmable Read-Only Memory. It is
asynchronous DRAMs. (04) also non-volatile memory developed in mid-1970s.
An electronic circuitry is used in EEPROM for
Ans: Difference between Synchronous and erasing and reprogramming.
Asynchronous DRAM It is like EPROM except that a high voltage electrical
Let us conclude by saying that in terms of the basic pulse is used in place of ultraviolet light for erasing
technology and principle of operation of a basic DRAM EEPROMs content.
memory cell, both types are the same, but the SDRAM
scores higher only because of the way it is used. Since 4) EAROM: EAROM is an acronym for Electrically
asynchronous DRAM does not share any sort of common Alterable Read-Only Memory.
clock signal with the CPU and chipset, the chipset has to It is a type of memory that combines the
manipulate the DRAMs control pins based on all sorts of characteristics of RAM and read-only memory. It is
timing considerations. SDRAM, however, shares the bus non-volatile, like read-only memory, but can be
clock with the CPU. Commands can be placed (or certain written into by the processor. It can only be re-
predefined combinations of signals) on its control pins on programmed a limited number of times. It is a
the rising clock edge. specialised read-only memory with a special slow-write
cycle and a much faster read cycle, used with
Ques 13 b) Explain the important Data transfer signals microprocessors and microcomputers.
on the PCI bus. (05)
Ques 14 b) Explain the procedure and the packets used
Ans: Data Transfer Signals on PCI Bus for an output transfer in USB interface. (05)
Table 2: Data transfer signals on the PCI bus
Ans:
Name Function
All information transferred over th USB in organised in
CLK A 33-MHz or 66-MHz clock.
packets, where a packet consists of one or more bytes of
FRAME# Sent by the initiator to indicate the duration of a
information. There are many types of packets that perform
transaction.
a variety of control functions.
AD 32 address/data lines, which may be optionally
increased to 64. The information transferred on the USB can be divided
C/BE# 4 command/byte-enable lines (8 for a 64-bit into two broad categories:
bus). 1) Control Packets: It performs such tasks as
IRDY#, Initiator-ready and Target-ready signals. addressing a device to initiate data transfer,
TRDY# acknowledging that data have been received correctly
DEVSEL# A response from the device indicating that it has or indicating in error.
recognised its address and is ready for a data
transfer transaction. 2) Data Packets: It carry information that is delivered to
IDSEL# Initialisation Device Select a device; for example, input and output data are
transferred inside data packets.
Ques 14 a) Describe the different type of ROMs. (04)
When the software requires data transfer to occur between
itself and the USB, it sends a block of data called an I/O
Ans: Types of ROM
Request Packet (IRP) to the appropriate pipe, and the
1) PROM: PROM stands for Programmable Read
software is later notified when this request is completed
Only Memory. Even though the users do not have the
successfully or terminated by error. Other than the
authority to manipulate the firmware yet they can
presence of an IRP request, the pipe has no interaction
customize the system. For customization, they have to
with the USB. In the event of an error after three retry
convert the programs into micro programs and store
attempts, the IRP is cancelled and all further and
them into the ROM with the help of PROM-programs.
outstanding IRPs to that pipe are ignored until the software
Like a ROM, once a PROM is programmed, its responds to the error signal that is generated by sending an
contents cannot be altered. appropriate call to the USB. How exactly this is handled
depends upon the type of device and the software.
2) EPROM: EPROM is the abbreviation of Erasable
Programmable Read Only Memory. EPROM has As suggested by the name Universal Serial Bus, data
the facility to erase and re-program the stored transmission in the bus occurs in a serial form. Bytes of
information. data are broken up and sent along the bus one bit at a time,
with the least significant bit first.
* *
Computer Organisation and Architecture (May 2017) 5
The actual data is sent across the bus in packets. Each Ques 16) Design a 4bit Arithmetic unit which performs
packet is a bundle of data along with information the following operations on two inputs. A and B,
concerning the source, destination and length of the data, controlled by selection variables s1, and s0, and input
and also error detection information. Since each endpoint carry Cin: (10)
sets, during configuration, a limit to the size of the packet
it can handle, an IRP may require several packets to be S1 S0 Cin = 0 Cin = 1
sent. 0 0 F=A F=A+1
0 1 F=A+B F=A+B+1
Each of these packets should be the maximum possible 1 0 F = A + B F = A + B + 1
size except for the final packet. The USB host has a built 1 1 F=A1 F=A
in mechanism so that the software can tell it when to
expect full sized packets. Ques 17 a) Write notes on status register. (05)
Note: Answer any Four questions. Each carries 10 Refer Unit-5 Question No.- 3 Page No.-61
marks.
Ques 15) Describe processor organisation with Ques 17 b) Distinguish between horizontal and vertical
diagram using: (10) microinstructions. (05)
i) Scratchpad memory. Ans: Difference between Horizontal and Vertical
ii) Two port memory. Microinstruction
Ans: Processor Organisation Using Scratchpad Refer Unit-6 Question No.- 6 Page No.-88-89
Memory and Two Port Memory Horizontal Vertical
Long formats Short formats
Ability to express a high Limited Ability to express
degree of parallelism parallelism microoperations
A address Scratchpad B address Little encoding of the Considerable encoding of the
memory control information control information
WE ME Memory Useful when higher Slower operating speed
enable operating speed is desired
* *
6 Computer Organisation and Architecture (KTU) Solved Paper
The content of CAR is incremented and applied to one of the multiplexer inputs and to the subroutine registers SBR.
The other three inputs to multiplexer number 1 come from the address field of the present microinstruction, from the output
of SBR, and from an external source that maps the instruction. Although the diagram shows a single subroutine register, a
typical sequencer will have a register stack about four to eight levels deep. In this way, a number of subroutines can be
active at the same time. A push and pop operation, in conjunction with a stack pointer, stores and retrieves the return
address during the call and return microinstructions.
The CD (condition) field of the microinstruction selects one of the status bits in the second multiplexer. If the bit selected
is equal to 1, the T(test) variable is equal to 1; otherwise, it is equal to 0. The T value together with the two bits from the
BR (branch) field go to an input logic circuit. The input logic in a particular sequencer will determine the type of
operations that are available in the unit. Typical sequencer operations are: increment, branch or jump, call and return from
subroutine, load an external address, push or pop the stack, and other address sequencing operations. With three inputs, the
sequencer can provide up to eight address sequencing operation. Some commercial sequencers have three or four inputs in
addition to the T input and thus provide a wider range of operations.
The input logic circuit in figure 7-8 has three inputs, I0, I1, and T, and three outputs, S0, S1, and L. Variables S0 and S1
select one of the source addresses for CAR. Variable L enables the load input in SBR. The binary values of the two
selection variables determine the path in the multiplexer. For example, with S1, S0 = 10, multiplexer input number 2 is
selected and establishes a transfer path from SBR to CAR. Note that each of the four inputs as well as the output of MUX 1
contains a 7-bit address.
External
(MAP)
l0Input logic 3 2 1 0
Load
l1 S1 MUX-1 SBR
T S0
Control Memory
Microops CD BR AD
* *
Computer Organisation and Architecture (May 2017) 7
Registers
R0 to R6
0 6 7 0 6 7 0
6 3
Destination 8:1 8:1
D 7 B 4 MUX MUX 1 A
select
8 5 BUS A select BUS B select 2
Status register 9
10 F
V Z S C ALU
11
Cin(12)
13
14 SH
Shifter
15
Output data
(a) Block Diagram of Processor Unit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SH Cin F D B A
(b) Control Word of Processor Unit
*
Figure 4 *
8 Computer Organisation and Architecture (KTU) Solved Paper
The Table lists the functions of all selection variables. The table also gives the 3-bit binary code for each of the five fields
A, B, D, F and SH.
All selection variable collectively forms the 16-bit control word shown in Figure 4 (b). This control word is used to
specify a micro-operation for the processor unit. The Table 5 list some examples of micro-operations and corresponding
control word for processor.
* *