Coa Module 2 Previous Year Question Paper Solved
Coa Module 2 Previous Year Question Paper Solved
(10)
ANSWER
Question 1 ,13
Micro-operation refers to a basic operation that can be executed on a register or memory at
the level of machine instructions. Micro-operations are the fundamental actions that the
processor performs in one cycle, like loading a register, shifting bits, or performing arithmetic
operations.
Shift Microoperation refers to the operation that shifts the contents of a register to the left or right,
typically by one or more positions. Shifting can be logical or arithmetic.
Logical Shift: This shifts the bits of the register and fills the vacated positions with 0.
o Example: If the register holds 10110101 (in binary), a logical left shift by one
position results in 01101010 (the rightmost bit is replaced by 0).
Arithmetic Shift: Similar to logical shift, but in case of a left shift, the vacated bit is
filled with 0. However, for right shift, the leftmost bit (sign bit) is copied to preserve
the sign of the number.
o Example: If the register holds 11010101 (in binary), an arithmetic right shift
will result in 11101010, preserving the sign bit.
Use case example:
Left Shift (Logical): Multiplying an unsigned binary number by 2.
o If you have 0011 (which is 3 in decimal) and you perform a logical left shift,
you get 0110 (which is 6 in decimal).
Right Shift (Arithmetic): Dividing a signed binary number by 2.
o If you have 1101 (which is -3 in decimal using 2's complement), an arithmetic
right shift will give you 1110 (which is -1 in decimal).
Carry Flag (C): Indicates whether there was a carry or borrow in the operation.
Overflow Flag (V): Indicates whether the result of an operation exceeds the capacity
of the register (signed overflow).
Zero Flag (Z): Indicates whether the result of the operation is zero.
Sign Flag (S): Indicates whether the result of an operation is positive or negative.
Carry Bit (C): Set when there is a carry out of the most significant bit during
addition, or when there is a borrow in subtraction.
Overflow Bit (V): Set when the result of an addition or subtraction operation
causes the result to exceed the representable range of the data (e.g., signed overflow).
4. Control Word: A control word is a binary word used to control the operation of the
processor. It consists of a combination of bits, each specifying a particular control signal for
components like registers, ALU, and buses.
Example:
Assume we want to specify an instruction for the ALU to perform an addition
operation between two registers and store the result in a destination register.
Control word:
Bit 0-3: Specifies the ALU operation (0001 for addition).
Bit 4-5: Specifies the source registers (01 for register 2 and 10 for register 3).
Bit 6-7: Specifies the destination register (11 for register 1).
Control Word Format: 0001 01 10 11
This control word tells the processor to:
1. Perform addition (from the ALU operation bits),
2. Use registers 2 and 3 as inputs (from the source register bits),
3. Store the result in register 1 (from the destination register bits).
5. Function Table:
A AND B A & B
A OR B A
A XOR B A ^ B
NOT A ~A
Explanation:
AND: All bits of the output will be 1 only if both corresponding bits of A and B are 1.
OR: A bit is 1 in the output if at least one of the corresponding bits of A or B is 1.
XOR: A bit in the output is 1 if and only if the corresponding bits of A and B are
different.
NOT: Inverts the bits of A (flips 0 to 1 and 1 to 0).
6.16. Accumulator Register: The accumulator is a special register used to hold
intermediate results during arithmetic or logic operations in the processor. It is
typically used in processors with a "one-register" architecture.
7.Register Transfer Logic Format: Register transfer logic (RTL) specifies the operations that occur
during a single clock cycle in a processor. Conditional register transfer is used to transfer data based
on some condition.
Example:
If the Zero Flag (Z) is set, then copy the value of Register A to Register B.
8. Booth's Algorithm is used to multiply two signed binary numbers in 2's complement form. It
reduces the number of operations by using a technique that considers pairs of bits in the multiplier.
The basic idea is to examine two consecutive bits of the multiplier and determine
whether to add, subtract, or do nothing.
For each step, the algorithm considers:
o If the pair is 01, add the multiplicand to the product.
o If the pair is 10, subtract the multiplicand from the product.
o If the pair is 00 or 11, no operation is performed.
This allows Booth’s algorithm to handle both positive and negative numbers efficiently.
9.
10. A True/Complement Circuit is a logic circuit that produces both the true value and the
complement (inverted) value of a binary number.
The circuit uses a NOT gate to produce the complement of the input
12. The 4-bit shifter design with two control variables (HI and HO) will perform the following
operations:
1. SHRL (Shift Right Logical): Shifts the 4-bit input to the right, filling with zeros on the left.
3. Load all bits with I: Loads the input I into all 4 bits of the output.
Design Explanation:
Truth Table:
HI HO Operation Output
0 1 Clear 0000
Logic Design: The shift logic can be implemented using multiplexers (MUX) to select the appropriate
operation based on the values of HI and HO
When S = 1: The circuit performs A - B, which is equivalent to A + (-B). To get -B, we need to
take the 2's complement of B.
Logic:
Diagram:
+-------+ +------+
A --->| |----| S |
|Adder | +------+
B --->| |----| |
+-------+ |
| |
17. A binary adder can be used to perform logical operations by manipulating the inputs in a specific
way:
AND: The adder’s carry logic can be used to perform an AND operation. Set the sum output
as the AND of the inputs.
o Sum = A AND B
o Sum = A OR B
o Sum = NOT A
In a two-port memory organization, the memory has two separate access ports, one for reading and
one for writing. This allows simultaneous reading and writing operations, which can improve the
performance of the processor by enabling parallel operations without conflicts.
Advantages:
1. Parallelism: It allows simultaneous read and write operations without any conflict. This is
useful in multi-step computations where data needs to be fetched and written back at the
same time, increasing throughput.
2. Faster Data Access: Two independent operations (e.g., reading data and writing results) can
occur at the same time, improving performance in processors that need fast access to
memory.
Scratchpad memory is a type of memory used for storing temporary data, and it usually involves a
single-port memory. This means only one operation (read or write) can occur at a time.
Disadvantages:
Serial Access: Because scratchpad memory only has one access port, only one operation
(read or write) can occur at a time. This can lead to slower performance in scenarios where
multiple operations need to be performed simultaneously.
19.
T1; C <- A
T2; C <- R
This register transfer logic implies that during T1, the contents of register A are copied into register C,
and during T2, the contents of register R are copied into register C.
Block Diagram:
+---------+ +---------+
| Register| | Register|
+---------+ +---------+
+---------+ +---------+
| Register| | Register|
+---------+ +---------+
T1 (C <- A): During T1, the value from register A is transferred to register C.
T2 (C <- R): During T2, the value from register R is transferred to register C.
In both steps, the control signals would determine when each transfer occurs.
In this organization, multiple processor registers and the ALU are connected through shared data
buses. This setup allows the transfer of data between registers and the ALU for operations.
Diagram:
lua
Copy
| R2 |<-------->| |<--------->| R3 |
| |
+-----------+ +-----------+
| R4 | | R2 |
+-----------+ +-----------+
1. Step 1: Select registers R3 and R4 using multiplexers controlled by the control unit, and place
their contents on the data bus.
2. Step 2: Send the contents of R3 and R4 to the ALU through the bus.
3. Step 3: The ALU performs the addition operation R3 + R4 and produces the result.
Explanation of Operations:
The control unit decides which registers are connected to the ALU and which register gets
the result.
This organization allows flexibility and efficient use of resources, as the same bus can be shared by
multiple registers and the ALU for different operations.
22.
Subtraction: Subtracting the contents of one register from another (e.g., R1 - R2).
Logic Micro-operations: These operations perform logical operations on the bits of registers.
Shift Micro-operations: These operations move the bits of a register to the left or right.
Logical Shift Left (SHL): Shifts all bits to the left and fills the rightmost bit with 0.
Logical Shift Right (SHR): Shifts all bits to the right and fills the leftmost bit with 0.
Arithmetic Shift Left: Same as SHL but typically used in signed integers.
Arithmetic Shift Right: Shifts all bits to the right, and the leftmost bit is filled with the sign bit
for signed integers.
23. To implement this combinational logic shifter, we can use multiplexers (MUXes) controlled
by the two selection variables H1 and H0.
Selection Variables: These two variables (H1, H0) will determine which operation is
performed.
We will use 2-to-1 multiplexers to implement each of these operations. The multiplexers will
select between different inputs based on the values of H1 and H0.
Block Diagram:
+-----------------+
| (2-to-1 MUX) |
+-----------------+
+------------------+------------------+
| |
| |
+--------------+ +--------------+
+--------------+ +--------------+
| |
| |
+------------------+------------------+
| Multiplexer 2 (2-to-1) |
+------------------+------------------+
| |
| |
+--------------+ +----------------+
| Shift Left | | Shift Right |
+--------------+ +----------------+
| |
| |
| |
+------------------+ +----------------+
| Input 0 | | Input 0 |
+------------------+ +----------------+
Explanation of Multiplexers:
o Shift Left (shl F): This will left-shift the bits in F. This happens when H1 = 0 and H0 =
1.
o Shift Right (shr F): This will right-shift the bits in F. This happens when H1 = 1 and H0
= 0.
The logic for Multiplexer 1 would be controlled by the H1 and H0 selection variables.
3. The function:
o When H1 = 0, H0 = 1: The output will be the result of shifting F left, i.e., S <- shl F.
o When H1 = 1, H0 = 0: The output will be the result of shifting F right, i.e., S <- shr F.