**MASTER OF COMPUTER APPLICATIONS**

Course Code : MCS-012

Course Title : Computer Organisation and Assembly Language Programming

Assignment Number : MCA (2)/012/Assign /2014-15

Maximum Marks : 100

Weightage : 25%

**Assume that you have a machine as shown in section 3.2.2 of Block 3 having the micro-operations as given in Figure 10 on page 62 of Block 3. Consider that R1 and R2 both are 8 bit registers and contains 1010 0011 and 1100 1011 respectively. What will be the values of select inputs, carry-in input and result of 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) Subtraction of R1 and R2

(ii) AND of R1 and R2

(iii) Shift right R2 twice

(iv) Add of R1 and R2 with carry

**(i) Subtraction of R1 and R2**

S3 |
S2 |
S1 |
S0 |
Ci |
F |
Micro-operation |
Name |

0 |
0 |
1 |
0 |
1 |
F=x+( |y+1) |
R ß R |
Subtraction |

1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 |

R2=

0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 |

+ | 1 | ||||||

0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |

|R2=

1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |

0 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |

1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 |

S3 |
S2 |
S1 |
S0 |
Ci |
F |
Micro-operation |
Name |
Value of Result R |

0 |
0 |
1 |
0 |
1 |
F=x+( |y+1) |
R ß R |
Subtraction |
1101 1000 |

No Carry Out Occurred.

**(ii) AND of R1 and R2 **

S3 |
S2 |
S1 |
S0 |
Ci |
F |
Micro-operation |
Name |

0 |
1 |
0 |
0 |
- |
F=x.y |
R ß R |
AND |

1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |

1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 |

1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |

S3 |
S2 |
S1 |
S0 |
Ci |
F |
Micro-operation |
Name |
Value of Result R |

0 |
1 |
0 |
0 |
- |
F=x.y |
R ß R |
AND |
1000 0011 |

No Carry Out Occurred.

**(iii) Shift right R1 twice**

S3 |
S2 |
S1 |
S0 |
Ci |
F |
Micro-operation |
Name |

1 |
1 |
- |
- |
- |
F=Shr(y) |
R ß Shr(R |
Shift right |

Shr(y) Function applied Twice on R1

1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |

1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 |

1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 |

S3 |
S2 |
S1 |
S0 |
Ci |
F |
Micro-operation |
Name |
Value of Result R |

1 |
1 |
- |
- |
- |
F=Shr(y) |
R ß Shr(R |
Shift right |
1110 1000 |

No Carry Out Occurred.

**(iv) Add of R1 and R2 with carry**

S3 |
S2 |
S1 |
S0 |
Ci |
F |
Micro-operation |
Name |

0 |
0 |
0 |
1 |
1 |
F=x+y+1 |
R ß R |
Add with carry |

1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 |

1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 |

1 | |||||||

0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 |

Cout = 1

S3 |
S2 |
S1 |
S0 |
Ci |
F |
Micro-operation |
Name |
Value of Result R |

0 |
0 |
0 |
1 |
1 |
F=x+y+1 |
R ß R |
Add with carry |
1 0110 1111 |

Carry Out has occurred.