Specification
BeginnerRead the technical specification and design the complete VHDL. GHDL simulation validates your code.
SPI Slave (CPOL=0, CPHA=0)
Implement a generic SPI slave in mode 0 (CPOL=0, CPHA=0) receiving a 32-bit frame.
8-bit SPI Master
Implement an SPI master (mode 0: CPOL=0, CPHA=0) capable of transmitting and receiving a byte over an SPI bus.
SPI Master Mode 0
Implement an SPI master in mode 0 (CPOL=0, CPHA=0) capable of transferring 8 bits serially.
BCD Counter
Implement a synchronous BCD counter that counts from 0 to 9 then wraps to 0, with active-low asynchronous reset and enable input.
Clock Divider
Implement a generic clock divider that divides the input frequency by 2×-_HALF, with asynchronous reset.
D Flip-Flop with Enable
Implement a D flip-flop with enable and active-high asynchronous reset. The flip-flop stores i_d on the rising edge only if i_en is active.
4-bit Shift Register
Implement a 4-bit serial shift register (SISO) with asynchronous reset. Bits shift right on each rising edge.
Sequence Detector «101»
Implement a Mealy state machine that detects the binary sequence «101» on a serial input, with overlap handling.
Simple 4-operation ALU
Implement a combinational ALU performing 4 operations on two 8-bit operands: addition, subtraction, AND, and OR, with carry flag.
Transparent Latch (FPGA Pitfall)
Implement a transparent latch to understand this classic FPGA pitfall. When enable is high, output follows input; when enable is low, output holds its value.
Loadable Shift Register
Implement an 8-bit loadable shift register combining parallel load and left shift, with load taking priority.
Pulse Stretcher
Implement a pulse stretcher that extends a single-cycle signal into an output active for G_CYCLES clock cycles.
Watchdog Timer
Implement a safety watchdog timer: a counter decrements continuously and triggers a timeout if no i_kick signal is received in time.
LED Sequence Controller
Implement a 3-state FSM controller (OFF, BLINK, ON) that drives an LED with blinking. Each button press advances the sequence.
PWM Generator
Implement a PWM generator with a sequential counter and a combinational output controlled by the duty cycle.
8-bit LFSR
Implement an 8-bit Linear Feedback Shift Register (LFSR) with seed loading and combinational feedback output.
Moving Average Filter (4 samples)
Implement a 4-sample moving average filter with a sequential shift register and combinational average computation.
Generic Parallel Register with Enable
Implement an N-bit parallel register with enable and combinational update detection.
2-FF CDC Synchronizer with Edge Detection
Implement a two flip-flop CDC synchronizer with combinational rising and falling edge detection.
CRC-16/CCITT (polynomial 0x1021)
Implement a synchronous CRC-16 calculator, bit by bit, with the CCITT polynomial and a combinational output of the CRC register.
I2C Master — Start & Addressing
Implement the first two phases of an I2C master: START condition and sending the 7-bit address + R/W bit via a 5-state FSM.
7-Segment Decoder
Implement a 7-segment decoder that converts a BCD digit (0-9) into 7 signals to light the correct display segments, with enable.
Top Level — Instantiation
Implement a top level that instantiates a BCD counter and a 7-segment decoder, correctly wiring internal signals and external ports.
1-Bit Full Adder
Design a 1-bit full adder with carry-in and carry-out. This block is the fundamental building block of any arithmetic unit.
4-to-1 Multiplexer
Design a purely combinational 4-to-1 multiplexer. The 2-bit selector chooses which of the 4 inputs is forwarded to the output.
2-to-4 Binary Decoder
Design a 2-to-4 binary decoder with an enable signal. The output is a one-hot code corresponding to the selector value when the decoder is active.
8-Bit Parity Checker
Design an 8-bit parity checker. The output indicates whether the number of 1-bits in the input is odd (parity = 1) or even (parity = 0).
4-Bit Comparator
Design a 4-bit combinational comparator that compares two unsigned numbers and indicates whether the first is greater than, equal to, or less than the second.
4-Bit Binary Multiplier
Design a 4-bit combinational multiplier that computes the product of two unsigned numbers on an 8-bit output.
BCD to Binary Converter
Design a combinational converter that transforms an 8-bit BCD (Binary-Coded Decimal) number into its 7-bit binary value.
AND Gate
Design a two-input AND logic gate. This is the fundamental building block of all combinational logic.
OR Gate
Design a two-input OR logic gate. The output is active when at least one input is '1'.
NOT Gate (Inverter)
Design a logic inverter. The output is the complement of the input.
NAND Gate
Design a two-input NAND logic gate. This is the universal gate: any logic function can be built using NAND gates.
NOR Gate
Design a two-input NOR logic gate. Like NAND, it is a universal gate.
XOR Gate
Design a two-input XOR (exclusive OR) logic gate. Used in adders, parity detection and encryption.
XNOR Gate
Design a two-input XNOR (equivalence) logic gate. The output is active when both inputs are the same.
2-to-1 Multiplexer
Design a purely combinational 2-to-1 multiplexer. The selector chooses which of the 2 inputs is forwarded to the output.
8-to-1 Multiplexer
Design a purely combinational 8-to-1 multiplexer. The 3-bit selector chooses which of the 8 inputs is forwarded to the output.
1-to-2 Demultiplexer
Design a 1-to-2 demultiplexer. The input is routed to one of the two outputs based on the selector.
1-to-4 Demultiplexer
Design a 1-to-4 demultiplexer. The input is routed to one of the four outputs based on the 2-bit selector.
3-to-8 Binary Decoder
Design a 3-to-8 binary decoder with enable signal. The output is a one-hot code corresponding to the selector value.
Binary to Gray Code Converter
Design a 4-bit binary to Gray code converter. Gray code is used in communications because only one bit changes between consecutive values.
Gray Code to Binary Converter
Design a 4-bit Gray code to binary converter. Inverse operation of the binary to Gray converter.
Half Adder
Design a half adder that adds two bits without carry-in.
4-Bit Subtractor
Design a 4-bit combinational subtractor that computes the difference of two unsigned numbers with borrow indication.
JK Flip-Flop
Implement a JK flip-flop with active-high asynchronous reset. The JK flip-flop is the most versatile: it can hold, set, reset, or toggle its output.
T Flip-Flop
Implement a T (Toggle) flip-flop with active-high asynchronous reset. When T='1', the output toggles on each rising edge.
Synchronous SR Flip-Flop
Implement a synchronous SR flip-flop with active-high asynchronous reset. S sets the output to '1', R resets it to '0'.
4-Bit Register
Implement a 4-bit register with enable and active-high asynchronous reset.
4-Bit Left Shift Register
Implement a 4-bit left shift register with serial input and asynchronous reset.
4-Bit SIPO Shift Register
Implement a 4-bit serial-in parallel-out (SIPO) shift register with asynchronous reset. Bits enter serially and are available in parallel.
4-Bit Up Counter
Implement a 4-bit synchronous up counter with enable and asynchronous reset.
4-Bit Down Counter
Implement a 4-bit synchronous down counter with enable and asynchronous reset. Reset initializes to maximum value (15).
4-Bit Ring Counter
Implement a 4-bit ring counter with asynchronous reset. A single '1' bit circulates through the register.