6) Calculate the remainder and quotient using the hardware design given below fo
ID: 2291158 • Letter: 6
Question
6) Calculate the remainder and quotient using the hardware design given below for two unsigned integers. An example is provided along with a modified flowchart for the algorithm for the optimized hardware below. First, you should study and understand the provided example and then attempt the division in the table. Start Divisor 32 bits 1. Shift (Remainder, Quotient) Left 2. sub Difference Remainder-Divisor 32-bit ALU sign Control shift left 2. Remainder Difference 32 bits 32 bits Set least significant bit of Quotient No Done Below example presents the case for 1110/0011 (4-bit dividend and divisor): Iteration Remainder Quotient Divisor Difference 0 Initialize 1110 0011 0001 1: Shift Left, Difference 2. DiffExplanation / Answer
In the given example the remainder, quotient and divisor are each 4 bits so 4 iterations are done.
Similarly in the flowchart the remainder, quotient and divisor are each 32 bits so 32 iterations are done.
For the given problem the remainder, quotient and divisor are each 6 bits so 6 iterations are to be done.
Step
Action
Divisor
Remainder/Quotient
Calculation
0
Initial
010 001
000 000 111 100
-
1
Rem<<
010 001
000 001 111 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
110 000 111 000
000 001 - 010 001
= 110 000 (answer is negative)
Rem < 0, Rem + Div
010 001
000 001 111 000
110 000 + 010 001 =
000 001
2
Rem<<
010 001
000 011 110 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
110 010 110 000
000 011 - 010 001
= 110 010(answer is negative)
Rem < 0, Rem + Div
010 001
000 011 110 000
110 010 + 010 001=
000 011
3
Rem<<
010 001
000 111 100 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
110 110 100 000
000 111 - 010 001 =
110 110(answer is negative)
Rem < 0, Rem + Div
010 001
000 111 100 000
110 110 + 010 001 =
000 111
4
Rem<<
010 001
001 111 000 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
111 110 000 000
001 111 - 010 001 =
111 110 (answer is negative)
Rem < 0, Rem + Div
010 001
001 111 000 000
111 110 + 010 001
5
Rem<<
010 001
011 110 000 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
001 101 000 000
011 110 - 010 001 =
001 101 (answer is positive)
Rem > 0, Set LSB of Quotient
010 001
001 101 000 001
6
Rem<<
010 001
011 010 000 010
Remainder/Quotient right shift
Rem = Rem - Div
010 001
001 001 000 010
011 010 - 010 001 =
001 001 (answer is positive)
Rem > 0, Set LSB of Quotient
010 001
001 001 000 011
After 6 iterations the final answer is Remainder = 001 001, Quotient = 000 011
Step
Action
Divisor
Remainder/Quotient
Calculation
0
Initial
010 001
000 000 111 100
-
1
Rem<<
010 001
000 001 111 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
110 000 111 000
000 001 - 010 001
= 110 000 (answer is negative)
Rem < 0, Rem + Div
010 001
000 001 111 000
110 000 + 010 001 =
000 001
2
Rem<<
010 001
000 011 110 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
110 010 110 000
000 011 - 010 001
= 110 010(answer is negative)
Rem < 0, Rem + Div
010 001
000 011 110 000
110 010 + 010 001=
000 011
3
Rem<<
010 001
000 111 100 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
110 110 100 000
000 111 - 010 001 =
110 110(answer is negative)
Rem < 0, Rem + Div
010 001
000 111 100 000
110 110 + 010 001 =
000 111
4
Rem<<
010 001
001 111 000 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
111 110 000 000
001 111 - 010 001 =
111 110 (answer is negative)
Rem < 0, Rem + Div
010 001
001 111 000 000
111 110 + 010 001
5
Rem<<
010 001
011 110 000 000
Remainder/Quotient right shift
Rem = Rem - Div
010 001
001 101 000 000
011 110 - 010 001 =
001 101 (answer is positive)
Rem > 0, Set LSB of Quotient
010 001
001 101 000 001
6
Rem<<
010 001
011 010 000 010
Remainder/Quotient right shift
Rem = Rem - Div
010 001
001 001 000 010
011 010 - 010 001 =
001 001 (answer is positive)
Rem > 0, Set LSB of Quotient
010 001
001 001 000 011
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.