After outputting the number sequence once, the circuit will not generate any other outputs until the next Start "1" signal. Results To design the required circuit, VHDL programming approach has been implemented first. The circuit has been programmed using three different files for counter, combinational comparator and shift register. Following are the corresponding files with the short explanation of the code. Code for the 4-bit counter is shown in Fig. 5. It can be seen that when the Start becomes "1", the counter begins to count, however it continues to count only in that case if Start goes back to "0" on the next clock cycle.

At the same time the tmp_enable_1 signal (output Enable_1) becomes "1" for the next 8 cycles to enable the shift register to input data.

On completion of 8 cycles, Enable_1 returns to "0" disconnecting shift register from the input, and Enable_2 becomes "1" enabling the comparator to input two 4-bit numbers from the shift register. Code for the shift register is shown in Fig. 6. When shift register is enabled, it takes and propagates the input bits for eight clock cycles.

Get quality help now
Writer Lyla
Writer Lyla
checked Verified writer

Proficient in: Computers

star star star star 5 (876)

“ Have been using her for a while and please believe when I tell you, she never fail. Thanks Writer Lyla you are indeed awesome ”

avatar avatar avatar
+84 relevant experts are online
Hire writer

After eight clock events, inputting stops, and received numbers are ready to be read by comparator.

Comparator acts as following. Upon receiving an enable signal, comparator compares two 4-bit numbers and outputs the Data Ready signal. On the next clock cycle, the LSB of the largest number (or number A if they are equal) is outputted through Data Out line. Next the 4-bit number is rotated inside itself so that the 2nd LSB is the array position "0".

Get to Know The Price Estimate For Your Paper
Topic
Number of pages
Email Invalid email

By clicking “Check Writers’ Offers”, you agree to our terms of service and privacy policy. We’ll occasionally send you promo and account related email

"You must agree to out terms of services and privacy policy"
Write my paper

You won’t be charged yet!

On the next clock cycle it is outputted through the same port. And so on until all 4 numbers are out. The resulting top level VHDL code is shown below.

Having compiled and debugged the code, it has been simulated with the test bench waveform. The following input data have been selected: "00100111". It should be noted that the LSB is being inputted first. Having selected the right timing for the Reset and Start signal, a resulting output waveform has been produced to confirm the correct operation of the circuit.

The sequence of the test is the following:

  1. Reset 'high' signal resets the whole circuit into the known state.
  2. Next the Start 'high' signal initiates the circuit to operate.
  3. The input port opens, and data starts to propagate through the shift registers.
  4. It should be observed that the first bit eventually becomes the LSB of the first number, and the last bit becomes the MSB of the second number. Therefore the entered numbers are '0111' and '0010'.
  5. Once all eight bit are inputted, they are compared.
  6. When the largest number is found, Data Ready signal becomes 'high' for one clock cycle
  7. The largest number is outputted, LSB first, in the above example it is '0111'.
  8. Once four bits are buffered, output does not generate any signal. To test an error free circuit operation the following data have been selected:
  • '0000' and '1111': to see that circuit can handle the boundary values;
  • '1111' and '1111': whether the same values are being compared properly;
  • '1000' and '0001': whether the LSB and MSB are not being mixed up;
  • '0000' and '0001': whether the neighbouring values are compared properly;

Having implemented the circuit in the VHDL code, it will be looked at as an electronic entity.

First of all, the shift registers will be implemented using flip-flops, and then a 4-bit counter will be designed as well. The comparator will not be implemented in the current report, however it should be mentioned that it is a combinational device.

Shift Register consists of 8 D flip-flops. As soon as Enable_1 signal of the counter becomes '1', tri-state buffer opens, and input bits are propagated along the flip-flops for 8 clock cycles. After 8 clock cycles, all bits are ready to be taken by the comparator. 4-bit counter: 4-bit counter controls two other components, comparator and shift register, by means of two outputs, Enable_1 and Enable_2. When Enable_1 is 'high', tri-state buffer of the shift register opens to allow the data in. When Enable_2 is 'high', comparator is ready to compare the two numbers.

The counter itself is enabled by the Start 'high' signal for one clock cycle. After that the StAB+AD+AC The resulting Boolean expressions were used to build a circuit of logic gates of JK flip-flops.

After running a circuit with the Reset and Start input from the word generator, the results could be confirmed with the logic analyser: It can be seen that after Reset signal and then Start, Output 1 becomes 'high' for 8 clock cycles to enable shift register input, then Output 2 becomes 'high' to enable comparator. When counter reaches'1111' state, both outputs return to 'low'. As it was mentioned above, the comparator will not be schematically designed for the purpose of this report. Its functionality consists of inputting two 4-bit numbers on the enable signal from the counter, and then comparing them.

Once compared, the Ready signal becomes 'high' for one clock cycle, and then the largest number is serially comes out on the Data Out port. Once all four bits are out and buffered, outputting stops. Conclusion A sequential synchronous circuit was designed using VHDL programming method, and then expanded based on the knowledge of the electronic components. Program code has been debugged and simulated. The resulting waveforms confirmed the expected operation. In my personal experience, VHDL programming method evolved into working design much easier as compared to the time and effort it would take using just schematic approach.

Once the problem is specified in the pseudo language, it can be rather straightforward put into the VHDL code. However not everyone can comprehend programming languages. Although majority of designers will benefit from the usage of VHDL programming, some may encounter certain difficulties and may have to use less advanced techniques. Mini-project Show preview only The above preview is unformatted text This student written piece of work is one of many that can be found in our University Degree Physics section.

Updated: Oct 10, 2024
Cite this page

VHDL. Is it easy, or not. (2020, Jun 02). Retrieved from https://studymoose.com/vhdl-easy-not-step-forward-12082-new-essay

VHDL. Is it easy, or not essay
Live chat  with support 24/7

👋 Hi! I’m your smart assistant Amy!

Don’t know where to start? Type your requirements and I’ll connect you to an academic expert within 3 minutes.

get help with your assignment