Question: The following algorithm is used to find the integer square root for an input integer number X [ Ex 1 : if X in {
The following algorithm is used to find the integer square root for an input integer number X
Ex: if X in then the result integer square root Y
Ex: if X in then the result integer square root Y Input: X nbit integer number
Output: Y sqrtX
Step: Initialization
A X Input Data
Q
B
step: Q Q B
step: B B
repeat the last two steps step and step until Q A
step: Shift B one bit to the right a logical shift
step: Y B The resultComplete the following Verilog code to provide a behavioral implementation for this algorithm:module SQRTCalculator
input CLK
input : X
output reg : Y
;Your design should include the following pins:
CLK: negative edge trigger input clock
X: The input number bits
Y: The result square root bits
Hint: define the variables A B and Q to be of size Notes:
Use behavioral description
DO NOT use the following operators:
DO NOT use an algorithmic state machine.
The calculation should be synchronous with the clock the result should be calculated in
a single clock cycle at the falling edge of the input clock
You have to use EDA Playground for this assignment........................give me the following: A Verilog code to implement your Design.
A testbench file to simulate and test your design:
a Set the clock period to be ns
b You have to cover all the possible cases for the input data different cases
c For each case you have to:
i Select the value for X from to
ii Wait for two clock cycles................give me codes in Verilog one for the main design and the other for the testbench
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
