Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Complete the following VHDL code to implement a divider ( A B ) using the repeated subtraction method. [ e . g . if A
Complete the following VHDL code to implement a divider using the repeated subtraction method. eg if and then the result can be calculated as:
The quotient number of subtractions and the remainder
library IEEE;
use IEEE.stdlogicall;
use IEEE.stdlogicunsigned.all;
entity divider is
port CLK : in stdlogic;
A B : in stdlogicvector downto ;
Q R : out stdlogicvector downto ;
end divider;
architecture behavioral of divider is
Your design should include the following pins:
CLK: positive edge trigger input clock
A: The first number bits
B: The Second number bits
: The quotient bits
: The remainder bits
Notes:
Use behavioral description
DO NOT use the following operators: MOD, REM
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 rising edge of the input clock
You have to use EDA Playground for this assignment
You have to submit two files:
A VHDL code to implement your Design.
A testbench file to simulate and test your design:
a Set the clock period to be
b You have to cover all the possible cases for the input data except: B and B
different cases
c For each case you have to:
i Select the value for A form to and the value for B from to
ii Wait for two clock cycles
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started