Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 1 - Design Techniques Design a circuit that calculates the square of a n

ID: 2249017 • Letter: P

Question

Problem 1 - Design Techniques Design a circuit that calculates the square of a number based on the following given guideline. It should not use any multiplier circuits but other logic components such as adders, shifters, flip flops. Registers, counter, multiplexers, and gates are allowed to be used Hint: Use the following interesting property.. 12 02+1-1 22-12+3-4 32-22+5-9 42=32+7=16 52-449-25 previous square that you found. See how 1, 3, 5, 7 and finally 9 are added. How many clock cycles would it take to generate the square of n (n2)? (20 points)

Explanation / Answer

Seeing the pattern, square of a number n can be expressed as

n2 = (n-1)2 + [1 + {(n-1) x 2}]

= (n-1)(n-1) + [1 + (n + n)]

Above expression can be implemented on a hardware using successive addition method as multiplier circuit is not allowed. Hence to perform (n-1) x (n-1) we need to add (n-1) to itself (n-1) times.

1. Initialize the register with 0 .

2. (n-1) can be computed by adding two complement of 1 with given number n.

2. Apply inputs to adder circuit where carry and sum is initialized.

3. Inputs to the adder will be output of register & (n-1).

4. output of above adder is fed back to register.

5. Hence (n-1) x (n-1) can be computed by successive addition in (n-1) clock cycles.

6. Further additional circuit can be used to compute 1 + (n-1)x2 by adding (n-1) to itself and plus 1 in two clock cycles. This circuit will work parrallel to step 1 - 5.

7. Hence (n-1) clock cycles is enough to compute square of n.

8. One additional clock may be required to load the operands in registers or start the operation.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote