Home Work-3

CAP211:COMPUTER ORGANIZATION AND
ARCHITECTURE

SUBMITTED TO: Lect. JITESHWAR ANAND

SUBMITTED BY:SURENDRA MCA 3nd SEM ROLL NO- D3804A15 REGD NO- 10806601

Declaration: 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: _____________________________________________________________________ Marks obtained : ___________ out of ______________________

Q1. How is I bit useful in determining the type of instruction. ANSWER: I bit plays important role to determine type of instruction. We have three types of instruction. 1. 2. 3. Memory reference instruction. Register reference instruction. Input-Output instruction

15 I

14 Opcode

12 11 Address

0

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. ANSWER: 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. To do this with the hardwired 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 (microprogramming) 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. Diagram of programmed control

Some situations when hard wired is preferred
1.

In case of speed: If speed is a consideration, hard-wiring may be required since it is faster to have the hardware issue the required control signals than to have a "program" do it. 2. In case of implementing RISK: Hardwired control unit is typically use for implementing control unit in pure RISC while micro programmed is not usually used for implementing RISC.

Diagram of hardwired control

Q3. Show the contents of E, A, Q and SC during the process of division of two binary numbers, 10100011 by 1011. ANSWER: The below explained procedure shows the contents of E, A, Q and SC during the process of

division.

10100011/1011= 1110 + 1001/1011 163/11 = 14 + 9/11 B = 1011 B + 1 = 0101 DVF = 0 E A Q SC 1010 0011 100 0100 0110 0101 1001 0111 011

Dividend in AQ - - - - 0 shl EAQ - - - - 1 add B + 1,suppress carry E = 1, set Qto 1 - - - - 1 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

E = 1, set Qn to 1 1 0100 1111 001 shl EAQ - - - - - 0 1001 1110 add B + 1, carry to E - - - 0101 E = 0, leave Qn = 0--- 0 1110 1110 add B - - - - - - 1011 restore remainder - - 1 1001 1110 000 remainder quotient

Q4. Show that adding B after A+B+1 restores the original value of A. What should be done with end carry? ANSWER:

A +-B + 1 performs : A + 2n ± B = 2n + A ± B Adding B: (2k + A ± B) + B = 2n + A We should remove end-carry 2n to obtain A.

Q5. Perform BCD addition and subtraction of 1254 and 456.

ANSWER: BCD addition :-

Carry bit 1254 +456 1710

0001 0000 0001

BCD ADDITION 1 0010 0100 0111

Sum

1

7

1 11 0101 0101 1011(>9) 0110 0001 1

0100 0110 1010(>9) 0110 0000 0

1254 -456 798

0001 0000

Sum

0000 0

BCD SUBTRACTION 0010 0101 0100 0101 1101 1111 0110 0110 0111 1001 7 9

0100 0110 1110(>9) 0110 1000 8

Q6. Why is it necessary to consider the case of divide overflow? 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.

Sign up to vote on this title
UsefulNot useful