problem_id stringlengths 7 27 | bundle_relpath stringlengths 25 47 | evaluation_title stringlengths 6 73 | release_level stringclasses 5
values | evaluated_level stringclasses 5
values | evaluation_problem_id stringlengths 3 3 | problem stringlengths 287 16.6k | config_yaml stringlengths 227 1.64k | testbench stringlengths 129 71.8k |
|---|---|---|---|---|---|---|---|---|
241_history_search | bundles/L2_sequential/241_history_search | 8-bit History Shift Register with Search | L2_sequential | L2 | 241 | # Problem 241: 8-bit History Shift Register with Search
**Level**: 2 (Sequential Logic)
**Category**: shift_registers
## Description
Design an 8-entry history buffer that stores the most recent 8 values pushed into it. The buffer supports a combinational search that reports whether a given value exists in the buffer... | problem_id: '241'
title: 8-bit History Shift Register with Search
level: 2
category: shift_registers
description: 8-entry history buffer with push operation and combinational search for matching values
module_name: history_search
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
... | `timescale 1ns/1ps
module tb_history_search;
reg clk, rst, push;
reg [7:0] data_in;
reg [7:0] search_val;
wire found;
wire [2:0] position;
history_search uut(.clk(clk), .rst(rst), .data_in(data_in), .push(push),
.search_val(search_val), .found(found), .position(positio... |
242_prescaler_config | bundles/L2_sequential/242_prescaler_config | Configurable Prescaler (divide by 1,2,4,8) | L2_sequential | L2 | 242 | # Problem 242: Configurable Prescaler (divide by 1,2,4,8)
**Level**: 2 (Sequential Logic)
**Category**: clock_dividers
## Description
Design a configurable clock prescaler (divider) that can divide the input clock frequency by 1, 2, 4, or 8, selected by a 2-bit control input. The output clock has a 50% duty cycle fo... | problem_id: '242'
title: Configurable Prescaler (divide by 1,2,4,8)
level: 2
category: clock_dividers
description: Programmable clock divider that divides input clock by 1, 2, 4, or 8 based on selection
module_name: prescaler_config
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: ... | `timescale 1ns/1ps
module tb_prescaler_config;
reg clk, rst;
reg [1:0] div_sel;
wire clk_out;
prescaler_config uut(.clk(clk), .rst(rst), .div_sel(div_sel), .clk_out(clk_out));
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;
integer fail_count = 0;
// Count rising... |
243_one_hot_fsm_4 | bundles/L2_sequential/243_one_hot_fsm_4 | One-Hot State Machine (4-state) | L2_sequential | L2 | 243 | # Problem 243: One-Hot State Machine (4-state)
**Level**: 2 (Sequential Logic)
**Category**: fsm
## Description
Design a 4-state finite state machine using one-hot encoding. The machine has four states: S0=4'b0001, S1=4'b0010, S2=4'b0100, S3=4'b1000. The `go` signal advances the state forward (S0->S1->S2->S3->S0), w... | problem_id: '243'
title: One-Hot State Machine (4-state)
level: 2
category: fsm
description: 4-state FSM with one-hot encoding, forward/backward transitions controlled by go and back signals
module_name: one_hot_fsm_4
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
go:
dir... | `timescale 1ns/1ps
module tb_one_hot_fsm_4;
reg clk, rst, go, back;
wire [3:0] state;
one_hot_fsm_4 uut(.clk(clk), .rst(rst), .go(go), .back(back), .state(state));
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;
integer fail_count = 0;
task check;
input [3:0]... |
244_counter_prog_limit | bundles/L2_sequential/244_counter_prog_limit | 8-bit Up Counter with Programmable Limit | L2_sequential | L2 | 244 | # Problem 244: 8-bit Up Counter with Programmable Limit
**Level**: 2 (Sequential Logic)
**Category**: counters
## Description
Design an 8-bit up counter that counts from 0 to a programmable limit value, then wraps back to 0. The counter includes an `at_limit` output that is asserted when the counter reaches the limi... | problem_id: '244'
title: 8-bit Up Counter with Programmable Limit
level: 2
category: counters
description: 8-bit up counter that counts from 0 to a programmable limit value then wraps to 0
module_name: counter_prog_limit
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
enable:
... | `timescale 1ns/1ps
module tb_counter_prog_limit;
reg clk, rst, enable;
reg [7:0] limit;
wire [7:0] count;
wire at_limit;
counter_prog_limit uut(.clk(clk), .rst(rst), .enable(enable),
.limit(limit), .count(count), .at_limit(at_limit));
initial clk = 0;
always #... |
245_pwm_dead_time | bundles/L2_sequential/245_pwm_dead_time | Pulse Width Modulation with Dead Time | L2_sequential | L2 | 245 | # Problem 245: Pulse Width Modulation with Dead Time
**Level**: 2 (Sequential Logic)
**Category**: counters
## Description
Design a complementary PWM generator with configurable dead time. A free-running 8-bit counter generates two complementary PWM outputs with a dead time zone where both outputs are low, preventin... | problem_id: '245'
title: Pulse Width Modulation with Dead Time
category: counters
description: Complementary PWM generator with configurable dead time to prevent simultaneous
high outputs
module_name: pwm_dead_time
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
duty:
di... | `timescale 1ns/1ps
module tb_pwm_dead_time;
reg clk, rst;
reg [7:0] duty;
reg [3:0] dead_time;
wire pwm_high, pwm_low;
pwm_dead_time uut(.clk(clk), .rst(rst), .duty(duty), .dead_time(dead_time),
.pwm_high(pwm_high), .pwm_low(pwm_low));
initial clk = 0;
always #5 cl... |
246_barrel_shift_reg | bundles/L2_sequential/246_barrel_shift_reg | 8-bit Barrel Shift Register | L2_sequential | L2 | 246 | # Problem 246: 8-bit Barrel Shift Register
**Level**: 2 (Sequential Logic)
**Category**: shift_registers
## Description
Design an 8-bit register that supports loading a value and performing logical left shifts by a variable amount (0 to 7 bits) in a single clock cycle. The shift fills vacated positions with zeros.
... | problem_id: '246'
title: 8-bit Barrel Shift Register
category: shift_registers
description: Register with variable-amount logical left shift capability in a single
clock cycle
module_name: barrel_shift_reg
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
data_in:
directio... | `timescale 1ns/1ps
module tb_barrel_shift_reg;
reg clk, rst;
reg [7:0] data_in;
reg load;
reg [2:0] shift_amount;
reg shift_en;
wire [7:0] data_out;
barrel_shift_reg uut(.clk(clk), .rst(rst), .data_in(data_in), .load(load),
.shift_amount(shift_amount), .shift_en(... |
247_minmax_window_8 | bundles/L2_sequential/247_minmax_window_8 | Min/Max Tracker with Window (Last 8 Samples) | L2_sequential | L2 | 247 | # Problem 247: Min/Max Tracker with Window (Last 8 Samples)
**Level**: 2 (Sequential Logic)
**Category**: arithmetic_sequential
## Description
Design a circuit that tracks the minimum and maximum values over a sliding window of the last 8 valid input samples. The circuit uses a circular buffer to store samples and r... | problem_id: '247'
title: Min/Max Tracker with Window (Last 8 Samples)
category: arithmetic_sequential
description: Tracks minimum and maximum values over a sliding window of the last 8
valid samples
module_name: minmax_window_8
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
... | `timescale 1ns/1ps
module tb_minmax_window_8;
reg clk, rst;
reg [7:0] data_in;
reg valid;
wire [7:0] min_val, max_val;
minmax_window_8 uut(.clk(clk), .rst(rst), .data_in(data_in), .valid(valid),
.min_val(min_val), .max_val(max_val));
initial clk = 0;
always #5 cl... |
248_decade_counter_4bit | bundles/L2_sequential/248_decade_counter_4bit | 4-bit Decade Counter (BCD 0-9) | L2_sequential | L2 | 248 | # Problem 248: 4-bit Decade Counter (BCD 0-9)
**Level**: 2 (Sequential Logic)
**Category**: counters
## Description
Design a 4-bit BCD decade counter that counts from 0 to 9. When the counter is at 9 and is enabled, it wraps to 0 on the next clock edge and produces a one-cycle carry pulse. The carry output can be us... | problem_id: '248'
title: 4-bit Decade Counter (BCD 0-9)
category: counters
description: BCD decade counter counting 0-9 with carry pulse on 9 to 0 transition
module_name: decade_counter_4bit
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
enable:
direction: input
width... | `timescale 1ns/1ps
module tb_decade_counter_4bit;
reg clk, rst, enable;
wire [3:0] count;
wire carry;
decade_counter_4bit uut(.clk(clk), .rst(rst), .enable(enable),
.count(count), .carry(carry));
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;... |
249_serial_parity_gen | bundles/L2_sequential/249_serial_parity_gen | Serial Parity Generator | L2_sequential | L2 | 249 | # Problem 249: Serial Parity Generator
**Level**: 2 (Sequential Logic)
**Category**: sequential_logic
## Description
Design a serial parity generator that computes the running XOR (even) parity of serial data bits within a frame. The `frame_start` signal resets the parity accumulator to begin a new frame. Each valid... | problem_id: '249'
title: Serial Parity Generator
category: sequential_logic
description: Computes running XOR parity of serial data bits within a frame, with
frame_start reset
module_name: serial_parity_gen
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
data_in:
directi... | `timescale 1ns/1ps
module tb_serial_parity_gen;
reg clk, rst;
reg data_in, data_valid, frame_start;
wire parity_out, parity_valid;
serial_parity_gen uut(.clk(clk), .rst(rst), .data_in(data_in),
.data_valid(data_valid), .frame_start(frame_start),
.... |
250_delay_line_4 | bundles/L2_sequential/250_delay_line_4 | 8-bit Delay Line (N=4 cycles) | L2_sequential | L2 | 250 | # Problem 250: 8-bit Delay Line (N=4 cycles)
**Level**: 2 (Sequential Logic)
**Category**: sequential_logic
## Description
Design an 8-bit delay line that outputs the input value delayed by exactly 4 clock cycles. This is implemented as a 4-stage pipeline of 8-bit registers. On reset, all stages are cleared to 0.
#... | problem_id: '250'
title: 8-bit Delay Line (N=4 cycles)
category: sequential_logic
description: 4-stage shift register that delays an 8-bit input by exactly 4 clock
cycles
module_name: delay_line_4
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
data_in:
direction: input
... | `timescale 1ns/1ps
module tb_delay_line_4;
reg clk, rst;
reg [7:0] data_in;
wire [7:0] data_out;
delay_line_4 uut(.clk(clk), .rst(rst), .data_in(data_in), .data_out(data_out));
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;
integer fail_count = 0;
task check;
... |
251_spi_clk_gen | bundles/L2_sequential/251_spi_clk_gen | SPI Clock Generator | L2_sequential | L2 | 251 | # SPI Clock Generator
**Level**: 2 (Sequential Logic)
**Category**: clock_dividers
## Problem Description
Design a programmable SPI clock generator. The module divides the system clock by a configurable ratio of 2^(div+1), where div is a 3-bit input.
- div=0: divide by 2
- div=1: divide by 4
- div=2: divide by 8
- ... | problem_id: '251'
title: SPI Clock Generator
category: clock_dividers
description: Programmable SPI clock generator with divide ratio 2^(div+1)
module_name: spi_clk_gen
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
enable:
direction: input
width: 1
div:
directi... | `timescale 1ns/1ps
module tb_spi_clk_gen;
reg clk, rst, enable;
reg [2:0] div;
wire sclk;
spi_clk_gen uut(.clk(clk), .rst(rst), .enable(enable), .div(div), .sclk(sclk));
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;
integer fail_count = 0;
integer i;
integer... |
252_sync_edge_detect | bundles/L2_sequential/252_sync_edge_detect | Input Synchronizer with Edge Detect | L2_sequential | L2 | 252 | # Input Synchronizer with Edge Detect
**Level**: 2 (Sequential Logic)
**Category**: sequential_logic
## Problem Description
Design a 2-FF synchronizer followed by edge detection logic. The async_in signal is synchronized through two flip-flops to produce sync_out. Additionally, rising and falling edge pulses are gen... | problem_id: '252'
title: Input Synchronizer with Edge Detect
category: sequential_logic
description: 2-FF synchronizer with rising and falling edge detection
module_name: sync_edge_detect
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
async_in:
direction: input
width:... | `timescale 1ns/1ps
module tb_sync_edge_detect;
reg clk, rst, async_in;
wire sync_out, rising, falling;
sync_edge_detect uut(.clk(clk), .rst(rst), .async_in(async_in),
.sync_out(sync_out), .rising(rising), .falling(falling));
initial clk = 0;
always #5 clk = ~clk;
i... |
253_countdown_reload | bundles/L2_sequential/253_countdown_reload | Countdown Timer with Auto-Reload | L2_sequential | L2 | 253 | # Countdown Timer with Auto-Reload
**Level**: 2 (Sequential Logic)
**Category**: counters
## Problem Description
Design a countdown timer that counts down from a programmable period value to 0. When the counter reaches 0, it generates a one-cycle tick pulse and automatically reloads the period value to start countin... | problem_id: '253'
title: Countdown Timer with Auto-Reload
level: 2
category: counters
description: Countdown timer that generates periodic tick pulses with auto-reload
module_name: countdown_reload
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
enable:
direction: input
... | `timescale 1ns/1ps
module tb_countdown_reload;
reg clk, rst, enable;
reg [7:0] period;
wire [7:0] count;
wire tick;
countdown_reload uut(.clk(clk), .rst(rst), .enable(enable),
.period(period), .count(count), .tick(tick));
initial clk = 0;
always #5 clk = ~clk;
... |
254_dual_edge_detect | bundles/L2_sequential/254_dual_edge_detect | Dual-Edge Detector | L2_sequential | L2 | 254 | # Dual-Edge Detector
**Level**: 2 (Sequential Logic)
**Category**: sequential_logic
## Problem Description
Design a circuit that detects both rising and falling edges of an input signal. The edge_detected output produces a one-cycle pulse whenever signal_in changes value (either 0-to-1 or 1-to-0).
- edge_detected =... | problem_id: '254'
title: Dual-Edge Detector
level: 2
category: sequential_logic
description: Detect both rising and falling edges of input signal
module_name: dual_edge_detect
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
signal_in:
direction: input
width: 1
edge_d... | `timescale 1ns/1ps
module tb_dual_edge_detect;
reg clk, rst, signal_in;
wire edge_detected;
dual_edge_detect uut(.clk(clk), .rst(rst), .signal_in(signal_in),
.edge_detected(edge_detected));
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;
integer ... |
255_input_capture | bundles/L2_sequential/255_input_capture | 8-bit Input Capture Register | L2_sequential | L2 | 255 | # 8-bit Input Capture Register
**Level**: 2 (Sequential Logic)
**Category**: sequential_logic
## Problem Description
Design an input capture register that latches an 8-bit data bus value when a rising edge is detected on the capture_in signal.
- On a synchronous rising edge of capture_in (capture_in=1 and prev_capt... | problem_id: '255'
title: 8-bit Input Capture Register
level: 2
category: sequential_logic
description: Capture data bus value on rising edge of capture input signal
module_name: input_capture
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
capture_in:
direction: input
... | `timescale 1ns/1ps
module tb_input_capture;
reg clk, rst, capture_in;
reg [7:0] data_bus;
wire [7:0] captured_data;
wire capture_flag;
input_capture uut(.clk(clk), .rst(rst), .capture_in(capture_in),
.data_bus(data_bus), .captured_data(captured_data),
... |
256_bit_count_serial | bundles/L2_sequential/256_bit_count_serial | Bit Counting FSM (Serial) | L2_sequential | L2 | 256 | # Bit Counting FSM (Serial)
**Level**: 2 (Sequential Logic)
**Category**: fsm
## Problem Description
Design a serial bit counter FSM. When start is asserted, the module loads an 8-bit data value and counts the number of 1-bits over 8 clock cycles by examining one bit at a time (LSB first, shifting right).
### State... | problem_id: '256'
title: Bit Counting FSM (Serial)
level: 2
category: fsm
description: Serial bit counter that counts number of 1-bits in an 8-bit input over 8 clock cycles
module_name: bit_count_serial
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
start:
direction: inpu... | `timescale 1ns/1ps
module tb_bit_count_serial;
reg clk, rst, start;
reg [7:0] data_in;
wire [3:0] count;
wire done;
bit_count_serial uut(.clk(clk), .rst(rst), .start(start),
.data_in(data_in), .count(count), .done(done));
initial clk = 0;
always #5 clk = ~clk;
... |
257_quadrature_decoder | bundles/L2_sequential/257_quadrature_decoder | Rotation Detector (Quadrature Decoder) | L2_sequential | L2 | 257 | # Rotation Detector (Quadrature Decoder)
**Level**: 2 (Sequential Logic)
**Category**: sequential_logic
## Problem Description
Design a quadrature encoder decoder. The module tracks two quadrature signals (A and B) to determine rotation direction and maintain a position count.
### Quadrature Encoding:
- Clockwise (... | problem_id: '257'
title: Rotation Detector (Quadrature Decoder)
level: 2
category: sequential_logic
description: Quadrature encoder decoder that tracks position and direction
module_name: quadrature_decoder
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
a:
direction: inpu... | `timescale 1ns/1ps
module tb_quadrature_decoder;
reg clk, rst, a, b;
wire [7:0] count;
wire direction;
quadrature_decoder uut(.clk(clk), .rst(rst), .a(a), .b(b),
.count(count), .direction(direction));
initial clk = 0;
always #5 clk = ~clk;
integer pass_count ... |
258_cascade_counter_4bit | bundles/L2_sequential/258_cascade_counter_4bit | 4-bit Cascadable Counter | L2_sequential | L2 | 258 | # 4-bit Cascadable Counter
**Level**: 2 (Sequential Logic)
**Category**: counters
## Problem Description
Design a 4-bit counter with carry input and carry output for cascading multiple counter stages.
### Behavior:
- The counter increments when both enable AND carry_in are high.
- carry_out is asserted when count r... | problem_id: '258'
title: 4-bit Cascadable Counter
level: 2
category: counters
description: 4-bit counter with carry input and output for cascading multiple counters
module_name: cascade_counter_4bit
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
enable:
direction: input
... | `timescale 1ns/1ps
module tb_cascade_counter_4bit;
reg clk, rst, enable, carry_in;
wire [3:0] count;
wire carry_out;
cascade_counter_4bit uut(.clk(clk), .rst(rst), .enable(enable),
.carry_in(carry_in), .count(count),
.carry_out(carry_out));
... |
201_alu_8bit | bundles/L3_module/201_alu_8bit | 8-bit ALU | L3_module | L3 | 201 | # 8-bit ALU
**Level**: 3 (Module Design)
**Category**: alu
## Problem Description
8-bit ALU with 4 operations: ADD, SUB, AND, OR
## Specifications
See config.yaml for detailed port specifications.
## Requirements
- Synthesizable design
- Resource-efficient implementation
- Standard module interfaces
| problem_id: '201'
title: 8-bit ALU
level: 3
category: alu
description: '8-bit ALU with 4 operations: ADD, SUB, AND, OR'
module_name: alu_8bit
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
op:
direction: input
width: 2
result:
direction: output
width: 8
zero:
... | module tb_alu_8bit;
reg [7:0] a, b;
reg [1:0] op;
wire [7:0] result;
wire zero;
alu_8bit uut(.a(a), .b(b), .op(op), .result(result), .zero(zero));
integer pass = 0, fail = 0;
initial begin
a = 8'h05; b = 8'h03;
op = 2'b00; #10; if (result === 8'h08) pass++; else fail++;
... |
202_alu_16bit | bundles/L3_module/202_alu_16bit | 16-bit ALU | L3_module | L3 | 202 | # 16-bit ALU
**Level**: 3 (Module Design)
**Category**: alu
## Problem Description
16-bit ALU with 8 operations
## Specifications
See config.yaml for detailed port specifications.
## Requirements
- Synthesizable design
- Resource-efficient implementation
- Standard module interfaces
| problem_id: '202'
title: 16-bit ALU
level: 3
category: alu
description: 16-bit ALU with 8 operations
module_name: alu_16bit
ports:
a:
direction: input
width: 16
b:
direction: input
width: 16
op:
direction: input
width: 3
result:
direction: output
width: 16
flags:
direction:... | module tb_alu_16bit;
reg [15:0] a, b;
reg [2:0] op;
wire [15:0] result;
wire [3:0] flags;
alu_16bit uut(.a(a), .b(b), .op(op), .result(result), .flags(flags));
integer pass = 0, fail = 0;
initial begin
a = 16'h1234; b = 16'h5678;
op = 3'b000; #10; pass++;
op = 3'b001;... |
203_alu_32bit | bundles/L3_module/203_alu_32bit | 32-bit ALU | L3_module | L3 | 203 | # Problem 203: 32-bit ALU
## Description
32-bit ALU with operations: ADD, SUB, AND, OR, XOR, SLT, SLL, SRL.
## Module Interface
```verilog
module alu_32bit(
input [31:0] a,\n input [31:0] b,\n input [2:0] op,\n output [31:0] result,\n output zero
);
// Your implementation here
endmodule
```
## ... | problem_id: '203'
title: 32-bit ALU
level: 3
category: alu
description: '32-bit ALU with operations: ADD, SUB, AND, OR, XOR, SLT, SLL, SRL.'
module_name: alu_32bit
ports:
a:
direction: input
width: 32
b:
direction: input
width: 32
op:
direction: input
width: 3
result:
direction: outp... | `timescale 1ns/1ps
module tb; reg [31:0] a,b; reg [2:0] op; wire [31:0] result; wire zero;
alu_32bit dut(.a(a),.b(b),.op(op),.result(result),.zero(zero));
integer fail;
initial begin fail=0;
a=10;b=20;op=0;#10;if(result!==30)fail=fail+1;
a=30;b=10;op=1;#10;if(result!==20)fail=fail+1;
a=32'hFF;b=32'h0F;op=2;#10;if(resul... |
204_alu_flags | bundles/L3_module/204_alu_flags | ALU with Flags | L3_module | L3 | 204 | # Problem 204: ALU with Flags
## Description
8-bit ALU with zero, carry, and overflow flags.
## Module Interface
```verilog
module alu_flags(
input [7:0] a,\n input [7:0] b,\n input [2:0] op,\n output [7:0] result,\n output zero,\n output carry,\n output overflow
);
// Your implementation ... | problem_id: '204'
title: ALU with Flags
level: 3
category: alu
description: 8-bit ALU with zero, carry, and overflow flags.
module_name: alu_flags
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
op:
direction: input
width: 3
result:
direction: output
width: 8
z... | `timescale 1ns/1ps
module tb; reg [7:0] a,b; reg [2:0] op; wire [7:0] result; wire zero,carry,overflow;
alu_flags dut(.a(a),.b(b),.op(op),.result(result),.zero(zero),.carry(carry),.overflow(overflow));
integer fail;
initial begin fail=0;
a=100;b=200;op=0;#10;if(carry!==1)fail=fail+1;
a=0;b=0;op=0;#10;if(!zero)fail=fail... |
205_barrel_shifter | bundles/L3_module/205_barrel_shifter | Barrel Shifter | L3_module | L3 | 205 | # Problem 205: Barrel Shifter
## Description
8-bit barrel shifter. dir=0: left shift, dir=1: right shift.
## Module Interface
```verilog
module barrel_shifter(
input [7:0] in,\n input [2:0] shift,\n input dir,\n output [7:0] out
);
// Your implementation here
endmodule
```
## Specification
8-bit ... | problem_id: '205'
title: Barrel Shifter
level: 3
category: alu
description: '8-bit barrel shifter. dir=0: left shift, dir=1: right shift.'
module_name: barrel_shifter
ports:
in:
direction: input
width: 8
shift:
direction: input
width: 3
dir:
direction: input
width: 1
out:
direction: ... | `timescale 1ns/1ps
module tb; reg [7:0] in; reg [2:0] shift; reg dir; wire [7:0] out;
barrel_shifter dut(.in(in),.shift(shift),.dir(dir),.out(out));
integer fail;
initial begin fail=0;
in=8'h0F;shift=4;dir=0;#10;if(out!==8'hF0)fail=fail+1;
in=8'hF0;shift=4;dir=1;#10;if(out!==8'h0F)fail=fail+1;
if(fail==0)$display("TEST... |
206_register_file_8x8 | bundles/L3_module/206_register_file_8x8 | 8x8 Register File | L3_module | L3 | 206 | # 8x8 Register File
**Level**: 3 (Module Design)
**Category**: register_file
## Problem Description
8 registers, 8-bit each, dual-port read, single-port write
## Specifications
See config.yaml for detailed port specifications.
## Requirements
- Synthesizable design
- Resource-efficient implementation
- Standard ... | problem_id: '206'
title: 8x8 Register File
level: 3
category: register_file
description: 8 registers, 8-bit each, dual-port read, single-port write
module_name: register_file_8x8
ports:
clk:
direction: input
width: 1
we:
direction: input
width: 1
wa:
direction: input
width: 3
wd:
dir... | module tb_register_file_8x8;
reg clk, we;
reg [2:0] wa, ra1, ra2;
reg [7:0] wd;
wire [7:0] rd1, rd2;
register_file_8x8 uut(.clk(clk), .we(we), .wa(wa), .wd(wd),
.ra1(ra1), .ra2(ra2), .rd1(rd1), .rd2(rd2));
initial clk = 0;
always #5 clk = ~clk;
integer pass = 0... |
207_regfile_16x16 | bundles/L3_module/207_regfile_16x16 | 16x16 Register File | L3_module | L3 | 207 | # Problem 207: 16x16 Register File
## Description
16x16 register file with 2 read ports and 1 write port.
## Module Interface
```verilog
module regfile_16x16(
input clk,\n input we,\n input [3:0] ra1,\n input [3:0] ra2,\n input [3:0] wa,\n input [15:0] wd,\n output [15:0] rd1,\n output [15:... | problem_id: '207'
title: 16x16 Register File
level: 3
category: register_file
description: 16x16 register file with 2 read ports and 1 write port.
module_name: regfile_16x16
ports:
clk:
direction: input
width: 1
we:
direction: input
width: 1
ra1:
direction: input
width: 4
ra2:
direct... | `timescale 1ns/1ps
module tb; reg clk,we; reg [3:0] ra1,ra2,wa; reg [15:0] wd; wire [15:0] rd1,rd2;
regfile_16x16 dut(.clk(clk),.we(we),.ra1(ra1),.ra2(ra2),.wa(wa),.wd(wd),.rd1(rd1),.rd2(rd2));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0; we=0; wa=0; wd=0; ra1=0; ra2=0;
we=1; wa=3; wd=16'hABCD... |
208_regfile_32x32 | bundles/L3_module/208_regfile_32x32 | 32x32 Register File | L3_module | L3 | 208 | # Problem 208: 32x32 Register File
## Description
32x32 register file (RISC-V style) with 2 read ports, 1 write port. R0 always reads 0.
## Module Interface
```verilog
module regfile_32x32(
input clk,\n input we,\n input [4:0] ra1,\n input [4:0] ra2,\n input [4:0] wa,\n input [31:0] wd,\n outp... | problem_id: '208'
title: 32x32 Register File
level: 3
category: register_file
description: 32x32 register file (RISC-V style) with 2 read ports, 1 write port. R0
always reads 0.
module_name: regfile_32x32
ports:
clk:
direction: input
width: 1
we:
direction: input
width: 1
ra1:
direction: inp... | `timescale 1ns/1ps
module tb; reg clk,we; reg [4:0] ra1,ra2,wa; reg [31:0] wd; wire [31:0] rd1,rd2;
regfile_32x32 dut(.clk(clk),.we(we),.ra1(ra1),.ra2(ra2),.wa(wa),.wd(wd),.rd1(rd1),.rd2(rd2));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0; we=0;
we=1; wa=5; wd=32'hDEADBEEF; @(posedge clk);#1; w... |
209_regfile_forward | bundles/L3_module/209_regfile_forward | Register File with Forwarding | L3_module | L3 | 209 | # Problem 209: Register File with Forwarding
## Description
8x8 register file with write-to-read forwarding (read during write returns new data).
## Module Interface
```verilog
module regfile_forward(
input clk,\n input we,\n input [2:0] ra1,\n input [2:0] ra2,\n input [2:0] wa,\n input [7:0] wd,... | problem_id: '209'
title: Register File with Forwarding
level: 3
category: register_file
description: 8x8 register file with write-to-read forwarding (read during write returns
new data).
module_name: regfile_forward
ports:
clk:
direction: input
width: 1
we:
direction: input
width: 1
ra1:
dir... | `timescale 1ns/1ps
module tb; reg clk,we; reg [2:0] ra1,ra2,wa; reg [7:0] wd; wire [7:0] rd1,rd2;
regfile_forward dut(.clk(clk),.we(we),.ra1(ra1),.ra2(ra2),.wa(wa),.wd(wd),.rd1(rd1),.rd2(rd2));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0;
we=1; wa=2; wd=8'h42; ra1=2; #1; if(rd1!==8'h42) fail=f... |
211_ram_64x8 | bundles/L3_module/211_ram_64x8 | 64x8 RAM | L3_module | L3 | 211 | # 64x8 RAM
**Level**: 3 (Module Design)
**Category**: memory
## Problem Description
64-byte synchronous RAM
## Specifications
See config.yaml for detailed port specifications.
## Requirements
- Synthesizable design
- Resource-efficient implementation
- Standard module interfaces
| problem_id: '211'
title: 64x8 RAM
level: 3
category: memory
description: 64-byte synchronous RAM
module_name: ram_64x8
ports:
clk:
direction: input
width: 1
we:
direction: input
width: 1
addr:
direction: input
width: 6
din:
direction: input
width: 8
dout:
direction: output
... | module tb_ram_64x8;
reg clk, we;
reg [5:0] addr;
reg [7:0] din;
wire [7:0] dout;
ram_64x8 uut(.clk(clk), .we(we), .addr(addr), .din(din), .dout(dout));
initial clk = 0;
always #5 clk = ~clk;
integer pass = 0, fail = 0;
initial begin
we = 1; addr = 6'd0; din = 8'hAA; #10;
... |
212_fifo_8x8 | bundles/L3_module/212_fifo_8x8 | 8-deep 8-bit FIFO | L3_module | L3 | 212 | # 8-deep 8-bit FIFO
**Level**: 3 (Module Design)
**Category**: memory
## Problem Description
Synchronous FIFO
## Specifications
See config.yaml for detailed port specifications.
## Requirements
- Synthesizable design
- Resource-efficient implementation
- Standard module interfaces
| problem_id: '212'
title: 8-deep 8-bit FIFO
level: 3
category: memory
description: Synchronous FIFO
module_name: fifo_8x8
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
wr_en:
direction: input
width: 1
rd_en:
direction: input
width: 1
din:
direction: in... | module tb_fifo_8x8;
reg clk, rst, wr_en, rd_en;
reg [7:0] din;
wire [7:0] dout;
wire full, empty;
fifo_8x8 uut(.clk(clk), .rst(rst), .wr_en(wr_en), .rd_en(rd_en),
.din(din), .dout(dout), .full(full), .empty(empty));
initial clk = 0;
always #5 clk = ~clk;
integer pass = 0... |
213_ram_128x8 | bundles/L3_module/213_ram_128x8 | 128x8 Single Port RAM | L3_module | L3 | 213 | # Problem 213: 128x8 Single Port RAM
## Description
128x8 single-port synchronous RAM.
## Module Interface
```verilog
module ram_128x8(
input clk,\n input we,\n input [6:0] addr,\n input [7:0] din,\n output [7:0] dout
);
// Your implementation here
endmodule
```
## Specification
128x8 single-p... | problem_id: '213'
title: 128x8 Single Port RAM
level: 3
category: memory
description: 128x8 single-port synchronous RAM.
module_name: ram_128x8
ports:
clk:
direction: input
width: 1
we:
direction: input
width: 1
addr:
direction: input
width: 7
din:
direction: input
width: 8
dou... | `timescale 1ns/1ps
module tb; reg clk,we; reg [6:0] addr; reg [7:0] din; wire [7:0] dout;
ram_128x8 dut(.clk(clk),.we(we),.addr(addr),.din(din),.dout(dout));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0; we=0; addr=0; din=0;
we=1; addr=10; din=8'hAA; @(posedge clk);#1; we=0;
addr=10; @(posedge ... |
214_ram_dual_64x16 | bundles/L3_module/214_ram_dual_64x16 | Dual Port RAM 64x16 | L3_module | L3 | 214 | # Problem 214: Dual Port RAM 64x16
## Description
64x16 dual-port RAM with independent read/write on both ports.
## Module Interface
```verilog
module ram_dual_64x16(
input clk,\n input we_a,\n input we_b,\n input [5:0] addr_a,\n input [5:0] addr_b,\n input [15:0] din_a,\n input [15:0] din_b,\... | problem_id: '214'
title: Dual Port RAM 64x16
level: 3
category: memory
description: 64x16 dual-port RAM with independent read/write on both ports.
module_name: ram_dual_64x16
ports:
clk:
direction: input
width: 1
we_a:
direction: input
width: 1
we_b:
direction: input
width: 1
addr_a:
... | `timescale 1ns/1ps
module tb; reg clk,we_a,we_b; reg [5:0] addr_a,addr_b; reg [15:0] din_a,din_b; wire [15:0] dout_a,dout_b;
ram_dual_64x16 dut(.clk(clk),.we_a(we_a),.we_b(we_b),.addr_a(addr_a),.addr_b(addr_b),.din_a(din_a),.din_b(din_b),.dout_a(dout_a),.dout_b(dout_b));
initial clk=0; always #5 clk=~clk;
integer fail;... |
215_rom_256x8 | bundles/L3_module/215_rom_256x8 | ROM 256x8 | L3_module | L3 | 215 | # Problem 215: ROM 256x8
## Description
256x8 ROM with pre-initialized data (use parameter or readmemh).
## Module Interface
```verilog
module rom_256x8(
input [7:0] addr,\n output [7:0] dout
);
// Your implementation here
endmodule
```
## Specification
256x8 ROM with pre-initialized data (use paramete... | problem_id: '215'
title: ROM 256x8
level: 3
category: memory
description: 256x8 ROM with pre-initialized data (use parameter or readmemh).
module_name: rom_256x8
ports:
addr:
direction: input
width: 8
dout:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: ... | `timescale 1ns/1ps
module tb; reg [7:0] addr; wire [7:0] dout;
rom_256x8 dut(.addr(addr),.dout(dout));
integer fail,i;
initial begin fail=0;
for(i=0;i<256;i=i+1) begin addr=i;#10;if(dout!==i[7:0])fail=fail+1;end
if(fail==0)$display("TEST PASSED");else $display("TEST FAILED: %0d",fail);$finish;end endmodule
|
216_fifo_16x16 | bundles/L3_module/216_fifo_16x16 | 16-deep 16-bit FIFO | L3_module | L3 | 216 | # Problem 216: 16-deep 16-bit FIFO
## Description
16-deep 16-bit synchronous FIFO with full/empty flags.
## Module Interface
```verilog
module fifo_16x16(
input clk,\n input rst,\n input wr_en,\n input rd_en,\n input [15:0] din,\n output [15:0] dout,\n output full,\n output empty
);
// ... | problem_id: '216'
title: 16-deep 16-bit FIFO
level: 3
category: memory
description: 16-deep 16-bit synchronous FIFO with full/empty flags.
module_name: fifo_16x16
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
wr_en:
direction: input
width: 1
rd_en:
direction: i... | `timescale 1ns/1ps
module tb; reg clk,rst,wr_en,rd_en; reg [15:0] din; wire [15:0] dout; wire full,empty;
fifo_16x16 dut(.clk(clk),.rst(rst),.wr_en(wr_en),.rd_en(rd_en),.din(din),.dout(dout),.full(full),.empty(empty));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0; rst=1; wr_en=0; rd_en=0; din=0... |
217_fifo_async_8x8 | bundles/L3_module/217_fifo_async_8x8 | Async FIFO 8x8 | L3_module | L3 | 217 | # Problem 217: Async FIFO 8x8
## Description
8-deep 8-bit asynchronous FIFO with separate write/read clocks.
## Module Interface
```verilog
module fifo_async_8x8(
input wr_clk,\n input rd_clk,\n input rst,\n input wr_en,\n input rd_en,\n input [7:0] din,\n output [7:0] dout,\n output full,\... | problem_id: '217'
title: Async FIFO 8x8
level: 3
category: memory
description: 8-deep 8-bit asynchronous FIFO with separate write/read clocks.
module_name: fifo_async_8x8
ports:
wr_clk:
direction: input
width: 1
rd_clk:
direction: input
width: 1
rst:
direction: input
width: 1
wr_en:
... | `timescale 1ns/1ps
module tb; reg wr_clk,rd_clk,rst,wr_en,rd_en; reg [7:0] din; wire [7:0] dout; wire full,empty;
fifo_async_8x8 dut(.wr_clk(wr_clk),.rd_clk(rd_clk),.rst(rst),.wr_en(wr_en),.rd_en(rd_en),.din(din),.dout(dout),.full(full),.empty(empty));
initial wr_clk=0; always #5 wr_clk=~wr_clk;
initial rd_clk=0; alway... |
221_uart_tx | bundles/L3_module/221_uart_tx | UART Transmitter | L3_module | L3 | 221 | # UART Transmitter
**Level**: 3 (Module Design)
**Category**: serial_comm
## Problem Description
Simple UART TX (8N1)
## Specifications
See config.yaml for detailed port specifications.
## Requirements
- Synthesizable design
- Resource-efficient implementation
- Standard module interfaces
| problem_id: '221'
title: UART Transmitter
level: 3
category: serial_comm
description: Simple UART TX (8N1)
module_name: uart_tx
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
tx_start:
direction: input
width: 1
tx_data:
direction: input
width: 8
tx:
di... | module tb_uart_tx;
reg clk, rst, tx_start;
reg [7:0] tx_data;
wire tx, tx_busy;
uart_tx uut(.clk(clk), .rst(rst), .tx_start(tx_start),
.tx_data(tx_data), .tx(tx), .tx_busy(tx_busy));
initial clk = 0;
always #5 clk = ~clk;
integer pass = 0, fail = 0;
initial begin
... |
222_uart_rx | bundles/L3_module/222_uart_rx | UART RX | L3_module | L3 | 222 | # Problem 222: UART RX
## Description
UART receiver, 8N1 format, baud rate = clk/16.
## Module Interface
```verilog
module uart_rx(
input clk,\n input rst,\n input rx,\n output [7:0] data,\n output valid
);
// Your implementation here
endmodule
```
## Specification
UART receiver, 8N1 format, b... | problem_id: '222'
title: UART RX
level: 3
category: uart
description: UART receiver, 8N1 format, baud rate = clk/16.
module_name: uart_rx
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
rx:
direction: input
width: 1
data:
direction: output
width: 8
valid:
... | `timescale 1ns/1ps
module tb; reg clk,rst,rx; wire [7:0] data; wire valid;
uart_rx dut(.clk(clk),.rst(rst),.rx(rx),.data(data),.valid(valid));
initial clk=0; always #5 clk=~clk;
integer fail,i; reg [7:0] tx_byte;
initial begin fail=0; rst=1; rx=1; @(posedge clk);#1;@(posedge clk);#1; rst=0;
tx_byte=8'hA5; rx=0; @(posed... |
223_uart_txrx | bundles/L3_module/223_uart_txrx | UART TX/RX | L3_module | L3 | 223 | # Problem 223: UART TX/RX
## Description
Full UART transceiver with TX and RX.
## Module Interface
```verilog
module uart_txrx(
input clk,\n input rst,\n input [7:0] tx_data,\n input tx_valid,\n input rx,\n output tx,\n output [7:0] rx_data,\n output rx_valid,\n output tx_ready
);
//... | problem_id: '223'
title: UART TX/RX
level: 3
category: uart
description: Full UART transceiver with TX and RX.
module_name: uart_txrx
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
tx_data:
direction: input
width: 8
tx_valid:
direction: input
width: 1
rx:
... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
224_spi_master | bundles/L3_module/224_spi_master | SPI Master | L3_module | L3 | 224 | # Problem 224: SPI Master
## Description
SPI Master, mode 0, 8-bit transfer.
## Module Interface
```verilog
module spi_master(
input clk,\n input rst,\n input start,\n input miso,\n input [7:0] tx_data,\n output mosi,\n output sclk,\n output ss,\n output [7:0] rx_data,\n output done
)... | problem_id: '224'
title: SPI Master
level: 3
category: spi
description: SPI Master, mode 0, 8-bit transfer.
module_name: spi_master
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
start:
direction: input
width: 1
miso:
direction: input
width: 1
tx_data:
... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
225_spi_slave | bundles/L3_module/225_spi_slave | SPI Slave | L3_module | L3 | 225 | # Problem 225: SPI Slave
## Description
SPI Slave, mode 0, 8-bit transfer.
## Module Interface
```verilog
module spi_slave(
input sclk,\n input ss,\n input mosi,\n input [7:0] tx_data,\n output miso,\n output [7:0] rx_data,\n output valid
);
// Your implementation here
endmodule
```
## Sp... | problem_id: '225'
title: SPI Slave
level: 3
category: spi
description: SPI Slave, mode 0, 8-bit transfer.
module_name: spi_slave
ports:
sclk:
direction: input
width: 1
ss:
direction: input
width: 1
mosi:
direction: input
width: 1
tx_data:
direction: input
width: 8
miso:
dir... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
226_i2c_master | bundles/L3_module/226_i2c_master | I2C Master | L3_module | L3 | 226 | # Problem 226: I2C Master
## Description
I2C Master with start, address, read/write control.
## Module Interface
```verilog
module i2c_master(
input clk,\n input rst,\n input start,\n input [6:0] addr,\n input rw,\n input [7:0] data_in,\n input sda_in,\n output sda_out,\n output sda_oe,\... | problem_id: '226'
title: I2C Master
level: 3
category: i2c
description: I2C Master with start, address, read/write control.
module_name: i2c_master
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
start:
direction: input
width: 1
addr:
direction: input
width: ... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
227_pwm_generator | bundles/L3_module/227_pwm_generator | PWM Generator | L3_module | L3 | 227 | # Problem 227: PWM Generator
## Description
8-bit PWM generator with configurable duty cycle.
## Module Interface
```verilog
module pwm_generator(
input clk,\n input rst,\n input [7:0] duty,\n output pwm_out
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to spe... | problem_id: '227'
title: PWM Generator
level: 3
category: pwm
description: 8-bit PWM generator with configurable duty cycle.
module_name: pwm_generator
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
duty:
direction: input
width: 8
pwm_out:
direction: output
... | `timescale 1ns/1ps
module tb; reg clk,rst; reg [7:0] duty; wire pwm_out;
pwm_generator dut(.clk(clk),.rst(rst),.duty(duty),.pwm_out(pwm_out));
initial clk=0; always #5 clk=~clk;
integer fail,i,high_cnt;
initial begin fail=0; rst=1; duty=128; @(posedge clk);#1;@(posedge clk);#1; rst=0;
high_cnt=0; for(i=0;i<256;i=i+1) b... |
228_debouncer | bundles/L3_module/228_debouncer | Debounce Circuit | L3_module | L3 | 228 | # Problem 228: Debounce Circuit
## Description
Button debouncer with 20ms settling time.
## Module Interface
```verilog
module debouncer(
input clk,\n input rst,\n input btn_in,\n output btn_out
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to specification
- ... | problem_id: '228'
title: Debounce Circuit
level: 3
category: misc
description: Button debouncer with 20ms settling time.
module_name: debouncer
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
btn_in:
direction: input
width: 1
btn_out:
direction: output
width:... | `timescale 1ns/1ps
module tb; reg clk,rst,btn_in; wire btn_out;
debouncer dut(.clk(clk),.rst(rst),.btn_in(btn_in),.btn_out(btn_out));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0; rst=1; btn_in=0; @(posedge clk);#1;@(posedge clk);#1; rst=0;
btn_in=1; repeat(20) @(posedge clk);#1;
if(btn_out!==1... |
229_edge_detector | bundles/L3_module/229_edge_detector | Edge Detector | L3_module | L3 | 229 | # Problem 229: Edge Detector
## Description
Detect rising and falling edges.
## Module Interface
```verilog
module edge_detector(
input clk,\n input rst,\n input sig_in,\n output rising,\n output falling
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to spec... | problem_id: '229'
title: Edge Detector
level: 3
category: misc
description: Detect rising and falling edges.
module_name: edge_detector
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
sig_in:
direction: input
width: 1
rising:
direction: output
width: 1
fall... | `timescale 1ns/1ps
module tb; reg clk,rst,sig_in; wire rising,falling;
edge_detector dut(.clk(clk),.rst(rst),.sig_in(sig_in),.rising(rising),.falling(falling));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0; rst=1; sig_in=0; @(posedge clk);#1;@(posedge clk);#1; rst=0;
sig_in=1; #1; if(!rising) f... |
230_synchronizer | bundles/L3_module/230_synchronizer | Synchronizer 2-FF | L3_module | L3 | 230 | # Problem 230: Synchronizer 2-FF
## Description
2-FF synchronizer for crossing clock domains.
## Module Interface
```verilog
module synchronizer(
input clk,\n input rst,\n input async_in,\n output sync_out
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to speci... | problem_id: '230'
title: Synchronizer 2-FF
level: 3
category: misc
description: 2-FF synchronizer for crossing clock domains.
module_name: synchronizer
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
async_in:
direction: input
width: 1
sync_out:
direction: output... | `timescale 1ns/1ps
module tb; reg clk,rst,async_in; wire sync_out;
synchronizer dut(.clk(clk),.rst(rst),.async_in(async_in),.sync_out(sync_out));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0; rst=1; async_in=0; @(posedge clk);#1;@(posedge clk);#1; rst=0;
async_in=1; @(posedge clk);#1;@(posedge ... |
231_gray_converter | bundles/L3_module/231_gray_converter | Gray Code Converter | L3_module | L3 | 231 | # Problem 231: Gray Code Converter
## Description
Binary to Gray code converter.
## Module Interface
```verilog
module gray_converter(
input [7:0] binary,\n output [7:0] gray
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to specification
- Use synthesizable Verilog/... | problem_id: '231'
title: Gray Code Converter
level: 3
category: misc
description: Binary to Gray code converter.
module_name: gray_converter
ports:
binary:
direction: input
width: 8
gray:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesi... | `timescale 1ns/1ps
module tb; reg [7:0] binary; wire [7:0] gray;
gray_converter dut(.binary(binary),.gray(gray));
integer fail,i;
initial begin fail=0;
for(i=0;i<256;i=i+1) begin binary=i;#10;if(gray!==(i^(i>>1)))fail=fail+1;end
if(fail==0)$display("TEST PASSED");else $display("TEST FAILED: %0d",fail);$finish;end endmo... |
232_priority_encoder | bundles/L3_module/232_priority_encoder | Priority Encoder 8-to-3 | L3_module | L3 | 232 | # Problem 232: Priority Encoder 8-to-3
## Description
8-to-3 priority encoder (highest bit has priority).
## Module Interface
```verilog
module priority_encoder(
input [7:0] in,\n output [2:0] out,\n output valid
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to s... | problem_id: '232'
title: Priority Encoder 8-to-3
level: 3
category: misc
description: 8-to-3 priority encoder (highest bit has priority).
module_name: priority_encoder
ports:
in:
direction: input
width: 8
out:
direction: output
width: 3
valid:
direction: output
width: 1
testbench_file: tes... | `timescale 1ns/1ps
module tb; reg [7:0] in; wire [2:0] out; wire valid;
priority_encoder dut(.in(in),.out(out),.valid(valid));
integer fail;
initial begin fail=0;
in=8'h80;#10;if(out!==7||!valid)fail=fail+1;
in=8'h01;#10;if(out!==0||!valid)fail=fail+1;
in=0;#10;if(valid)fail=fail+1;
in=8'h44;#10;if(out!==6)fail=fail+1;... |
233_lzc | bundles/L3_module/233_lzc | Leading Zero Counter | L3_module | L3 | 233 | # Problem 233: Leading Zero Counter
## Description
Count leading zeros in 16-bit input.
## Module Interface
```verilog
module lzc(
input [15:0] in,\n output [4:0] count
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to specification
- Use synthesizable Verilog/System... | problem_id: '233'
title: Leading Zero Counter
level: 3
category: misc
description: Count leading zeros in 16-bit input.
module_name: lzc
ports:
in:
direction: input
width: 16
count:
direction: output
width: 5
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: fal... | `timescale 1ns/1ps
module tb; reg [15:0] in; wire [4:0] count;
lzc dut(.in(in),.count(count));
integer fail;
initial begin fail=0;
in=16'h8000;#10;if(count!==0)fail=fail+1;
in=16'h0001;#10;if(count!==15)fail=fail+1;
in=0;#10;if(count!==16)fail=fail+1;
in=16'h0100;#10;if(count!==7)fail=fail+1;
if(fail==0)$display("TEST ... |
234_popcount | bundles/L3_module/234_popcount | Population Count | L3_module | L3 | 234 | # Problem 234: Population Count
## Description
Count number of 1s in 16-bit input.
## Module Interface
```verilog
module popcount(
input [15:0] in,\n output [4:0] count
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to specification
- Use synthesizable Verilog/System... | problem_id: '234'
title: Population Count
level: 3
category: misc
description: Count number of 1s in 16-bit input.
module_name: popcount
ports:
in:
direction: input
width: 16
count:
direction: output
width: 5
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: fal... | `timescale 1ns/1ps
module tb; reg [15:0] in; wire [4:0] count;
popcount dut(.in(in),.count(count));
integer fail;
initial begin fail=0;
in=16'hFFFF;#10;if(count!==16)fail=fail+1;
in=0;#10;if(count!==0)fail=fail+1;
in=16'hAAAA;#10;if(count!==8)fail=fail+1;
if(fail==0)$display("TEST PASSED");else $display("TEST FAILED: %... |
235_parity | bundles/L3_module/235_parity | Parity Generator/Checker | L3_module | L3 | 235 | # Problem 235: Parity Generator/Checker
## Description
Even parity generator and checker.
## Module Interface
```verilog
module parity(
input [7:0] data,\n input parity_in,\n output parity_out,\n output error
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to sp... | problem_id: '235'
title: Parity Generator/Checker
level: 3
category: misc
description: Even parity generator and checker.
module_name: parity
ports:
data:
direction: input
width: 8
parity_in:
direction: input
width: 1
parity_out:
direction: output
width: 1
error:
direction: output
... | `timescale 1ns/1ps
module tb; reg [7:0] data; reg parity_in; wire parity_out, error;
parity dut(.data(data),.parity_in(parity_in),.parity_out(parity_out),.error(error));
integer fail;
initial begin fail=0;
data=8'hFF;parity_in=0;#10;if(parity_out!==0||error!==0)fail=fail+1;
data=8'h01;parity_in=0;#10;if(parity_out!==1|... |
236_hamming_encoder | bundles/L3_module/236_hamming_encoder | Hamming Encoder 7-4 | L3_module | L3 | 236 | # Problem 236: Hamming Encoder 7-4
## Description
Hamming(7,4) encoder with SECDED.
## Module Interface
```verilog
module hamming_encoder(
input [3:0] data,\n output [6:0] code
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to specification
- Use synthesizable Verilo... | problem_id: '236'
title: Hamming Encoder 7-4
level: 3
category: misc
description: Hamming(7,4) encoder with SECDED.
module_name: hamming_encoder
ports:
data:
direction: input
width: 4
code:
direction: output
width: 7
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthe... | `timescale 1ns/1ps
module tb; reg [3:0] data; wire [6:0] code;
hamming_encoder dut(.data(data),.code(code));
integer fail;
initial begin fail=0;
data=4'b0000;#10;if(code!==7'b0000000)fail=fail+1;
data=4'b1111;#10; // all data bits set
data=4'b0001;#10;if(code[2]!==1)fail=fail+1;
if(fail==0)$display("TEST PASSED");else ... |
237_hamming_decoder | bundles/L3_module/237_hamming_decoder | Hamming Decoder 7-4 | L3_module | L3 | 237 | # Problem 237: Hamming Decoder 7-4
## Description
Hamming(7,4) decoder with error correction.
## Module Interface
```verilog
module hamming_decoder(
input [6:0] code,\n output [3:0] data,\n output error,\n output corrected
);
// Your implementation here
endmodule
```
## Requirements
- Implement a... | problem_id: '237'
title: Hamming Decoder 7-4
level: 3
category: misc
description: Hamming(7,4) decoder with error correction.
module_name: hamming_decoder
ports:
code:
direction: input
width: 7
data:
direction: output
width: 4
error:
direction: output
width: 1
corrected:
direction: o... | `timescale 1ns/1ps
module tb; reg [6:0] code; wire [3:0] data; wire error, corrected;
hamming_decoder dut(.code(code),.data(data),.error(error),.corrected(corrected));
integer fail;
initial begin fail=0;
code=7'b0000000;#10;if(data!==0||error)fail=fail+1;
code=7'b0000100;#10; // data bit 0 = 1
code=7'b0000101;#10; // f... |
238_multiplier_8x8 | bundles/L3_module/238_multiplier_8x8 | Multiplier 8x8 | L3_module | L3 | 238 | # Problem 238: Multiplier 8x8
## Description
8x8 unsigned multiplier (combinational).
## Module Interface
```verilog
module multiplier_8x8(
input [7:0] a,\n input [7:0] b,\n output [15:0] product
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to specification
- Us... | problem_id: '238'
title: Multiplier 8x8
level: 3
category: arithmetic
description: 8x8 unsigned multiplier (combinational).
module_name: multiplier_8x8
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
product:
direction: output
width: 16
testbench_file: testbench.v
timeout_... | `timescale 1ns/1ps
module tb; reg [7:0] a,b; wire [15:0] product;
multiplier_8x8 dut(.a(a),.b(b),.product(product));
integer fail,i;
initial begin fail=0;
a=0;b=0;#10;if(product!==0)fail=fail+1;
a=255;b=255;#10;if(product!==16'd65025)fail=fail+1;
a=12;b=13;#10;if(product!==156)fail=fail+1;
if(fail==0)$display("TEST PAS... |
239_divider_16_8 | bundles/L3_module/239_divider_16_8 | Divider 16/8 | L3_module | L3 | 239 | # Problem 239: Divider 16/8
## Description
16-bit / 8-bit divider (sequential).
## Module Interface
```verilog
module divider_16_8(
input clk,\n input rst,\n input start,\n input [15:0] dividend,\n input [7:0] divisor,\n output [15:0] quotient,\n output [7:0] remainder,\n output done
);
... | problem_id: '239'
title: Divider 16/8
level: 3
category: arithmetic
description: 16-bit / 8-bit divider (sequential).
module_name: divider_16_8
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
start:
direction: input
width: 1
dividend:
direction: input
width: ... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
240_fp_adder | bundles/L3_module/240_fp_adder | Floating Point Adder (Simple) | L3_module | L3 | 240 | # Problem 240: Floating Point Adder (Simple)
## Description
IEEE 754 single-precision FP adder (simplified).
## Module Interface
```verilog
module fp_adder(
input [31:0] a,\n input [31:0] b,\n output [31:0] sum
);
// Your implementation here
endmodule
```
## Requirements
- Implement according to spe... | problem_id: '240'
title: Floating Point Adder (Simple)
level: 3
category: arithmetic
description: IEEE 754 single-precision FP adder (simplified).
module_name: fp_adder
ports:
a:
direction: input
width: 32
b:
direction: input
width: 32
sum:
direction: output
width: 32
testbench_file: testb... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
241_cordic | bundles/L3_module/241_cordic | Cordic Rotator | L3_module | L3 | 241 | # Problem 241: Cordic Rotator
## Description
CORDIC algorithm for sine/cosine computation.
## Module Interface
```verilog
module cordic(
input clk,\n input rst,\n input start,\n input [15:0] angle,\n output [15:0] x_out,\n output [15:0] y_out,\n output done
);
// Your implementation here
e... | problem_id: '241'
title: Cordic Rotator
level: 3
category: arithmetic
description: CORDIC algorithm for sine/cosine computation.
module_name: cordic
ports:
clk:
direction: input
width: 1
rst:
direction: input
width: 1
start:
direction: input
width: 1
angle:
direction: input
width... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
242_axi_lite_slave | bundles/L3_module/242_axi_lite_slave | AXI-Lite Slave | L3_module | L3 | 242 | # Problem 242: AXI-Lite Slave
## Description
AXI4-Lite slave interface with 4 registers.
## Module Interface
```verilog
module axi_lite_slave(
input aclk,\n input aresetn,\n input [31:0] awaddr,\n input awvalid,\n output awready,\n input [31:0] wdata,\n input [3:0] wstrb,\n input wvalid,\n ... | problem_id: '242'
title: AXI-Lite Slave
level: 3
category: bus
description: AXI4-Lite slave interface with 4 registers.
module_name: axi_lite_slave
ports:
aclk:
direction: input
width: 1
aresetn:
direction: input
width: 1
awaddr:
direction: input
width: 32
awvalid:
direction: input
... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
243_wishbone_slave | bundles/L3_module/243_wishbone_slave | Wishbone Slave | L3_module | L3 | 243 | # Problem 243: Wishbone Slave
## Description
Wishbone B4 slave interface.
## Module Interface
```verilog
module wishbone_slave(
input clk_i,\n input rst_i,\n input [7:0] adr_i,\n input [31:0] dat_i,\n output [31:0] dat_o,\n input we_i,\n input stb_i,\n input cyc_i,\n output ack_o
);
... | problem_id: '243'
title: Wishbone Slave
level: 3
category: bus
description: Wishbone B4 slave interface.
module_name: wishbone_slave
ports:
clk_i:
direction: input
width: 1
rst_i:
direction: input
width: 1
adr_i:
direction: input
width: 8
dat_i:
direction: input
width: 32
dat_o... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
244_apb_slave | bundles/L3_module/244_apb_slave | APB Slave | L3_module | L3 | 244 | # Problem 244: APB Slave
## Description
AMBA APB slave interface.
## Module Interface
```verilog
module apb_slave(
input pclk,\n input presetn,\n input [31:0] paddr,\n input pwrite,\n input [31:0] pwdata,\n input psel,\n input penable,\n output [31:0] prdata,\n output pready
);
// Yo... | problem_id: '244'
title: APB Slave
level: 3
category: bus
description: AMBA APB slave interface.
module_name: apb_slave
ports:
pclk:
direction: input
width: 1
presetn:
direction: input
width: 1
paddr:
direction: input
width: 32
pwrite:
direction: input
width: 1
pwdata:
dire... | `timescale 1ns/1ps
module tb;
reg clk; initial clk=0; always #5 clk=~clk;
reg rst;
initial begin
rst = 1; #20; rst = 0; #100;
$display("TEST PASSED");
$finish;
end
initial begin #100000; $display("TIMEOUT"); $finish; end
endmodule
|
245_mac_8x8 | bundles/L3_module/245_mac_8x8 | 8-bit x 8-bit MAC | L3_module | L1 | 245 | # 8-bit x 8-bit MAC
## Description
8-bit Multiply-Accumulate unit.
## Module Interface
```verilog
module mac_8x8 (
input clk, input rst, input [7:0] a, input [7:0] b, output [23:0] acc
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `a`: input/8
- `b`: input/8
- `acc`: output/2... | problem_id: 245
title: 8-bit x 8-bit MAC
difficulty: L3
module_name: mac_8x8
description: 8-bit Multiply-Accumulate unit.
ports:
clk: input/1
rst: input/1
a: input/8
b: input/8
acc: output/24
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
246_fir_4tap | bundles/L3_module/246_fir_4tap | FIR Filter 4-tap | L3_module | L1 | 246 | # FIR Filter 4-tap
## Description
4-tap FIR filter with fixed coefficients [1, 2, 2, 1]/8.
## Module Interface
```verilog
module fir_4tap (
input clk, input rst, input [7:0] din, output [15:0] dout
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `din`: input/8
- `dout`: output/16
... | problem_id: 246
title: FIR Filter 4-tap
difficulty: L3
module_name: fir_4tap
description: 4-tap FIR filter with fixed coefficients [1, 2, 2, 1]/8.
ports:
clk: input/1
rst: input/1
din: input/8
dout: output/16
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
247_moving_avg | bundles/L3_module/247_moving_avg | Moving Average Filter | L3_module | L1 | 247 | # Moving Average Filter
## Description
8-sample moving average filter.
## Module Interface
```verilog
module moving_avg (
input clk, input rst, input [7:0] din, output [7:0] dout
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `din`: input/8
- `dout`: output/8
## Functionality
Th... | problem_id: 247
title: Moving Average Filter
difficulty: L3
module_name: moving_avg
description: 8-sample moving average filter.
ports:
clk: input/1
rst: input/1
din: input/8
dout: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
248_cic_integrator | bundles/L3_module/248_cic_integrator | CIC Filter Integrator | L3_module | L1 | 248 | # CIC Filter Integrator
## Description
CIC filter integrator stage.
## Module Interface
```verilog
module cic_integrator (
input clk, input rst, input [7:0] din, output [15:0] dout
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `din`: input/8
- `dout`: output/16
## Functionality
... | problem_id: 248
title: CIC Filter Integrator
difficulty: L3
module_name: cic_integrator
description: CIC filter integrator stage.
ports:
clk: input/1
rst: input/1
din: input/8
dout: output/16
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
249_decimator_2 | bundles/L3_module/249_decimator_2 | Decimator by 2 | L3_module | L1 | 249 | # Decimator by 2
## Description
Decimation filter (downsample by 2).
## Module Interface
```verilog
module decimator_2 (
input clk, input rst, input [7:0] din, output [7:0] dout, output valid
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `din`: input/8
- `dout`: output/8
- `v... | problem_id: 249
title: Decimator by 2
difficulty: L3
module_name: decimator_2
description: Decimation filter (downsample by 2).
ports:
clk: input/1
rst: input/1
din: input/8
dout: output/8
valid: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
250_interpolator_2 | bundles/L3_module/250_interpolator_2 | Interpolator by 2 | L3_module | L1 | 250 | # Interpolator by 2
## Description
Interpolation filter (upsample by 2).
## Module Interface
```verilog
module interpolator_2 (
input clk, input rst, input [7:0] din, input din_valid, output [7:0] dout
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `din`: input/8
- `din_valid`... | problem_id: 250
title: Interpolator by 2
difficulty: L3
module_name: interpolator_2
description: Interpolation filter (upsample by 2).
ports:
clk: input/1
rst: input/1
din: input/8
din_valid: input/1
dout: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
251_nco | bundles/L3_module/251_nco | NCO (Numerically Controlled Oscillator) | L3_module | L1 | 251 | # NCO (Numerically Controlled Oscillator)
## Description
Simple NCO generating sine and cosine.
## Module Interface
```verilog
module nco (
input clk, input rst, input [15:0] freq_word, output [7:0] sin, output [7:0] cos
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `freq_wor... | problem_id: 251
title: NCO (Numerically Controlled Oscillator)
difficulty: L3
module_name: nco
description: Simple NCO generating sine and cosine.
ports:
clk: input/1
rst: input/1
freq_word: input/16
sin: output/8
cos: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
252_cordic_rotate | bundles/L3_module/252_cordic_rotate | CORDIC Rotator | L3_module | L1 | 252 | # CORDIC Rotator
## Description
CORDIC rotation mode (4 iterations).
## Module Interface
```verilog
module cordic_rotate (
input clk, input rst, input [15:0] x_in, input [15:0] y_in, input [7:0] theta, output [15:0] x_out, output [15:0] y_out
);
```
## Port Specification
- `clk`: input/... | problem_id: 252
title: CORDIC Rotator
difficulty: L3
module_name: cordic_rotate
description: CORDIC rotation mode (4 iterations).
ports:
clk: input/1
rst: input/1
x_in: input/16
y_in: input/16
theta: input/8
x_out: output/16
y_out: output/16
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
261_manchester_enc | bundles/L3_module/261_manchester_enc | Manchester Encoder | L3_module | L1 | 261 | # Manchester Encoder
## Description
Manchester encoding (IEEE 802.3).
## Module Interface
```verilog
module manchester_enc (
input clk, input rst, input data, output encoded
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `data`: input/1
- `encoded`: output/1
## Functionality
Imp... | problem_id: 261
title: Manchester Encoder
difficulty: L3
module_name: manchester_enc
description: Manchester encoding (IEEE 802.3).
ports:
clk: input/1
rst: input/1
data: input/1
encoded: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
262_manchester_dec | bundles/L3_module/262_manchester_dec | Manchester Decoder | L3_module | L1 | 262 | # Manchester Decoder
## Description
Manchester decoding.
## Module Interface
```verilog
module manchester_dec (
input clk, input rst, input encoded, output data, output valid
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `encoded`: input/1
- `data`: output/1
- `valid`: output... | problem_id: 262
title: Manchester Decoder
difficulty: L3
module_name: manchester_dec
description: Manchester decoding.
ports:
clk: input/1
rst: input/1
encoded: input/1
data: output/1
valid: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
263_8b10b_enc | bundles/L3_module/263_8b10b_enc | 8B/10B Encoder Simplified | L3_module | L1 | 263 | # 8B/10B Encoder Simplified
## Description
Simplified 8B/10B encoder (subset of codes).
## Module Interface
```verilog
module 8b10b_enc (
input clk, input rst, input [7:0] din, output [9:0] dout
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `din`: input/8
- `dout`: output/10
## ... | problem_id: 263
title: 8B/10B Encoder Simplified
difficulty: L3
module_name: 8b10b_enc
description: Simplified 8B/10B encoder (subset of codes).
ports:
clk: input/1
rst: input/1
din: input/8
dout: output/10
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
264_crc8_calc | bundles/L3_module/264_crc8_calc | CRC-8 Calculator | L3_module | L1 | 264 | # CRC-8 Calculator
## Description
CRC-8 calculator (polynomial: 0x07).
## Module Interface
```verilog
module crc8_calc (
input clk, input rst, input [7:0] data, input data_valid, output [7:0] crc
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `data`: input/8
- `data_valid`: in... | problem_id: 264
title: CRC-8 Calculator
difficulty: L3
module_name: crc8_calc
description: 'CRC-8 calculator (polynomial: 0x07).'
ports:
clk: input/1
rst: input/1
data: input/8
data_valid: input/1
crc: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
265_crc16_calc | bundles/L3_module/265_crc16_calc | CRC-16 Calculator | L3_module | L1 | 265 | # CRC-16 Calculator
## Description
CRC-16 calculator (polynomial: 0x1021).
## Module Interface
```verilog
module crc16_calc (
input clk, input rst, input [7:0] data, input data_valid, output [15:0] crc
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `data`: input/8
- `data_vali... | problem_id: 265
title: CRC-16 Calculator
difficulty: L3
module_name: crc16_calc
description: 'CRC-16 calculator (polynomial: 0x1021).'
ports:
clk: input/1
rst: input/1
data: input/8
data_valid: input/1
crc: output/16
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
266_frame_packer | bundles/L3_module/266_frame_packer | Frame Packer | L3_module | L1 | 266 | # Frame Packer
## Description
Pack bytes into 8-byte frame with SOF/EOF markers.
## Module Interface
```verilog
module frame_packer (
input clk, input rst, input [7:0] data, input sof, input eof, output [63:0] frame
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `data`: in... | problem_id: 266
title: Frame Packer
difficulty: L3
module_name: frame_packer
description: Pack bytes into 8-byte frame with SOF/EOF markers.
ports:
clk: input/1
rst: input/1
data: input/8
sof: input/1
eof: input/1
frame: output/64
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
267_frame_unpacker | bundles/L3_module/267_frame_unpacker | Frame Unpacker | L3_module | L1 | 267 | # Frame Unpacker
## Description
Unpack frame into byte stream.
## Module Interface
```verilog
module frame_unpacker (
input clk, input rst, input [63:0] frame, output [7:0] data, output valid
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- `frame`: input/64
- `data`: output/8
-... | problem_id: 267
title: Frame Unpacker
difficulty: L3
module_name: frame_unpacker
description: Unpack frame into byte stream.
ports:
clk: input/1
rst: input/1
frame: input/64
data: output/8
valid: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
268_byte_stuffer | bundles/L3_module/268_byte_stuffer | Byte Stuffer | L3_module | L1 | 268 | # Byte Stuffer
## Description
COBS (Consistent Overhead Byte Stuffing) encoder.
## Module Interface
```verilog
module byte_stuffer (
input clk, input rst, input [7:0] din, input din_valid, output [7:0] dout, output dout_valid
);
```
## Port Specification
- `clk`: input/1
- `rst`: input/1
- ... | problem_id: 268
title: Byte Stuffer
difficulty: L3
module_name: byte_stuffer
description: COBS (Consistent Overhead Byte Stuffing) encoder.
ports:
clk: input/1
rst: input/1
din: input/8
din_valid: input/1
dout: output/8
dout_valid: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
273_img_buffer_3x3 | bundles/L3_module/273_img_buffer_3x3 | 3x3 Image Buffer | L3_module | L1 | 273 | # 3x3 Image Buffer
## Description
3x3 sliding window buffer for image processing.
## Module Interface
```verilog
module img_buffer_3x3 (
input clk, input rst, input [7:0] pixel_in, output [23:0] row0, output [23:0] row1, output [23:0] row2
);
```
## Port Specification
- `clk`: input/1
- `rs... | problem_id: 273
title: 3x3 Image Buffer
difficulty: L3
module_name: img_buffer_3x3
description: 3x3 sliding window buffer for image processing.
ports:
clk: input/1
rst: input/1
pixel_in: input/8
row0: output/24
row1: output/24
row2: output/24
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
274_sobel_x | bundles/L3_module/274_sobel_x | Sobel X Filter | L3_module | L1 | 274 | # Sobel X Filter
## Description
Sobel X gradient filter.
## Module Interface
```verilog
module sobel_x (
input clk, input [7:0] p00, input [7:0] p01, input [7:0] p02, input [7:0] p10, input [7:0] p12, input [7:0] p20, input [7:0] p21, input [7:0] p22, output [15:0] gx
);
```
... | problem_id: 274
title: Sobel X Filter
difficulty: L3
module_name: sobel_x
description: Sobel X gradient filter.
ports:
clk: input/1
p00: input/8
p01: input/8
p02: input/8
p10: input/8
p12: input/8
p20: input/8
p21: input/8
p22: input/8
gx: output/16
testbench: testbench.v
timeout: 10
test_cases: 100... | `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
275_sobel_y | bundles/L3_module/275_sobel_y | Sobel Y Filter | L3_module | L1 | 275 | # Sobel Y Filter
## Description
Sobel Y gradient filter.
## Module Interface
```verilog
module sobel_y (
input clk, input [7:0] p00, input [7:0] p01, input [7:0] p02, input [7:0] p10, input [7:0] p12, input [7:0] p20, input [7:0] p21, input [7:0] p22, output [15:0] gy
);
```
... | problem_id: 275
title: Sobel Y Filter
difficulty: L3
module_name: sobel_y
description: Sobel Y gradient filter.
ports:
clk: input/1
p00: input/8
p01: input/8
p02: input/8
p10: input/8
p12: input/8
p20: input/8
p21: input/8
p22: input/8
gy: output/16
testbench: testbench.v
timeout: 10
test_cases: 100... | `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
276_box_blur_3x3 | bundles/L3_module/276_box_blur_3x3 | Box Blur 3x3 | L3_module | L1 | 276 | # Box Blur 3x3
## Description
3x3 box blur filter.
## Module Interface
```verilog
module box_blur_3x3 (
input clk, input [7:0] p00, input [7:0] p01, input [7:0] p02, input [7:0] p10, input [7:0] p11, input [7:0] p12, input [7:0] p20, input [7:0] p21, input [7:0] p22, outpu... | problem_id: 276
title: Box Blur 3x3
difficulty: L3
module_name: box_blur_3x3
description: 3x3 box blur filter.
ports:
clk: input/1
p00: input/8
p01: input/8
p02: input/8
p10: input/8
p11: input/8
p12: input/8
p20: input/8
p21: input/8
p22: input/8
blurred: output/8
testbench: testbench.v
timeout: ... | `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
277_median_3x3 | bundles/L3_module/277_median_3x3 | Median Filter 3x3 | L3_module | L1 | 277 | # Median Filter 3x3
## Description
3x3 median filter for noise reduction.
## Module Interface
```verilog
module median_3x3 (
input clk, input [7:0] p0, input [7:0] p1, input [7:0] p2, input [7:0] p3, input [7:0] p4, input [7:0] p5, input [7:0] p6, input [7:0] p7, input [7:0] p... | problem_id: 277
title: Median Filter 3x3
difficulty: L3
module_name: median_3x3
description: 3x3 median filter for noise reduction.
ports:
clk: input/1
p0: input/8
p1: input/8
p2: input/8
p3: input/8
p4: input/8
p5: input/8
p6: input/8
p7: input/8
p8: input/8
median: output/8
testbench: testbench.... | `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
278_rgb2gray | bundles/L3_module/278_rgb2gray | RGB to Grayscale | L3_module | L1 | 278 | # RGB to Grayscale
## Description
RGB to grayscale conversion (Y = 0.299R + 0.587G + 0.114B).
## Module Interface
```verilog
module rgb2gray (
input [7:0] r, input [7:0] g, input [7:0] b, output [7:0] gray
);
```
## Port Specification
- `r`: input/8
- `g`: input/8
- `b`: input/8
- `gray`: output/8
... | problem_id: 278
title: RGB to Grayscale
difficulty: L3
module_name: rgb2gray
description: RGB to grayscale conversion (Y = 0.299R + 0.587G + 0.114B).
ports:
r: input/8
g: input/8
b: input/8
gray: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb; reg clk; reg [7:0] r,g,b; wire [7:0] gray;
rgb2gray dut(.clk(clk),.r(r),.g(g),.b(b),.gray(gray));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0;
r=255;g=255;b=255;@(posedge clk);#1;@(posedge clk);#1;
$display("white: gray=%0d",gray);
r=0;g=0;b=0;@(posedge clk);#1;@(... |
279_threshold_filter | bundles/L3_module/279_threshold_filter | Threshold Filter | L3_module | L1 | 279 | # Threshold Filter
## Description
Binary threshold filter.
## Module Interface
```verilog
module threshold_filter (
input [7:0] pixel, input [7:0] threshold, output binary
);
```
## Port Specification
- `pixel`: input/8
- `threshold`: input/8
- `binary`: output/1
## Functionality
This module implemen... | problem_id: 279
title: Threshold Filter
difficulty: L3
module_name: threshold_filter
description: Binary threshold filter.
ports:
pixel: input/8
threshold: input/8
binary: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb; reg clk; reg [7:0] pixel, threshold; wire out;
threshold_filter dut(.clk(clk),.pixel(pixel),.threshold(threshold),.out(out));
initial clk=0; always #5 clk=~clk;
integer fail;
initial begin fail=0; threshold=128;
pixel=200;@(posedge clk);#1;if(out!==1)fail=fail+1;
pixel=50;@(posedge clk);#1... |
280_histogram_cnt | bundles/L3_module/280_histogram_cnt | Histogram Counter | L3_module | L1 | 280 | # Histogram Counter
## Description
Image histogram counter (256 bins).
## Module Interface
```verilog
module histogram_cnt (
input clk, input rst, input [7:0] pixel, input pixel_valid, input [7:0] bin_addr, output [15:0] bin_count
);
```
## Port Specification
- `clk`: input/1
- `rst`: input... | problem_id: 280
title: Histogram Counter
difficulty: L3
module_name: histogram_cnt
description: Image histogram counter (256 bins).
ports:
clk: input/1
rst: input/1
pixel: input/8
pixel_valid: input/1
bin_addr: input/8
bin_count: output/16
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb;
initial begin
#10;
$display("TEST PASSED");
$finish;
end
endmodule
|
281_alu_16bit_flags | bundles/L3_module/281_alu_16bit_flags | 16-bit ALU with Flags | L3_module | L3 | 281 | # Problem 281: 16-bit ALU with Flags
**Level**: 3 (Module Design)
**Category**: alu
## Description
Design a 16-bit Arithmetic Logic Unit (ALU) that supports 9 operations and produces condition flags.
## Module Interface
```verilog
module alu_16bit_flags(
input clk,
input [15:0] a,
input [15:0... | problem_id: "281"
title: "16-bit ALU with Flags"
level: 3
category: "alu"
description: "16-bit ALU supporting ADD, SUB, AND, OR, XOR, NOT, SHL, SHR, CMP with zero/carry/negative/overflow flags"
module_name: "alu_16bit_flags"
ports:
clk:
direction: "input"
width: "1"
a:
direction: "input"
width: "16... | `timescale 1ns/1ps
module tb_alu_16bit_flags;
reg clk;
reg [15:0] a, b;
reg [3:0] op;
wire [15:0] result;
wire zero, carry, negative, overflow;
alu_16bit_flags uut (
.clk(clk), .a(a), .b(b), .op(op),
.result(result), .zero(zero), .carry(carry),
.negat... |
282_regfile_8x16 | bundles/L3_module/282_regfile_8x16 | Dual-Port Register File (8x16) | L3_module | L3 | 282 | # Problem 282: Dual-Port Register File (8x16)
**Level**: 3 (Module Design)
**Category**: register_file
## Description
Design an 8-register by 16-bit register file with two asynchronous read ports and one synchronous write port. Register 0 is hardwired to zero.
## Module Interface
```verilog
module regfile_8x16(
... | problem_id: "282"
title: "Dual-Port Register File (8x16)"
level: 3
category: "register_file"
description: "8-register x 16-bit register file with two async read ports and one sync write port. Register 0 hardwired to zero."
module_name: "regfile_8x16"
ports:
clk:
direction: "input"
width: "1"
rst:
direc... | `timescale 1ns/1ps
module tb_regfile_8x16;
reg clk;
reg rst;
reg we;
reg [2:0] waddr;
reg [15:0] wdata;
reg [2:0] raddr1, raddr2;
wire [15:0] rdata1, rdata2;
regfile_8x16 uut (
.clk(clk), .rst(rst), .we(we),
.waddr(waddr), .wdata(wdata),
... |
283_sync_ram_32x8 | bundles/L3_module/283_sync_ram_32x8 | Single-Port Synchronous RAM (32x8) | L3_module | L3 | 283 | # Problem 283: Single-Port Synchronous RAM (32x8)
**Level**: 3 (Module Design)
**Category**: memory
## Description
Design a single-port synchronous RAM with 32 entries of 8 bits each. Both read and write operations are synchronous (clocked).
## Module Interface
```verilog
module sync_ram_32x8(
input clk... | problem_id: "283"
title: "Single-Port Synchronous RAM (32x8)"
level: 3
category: "memory"
description: "32-entry x 8-bit synchronous RAM with registered read output"
module_name: "sync_ram_32x8"
ports:
clk:
direction: "input"
width: "1"
we:
direction: "input"
width: "1"
addr:
direction: "inpu... | `timescale 1ns/1ps
module tb_sync_ram_32x8;
reg clk;
reg we;
reg [4:0] addr;
reg [7:0] din;
wire [7:0] dout;
sync_ram_32x8 uut (
.clk(clk), .we(we), .addr(addr), .din(din), .dout(dout)
);
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;
... |
284_sync_fifo_8x16 | bundles/L3_module/284_sync_fifo_8x16 | Synchronous FIFO (8-deep, 16-bit) | L3_module | L3 | 284 | # Problem 284: Synchronous FIFO (8-deep, 16-bit)
**Level**: 3 (Module Design)
**Category**: memory
## Description
Design a synchronous FIFO (First-In, First-Out) buffer with 8 entries, each 16 bits wide. The FIFO provides full/empty status flags and an occupancy count.
## Module Interface
```verilog
module sync_fi... | problem_id: "284"
title: "Synchronous FIFO (8-deep, 16-bit)"
level: 3
category: "memory"
description: "8-entry 16-bit synchronous FIFO with full/empty flags and occupancy count"
module_name: "sync_fifo_8x16"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
wr_en:
d... | `timescale 1ns/1ps
module tb_sync_fifo_8x16;
reg clk;
reg rst;
reg wr_en, rd_en;
reg [15:0] din;
wire [15:0] dout;
wire full, empty;
wire [3:0] count;
sync_fifo_8x16 uut (
.clk(clk), .rst(rst),
.wr_en(wr_en), .rd_en(rd_en), .din(din),
... |
285_barrel_shifter_16 | bundles/L3_module/285_barrel_shifter_16 | 16-bit Barrel Shifter | L3_module | L3 | 285 | # Problem 285: 16-bit Barrel Shifter
**Level**: 3 (Module Design)
**Category**: alu
## Description
Design a combinational 16-bit barrel shifter that supports left shift, right logical shift, and right arithmetic shift.
## Module Interface
```verilog
module barrel_shifter_16(
input [15:0] data,
input [3:0... | problem_id: "285"
title: "16-bit Barrel Shifter"
level: 3
category: "alu"
description: "Combinational 16-bit barrel shifter supporting left/right logical and arithmetic shifts"
module_name: "barrel_shifter_16"
ports:
data:
direction: "input"
width: "16"
shamt:
direction: "input"
width: "4"
dir:
... | `timescale 1ns/1ps
module tb_barrel_shifter_16;
reg [15:0] data;
reg [3:0] shamt;
reg dir, arith;
wire [15:0] result;
barrel_shifter_16 uut (
.data(data), .shamt(shamt), .dir(dir), .arith(arith), .result(result)
);
integer pass_count = 0;
integer fail_count = 0;
... |
286_priority_enc_32 | bundles/L3_module/286_priority_enc_32 | Priority Encoder (32-input) | L3_module | L3 | 286 | # Problem 286: Priority Encoder (32-input)
**Level**: 3 (Module Design)
**Category**: alu
## Description
Design a combinational 32-input priority encoder that finds the position of the highest-priority (most significant) set bit.
## Module Interface
```verilog
module priority_enc_32(
input [31:0] req,
out... | problem_id: "286"
title: "Priority Encoder (32-input)"
level: 3
category: "alu"
description: "Combinational 32-input priority encoder that encodes the position of the highest-priority (MSB) set bit"
module_name: "priority_enc_32"
ports:
req:
direction: "input"
width: "32"
enc:
direction: "output"
w... | `timescale 1ns/1ps
module tb_priority_enc_32;
reg [31:0] req;
wire [4:0] enc;
wire valid;
priority_enc_32 uut (
.req(req), .enc(enc), .valid(valid)
);
integer pass_count = 0;
integer fail_count = 0;
integer test_num = 0;
task check;
input [31:0] treq;
... |
287_dual_port_ram_64x8 | bundles/L3_module/287_dual_port_ram_64x8 | Dual-Port RAM (64x8) | L3_module | L3 | 287 | # Problem 287: Dual-Port RAM (64x8)
**Level**: 3 (Module Design)
**Category**: memory
## Problem Description
Implement a true dual-port synchronous RAM with 64 entries of 8 bits each. Both ports can independently read and write on every clock cycle.
## Module Interface
```verilog
module dual_port_ram_64x8(
inp... | problem_id: "287"
title: "Dual-Port RAM (64x8)"
level: 3
category: "memory"
description: "True dual-port synchronous RAM, 64 entries x 8 bits, with port A priority on write collision"
module_name: "dual_port_ram_64x8"
ports:
clk:
direction: "input"
width: "1"
we_a:
direction: "input"
width: "1"
we... | `timescale 1ns/1ps
module tb_dual_port_ram_64x8;
reg clk;
reg we_a, we_b;
reg [5:0] addr_a, addr_b;
reg [7:0] din_a, din_b;
wire [7:0] dout_a, dout_b;
dual_port_ram_64x8 uut(
.clk(clk),
.we_a(we_a), .we_b(we_b),
.addr_a(addr_a), .addr_b(addr_b),
.din_a(din_a), .... |
288_rom_sine_256x8 | bundles/L3_module/288_rom_sine_256x8 | ROM Lookup Table (256x8, Sine Wave) | L3_module | L3 | 288 | # Problem 288: ROM Lookup Table (256x8, Sine Wave)
**Level**: 3 (Module Design)
**Category**: memory
## Problem Description
Implement a synchronous ROM that stores a 256-entry sine lookup table with 8-bit resolution. The table represents one full period of a sine wave, scaled and offset to the unsigned range 0-255.
... | problem_id: "288"
title: "ROM Lookup Table (256x8, Sine Wave)"
level: 3
category: "memory"
description: "Synchronous ROM storing a 256-entry 8-bit sine quarter-wave lookup table"
module_name: "rom_sine_256x8"
ports:
clk:
direction: "input"
width: "1"
addr:
direction: "input"
width: "8"
data:
d... | `timescale 1ns/1ps
module tb_rom_sine_256x8;
reg clk;
reg [7:0] addr;
wire [7:0] data;
rom_sine_256x8 uut(
.clk(clk),
.addr(addr),
.data(data)
);
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;
integer fail_count = 0;
integer test_num = ... |
289_uart_tx_8n1 | bundles/L3_module/289_uart_tx_8n1 | UART Transmitter (8N1) | L3_module | L3 | 289 | # Problem 289: UART Transmitter (8N1)
**Level**: 3 (Module Design)
**Category**: serial_comm
## Problem Description
Implement a UART transmitter using 8N1 format (8 data bits, no parity, 1 stop bit). For simplicity, there is no baud rate divider -- each bit is transmitted for exactly one clock cycle.
## Module Inte... | problem_id: "289"
title: "UART Transmitter (8N1)"
level: 3
category: "serial_comm"
description: "UART transmitter with 8 data bits, no parity, 1 stop bit, 1 bit per clock"
module_name: "uart_tx_8n1"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
tx_start:
directio... | `timescale 1ns/1ps
module tb_uart_tx_8n1;
reg clk, rst, tx_start;
reg [7:0] tx_data;
wire tx_out, tx_busy;
uart_tx_8n1 uut(
.clk(clk), .rst(rst),
.tx_start(tx_start), .tx_data(tx_data),
.tx_out(tx_out), .tx_busy(tx_busy)
);
initial clk = 0;
always #5 clk = ~clk;
... |
290_uart_rx_8n1 | bundles/L3_module/290_uart_rx_8n1 | UART Receiver (8N1) | L3_module | L3 | 290 | # Problem 290: UART Receiver (8N1)
**Level**: 3 (Module Design)
**Category**: serial_comm
## Problem Description
Implement a UART receiver using 8N1 format (8 data bits, no parity, 1 stop bit). For simplicity, there is no oversampling -- each bit is sampled once per clock cycle (1 bit per clock).
## Module Interfac... | problem_id: "290"
title: "UART Receiver (8N1)"
level: 3
category: "serial_comm"
description: "UART receiver with 8 data bits, no parity, 1 stop bit, 1 bit per clock"
module_name: "uart_rx_8n1"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
rx_in:
direction: "input... | `timescale 1ns/1ps
module tb_uart_rx_8n1;
reg clk, rst, rx_in;
wire [7:0] rx_data;
wire rx_valid;
uart_rx_8n1 uut(
.clk(clk), .rst(rst),
.rx_in(rx_in),
.rx_data(rx_data), .rx_valid(rx_valid)
);
initial clk = 0;
always #5 clk = ~clk;
integer pass_count = 0;
... |
291_spi_master_mode0 | bundles/L3_module/291_spi_master_mode0 | SPI Master (Mode 0, 8-bit) | L3_module | L3 | 291 | # Problem 291: SPI Master (Mode 0, 8-bit)
**Level**: 3 (Module Design)
**Category**: serial_comm
## Problem Description
Implement an SPI master controller operating in Mode 0 (CPOL=0, CPHA=0) for 8-bit transfers.
## Module Interface
```verilog
module spi_master_mode0(
input clk,
input rst,
input start,... | problem_id: "291"
title: "SPI Master (Mode 0, 8-bit)"
level: 3
category: "serial_comm"
description: "SPI master controller, Mode 0 (CPOL=0, CPHA=0), 8-bit transfers"
module_name: "spi_master_mode0"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
start:
direction: "... | `timescale 1ns/1ps
module tb_spi_master_mode0;
reg clk, rst, start;
reg [7:0] mosi_data;
reg miso;
wire sclk, mosi, cs_n, done;
wire [7:0] rx_data;
spi_master_mode0 uut(
.clk(clk), .rst(rst),
.start(start), .mosi_data(mosi_data),
.miso(miso),
.sclk(sclk), .mosi(... |
292_i2c_start_stop | bundles/L3_module/292_i2c_start_stop | I2C Start/Stop Condition Generator | L3_module | L3 | 292 | # Problem 292: I2C Start/Stop Condition Generator
**Level**: 3 (Module Design)
**Category**: serial_comm
## Problem Description
Implement a module that generates I2C start and stop conditions on the SCL and SDA lines using a small FSM.
## Module Interface
```verilog
module i2c_start_stop(
input clk,
input ... | problem_id: "292"
title: "I2C Start/Stop Condition Generator"
level: 3
category: "serial_comm"
description: "Generate I2C start condition (SDA falls while SCL high) and stop condition (SDA rises while SCL high)"
module_name: "i2c_start_stop"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "inp... | `timescale 1ns/1ps
module tb_i2c_start_stop;
reg clk, rst;
reg generate_start, generate_stop;
wire scl, sda, busy;
i2c_start_stop uut(
.clk(clk), .rst(rst),
.generate_start(generate_start),
.generate_stop(generate_stop),
.scl(scl), .sda(sda), .busy(busy)
);
ini... |
293_pwm_gen_config | bundles/L3_module/293_pwm_gen_config | PWM Generator with Configurable Frequency | L3_module | L3 | 293 | # Problem 293: PWM Generator with Configurable Frequency
**Level**: 3 (Module Design)
**Category**: peripheral
## Problem Description
Implement a programmable PWM (Pulse Width Modulation) generator with configurable period and duty cycle.
## Module Interface
```verilog
module pwm_gen_config(
input clk,
inp... | problem_id: "293"
title: "PWM Generator with Configurable Frequency"
level: 3
category: "peripheral"
description: "Programmable PWM generator with configurable period and duty cycle"
module_name: "pwm_gen_config"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
enable:
... | `timescale 1ns/1ps
module tb_pwm_gen_config;
reg clk, rst, enable;
reg [7:0] period, duty;
wire pwm_out;
pwm_gen_config uut(
.clk(clk), .rst(rst),
.enable(enable),
.period(period), .duty(duty),
.pwm_out(pwm_out)
);
initial clk = 0;
always #5 clk = ~clk;
... |
294_debouncer_config | bundles/L3_module/294_debouncer_config | Debouncer with Configurable Delay | L3_module | L3 | 294 | # Problem 294: Debouncer with Configurable Delay
**Level**: 3 (Module Design)
**Category**: peripheral
## Description
Design a debouncer that filters out glitches from a noisy input signal. The output should only change after the input has been stable for a configurable number of clock cycles.
## Module Interface
... | problem_id: "294"
title: "Debouncer with Configurable Delay"
level: 3
category: "peripheral"
description: "Debounce a noisy input signal with configurable stable-cycle count"
module_name: "debouncer_config"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
noisy_in:
... | `timescale 1ns/1ps
module tb_debouncer_config;
reg clk;
reg rst;
reg noisy_in;
reg [7:0] delay_val;
wire clean_out;
debouncer_config uut (
.clk(clk),
.rst(rst),
.noisy_in(noisy_in),
.delay_val(delay_val),
.clean_out(clean_out)
);
initial clk = ... |
295_interrupt_ctrl_4 | bundles/L3_module/295_interrupt_ctrl_4 | Edge-Triggered Interrupt Controller (4-source) | L3_module | L3 | 295 | # Problem 295: Edge-Triggered Interrupt Controller (4-source)
**Level**: 3 (Module Design)
**Category**: peripheral
## Description
Design a 4-source edge-triggered interrupt controller. The controller detects rising edges on interrupt request lines, maintains pending status, supports masking, and provides a combined... | problem_id: "295"
title: "Edge-Triggered Interrupt Controller (4-source)"
level: 3
category: "peripheral"
description: "4-source edge-triggered interrupt controller with mask and acknowledge"
module_name: "interrupt_ctrl_4"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1... | `timescale 1ns/1ps
module tb_interrupt_ctrl_4;
reg clk;
reg rst;
reg [3:0] irq;
reg [3:0] ack;
reg [3:0] mask;
wire [3:0] pending;
wire irq_out;
interrupt_ctrl_4 uut (
.clk(clk),
.rst(rst),
.irq(irq),
.ack(ack),
.mask(mask),
.pending(pen... |
296_signed_mult_pipe_8x8 | bundles/L3_module/296_signed_mult_pipe_8x8 | Signed 8x8 Multiplier with Pipeline | L3_module | L3 | 296 | # Problem 296: Signed 8x8 Multiplier with Pipeline
**Level**: 3 (Module Design)
**Category**: arithmetic
## Description
Design a 2-stage pipelined signed 8-bit multiplier. The pipeline introduces a 2-clock-cycle latency from input to output.
## Module Interface
```verilog
module signed_mult_pipe_8x8(
input clk... | problem_id: "296"
title: "Signed 8x8 Multiplier with Pipeline"
level: 3
category: "arithmetic"
description: "2-stage pipelined signed 8-bit multiplier"
module_name: "signed_mult_pipe_8x8"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
a:
direction: "input"
wi... | `timescale 1ns/1ps
module tb_signed_mult_pipe_8x8;
reg clk;
reg rst;
reg signed [7:0] a;
reg signed [7:0] b;
reg valid_in;
wire signed [15:0] product;
wire valid_out;
signed_mult_pipe_8x8 uut (
.clk(clk),
.rst(rst),
.a(a),
.b(b),
.valid_in(valid... |
297_div_16bit_seq | bundles/L3_module/297_div_16bit_seq | Unsigned 16-bit Divider (Sequential) | L3_module | L3 | 297 | # Problem 297: Unsigned 16-bit Divider (Sequential)
**Level**: 3 (Module Design)
**Category**: arithmetic
## Description
Design a sequential restoring division unit for unsigned 16-bit operands. The divider takes 16 clock cycles to complete a division operation.
## Module Interface
```verilog
module div_16bit_seq(... | problem_id: "297"
title: "Unsigned 16-bit Divider (Sequential)"
level: 3
category: "arithmetic"
description: "Sequential restoring divider for unsigned 16-bit operands"
module_name: "div_16bit_seq"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
start:
direction: ... | `timescale 1ns/1ps
module tb_div_16bit_seq;
reg clk;
reg rst;
reg start;
reg [15:0] dividend;
reg [15:0] divisor;
wire [15:0] quotient;
wire [15:0] remainder;
wire done;
wire busy;
div_16bit_seq uut (
.clk(clk),
.rst(rst),
.start(start),
.divide... |
298_crc16_parallel | bundles/L3_module/298_crc16_parallel | CRC-16 Calculator (Parallel, 8-bit input) | L3_module | L3 | 298 | # Problem 298: CRC-16 Calculator (Parallel, 8-bit input)
**Level**: 3 (Module Design)
**Category**: encoding
## Description
Design a CRC-16-CCITT calculator that processes 8 bits of data per clock cycle using parallel XOR logic.
## Module Interface
```verilog
module crc16_parallel(
input clk,
input rst,
... | problem_id: "298"
title: "CRC-16 Calculator (Parallel, 8-bit input)"
level: 3
category: "encoding"
description: "CRC-16-CCITT parallel calculator processing 8 bits per clock cycle"
module_name: "crc16_parallel"
ports:
clk:
direction: "input"
width: "1"
rst:
direction: "input"
width: "1"
data_in:
... | `timescale 1ns/1ps
module tb_crc16_parallel;
reg clk;
reg rst;
reg [7:0] data_in;
reg data_valid;
reg init;
wire [15:0] crc;
crc16_parallel uut (
.clk(clk),
.rst(rst),
.data_in(data_in),
.data_valid(data_valid),
.init(init),
.crc(crc)
);... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.