Problem 4 (12 marks a) (8 marks) Suppose A 0 and B-0101. Show the step by step r
ID: 3733371 • Letter: P
Question
Problem 4 (12 marks a) (8 marks) Suppose A 0 and B-0101. Show the step by step result computing A divide B, using the hardware shown in Fig. 2. Assume A and B are 4-bit unsigned numbers. Dividend is initially loaded into the Remainder register. Please show the steps in the given table. Please expand the table if more rows needed. Divisor 4 bits ALU Shift right Shitt left Control Writetest 8 bits Fig.2 b) (4 marks) Suppose that each operation (addition, subtraction or shift) takes 2ns. Please calculate the time necessary to perform the above division using the given hardware. Assume the registers have been initialized.Explanation / Answer
a)
A = 0111 B = 0101
A and B are unsigned 4-bits numbers.
Initially, dividend is loaded into remainder register.
We have to compute A divide B (A/B) i.e. A is divident and B is divisor
Remainder
If remainder<0 restore value of left half before subtraction
Quotient = 0001 Remainder = 0010
Number of steps that should be there in division process = number of bits in number given
Here, A and B are of 4bits therefore number of steps in divison = 4
Note: Restoration of left half before subtractions is done by adding left half to divisor. i.e. it is considered as addition operation.
A = 0111 = 710 B = 0101 = 510
Quotient = 1 and remainder = 2
b)
It is given that each operation(addition,subtraction,shift) takes 2ns
Total addition operartions = 4
Total subtraction operations = 4
Total shift operations = 5
Total number of operations = 4+4+5 = 13
Therefore, time necessary to perform the above divison = 13 *2ns =26ns
DivisorRemainder
Description Steps 0101 0000 0111 Initial values 0101 0000 1110 Shift remainder register left by 1bit Step 1(i) 0101 1011 1110 Subtract divisor from left half of remainder and place result in left half part i.e.0000 - 0101 = 1011 Step 1(ii) 0101 0000 1110 If remainder<0 restore value of left half before subtraction i.e. quotient = 0000 Step 1(iii) 0101 0001 1100 Shift remainder register left by 1bit Step 2(i) 0101 1100 1100 Subtract divisor from left half and place result in left half part i.e.0001 - 0101 = 1100 Step 2(ii) 0101 0001 1100If remainder<0 restore value of left half before subtraction
Step 2(iii) 0101 0011 1000 Shift remainder left by 1 bit setting rightmost bit to 0 Step 3(i) 0101 1110 1000 Subtract divisor from left half and place result in left half part i.e.0011 - 0101 = 1110 Step 3(ii) 0101 0011 1000 If remainder<0 restore value of left half before subtraction Step 3(iii) 0101 0111 0000 Shift remainder left by 1 bit setting rightmost bit to 0 Step 4(i) 0101 0010 0000 Subtract divisor from left half and place result in left half part i.e.0111 - 0101 = 0010 Step 4(ii) 0101 0100 0001 if remainder>=0 shift remainder left by 1bit and set rightmost bit to 1 Step 4(iii) 0101 0010 0001 Shift left half part to right by 1 bit DoneRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.