Vous êtes sur la page 1sur 10

Assighnment no:-3

Basic-
Architecture

Submitted to: Submitted by:

Ketan sood Sir Ankur singh


Roll no:- Re3801a29
Reg no:-10800943
Class:-B.C.A-M.C.A
PART-A

Q1. How is I bit useful in determining the type of


instruction

Ans: We can determine the types of instruction in


following ways:-

I bit plays important role to determine type of instruction.


We have three types of instruction.
1. Memory reference instruction.
2. Register reference instruction.
3. Input-Output instruction

15 14 12 11
0
I Opcode Address

Instruction format
• When I=0 then it will be direct memory reference
instruction.
• When I=1 , it will be indirect memory reference
instruction.

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
0 100 Address of
instruction

If oppcode is 000 to 110 then instruction is memory


reference instruction.

Register reference
instruction
0 111 Address of
instruction

If I=0 and oppcode =111 then instruction is register


reference instruction.

Input output instrution


100 Address of instruction

If I=1 and oppcode =111 then instruction is input-output


instruction.

Q2. Why is micro programmed control better than


hardwired? Identify some situations when
hardwired is preferred.
Ans:

Micro programmed control is better than


hardwired here are some reasons why it is better
than hardwired.

1. If we want any modification or change then we can


do easily by updating the micro programmed in
control memory. But in case of hard wired we have
to construct all the circuit again which is very
difficult.
For example:
Taking our basic computer as an example, we notice that
its four-bit op-code permits up to 16 instructions.
Therefore, we could add seven more instructions to the
instruction set by simply expanding its microprogram.
1. To do this with the hard-wired version of our
computer would require a complete redesign of the
controller circuit hardware.

2. Another advantage to using micro-programmed


control is the fact that the task of designing the
computer in the first place is simplified. The process
of specifying the architecture and instruction set is
now one of software (micro-programming) as
opposed to hardware design.
3. Simplifies design of control unit.
4. Micro programmed control is Cheaper than
hardwired control.
5. It is less error-prone
6. It is easy to modify than hard wired.
a. Diagram of programmed control
Q3. Show the contents of E, A, Q and SC during the
process of division of two binary numbers,
10100011 by 1011.

Ans: 10100011/1011= 1110 + 1001/1011 163/11 = 14


+ 9/11
B = 1011 B + 1 = 0101 DVF = 0
Here Divisor B=1011 BC =0100 which is
Complement of B
BC +1=0101

E A Q SC

Dividend in AQ 0 1010 0011


100

Shl EAQ 1 0100 0110

Add BC+1, remove Carry +0101

E=1 1 1001

E=1,Set Qn=1 1 1001


0111 011

Shl EAQ 1 0010 1110

Add BC+1, remove Carry +0101

E=1 1 0111

E=1, Set Qn=1 1 0111 1111


010

Shl EAQ 0 1111 1110

Add BC+1, Carry To E 0 +0101


E=1 1 0100 1110

E=1, Set Qn=1 1 0100 1111


001

Shl EAQ 0 1001 1110

Add BC+1, Carry To E 0 +0101

E=0 0 1110 1110

E=0, Leave Qn=0 0 1110 1110

Add B, Carry To E 0 +1011

E=1 1 1001

Remainder 1 1001 1110


100

Neglect E

A: 1001

Q: 1110

PART-B

Q4. Show that adding B after A+B+1 restores the


original value of A. What should be done with end
carry?
Ans:-

A+B’+1 performs : A+2x-B= 2x+A-B


Adding B: : (2x+A-B)+B=2x+A
Remove end carry 2x to obtain A.

Q5. Perform BCD addition and subtraction of 1254


and 456.

Ans:-

BCD ADDITION
Carry bit 1 11
1
1254 0001 0 0101 0100
010
+456 0000 0 0101 0110
100
1710 0001 1011( 1010(
0111 >9) >9)
0110 0110
000 0000
1
Sum 1 1 0
7

BCD SUBTRACTION
1254 0001 001 0101 0100
0
-456 0000 010 0101 0110
0
798 110 1111 1110(>
1 9)
011 0110 0110
0
0000 011 1001 1000
1
Sum 0 7 9 8

Q6. Why is it necessary to consider the case of


divide overflow?

Ans:

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.

1. 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.