Module 5 COA Solutions
Module 5 COA Solutions
A B C
1 2 1 2
2 4 1 1
Which code sequence executes the most instructions? Which will be faster?
What is the CPI for each sequence?
10. Show the IEEE 754 binary representation of the number – 0.7510 in single & double
precision.
11. Convert the following floating-point number (represent in IEEE 754 floating-point format)
to their equivalent decimal number.
11000000100000000000000000000000
12. Add 9.99910 X 101 x 1.61010 x 10 -1 using floating-point addition .
13. Explain Booth’s algorithm for multiplication.
Answers
1.)
Architecture describes
The Organization describes
1. what the computer
how it does it.
does.
Computer Architecture
Computer Organization
deals with the
2. deals with a structural
functional behavior of
relationship.
computer systems.
Computer Architecture
comprises logical
Computer Organization
functions such as
consists of physical units
7. instruction sets,
like circuit designs,
registers, data types,
peripherals, and adders.
and addressing
modes.
Architecture coordinates
Computer Organization
between the hardware
8. handles the segments of
and software of the
the network in a system.
system.
Throughout whole generational changes, Computer Organization goes through more
amendments than Computer Architecture. At an abstract level, we make reference to Moore’s
Law then transistor density is doubling every 2 years. Increased density simply results in faster
computing. Moreover, transistors shrank over this period which results in faster clock speeds. As
hardware-level computing has ramped up, allocation of resources is also required to be tunned
over the period. Therefore many reforms have been compensated in Computer Architecture
over the period to keep account of these radical changes at the hardware level.
https://www.javatpoint.com/instruction-cycle
Interrupt Cycle:
https://www.ques10.com/p/19373/explain-instruction-cycle-with-interrupts-exec
utio/#:~:text=Interrupt%20Cycle%3A&text=It%20is%20the%20process%20by,the
%20computer%20is%20shut%20down.
3.) The interrupt is a signal emitted by hardware or software when a process or an event
needs immediate attention. It alerts the processor to a high-priority process requiring
interruption of the current working process. In I/O devices one of the bus control lines is
dedicated for this purpose and is called the Interrupt Service Routine (ISR).
When a device raises an interrupt at let’s say process i, the processor first completes the
execution of instruction i. Then it loads the Program Counter (PC) with the address of the
first instruction of the ISR. Before loading the Program Counter with the address, the
address of the interrupted instruction is moved to a temporary location. Therefore, after
handling the interrupt the processor can continue with process i+1. While the processor
is handling the interrupts, it must inform the device that its request has been recognized
so that it stops sending the interrupt request signal. Also, saving the registers so that the
interrupted process can be restored in the future, increases the delay between the time
an interrupt is received and the start of the execution of the ISR. This is called Interrupt
Latency.
https://www.geeksforgeeks.org/interrupts/
9.)
Sequence 1 : executes 2+1+2 = 5 instructions.
Sequence 2 : executes 4+1+1 = 6 instructions.
Since Seq 2 takes fewer overall cycles clock but has more instructions it
must have a lower CPI.
10.)
Concept:
Sign:
It takes one bit. 0 represents a positive number while 1 represents a negative number.
Exponent:
Mantissa:
Format:
Calculation:
Here, exponent = -1
E-127 = -1
Hence the correct answer is 1 0111 1110 1000 0000 0000 0000 0000 000.
12.)
https://people.utm.my/nur-haliza/files/2021/09/Module-2-Data-Representation-in-CS-v2b
-4-Mac-2021Lstudent-1.pdf
13.)
https://www.javatpoint.com/booths-multiplication-algorithm-in-coa
14.)
https://www.geeksforgeeks.org/computer-organization-von-neumann-architecture/
15.)
Moore's law is the observation that the number of transistors in a dense integrated circuit (IC)
doubles about every two years. Moore's law is an observation and projection of a historical trend.
Rather than a law of physics, it is an empirical relationship linked to gains from experience in
production.
Mathematically, Moore's Law predicted that transistor count would double every 2 years due to
shrinking transistor dimensions and other improvements. As a consequence of shrinking
dimensions, Dennard's scaling predicted that power consumption per unit area would remain
constant.
Microprocessor architects report that since around 2010, semiconductor advancement has slowed
industry-wide below the pace predicted by Moore's law. As a result, much of the semiconductor
industry has shifted its focus to the needs of major computing applications rather than
semiconductor scaling.
Module-II
1. Which addressing mode is used for accessing data stored in an array in memory?
2. “Instruction set of a system is dependent on its system architecture”. Comment.
3. What is the difference between Big-endian and little-endian representation.
4. What are different addressing modes? Explain the working principle with a suitable
example.
5. What are the advantages and disadvantages of register mode.
6. What is instruction sequencing?
7. Differentiate between Pseudo- instruction(directives) and Instructions with examples.
8. How the loops are formed using instructions? Explain with suitable examples.
9. What are subroutines? How subroutines are defined using instructions? State using
examples.
10. What is word length? How the word size is associated with the particular architecture of
a system?
11. Give some examples of (i) Data Transfer (ii) Arithmetic (iii) Logical (iv) Program Control
and(v) I/O operations Instructions
1.) The address of the operand is obtained by adding to the contents of the general register
(called index register) a constant value. The number of the index register and the
constant value is included in the instruction code. Index Mode is used to access an array
whose elements are in successive memory locations. The content of the instruction code
represents the starting address of the array and the value of the index register, and the
index value of the current element. By incrementing or decrementing the index register
different elements of the array can be accessed.
.data
array1: .byte 1,2,3,4,5,6
.text
__start:
move $3, $0 # $3 initialize index register with 0
add $3, $3,4 # compute the index value of the fifth element
sb $0, array1($3) # array1[4]=0
# store byte 0 in the fifth element of the array
# index addressing mode
Done
2.) An instruction can vary in length depending on the architecture. In x86 systems, the length of
the instruction is typically 1 to 3 bytes (for the opcode), plus a number of bytes needed for
the operands, depending on the addressing mode. additionally, shorter instructions do not
always mean faster instructions. Sometimes a short instruction hides a lot of machine cycles
We can see in the variation in RISC and CISC style processors where the complexity of
instructions is also determined by the architecture.
3.)All computers do not store the bytes that comprise a multi-byte value in the same
order. Consider a 16-bit internet that is made up of 2 bytes. Two ways to store this value
−
● Little Endian − In this scheme, the low-order byte is stored on the starting
address (A) and the high-order byte is stored on the next address (A + 1).
● Big Endian − In this scheme, the high-order byte is stored on the starting
address (A) and the low-order byte is stored on the next address (A + 1).
To allow machines with different byte order conventions to communicate with each
other, the Internet protocols specify a canonical byte order convention for data
transmitted over the network. This is known as Network Byte Order.
By these definitions, a 32-bit data pattern is regarded as a 32-bit unsigned integer. The
"high- Order" byte is the one for the largest powers of 2: 231, ..., 224. The "low-order"
byte is the one for the smallest powers of 2: 27, ..., 20.
Example
0x12674592 in 32-bit representation can be stored as −
4.)
The operands of the instructions can be located either in the main memory or in the
CPU registers. If the operand is placed in the main memory, then the instruction
provides the location address in the operand field. Many methods are followed to
specify the operand address. The different methods/modes for specifying the operand
address in the instructions are known as addressing modes.
Immediate Mode − In this mode, the operand is specified in the instruction itself. In
other words, an immediate-mode instruction has an operand field instead of an address
field. The operand field includes the actual operand to be used in conjunction with the
operation determined in the instruction. Immediate-mode instructions are beneficial for
initializing registers to a constant value.
Register Mode − In this mode, the operands are in registers that reside within the CPU.
The specific register is selected from a register field in the instruction. A k-bit field can
determine any one of the 2k registers.
Register Indirect Mode − In this mode, the instruction defines a register in the CPU
whose contents provide the address of the operand in memory. In other words, the
selected register includes the address of the operand rather than the operand itself.
A reference to the register is then equivalent to specifying a memory address. The
advantage of a register indirect mode instruction is that the address field of the
instruction uses fewer bits to select a register than would have been required to specify
a memory address directly.
Autoincrement or Autodecrement Mode &minuend; This is similar to the register
indirect mode except that the register is incremented or decremented after (or before)
its value is used to access memory. When the address stored in the register defines a
table of data in memory, it is necessary to increment or decrement the register after
every access to the table. This can be obtained by using the increment or decrement
instruction.
Direct Address Mode − In this mode, the effective address is equal to the address part
of the instruction. The operand resides in memory and its address is given directly by
the address field of the instruction. In a branch-type instruction, the address field
specifies the actual branch address.
Indirect Address Mode − In this mode, the address field of the instruction gives the
address where the effective address is stored in memory. Control fetches the instruction
from memory and uses its address part to access memory again to read the effective
address.
Indexed Addressing Mode − In this mode, the content of an index register is added to
the address part of the instruction to obtain the effective address. The index register is a
special CPU register that contains an index value. The address field of the instruction
defines the beginning address of a data array in memory.
5.)
Advantages of Register Mode.
1. By using addressing modes we can reduce the number of bits in the
addressing field of the instruction.
2. Most addressing modes modify the address field of the instruction.
3. The implied and immediate models need no address field at all.
4. It allows a variety of data processing and data movement instructions to be
designed.
REGISTER INDIRECT
REGISTER MODE
MODE
Operand is placed in a The operand’s offset is
general-purpose placed in one of the
register. registers.
6.)
8.)
https://www.educative.io/edpresso/what-are-loops-in-assembly-language
9.)
https://www.geeksforgeeks.org/subroutine-subroutine-nesting-and-stack-memory/
Example -> Stack Memory.
10.)
In computer science, the word length can be defined as the length in bits of the
processors working registers. this usually corresponds to the number of data
inputs/outputs (aka the data bus) that the processor uses in its normal operations(i.e.
the number of bits that a MOV operation affects). The total memory location required to
feed the instruction in memory is called instruction word size. The memory location of
the 8085 microprocessor can accommodate 8-bits of data. To store 16-bits data, they
are stored in two consecutive memory locations (i.e. 2 Bytes).
11.)
Data Transfer Instruction
MOV: Moves value at B to A; Operands (Rd, M); MOV(A, B)
PUSH: Pushes R.P to the stack; PUSH H
POP: Pops the stack to r.p. ; POP H
Logical Instructions
ANA: Performs AND operations; ANA B ⇒ A AND B.
ORA : Performs OR operations; ORA B ⇒ A OR B
Arthematic Instructions
ADD : A= A+R ; ADD B
SUB: A=A-R; SUB B
Program Control Instructions
12.)
https://www.geeksforgeeks.org/computer-organization-instruction-formats-zero-one-two-
three-address-instruction/
Module – III
1. Explain the difference between Horizontal and Vertical micro-programmed Control Unit.
2. What are the differences between the Hardwired and microprogram control unit.
3. Explain in detail about different instruction types and instruction sequencing.
4. What is Pipelining? What are the major characteristics of a Pipeline?
5. What are the various stages in a Pipeline execution? Explain the various types of
pipeline 2hazards?
6. Why we need an instruction buffer in a pipelined CPU? What are the problems faced in
instruction pipeline and how they are resolved?
7. Define stall .
8. Illustrdo ate the behaviour of four segment instruction pipeline using space-time
diagram.
9. the A non-pipeline system takes 50ns to process a task. The same task can be processed
in a 4– segment pipeline with a clock of 10 ns. Determine speedup ratio of the pipeline
for 100 tasks.
10. Explain how parallel processing improves the performance of multiprocessing
environment?
11. What are the registers necessary to fetch decode and execute an instruction ?
1.)
https://www.geeksforgeeks.org/difference-between-horizontal-and-vertical-micro-progra
mmed-control-unit/
2.)
Set 01 :
https://www.geeksforgeeks.org/difference-between-hardwired-and-microprogrammed-co
ntrol-unit/?ref=rp
Set 02 :
https://www.geeksforgeeks.org/difference-between-hardwired-and-micro-programmed-c
ontrol-unit-set-2/?ref=lbp
3.)
https://educatech.in/instructions-and-instruction-sequencing-in-computer-organization/
4.)
https://www.javatpoint.com/pipelining
5.)
https://www.javatpoint.com/execution-stages-and-throughput-in-pipeline
Pipeline hazards :
https://www.geeksforgeeks.org/computer-organization-and-architecture-pipelining-set-2-
dependencies-and-data-hazard/
6.) Covered in Ques 5
7.)
https://www.geeksforgeeks.org/computer-organization-and-architecture-pipelining-set-3-
types-and-stalling/
8.)
https://www.slideshare.net/prithvisharma9083/pipeline-processing-and-space-time-diagr
am
9.)
https://testbook.com/question-answer/a-non-pipeline-system-takes-50ns-to-process-a-ta
sk--604eedb859d8c471da980409
10.)
https://www.tutorialspoint.com/what-is-parallel-processing
11.)
http://theteacher.info/index.php/fundamentals-of-cs/1-hardware-and-communication/topi
cs/2599-registers-and-the-fetch-decode-execute-cycle#:~:text=The%20way%20register
s%20are%20used,that%20is%20all%20it%20does.
Module -IV
1. Describe the Memory Hierarchy. Compare them in terms of size, speed and cost.
2. Differentiate between SRAM and DRAM.
3. Explain locality of reference with example.
4. Define mapping . What are the three mapping Techniques used in caches?
5. What are the various replacement algorithms.
6. Define auxiliary memory, seek time, rotational time, access time and transfer time.
7. How does the locality of reference help in faster access of memories .
8. A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block
size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB.
The number of bits for the TAG field is _____
9. Consider a 4-way set associative cache consisting of 128 lines with a line size of 64
words. The CPU generates a 20-bit address of a word in main memory. The number of
bits in the TAG, LINE and WORD fields are ?
10. Differentiate between auxiliary memory and Cache memory.
1.)
https://www.geeksforgeeks.org/memory-hierarchy-design-and-its-characteristics/
2.)
https://www.geeksforgeeks.org/difference-between-sram-and-dram/
3.)
https://www.geeksforgeeks.org/locality-of-reference-and-cache-operation-in-cache-me
mory/
4.)
https://www.geeksforgeeks.org/cache-memory-in-computer-organization/
5.)
6.)
Auxiliary Memory
https://www.javatpoint.com/coa-auxiliary-memory
https://www.geeksforgeeks.org/difference-between-seek-time-and-rotational-latency-in
-disk-scheduling/
https://www.geeksforgeeks.org/difference-between-seek-time-and-transfer-time-in-disk
-scheduling/
7.)
Simply put, it increases the likelihood that when the CPU goes to fetch something it will
already be in the cache (a “hit”) as opposed to it not being in the cache and having to take
the “miss,” and therefore the delay, to go to main memory or the next level of cache to
retrieve the content.
The assumption is that when you access some arbitrary memory, locality presumes that
future access will be nearby, and therefore the retrieval logic should go get more than just
the one specified address at a lower cost for retrieving an entire cache line, in hopes that it’s
saving itself additional delay to go back later to get the other nearby data (or instructions,
same thing.)
8.)
https://testbook.com/question-answer/a-4-way-set-associative-cache-memory-unit-wit
h-a-c--5f009fde83ab5c07edbc5ef0
9.)
https://www.geeksforgeeks.org/gate-gate-cs-2007-question-10/
10.)
https://www.geeksforgeeks.org/difference-between-primary-and-secondary-memory/
Module -V
1. What is the importance of I/O interface? Compare the features of SCSI and PCI
Interfaces.
2. Explain the use of vectored interrupts in processes. Why is priority handling desired in
interrupt controllers? How does the different priority scheme work?
3. What is the difference between a subroutine and an interrupt-service routine? Explain
with suitable example.
4. What is the difference between isolated I/O and memory mapped I/O? What are the
advantages and disadvantages of each?
5. What is cache coherency and how is it eliminated?
6. The approaches of shared memory and message passing both support simultaneous
execution of tasks that interact with each other. Which of these two approaches can
emulate the action of the other more easily? Justify your answer.
7. Give an overview of parallel priority interrupt hardware. Write about two different
approaches for bus arbitration
8. Explain the importance of handshake control for data transfer in asynchronous bus?
9. Explain Flynn’s classification of computers.
10. Explain the term exception. What is Synchronous Bus? Explain.
11. Explain the usage of daisy chains and priority in simultaneous interrupt handling?
12. Discuss the implementation of nested interrupts to handle multiple devices with suitable
example.
13. Explain the method of enabling and disabling Interrupts.
14. With suitable block diagram describe the types of shared memory multiprocessor
architecture and also discuss their major differences.
1.)
https://www.geeksforgeeks.org/io-interface-interrupt-dma-mode/#:~:text=The%20method%20
that%20is%20used,connected%20to%20any%20computer%20system.
https://stackoverflow.com/questions/17339640/difference-between-scsi-and-pci
2.)
In computer science, a vectored interrupt is a processing technique in which the interrupting device
directs the processor to the appropriate interrupt service routine. This is in contrast to a polled
interrupt system, in which a single interrupt service routine must determine the source of the
interrupt by checking all potential interrupt sources, a slow and relatively laborious process.
https://www.geeksforgeeks.org/priority-interrupts-sw-polling-daisy-chaining/
https://cvbl.iiita.ac.in/sks/coa-files/lectures/Lec_12_IO[2].pdf
3.)
Subroutine is a portion of code within a larger program, which performs a specific task and
is relatively independent of the remaining code.
Interrupt Service Routines (ISRs) are to handle hardware interrupts. These routines are not
independent threads, but more like signals. ISR is called if any thread is suspended by an
interrupt
Subroutine runs when you call it. ISR runs whenever a certain signal occurs. (The signal can
be generated by software or hardware.) The big difference is that you know where the
subroutine runs (because you call it). But you do not know when the ISR will be executed.
Your code may run normally when a hardware interrupt occurs and your program jumps to
the ISR. This can happen anywhere in your code (in between two statements or even in the
middle of a complete statement, remember a statement is compiled into multiple assembly
instructions).
Therefore, care must be taken when ISR accesses global variables. A race condition may
occur if ISR and a normal thread touch the same global variable at the same time.