Chargement…
Chargement…
Start from a technical specification and design the complete VHDL, validated by GHDL simulation.
Exercises
172
Done
0
Total
172
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 × G_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.
BCD to Excess-3 Encoder
Design a combinational encoder that converts a valid BCD digit to Excess-3 code.
Hamming (7,4) Encoder
Encode 4 data bits with three even-parity bits to form a Hamming (7,4) word.
Fix an Unintended Latch
Fix an incomplete combinational process that keeps an old value when `i_sel = "11"`.
Odd Counter
Build a synchronous counter that only walks through 4-bit odd values.
Self Reloading Counter
Implement a down counter that reloads itself when it reaches zero.
Thermometer to Binary Decoder
Convert an 8-bit thermometer code to a binary count.
Fibonacci Generator
Design an 8-bit sequential Fibonacci sequence generator.
Sequence Reverser
Reverse the order of four nibbles packed into a 16-bit word.
Running Sum Calculator
Add a stream of unsigned samples into a 12-bit accumulator.
Duplicate Detector
Detect whether four 4-bit values contain at least one duplicate.
Difference Calculator
Compute the signed difference between two 8-bit samples.
Stream Accumulator
Accumulate a packet of samples and report the sum on the last word.
Prefix Sum
Compute cumulative sums for four 4-bit values.
Hamming Distance Calculator
Count the differing bits between two 8-bit words.
Trailing Zero Counter
Count consecutive zeros starting at the least significant bit.
MAC Address Filter
Accept a frame when its destination MAC is local or broadcast.
Packet Length Validator
Check that a packet length sits inside an allowed window.
VLAN Tag Detector
Detect common VLAN TPIDs and extract the TCI field.
ReLU Activation Unit
Implement an 8-bit signed ReLU activation.
Max Pooling Unit
Compute the maximum over a 2x2 window of 8-bit pixels.
Argmax Unit
Return the maximum value and its index among four inputs.
Synchronous FIFO Controller
Implement a synchronous FIFO controller managing read/write pointers, full/empty flags and fill level.
AXI4 Master - Read Channels
Implement a simple AXI4 master managing the two read channels: Read Address (AR) and Read Data (R).
AXI-Lite Slave - Register Map
Implement an AXI-Lite slave with three 32-bit read/write registers, managed by two independent state machines.
FSM - Pedestrian Light
Implement a 3-process state machine for a pedestrian light with integrated timer and per-state duration management.
LED Controller - Moore State Machine
Implement a 3-process Moore state machine that cycles 4 LEDs in sequence on command.
N-bit Adder - Ripple Carry
Implement an N-bit ripple carry adder using only logical operators, without any arithmetic library.
Bidirectional Counter with Parallel Load
Implement a generic bidirectional counter with parallel load, enable, and asynchronous reset.
Configurable Debouncer
Implement a debouncer circuit with configurable stabilization time via generics.
8-to-3 Priority Encoder
Implement an 8-to-3 combinational priority encoder that encodes the position of the highest-priority active bit.
4-bit Johnson Counter
Implement a 4-bit Johnson counter with synchronous reset. The counter goes through a sequence of 8 states before returning to its initial state.
8-bit Barrel Shifter
Implement an 8-bit barrel shifter performing a logical left shift in 3 combinational stages (shift-by-4, shift-by-2, shift-by-1).
W1C Register (Write-1-to-Clear)
Implement a W1C register: bits are set via i_set_en and cleared by writing 1 via i_clr_en.
1µs Tick Generator
Generate a 1µs periodic pulse from a system clock with known period.
N-bit Counter with Overflow Output
Implement a generic synchronous N-bit counter with enable, asynchronous reset and overflow indication.
8-Bit Comparator
Implement an 8-bit combinational comparator that compares two unsigned numbers and indicates their relationship.
4-Bit Adder-Subtractor
Implement a 4-bit combinational block selectable between addition and subtraction via a control signal.
Cascadable N-Bit Comparator
Implement a generic cascadable comparator with cascade inputs for connecting multiple stages.
8-Bit Register with Load Enable
Implement an 8-bit register with parallel load enable and asynchronous reset.
4-Bit Bidirectional Shift Register
Implement a 4-bit shift register that can shift left, shift right, parallel load, or hold its value.
8x4 ROM
Implement an 8-word by 4-bit read-only memory (ROM), purely combinational.
16x4 ROM with Constant Array
Implement a 16-word by 4-bit ROM using a VHDL constant array.
8x4 Synchronous RAM
Implement an 8-word by 4-bit RAM with synchronous write and asynchronous read.
16x4 Synchronous RAM
Implement a 16-word by 4-bit RAM with synchronous write and asynchronous read.
8-Deep 8-Bit LIFO Stack
Implement an 8-deep, 8-bit LIFO stack with push, pop, and empty/full flags.
8x8 Dual-Port RAM
Implement an 8-word by 8-bit dual-port RAM: independent write and read ports.
4x8 Register File
Implement a 4-register, 8-bit register file with 1 write port and 2 read ports.
4-Bit Carry Lookahead Adder
Implement a 4-bit Carry Lookahead Adder (CLA).
8-Bit CLA Adder (2 Cascaded Blocks)
Implement an 8-bit CLA adder by cascading two 4-bit CLA blocks.
4-Bit Barrel Shifter
Implement a 4-bit, 2-stage barrel shifter that can logically shift left by 0 to 3 positions.
Simplified 8-Bit Floating-Point Adder
Implement an adder for a simplified float format: 1 sign bit, 3 exponent bits (bias 3), 4 mantissa bits (implicit 1.xxxx).
Simplified 8-Bit Floating-Point Multiplier
Implement a multiplier for the same simplified float format: 1 sign bit, 3 exponent bits (bias 3), 4 mantissa bits (implicit 1).
7-Bit Parity Generator
Implement an even parity generator: generates a parity bit for 7 data bits, and verifies an 8-bit word (7 data + 1 parity).
8-Bit Population Counter (Popcount)
Implement a population counter: count the number of '1' bits in an 8-bit vector.
4-Channel Priority Multiplexer
Implement a priority multiplexer: 4 data channels of 4 bits with request bits. The highest-priority active channel is selected.
CDC Handshake Synchronizer
Implement a 4-phase handshake synchronizer to transfer a data bus between two independent clock domains.
5-tap FIR Low-pass Filter
Implement a 5-tap direct-form FIR low-pass filter with line buffer and fixed coefficients.
4-Stage Pipelined 5x5 Multiplier
Transform a 5x5 combinational multiplier into a 4-stage pipelined architecture.
Hamming (7,4) Corrector
Decode a Hamming (7,4) word, compute the syndrome and correct one single-bit error.
4-Bit PISO Register
Implement a Parallel-In Serial-Out register with parallel load and controlled shifting.
Synchronous Modulo-6 Counter
Design a synchronous counter that cycles through states 0 to 5 with enable and terminal-count pulse.
time_of_day Clock with Record
Create a `time_of_day_pkg` package, a `record` type and a reusable time-of-day counter.
Priority Arbiter
Implement a combinational arbiter that grants the bus to the requester with the lowest numeric priority.
Signed-Magnitude Comparator
Compare two signed-magnitude numbers without treating them as two's-complement values.
Unconstrained Bit Reverser
Code a bit-order reverser compatible with vectors of different sizes and directions.
Binary to BCD Converter
Convert an 8-bit binary word into three BCD digits.
Gray Code Counter
Implement a 4-bit counter that exposes its value as Gray code.
Leading Zero Counter
Count consecutive zeros starting at the most significant bit.
Digital Differentiator
Compute the difference between two consecutive valid samples.
Lookup Table Interpolator
Linearly interpolate between four fixed table points.
Counter Manager
Control four 4-bit counters with select, increment, and clear.
Histogram Calculator
Accumulate four histogram bins from 2-bit samples.
Memory Copy Controller
Generate a read-then-write sequence to copy four words.
Scratchpad Accumulator
Accumulate signed values into four scratchpad locations.
Prime Number Checker
Determine whether a 4-bit value is prime.
Moving Maximum Filter
Output the maximum of the last four valid samples.
Factorial Calculator
Compute `n!` for a 3-bit input from 0 to 5.
Palindrome Checker
Check whether four nibbles form a palindrome sequence.
Two Sum Finder
Find whether any pair among four values reaches a target.
Run Length Encoder
Compress a 4-bit stream by emitting symbol and run length on changes.
Peak Detector
Detect a local maximum in an 8-bit sample stream.
Binary Search
Search a target in four sorted ascending values.
Dot Product Calculator
Compute the dot product of two four-element 4-bit vectors.
Insertion Sort Engine
Insert a stream of four values into an internal sorted array.
Mode Finder
Return the most frequent value among four 4-bit values.
Bitonic Sequence Detector
Detect an increasing run followed by a decreasing run in four values.
Ethernet Header Parser
Split a 14-byte Ethernet II header into its main fields.
IPv4 Header Checksum
Compute the one’s-complement checksum over ten 16-bit IPv4 header words.
ARP Request Detector
Detect an IPv4/Ethernet ARP request targeting the local address.
MAC Unit
Implement unsigned 8x8 multiply-accumulate.
Full SPI Master (Configurable mode)
Implement a generic SPI master controller supporting all 4 SPI modes, with clock divider, multi-slave and configurable frame sizes.
UART 8N1 Transmitter
Implement a complete UART 8N1 transmitter with baud rate generator and 4-state FSM driving the serial transfer.
Configurable Synchronous FIFO
Implement a synchronous FIFO with configurable width and depth, circular pointers and full/empty flags.
Single-Port RAM 256x8
Implement a single-port synchronous RAM of 256 words of 8 bits with synchronous read and synchronous write.
Dual-Port RAM 128x16
Implement a dual-port synchronous RAM of 128 words of 16 bits. Port A writes, port B reads.
Interrupt Generator
Implement an interrupt generator: each IT vector stays active for g_MIN_WIDTH_PULSE cycles then is reported in the status register.
AXI4-Lite Master
Implement a generic AXI4-Lite master capable of performing read and write accesses on an AXI4-Lite bus.
AXI4-Lite Slave
Implement a generic AXI4-Lite slave with simplified register interface.
AXI4 Master - Write Channels
Implement a simple AXI4 master managing the three write channels: Write Address (AW), Write Data (W) and Write Response (B).
mu0 Processor (16-bit)
Implement a 16-bit accumulator-based mini processor: ALU, PC/IR/ACC/R registers, control FSM, and top-level assembly. 14 instructions covered.
SHA-256 core (1-block)
Implement a hardware SHA-256 core on a 512-bit block: logical functions, message schedule shift register, compression unit and top-level FSM.
4-Bit SAR ADC Controller
Implement a successive-approximation conversion FSMD to drive an internal DAC and read a comparator.
2-Stage float32 Multiplier
Implement a simplified IEEE-754 single-precision multiplier with mantissa/exponent split.
Intel HEX Initialized ROM
Build a simulation ROM from Intel HEX records provided by the project.
µ-law Audio Compressor
Develop a functional µ-law compression model for a normalized real-valued signal.
Dual Edge Flip Flop
Model a simple DDR output from two opposite-edge registers.
Stopwatch Timer
Build a decimal seconds/tenths stopwatch driven by an external tick.
Asynchronous FIFO
Implement a small 8-bit FIFO between two clock domains.
IIR Biquad Filter
Implement an integer IIR biquad cell with fixed coefficients.
Decimation Filter
Average four samples then output one decimated sample.
Memory Arbiter
Arbitrate two masters onto a single memory port.
Bubble Sort Engine
Sort four 4-bit values with a comparator network inspired by bubble sort.
Merge Sorted Streams
Merge two already-sorted pairs into four sorted outputs.
Median Calculator
Compute the median of five 4-bit values.
1D Convolution Engine
Implement a 3-tap 1D convolution with fixed coefficients `1,2,1`.
Matrix Transpose
Transpose a 2x2 byte matrix packed into 32 bits.
Longest Consecutive Sequence
Measure the longest `+1` run in four already-sorted values.