Professional Documents
Culture Documents
I declare that this assignment is my individual work. I have not copied from any other
student’s work or from any other source except where due acknowledgment is made
explicitly in the text, nor has any part been written for me by another person.
Student’s Signature
Evaluator’s comments:
_____________________________________________________________________
ANSWER:
3. Input-Output instruction
15 14 12 11 0
I Opcode Address
Instruction format
I bit always responsible for distinguishing between Register reference and Input-Output
instruction.
Oppcode bits are responsible for distinguishing between memory reference among
register and input-output reference instructions.
Examples.
memory reference instruction
Q2. Why is micro programmed control better than hardwired? Identify some situations
when hardwired is preferred.
ANSWER:
Micro programmed control is better than hardwired here are some reasons why it is better
than hardwired.
ANSWER:
The below explained procedure shows the contents of E, A, Q and SC during the process of
division.
E A Q SC
Dividend in AQ - - - - 0 1010 0011 100
shl EAQ - - - - - 1 0100 0110
add B + 1,suppress carry 0101
E = 1, set Qto 1 - - - - 1 1001 0111 011
N
shl EAQ - - - - - - 1 0010 1110
add B + 1,suppress carry 0101
E = 1, set Q to 1 - - - - 1 0111 1111 010
shl EAQ - - - - - - 0 1111 1110
add B + 1, carry to E - - 0101
ANSWER:
A +-B + 1 performs : A + 2n – B = 2n + A – B
Adding B: (2k + A – B) + B = 2n + A
ANSWER:
BCD addition :-
BCD ADDITION
Carry bit 1 1 11
1254 0001 0010 0101 0100
+456 0000 0100 0101 0110
1710 0001 0111 1011(>9) 1010(>9)
0110 0110
0001 0000
Sum 1 7 1 0
BCD SUBTRACTION
1254 0001 0010 0101 0100
-456 0000 0100 0101 0110
798 1101 1111 1110(>9)
0110 0110 0110
0000 0111 1001 1000
Sum 0 7 9 8
ANSWER:
1.
If the dividend is the negative integer of largest possible magnitude for the type and the divisor is
-1, then overflow occurs and the result is equal to the dividend. Despite the overflow, no
exception occurs.
2
We handle this by inspecting the instruction which generated the signal and advancing ip to point
to the instruction.
3. In recursive implementations of D&C algorithms, one must make sure that there is
sufficient memory allocated for the recursion stack, otherwise the execution may fail
because of stack overflow. Fortunately, D&C algorithms that are time-efficient often
have relatively small recursion depth. For example, the quicksort algorithm can be
implemented so that it never requires more than log2n nested recursive calls to sort n
items.