Chargement…
Chargement…
Start from a technical specification and design the complete VHDL, validated by GHDL simulation.
Exercises
109
Done
0
Total
109
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.
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.
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.
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.