(b) Assume that you have a machine, as shown in section 3.2.2 of Block 3 having the micro operations given in Figure 10 on page 62 of Block 3. Consider that R1 and R2 both are 8-bit registers and contain 11100111 and 00111100 respectively. What will be the values of select inputs, carry-in input, and the result of the operation (including carry-out bit) if the following micro-operations are performed? (For each micro-operation you may assume the initial value of R1 and R2 as given above) (i) Decrement R1 (ii) Add R1 and R2 with Carry (iii) Exclusive OR of the registers R1 and R2 (iv) Shift right R1

, , No Comments

Given Initial Values:

- R1: 11100111 (8 bits)

- R2: 00111100 (8 bits)


Micro-Operations:


1. Decrement R1:

   - Values:

     - R1 (After Decrement): 11100110

     - Select Inputs: S0 = 0, S1 = 0, S2 = 1 (for Decrement)

     - Carry-In: 1 (from Decrement operation)

     - Result: 11100110 (8 bits), Carry-Out: 0


2. Add R1 and R2 with Carry:

   -Values:

     - R1 + R2 + Carry-In: 11100111 + 00111100 + 1 (Carry-In) = 100111100

     - Select Inputs: S0 = 0, S1 = 1, S2 = 1 (for Add with Carry)

     - Carry-In: 1 (from previous operation)

     - Result: 00111100 (8 bits), Carry-Out: 1


3. Exclusive OR of R1 and R2:

   - Values:

     - R1 ⊕ R2: 11100111 ⊕ 00111100 = 11011011

     - Select Inputs: S0 = 1, S1 = 0, S2 = 0 (for Exclusive OR)

     - Carry-In: Not applicable for XOR operation

     - Result: 11011011 (8 bits), Carry-Out: Not applicable


4. Shift Right R1:

   - Values:

     - Shift Right R1: 11100111 >> 1 = 11110011

     - Select Inputs: S0 = 0, S1 = 0, S2 = 0 (for Shift Right)

     - Carry-In: Not applicable for Shift Right operation

     - Result: 11110011 (8 bits), Carry-Out: Least Significant Bit (LSB) becomes Carry-Out


These values are obtained based on the given micro-operations and the initial values of registers R1 and R2. The select inputs and carry-in values are set according to the specified micro-operation. 

0 टिप्पणियाँ:

Post a Comment