小弟以前曾学过一点vhdl,时间长差不多忘了,如今为了饭碗问题不得不完成此题,请各位达人赐教,小弟不胜感激。大概意思就是做一个ip地址的分类。
This assignment assumes you have basic knowledge of IP (Internet Protocol). If not, please refer to the end of this mail for a quick introduction or see http://en.wikipedia.org/wiki/IPv4 .
An IP prefix shows a range of IP addresses that share the same initial portion (e.g. 10.15.20.0/24 shows all the IP addresses in the range from 10.15.20.0 to 10.15.20.255)
An IP prefix is represented with 5 bytes (4 for the address portion (e.g. to represent 10.15.20.0) and 1 byte for showing the number of shared initial bits (e.g. to represent 24))
In this assignment, you will be given 16 nonoverlapping IP ranges represented with IP prefixes.
The system has a single clock running at 100 MHz and an asynchronous reset . The system should realize the following two operations.
Query Operation: ----------------
The system receives IP addresses synchoronous to the positive edge of the system clock from its 32-bit input bus INPUT.
The system will receive up to one IP address at every clock cycle and you are expected to determine which of the 16 prefixes this address belongs to with minimum delay.
For instance, when you receive IP address 10.14.20.4 and if you have a prefix 10.14/16, you need to report this prefix at your output. You can assign a number to each prefix from 0 to 15 and only report this number.
Update Operation: -----------------
Every 200 ns, a new set of 16 nonoverlapping IP ranges will be given through a separate 8-bit input to replace the current set. This process will be completed in (5 * 16 = 80 clock cycles).
During this process an input signal UPDATE will be high. All other times UPDATE signal will be low. When update signal is high, there will be no query operation.
Deliverables: ------------
1. A synthesizable VHDL program of the assignment. 2. A testbench VHDL program to thoroughly verify the operation. 3. Simulation waveforms to clearly show the system works as specified.
|