Documente Academic
Documente Profesional
Documente Cultură
Introduction.........................................................................................................2 VHDL function for a divider...............................................................................2 Shift and Subtract Division implementation (Behavioral)..................................2 Shift and Subtract Division implementation (Structural)................................... 3 i. Data Path........................................................................................................3 ii. Controller....................................................................................................... 4 iii. Integration of Data Path and Controller.........................................................5 5. Testbenches......................................................................................................... 6 6. Synthesis of various models and components.....................................................6 7. References...........................................................................................................6
1. Introduction
This report aims to address the short project implementation as part of the VHDL course. A shift and subtract divider was implemented as the project task and synthesized using both behavioral and structural models. The correctness of the final design was checked using testbenches with all possible input stimuli combinations. The Divider takes Unsigned vectors as inputs and returns Quotient and Remainder of the same type. It is assumed that the dividend vector length 'm' is more than that of the divisor.
In total, 4 cycles are used in one loop operation of the divider. The data flow diagram shows 5 cycles, but 2 of them (cycle 4 and 5) are mutually exclusive and only one of them would be executed in any given loop. The variable n1 holds the count of the loops which is to be done m-n+1 times. ii. Controller The controller obviously is a finite state machine. The number of states in this design is 5. The number of states can also be reduced increasing the parallelism, but at a cost of extra hardware components. The present design uses 1 comparator, 1 bit shifter, 1 adder and 1 subtracter. These components are controlled by various control signals. Also the operands for these components are chosen using selection signals to multiplexers. Similarly, the output results are stored in various registers depending on which register is enabled. All these decisions of enable/disable, selection etc are taken care by the controller. The controller also outputs a signal 'BUSY' when the divider is calculating and not available to process other inputs. The state transition diagram of the controller is as shown below :
iii. Integration of Data Path and Controller Finally, the data path and the controller were integrated into a single circuit resulting the complete and fully functional divider. The divider as an entity, takes input A and B as unsigned vectors and outputs Q and R of the same type. This is a synchronous circuit and hence takes a clock input, and a reset input as well. Apart from that, the circuit is having an enable pin, which when given a high input makes the circuit active. 5
5. Testbenches
The correctness of a circuit can only be ensured after testing the circuit with all possible input values. Therefore testbenches were written in this project too, which when run, stimulates the divider circuit with all possible input values, and checks the output results with the expected values.
7. References
1. http://en.wikipedia.org/wiki/Netlist 2. http://www.vhdl-online.de/