FPGA and VHDL Tutorials Blog


VHDL code for 4-bit binary comparator

Binary comparator compare two 4-bit binary number. It is also known as magnitude comparator and digital comparator. Analog form comparator is voltage comparator. The functionality of this comparator circuit is, It consist of 3 outputs Greater, Equal and Smaller. IfRead More »


VHDL Code for 4-bit Adder / Subtractor

This example describes a two input 4-bit adder/subtractor design in VHDL. The design unit multiplexes add and subtract operations with an OP input. 0 input produce adder output and 1 input produce subtractor output. VHDL Code for 4-bit Adder /Read More »


VHDL Code for Flipflop – D,JK,SR,T

All flip-flops can be divided into four basic types: SR, JK, D and T. They differ in the number of inputs and in the response invoked by different value of input signals. SR FlipFlop A flip-flop circuit can be constructed from two NAND gates orRead More »


VHDL Code for Clock Divider (Frequency Divider)

Clock Divider is also known as frequency divider, which divides the input clock frequency and produce output clock. In our case let us take input frequency as 50MHz and divide the clock frequency to generate 1KHz output signal. VHDL codeRead More »


Setup Time and Hold Time in FPGA

Setup Time The amount of time the synchronous input (D) must be stable before the active edge of the clock. Hold Time The amount of time the synchronous input (D) must be stable after the active edge of the clock. Metastability If either setupRead More »


Digital Clock manager DCM in Xilinx FPGA

Digital Clock Manager DCM provides clocking to all the resources of Xilinx FPGA with advanced feature. Digital Clock Manager DCM integrates advanced clocking capabilities to FPGA global clock distribution network. It eliminates clock deskewing, Phase shifting, and also act as frequencyRead More »

4-bit alu vhdl 4

VHDL code for 4-bit ALU

ALU’s comprise the combinational logic that implements logic operations such as AND, OR, NOT gate and arithmetic operations, such as Adder, Subtractor.  Functionally, the operation of typical ALU is represented as shown in diagram below, Functional Description of 4-bit ArithmeticRead More »