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 |
|---|---|---|---|---|---|---|---|---|
001_and_gate | bundles/L1_basic/001_and_gate | AND Gate | L1_basic | L1 | 001 | # Problem 001: AND Gate
## Description
Implement a 2-input AND gate.
## Module Interface
```verilog
module and_gate(
input a,
input b,
output y
);
// Your code here
endmodule
```
## Specification
- Inputs: `a`, `b` (1-bit each)
- Output: `y` (1-bit)
- Function: `y = a & b`
## Truth Table
| a | b... | problem_id: "001"
title: "AND Gate"
level: 1
category: "basic_gates"
description: "Implement a 2-input AND gate"
module_name: "and_gate"
ports:
a:
direction: "input"
width: "1"
b:
direction: "input"
width: "1"
y:
direction: "output"
width: "1"
testbench_file: "testbench.v"
timeout_compil... | `timescale 1ns/1ps
module tb_and_gate;
reg a, b;
wire y;
// Instantiate the module under test
and_gate uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing AND gate...");
// Test case 1: ... |
002_or_gate | bundles/L1_basic/002_or_gate | OR Gate | L1_basic | L1 | 002 | # Problem 002: OR Gate
## Description
Implement a 2-input OR gate.
## Module Interface
```verilog
module or_gate(
input a,
input b,
output y
);
// Your code here
endmodule
```
## Specification
- Inputs: `a`, `b` (1-bit each)
- Output: `y` (1-bit)
- Function: `y = a | b`
## Scoring
- Functional c... | problem_id: "002"
title: "OR Gate"
level: 1
category: "basic_gates"
description: "Implement a 2-input OR gate"
module_name: "or_gate"
ports:
a: { direction: "input", width: "1" }
b: { direction: "input", width: "1" }
y: { direction: "output", width: "1" }
testbench_file: "testbench.v"
timeout_compile: 10
timeout_... | `timescale 1ns/1ps
module tb_or_gate;
reg a, b;
wire y;
or_gate uut(.a(a), .b(b), .y(y));
integer pass_count = 0;
integer fail_count = 0;
task check(input expected);
begin
#10;
if (y === expected) pass_count = pass_count + 1;
else fail_count = fail_cou... |
003_not_gate | bundles/L1_basic/003_not_gate | NOT Gate | L1_basic | L1 | 003 | # Problem 003: NOT Gate
## Description
Implement a NOT gate (inverter).
## Module Interface
```verilog
module not_gate(
input a,
output y
);
// Your code here
endmodule
```
## Specification
- Input: `a` (1-bit)
- Output: `y` (1-bit)
- Function: `y = ~a`
## Scoring
- Functional correctness: 100%
| problem_id: "003"
title: "NOT Gate"
level: 1
category: "basic_gates"
description: "Implement a NOT gate"
module_name: "not_gate"
ports:
a: { direction: "input", width: "1" }
y: { direction: "output", width: "1" }
testbench_file: "testbench.v"
timeout_compile: 10
timeout_simulate: 10
require_synthesis: false
check_w... | `timescale 1ns/1ps
module tb_not_gate;
reg a;
wire y;
not_gate uut(.a(a), .y(y));
integer pass_count = 0;
integer fail_count = 0;
initial begin
a = 0; #10;
if (y === 1'b1) pass_count = pass_count + 1; else fail_count = fail_count + 1;
a = 1; #10;
if (y === 1'b0) p... |
004_xor_gate | bundles/L1_basic/004_xor_gate | XOR Gate | L1_basic | L1 | 004 | # Problem 004: XOR Gate
## Description
Implement a 2-input XOR gate.
## Module Interface
```verilog
module xor_gate(
input a,
input b,
output y
);
// Your code here
endmodule
```
## Specification
- Inputs: `a`, `b` (1-bit each)
- Output: `y` (1-bit)
- Function: `y = a ^ b`
## Scoring
- Functiona... | problem_id: "004"
title: "XOR Gate"
level: 1
category: "basic_gates"
description: "Implement a 2-input XOR gate"
module_name: "xor_gate"
ports:
a: { direction: "input", width: "1" }
b: { direction: "input", width: "1" }
y: { direction: "output", width: "1" }
testbench_file: "testbench.v"
timeout_compile: 10
timeo... | `timescale 1ns/1ps
module tb_xor_gate;
reg a, b;
wire y;
xor_gate uut(.a(a), .b(b), .y(y));
integer pass_count = 0;
integer fail_count = 0;
initial begin
a=0; b=0; #10; if (y===1'b0) pass_count=pass_count+1; else fail_count=fail_count+1;
a=0; b=1; #10; if (y===1'b1) pass_count=pa... |
005_mux2to1 | bundles/L1_basic/005_mux2to1 | 2-to-1 Multiplexer | L1_basic | L1 | 005 | # Problem 005: 2-to-1 Multiplexer
## Description
Implement a 2-to-1 multiplexer that selects between two 8-bit inputs.
## Module Interface
```verilog
module mux2to1(
input [7:0] a,
input [7:0] b,
input sel,
output [7:0] y
);
// Your code here
endmodule
```
## Specification
- When `sel = 0`: ou... | problem_id: "005"
title: "2-to-1 Multiplexer"
level: 1
category: "mux"
description: "Implement a 2-to-1 mux for 8-bit data"
module_name: "mux2to1"
ports:
a:
direction: "input"
width: "8"
b:
direction: "input"
width: "8"
sel:
direction: "input"
width: "1"
y:
direction: "output"
w... | `timescale 1ns/1ps
module tb_mux2to1;
reg [7:0] a, b;
reg sel;
wire [7:0] y;
mux2to1 uut (
.a(a),
.b(b),
.sel(sel),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
integer i;
initial begin
$display("Testing 2-to-1 Multiplexer...");... |
006_mux4to1 | bundles/L1_basic/006_mux4to1 | 4-to-1 Multiplexer | L1_basic | L1 | 006 | # Problem 006: 4-to-1 Multiplexer
## Description
Implement a 4-to-1 multiplexer with 8-bit data inputs.
## Module Interface
```verilog
module mux4to1(
input [7:0] a,
input [7:0] b,
input [7:0] c,
input [7:0] d,
input [1:0] sel,
output [7:0] y
);
// Your code here
endmodule
```
## Specif... | problem_id: "006"
title: "4-to-1 Multiplexer"
level: 1
category: "basic_mux"
description: "Implement a 4-to-1 multiplexer"
module_name: "mux4to1"
ports:
a: { direction: "input", width: "8" }
b: { direction: "input", width: "8" }
c: { direction: "input", width: "8" }
d: { direction: "input", width: "8" }
sel: ... | `timescale 1ns/1ps
module tb_mux4to1;
reg [7:0] a, b, c, d;
reg [1:0] sel;
wire [7:0] y;
mux4to1 uut(.a(a), .b(b), .c(c), .d(d), .sel(sel), .y(y));
integer pass_count = 0;
integer fail_count = 0;
integer i;
initial begin
a = 8'hAA; b = 8'hBB; c = 8'hCC; d = 8'hDD;
sel = 2... |
007_half_adder | bundles/L1_basic/007_half_adder | Half Adder | L1_basic | L1 | 007 | # Problem 007: Half Adder
## Description
Implement a half adder.
## Module Interface
```verilog
module half_adder(
input a,
input b,
output sum,
output carry
);
// Your code here
endmodule
```
## Specification
- `sum = a ^ b`
- `carry = a & b`
## Scoring
- Functional correctness: 100%
| problem_id: "007"
title: "Half Adder"
level: 1
category: "basic_arithmetic"
description: "Implement a half adder"
module_name: "half_adder"
ports:
a: { direction: "input", width: "1" }
b: { direction: "input", width: "1" }
sum: { direction: "output", width: "1" }
carry: { direction: "output", width: "1" }
testb... | `timescale 1ns/1ps
module tb_half_adder;
reg a, b;
wire sum, carry;
half_adder uut(.a(a), .b(b), .sum(sum), .carry(carry));
integer pass_count = 0;
integer fail_count = 0;
initial begin
a=0; b=0; #10; if (sum===1'b0 && carry===1'b0) pass_count=pass_count+1; else fail_count=fail_count+1;
... |
008_full_adder | bundles/L1_basic/008_full_adder | 8-bit Adder | L1_basic | L1 | 008 | # Problem 008: 8-bit Adder
## Description
Implement an 8-bit adder with carry output.
## Module Interface
```verilog
module adder8(
input [7:0] a,
input [7:0] b,
input cin,
output [7:0] sum,
output cout
);
// Your code here
endmodule
```
## Specification
- Compute `{cout, sum} = a + b + ci... | problem_id: "008"
title: "8-bit Adder"
level: 1
category: "arithmetic"
description: "Implement an 8-bit adder with carry"
module_name: "adder8"
ports:
a:
direction: "input"
width: "8"
b:
direction: "input"
width: "8"
cin:
direction: "input"
width: "1"
sum:
direction: "output"
wi... | `timescale 1ns/1ps
module tb_adder8;
reg [7:0] a, b;
reg cin;
wire [7:0] sum;
wire cout;
adder8 uut (
.a(a),
.b(b),
.cin(cin),
.sum(sum),
.cout(cout)
);
integer pass_count = 0;
integer fail_count = 0;
integer i;
reg [8:0] expected;
... |
009_decoder2to4 | bundles/L1_basic/009_decoder2to4 | 2-to-4 Decoder | L1_basic | L1 | 009 | # Problem 009: 2-to-4 Decoder
## Description
Implement a 2-to-4 decoder with enable.
## Module Interface
```verilog
module decoder2to4(
input [1:0] in,
input en,
output [3:0] out
);
// Your code here
endmodule
```
## Specification
- When `en = 1`: exactly one bit of `out` is high based on `in`
-... | problem_id: "009"
title: "2-to-4 Decoder"
level: 1
category: "basic_decoder"
description: "Implement a 2-to-4 decoder with enable"
module_name: "decoder2to4"
ports:
in: { direction: "input", width: "2" }
en: { direction: "input", width: "1" }
out: { direction: "output", width: "4" }
testbench_file: "testbench.v"
... | `timescale 1ns/1ps
module tb_decoder2to4;
reg [1:0] in;
reg en;
wire [3:0] out;
decoder2to4 uut(.in(in), .en(en), .out(out));
integer pass_count = 0;
integer fail_count = 0;
initial begin
// Enable tests
en=1; in=2'b00; #10; if (out===4'b0001) pass_count=pass_count+1; else fa... |
010_priority_encoder | bundles/L1_basic/010_priority_encoder | Priority Encoder | L1_basic | L1 | 010 | # Problem 010: Priority Encoder
## Description
Implement a 4-bit priority encoder.
## Module Interface
```verilog
module priority_encoder(
input [3:0] in,
output reg [1:0] out,
output valid
);
// Your code here
endmodule
```
## Specification
- Output encodes the highest-priority (most significant)... | problem_id: "010"
title: "Priority Encoder"
level: 1
category: "basic_encoder"
description: "Implement a 4-bit priority encoder"
module_name: "priority_encoder"
ports:
in: { direction: "input", width: "4" }
out: { direction: "output", width: "2" }
valid: { direction: "output", width: "1" }
testbench_file: "testbe... | `timescale 1ns/1ps
module tb_priority_encoder;
reg [3:0] in;
wire [1:0] out;
wire valid;
priority_encoder uut(.in(in), .out(out), .valid(valid));
integer pass_count = 0;
integer fail_count = 0;
initial begin
in=4'b0000; #10; if (valid===1'b0 && out===2'b00) pass_count=pass_count+1; e... |
011_not_gate | bundles/L1_basic/011_not_gate | NOT Gate | L1_basic | L1 | 011 | # NOT Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a NOT gate
## Module Interface
```verilog
module not_gate(
input a,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
**Outputs:**
- `y` (1-bit): Output signal
## Examp... | problem_id: '011'
title: NOT Gate
level: 1
category: basic_gates
description: Implement a NOT gate
module_name: not_gate
ports:
a:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
check_waveform: fal... | `timescale 1ns/1ps
module tb_not_gate;
reg a;
wire y;
// Instantiate the module under test
not_gate uut (
.a(a),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing not_gate...");
// Test 1
a = 1'b0; #10;
... |
012_and_gate | bundles/L1_basic/012_and_gate | AND Gate | L1_basic | L1 | 012 | # AND Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a 2-input AND gate
## Module Interface
```verilog
module and_gate(
input a, input b,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Input signal
**Outp... | problem_id: '012'
title: AND Gate
level: 1
category: basic_gates
description: Implement a 2-input AND gate
module_name: and_gate
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: ... | `timescale 1ns/1ps
module tb_and_gate;
reg a;
reg b;
wire y;
// Instantiate the module under test
and_gate uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing and_gate...");
// Test... |
013_or_gate | bundles/L1_basic/013_or_gate | OR Gate | L1_basic | L1 | 013 | # OR Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a 2-input OR gate
## Module Interface
```verilog
module or_gate(
input a, input b,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Input signal
**Outputs... | problem_id: '013'
title: OR Gate
level: 1
category: basic_gates
description: Implement a 2-input OR gate
module_name: or_gate
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
... | `timescale 1ns/1ps
module tb_or_gate;
reg a;
reg b;
wire y;
// Instantiate the module under test
or_gate uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing or_gate...");
// Test 1
... |
014_xor_gate | bundles/L1_basic/014_xor_gate | XOR Gate | L1_basic | L1 | 014 | # XOR Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a 2-input XOR gate
## Module Interface
```verilog
module xor_gate(
input a, input b,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Input signal
**Outp... | problem_id: '014'
title: XOR Gate
level: 1
category: basic_gates
description: Implement a 2-input XOR gate
module_name: xor_gate
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: ... | `timescale 1ns/1ps
module tb_xor_gate;
reg a;
reg b;
wire y;
// Instantiate the module under test
xor_gate uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing xor_gate...");
// Test... |
015_nand_gate | bundles/L1_basic/015_nand_gate | NAND Gate | L1_basic | L1 | 015 | # NAND Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a 2-input NAND gate
## Module Interface
```verilog
module nand_gate(
input a, input b,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Input signal
**O... | problem_id: '015'
title: NAND Gate
level: 1
category: basic_gates
description: Implement a 2-input NAND gate
module_name: nand_gate
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulat... | `timescale 1ns/1ps
module tb_nand_gate;
reg a;
reg b;
wire y;
// Instantiate the module under test
nand_gate uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing nand_gate...");
// T... |
016_nor_gate | bundles/L1_basic/016_nor_gate | NOR Gate | L1_basic | L1 | 016 | # NOR Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a 2-input NOR gate
## Module Interface
```verilog
module nor_gate(
input a, input b,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Input signal
**Outp... | problem_id: '016'
title: NOR Gate
level: 1
category: basic_gates
description: Implement a 2-input NOR gate
module_name: nor_gate
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: ... | `timescale 1ns/1ps
module tb_nor_gate;
reg a;
reg b;
wire y;
// Instantiate the module under test
nor_gate uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing nor_gate...");
// Test... |
017_xnor_gate | bundles/L1_basic/017_xnor_gate | XNOR Gate | L1_basic | L1 | 017 | # XNOR Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a 2-input XNOR gate
## Module Interface
```verilog
module xnor_gate(
input a, input b,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Input signal
**O... | problem_id: '017'
title: XNOR Gate
level: 1
category: basic_gates
description: Implement a 2-input XNOR gate
module_name: xnor_gate
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulat... | `timescale 1ns/1ps
module tb_xnor_gate;
reg a;
reg b;
wire y;
// Instantiate the module under test
xnor_gate uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing xnor_gate...");
// T... |
018_and3_gate | bundles/L1_basic/018_and3_gate | 3-input AND Gate | L1_basic | L1 | 018 | # 3-input AND Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a 3-input AND gate
## Module Interface
```verilog
module and3_gate(
input a, input b, input c,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): In... | problem_id: 018
title: 3-input AND Gate
level: 1
category: basic_gates
description: Implement a 3-input AND gate
module_name: and3_gate
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
c:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: test... | `timescale 1ns/1ps
module tb_and3_gate;
reg a;
reg b;
reg c;
wire y;
// Instantiate the module under test
and3_gate uut (
.a(a),
.b(b),
.c(c),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing and... |
019_or3_gate | bundles/L1_basic/019_or3_gate | 3-input OR Gate | L1_basic | L1 | 019 | # 3-input OR Gate
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a 3-input OR gate
## Module Interface
```verilog
module or3_gate(
input a, input b, input c,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Input... | problem_id: 019
title: 3-input OR Gate
level: 1
category: basic_gates
description: Implement a 3-input OR gate
module_name: or3_gate
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
c:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testben... | `timescale 1ns/1ps
module tb_or3_gate;
reg a;
reg b;
reg c;
wire y;
// Instantiate the module under test
or3_gate uut (
.a(a),
.b(b),
.c(c),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing or3_g... |
020_buffer | bundles/L1_basic/020_buffer | Buffer | L1_basic | L1 | 020 | # Buffer
**Level**: 1 (Basic Combinational Logic)
**Category**: basic_gates
## Problem Description
Implement a buffer (passes input to output)
## Module Interface
```verilog
module buffer(
input a,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
**Outputs:**
- `y` (1-bit): Outp... | problem_id: '020'
title: Buffer
level: 1
category: basic_gates
description: Implement a buffer (passes input to output)
module_name: buffer
ports:
a:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
... | `timescale 1ns/1ps
module tb_buffer;
reg a;
wire y;
// Instantiate the module under test
buffer uut (
.a(a),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing buffer...");
// Test 1
a = 1'b0; #10;
... |
021_bitwise_and | bundles/L1_basic/021_bitwise_and | 8-bit Bitwise AND | L1_basic | L1 | 021 | # 8-bit Bitwise AND
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
8-bit bitwise AND operation
## Module Interface
```verilog
module bitwise_and(
input [7:0] a, input [7:0] b,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
- `b` (8-... | problem_id: '021'
title: 8-bit Bitwise AND
level: 1
category: multi_bit
description: 8-bit bitwise AND operation
module_name: bitwise_and
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
y:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_s... | `timescale 1ns/1ps
module tb_bitwise_and;
reg [7:0] a;
reg [7:0] b;
wire [7:0] y;
// Instantiate the module under test
bitwise_and uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing bitwise... |
022_bitwise_or | bundles/L1_basic/022_bitwise_or | 8-bit Bitwise OR | L1_basic | L1 | 022 | # 8-bit Bitwise OR
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
8-bit bitwise OR operation
## Module Interface
```verilog
module bitwise_or(
input [7:0] a, input [7:0] b,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
- `b` (8-bit... | problem_id: '022'
title: 8-bit Bitwise OR
level: 1
category: multi_bit
description: 8-bit bitwise OR operation
module_name: bitwise_or
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
y:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simu... | `timescale 1ns/1ps
module tb_bitwise_or;
reg [7:0] a;
reg [7:0] b;
wire [7:0] y;
// Instantiate the module under test
bitwise_or uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing bitwise_o... |
023_bitwise_xor | bundles/L1_basic/023_bitwise_xor | 8-bit Bitwise XOR | L1_basic | L1 | 023 | # 8-bit Bitwise XOR
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
8-bit bitwise XOR operation
## Module Interface
```verilog
module bitwise_xor(
input [7:0] a, input [7:0] b,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
- `b` (8-... | problem_id: '023'
title: 8-bit Bitwise XOR
level: 1
category: multi_bit
description: 8-bit bitwise XOR operation
module_name: bitwise_xor
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
y:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_s... | `timescale 1ns/1ps
module tb_bitwise_xor;
reg [7:0] a;
reg [7:0] b;
wire [7:0] y;
// Instantiate the module under test
bitwise_xor uut (
.a(a),
.b(b),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing bitwise... |
024_bitwise_not | bundles/L1_basic/024_bitwise_not | 8-bit Bitwise NOT | L1_basic | L1 | 024 | # 8-bit Bitwise NOT
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
8-bit bitwise NOT operation
## Module Interface
```verilog
module bitwise_not(
input [7:0] a,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
**Outputs:**
- `y` (8-b... | problem_id: '024'
title: 8-bit Bitwise NOT
level: 1
category: multi_bit
description: 8-bit bitwise NOT operation
module_name: bitwise_not
ports:
a:
direction: input
width: 8
y:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
ch... | `timescale 1ns/1ps
module tb_bitwise_not;
reg [7:0] a;
wire [7:0] y;
// Instantiate the module under test
bitwise_not uut (
.a(a),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing bitwise_not...");
// Test 1
... |
025_equal_comparator | bundles/L1_basic/025_equal_comparator | 8-bit Equality Comparator | L1_basic | L1 | 025 | # 8-bit Equality Comparator
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
Check if two 8-bit values are equal
## Module Interface
```verilog
module equal_comparator(
input [7:0] a, input [7:0] b,
output eq
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input... | problem_id: '025'
title: 8-bit Equality Comparator
level: 1
category: multi_bit
description: Check if two 8-bit values are equal
module_name: equal_comparator
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
eq:
direction: output
width: 1
testbench_file: testbench.v
timeout... | `timescale 1ns/1ps
module tb_equal_comparator;
reg [7:0] a;
reg [7:0] b;
wire eq;
// Instantiate the module under test
equal_comparator uut (
.a(a),
.b(b),
.eq(eq)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing ... |
026_greater_comparator | bundles/L1_basic/026_greater_comparator | 8-bit Greater Than | L1_basic | L1 | 026 | # 8-bit Greater Than
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
Check if a > b (8-bit unsigned)
## Module Interface
```verilog
module greater_comparator(
input [7:0] a, input [7:0] b,
output gt
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
- ... | problem_id: '026'
title: 8-bit Greater Than
level: 1
category: multi_bit
description: Check if a > b (8-bit unsigned)
module_name: greater_comparator
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
gt:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile:... | `timescale 1ns/1ps
module tb_greater_comparator;
reg [7:0] a;
reg [7:0] b;
wire gt;
// Instantiate the module under test
greater_comparator uut (
.a(a),
.b(b),
.gt(gt)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Test... |
027_less_comparator | bundles/L1_basic/027_less_comparator | 8-bit Less Than | L1_basic | L1 | 027 | # 8-bit Less Than
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
Check if a < b (8-bit unsigned)
## Module Interface
```verilog
module less_comparator(
input [7:0] a, input [7:0] b,
output lt
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
- `b` (8... | problem_id: '027'
title: 8-bit Less Than
level: 1
category: multi_bit
description: Check if a < b (8-bit unsigned)
module_name: less_comparator
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
lt:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
ti... | `timescale 1ns/1ps
module tb_less_comparator;
reg [7:0] a;
reg [7:0] b;
wire lt;
// Instantiate the module under test
less_comparator uut (
.a(a),
.b(b),
.lt(lt)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing le... |
028_adder4 | bundles/L1_basic/028_adder4 | 4-bit Adder | L1_basic | L1 | 028 | # 4-bit Adder
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
4-bit adder (no carry out)
## Module Interface
```verilog
module adder4(
input [3:0] a, input [3:0] b,
output [3:0] sum
);
```
## Specifications
**Inputs:**
- `a` (4-bit): Input value
- `b` (4-bit): Inpu... | problem_id: 028
title: 4-bit Adder
level: 1
category: multi_bit
description: 4-bit adder (no carry out)
module_name: adder4
ports:
a:
direction: input
width: 4
b:
direction: input
width: 4
sum:
direction: output
width: 4
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
... | `timescale 1ns/1ps
module tb_adder4;
reg [3:0] a;
reg [3:0] b;
wire [3:0] sum;
// Instantiate the module under test
adder4 uut (
.a(a),
.b(b),
.sum(sum)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing adder4...")... |
029_adder8 | bundles/L1_basic/029_adder8 | 8-bit Adder | L1_basic | L1 | 029 | # 8-bit Adder
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
8-bit adder
## Module Interface
```verilog
module adder8(
input [7:0] a, input [7:0] b,
output [7:0] sum
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
- `b` (8-bit): Input value
**Outp... | problem_id: 029
title: 8-bit Adder
level: 1
category: multi_bit
description: 8-bit adder
module_name: adder8
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
sum:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthes... | `timescale 1ns/1ps
module tb_adder8;
reg [7:0] a;
reg [7:0] b;
wire [7:0] sum;
// Instantiate the module under test
adder8 uut (
.a(a),
.b(b),
.sum(sum)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing adder8...")... |
030_adder8_carry | bundles/L1_basic/030_adder8_carry | 8-bit Adder with Carry | L1_basic | L1 | 030 | # 8-bit Adder with Carry
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
8-bit adder with carry out
## Module Interface
```verilog
module adder8_carry(
input [7:0] a, input [7:0] b,
output [7:0] sum, output cout
);
```
## Specifications
**Inputs:**
- `a` (8-bit): I... | problem_id: '030'
title: 8-bit Adder with Carry
level: 1
category: multi_bit
description: 8-bit adder with carry out
module_name: adder8_carry
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
sum:
direction: output
width: 8
cout:
direction: output
width: 1
testben... | `timescale 1ns/1ps
module tb_adder8_carry;
reg [7:0] a;
reg [7:0] b;
wire [7:0] sum;
wire cout;
// Instantiate the module under test
adder8_carry uut (
.a(a),
.b(b),
.sum(sum),
.cout(cout)
);
integer pass_count = 0;
integer fail_count = 0;
ini... |
031_subtractor8 | bundles/L1_basic/031_subtractor8 | 8-bit Subtractor | L1_basic | L1 | 031 | # 8-bit Subtractor
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
8-bit subtractor
## Module Interface
```verilog
module subtractor8(
input [7:0] a, input [7:0] b,
output [7:0] diff
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
- `b` (8-bit): Inp... | problem_id: '031'
title: 8-bit Subtractor
level: 1
category: multi_bit
description: 8-bit subtractor
module_name: subtractor8
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
diff:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: ... | `timescale 1ns/1ps
module tb_subtractor8;
reg [7:0] a;
reg [7:0] b;
wire [7:0] diff;
// Instantiate the module under test
subtractor8 uut (
.a(a),
.b(b),
.diff(diff)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testin... |
032_incrementer | bundles/L1_basic/032_incrementer | 8-bit Incrementer | L1_basic | L1 | 032 | # 8-bit Incrementer
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
Add 1 to 8-bit input
## Module Interface
```verilog
module incrementer(
input [7:0] a,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
**Outputs:**
- `y` (8-bit): Ou... | problem_id: '032'
title: 8-bit Incrementer
level: 1
category: multi_bit
description: Add 1 to 8-bit input
module_name: incrementer
ports:
a:
direction: input
width: 8
y:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
check_wav... | `timescale 1ns/1ps
module tb_incrementer;
reg [7:0] a;
wire [7:0] y;
// Instantiate the module under test
incrementer uut (
.a(a),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing incrementer...");
// Test 1
... |
033_decrementer | bundles/L1_basic/033_decrementer | 8-bit Decrementer | L1_basic | L1 | 033 | # 8-bit Decrementer
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
Subtract 1 from 8-bit input
## Module Interface
```verilog
module decrementer(
input [7:0] a,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
**Outputs:**
- `y` (8-b... | problem_id: '033'
title: 8-bit Decrementer
level: 1
category: multi_bit
description: Subtract 1 from 8-bit input
module_name: decrementer
ports:
a:
direction: input
width: 8
y:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
ch... | `timescale 1ns/1ps
module tb_decrementer;
reg [7:0] a;
wire [7:0] y;
// Instantiate the module under test
decrementer uut (
.a(a),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing decrementer...");
// Test 1
... |
034_magnitude_comp | bundles/L1_basic/034_magnitude_comp | 4-bit Magnitude Comparator | L1_basic | L1 | 034 | # 4-bit Magnitude Comparator
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
Compare two 4-bit values (eq, gt, lt)
## Module Interface
```verilog
module magnitude_comp(
input [3:0] a, input [3:0] b,
output eq, output gt, output lt
);
```
## Specifications
**Inputs:... | problem_id: '034'
title: 4-bit Magnitude Comparator
level: 1
category: multi_bit
description: Compare two 4-bit values (eq, gt, lt)
module_name: magnitude_comp
ports:
a:
direction: input
width: 4
b:
direction: input
width: 4
eq:
direction: output
width: 1
gt:
direction: output
wi... | `timescale 1ns/1ps
module tb_magnitude_comp;
reg [3:0] a;
reg [3:0] b;
wire eq;
wire gt;
wire lt;
// Instantiate the module under test
magnitude_comp uut (
.a(a),
.b(b),
.eq(eq),
.gt(gt),
.lt(lt)
);
integer pass_count = 0;
integer fail_... |
035_zero_detector | bundles/L1_basic/035_zero_detector | 8-bit Zero Detector | L1_basic | L1 | 035 | # 8-bit Zero Detector
**Level**: 1 (Basic Combinational Logic)
**Category**: multi_bit
## Problem Description
Output 1 if input is zero
## Module Interface
```verilog
module zero_detector(
input [7:0] a,
output is_zero
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
**Outputs:**
- `is_ze... | problem_id: '035'
title: 8-bit Zero Detector
level: 1
category: multi_bit
description: Output 1 if input is zero
module_name: zero_detector
ports:
a:
direction: input
width: 8
is_zero:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: ... | `timescale 1ns/1ps
module tb_zero_detector;
reg [7:0] a;
wire is_zero;
// Instantiate the module under test
zero_detector uut (
.a(a),
.is_zero(is_zero)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing zero_detector...");
... |
036_mux2to1 | bundles/L1_basic/036_mux2to1 | 2-to-1 Multiplexer | L1_basic | L1 | 036 | # 2-to-1 Multiplexer
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
2-to-1 MUX (1-bit inputs)
## Module Interface
```verilog
module mux2to1(
input a, input b, input sel,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): In... | problem_id: '036'
title: 2-to-1 Multiplexer
level: 1
category: multiplexers
description: 2-to-1 MUX (1-bit inputs)
module_name: mux2to1
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
sel:
direction: input
width: 1
y:
direction: output
width: 1
testbench_file: te... | `timescale 1ns/1ps
module tb_mux2to1;
reg a;
reg b;
reg sel;
wire y;
// Instantiate the module under test
mux2to1 uut (
.a(a),
.b(b),
.sel(sel),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing m... |
037_mux2to1_8bit | bundles/L1_basic/037_mux2to1_8bit | 2-to-1 MUX (8-bit) | L1_basic | L1 | 037 | # 2-to-1 MUX (8-bit)
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
2-to-1 MUX with 8-bit inputs
## Module Interface
```verilog
module mux2to1_8bit(
input [7:0] a, input [7:0] b, input sel,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Inpu... | problem_id: '037'
title: 2-to-1 MUX (8-bit)
level: 1
category: multiplexers
description: 2-to-1 MUX with 8-bit inputs
module_name: mux2to1_8bit
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
sel:
direction: input
width: 1
y:
direction: output
width: 8
testbench_... | `timescale 1ns/1ps
module tb_mux2to1_8bit;
reg [7:0] a;
reg [7:0] b;
reg sel;
wire [7:0] y;
// Instantiate the module under test
mux2to1_8bit uut (
.a(a),
.b(b),
.sel(sel),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin... |
038_mux4to1 | bundles/L1_basic/038_mux4to1 | 4-to-1 Multiplexer | L1_basic | L1 | 038 | # 4-to-1 Multiplexer
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
4-to-1 MUX (1-bit inputs)
## Module Interface
```verilog
module mux4to1(
input a, input b, input c, input d, input [1:0] sel,
output y
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input ... | problem_id: 038
title: 4-to-1 Multiplexer
level: 1
category: multiplexers
description: 4-to-1 MUX (1-bit inputs)
module_name: mux4to1
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
c:
direction: input
width: 1
d:
direction: input
width: 1
sel:
direction: i... | `timescale 1ns/1ps
module tb_mux4to1;
reg a;
reg b;
reg c;
reg d;
reg [1:0] sel;
wire y;
// Instantiate the module under test
mux4to1 uut (
.a(a),
.b(b),
.c(c),
.d(d),
.sel(sel),
.y(y)
);
integer pass_count = 0;
integer fail... |
039_mux4to1_8bit | bundles/L1_basic/039_mux4to1_8bit | 4-to-1 MUX (8-bit) | L1_basic | L1 | 039 | # 4-to-1 MUX (8-bit)
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
4-to-1 MUX with 8-bit inputs
## Module Interface
```verilog
module mux4to1_8bit(
input [7:0] a, input [7:0] b, input [7:0] c, input [7:0] d, input [1:0] sel,
output [7:0] y
);
```
## Specificati... | problem_id: 039
title: 4-to-1 MUX (8-bit)
level: 1
category: multiplexers
description: 4-to-1 MUX with 8-bit inputs
module_name: mux4to1_8bit
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
c:
direction: input
width: 8
d:
direction: input
width: 8
sel:
dire... | `timescale 1ns/1ps
module tb_mux4to1_8bit;
reg [7:0] a;
reg [7:0] b;
reg [7:0] c;
reg [7:0] d;
reg [1:0] sel;
wire [7:0] y;
// Instantiate the module under test
mux4to1_8bit uut (
.a(a),
.b(b),
.c(c),
.d(d),
.sel(sel),
.y(y)
);
... |
040_mux8to1 | bundles/L1_basic/040_mux8to1 | 8-to-1 Multiplexer | L1_basic | L1 | 040 | # 8-to-1 Multiplexer
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
8-to-1 MUX (1-bit inputs)
## Module Interface
```verilog
module mux8to1(
input in0, input in1, input in2, input in3, input in4, input in5, input in6, input in7, input [2:0] sel,
output y
);
```
... | problem_id: '040'
title: 8-to-1 Multiplexer
level: 1
category: multiplexers
description: 8-to-1 MUX (1-bit inputs)
module_name: mux8to1
ports:
in0:
direction: input
width: 1
in1:
direction: input
width: 1
in2:
direction: input
width: 1
in3:
direction: input
width: 1
in4:
di... | `timescale 1ns/1ps
module tb_mux8to1;
reg in0;
reg in1;
reg in2;
reg in3;
reg in4;
reg in5;
reg in6;
reg in7;
reg [2:0] sel;
wire y;
// Instantiate the module under test
mux8to1 uut (
.in0(in0),
.in1(in1),
.in2(in2),
.in3(in3),
.... |
041_mux8to1_8bit | bundles/L1_basic/041_mux8to1_8bit | 8-to-1 MUX (8-bit) | L1_basic | L1 | 041 | # 8-to-1 MUX (8-bit)
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
8-to-1 MUX with 8-bit inputs
## Module Interface
```verilog
module mux8to1_8bit(
input [7:0] in0, input [7:0] in1, input [7:0] in2, input [7:0] in3, input [7:0] in4, input [7:0] in5, input [7:0] in6,... | problem_id: '041'
title: 8-to-1 MUX (8-bit)
level: 1
category: multiplexers
description: 8-to-1 MUX with 8-bit inputs
module_name: mux8to1_8bit
ports:
in0:
direction: input
width: 8
in1:
direction: input
width: 8
in2:
direction: input
width: 8
in3:
direction: input
width: 8
in4... | `timescale 1ns/1ps
module tb_mux8to1_8bit;
reg [7:0] in0;
reg [7:0] in1;
reg [7:0] in2;
reg [7:0] in3;
reg [7:0] in4;
reg [7:0] in5;
reg [7:0] in6;
reg [7:0] in7;
reg [2:0] sel;
wire [7:0] y;
// Instantiate the module under test
mux8to1_8bit uut (
.in0(in0),
... |
042_demux1to2 | bundles/L1_basic/042_demux1to2 | 1-to-2 Demultiplexer | L1_basic | L1 | 042 | # 1-to-2 Demultiplexer
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
1-to-2 DEMUX
## Module Interface
```verilog
module demux1to2(
input in, input sel,
output out0, output out1
);
```
## Specifications
**Inputs:**
- `in` (1-bit): Input signal
- `sel` (1-bit): ... | problem_id: '042'
title: 1-to-2 Demultiplexer
level: 1
category: multiplexers
description: 1-to-2 DEMUX
module_name: demux1to2
ports:
in:
direction: input
width: 1
sel:
direction: input
width: 1
out0:
direction: output
width: 1
out1:
direction: output
width: 1
testbench_file: tes... | `timescale 1ns/1ps
module tb_demux1to2;
reg in;
reg sel;
wire out0;
wire out1;
// Instantiate the module under test
demux1to2 uut (
.in(in),
.sel(sel),
.out0(out0),
.out1(out1)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
... |
043_demux1to4 | bundles/L1_basic/043_demux1to4 | 1-to-4 Demultiplexer | L1_basic | L1 | 043 | # 1-to-4 Demultiplexer
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
1-to-4 DEMUX
## Module Interface
```verilog
module demux1to4(
input in, input [1:0] sel,
output out0, output out1, output out2, output out3
);
```
## Specifications
**Inputs:**
- `in` (1-bit)... | problem_id: '043'
title: 1-to-4 Demultiplexer
level: 1
category: multiplexers
description: 1-to-4 DEMUX
module_name: demux1to4
ports:
in:
direction: input
width: 1
sel:
direction: input
width: 2
out0:
direction: output
width: 1
out1:
direction: output
width: 1
out2:
directi... | `timescale 1ns/1ps
module tb_demux1to4;
reg in;
reg [1:0] sel;
wire out0;
wire out1;
wire out2;
wire out3;
// Instantiate the module under test
demux1to4 uut (
.in(in),
.sel(sel),
.out0(out0),
.out1(out1),
.out2(out2),
.out3(out3)
);... |
044_mux2to1_wide | bundles/L1_basic/044_mux2to1_wide | 2-to-1 MUX (16-bit) | L1_basic | L1 | 044 | # 2-to-1 MUX (16-bit)
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
2-to-1 MUX with 16-bit inputs
## Module Interface
```verilog
module mux2to1_wide(
input [15:0] a, input [15:0] b, input sel,
output [15:0] y
);
```
## Specifications
**Inputs:**
- `a` (16-bit)... | problem_id: '044'
title: 2-to-1 MUX (16-bit)
level: 1
category: multiplexers
description: 2-to-1 MUX with 16-bit inputs
module_name: mux2to1_wide
ports:
a:
direction: input
width: 16
b:
direction: input
width: 16
sel:
direction: input
width: 1
y:
direction: output
width: 16
testb... | `timescale 1ns/1ps
module tb_mux2to1_wide;
reg [15:0] a;
reg [15:0] b;
reg sel;
wire [15:0] y;
// Instantiate the module under test
mux2to1_wide uut (
.a(a),
.b(b),
.sel(sel),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial be... |
045_mux4to1_wide | bundles/L1_basic/045_mux4to1_wide | 4-to-1 MUX (16-bit) | L1_basic | L1 | 045 | # 4-to-1 MUX (16-bit)
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
4-to-1 MUX with 16-bit inputs
## Module Interface
```verilog
module mux4to1_wide(
input [15:0] a, input [15:0] b, input [15:0] c, input [15:0] d, input [1:0] sel,
output [15:0] y
);
```
## Spec... | problem_id: '045'
title: 4-to-1 MUX (16-bit)
level: 1
category: multiplexers
description: 4-to-1 MUX with 16-bit inputs
module_name: mux4to1_wide
ports:
a:
direction: input
width: 16
b:
direction: input
width: 16
c:
direction: input
width: 16
d:
direction: input
width: 16
sel:
... | `timescale 1ns/1ps
module tb_mux4to1_wide;
reg [15:0] a;
reg [15:0] b;
reg [15:0] c;
reg [15:0] d;
reg [1:0] sel;
wire [15:0] y;
// Instantiate the module under test
mux4to1_wide uut (
.a(a),
.b(b),
.c(c),
.d(d),
.sel(sel),
.y(y)
);
... |
046_tri_state_mux | bundles/L1_basic/046_tri_state_mux | Tri-state MUX | L1_basic | L1 | 046 | # Tri-state MUX
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
2-to-1 MUX with enable
## Module Interface
```verilog
module tri_state_mux(
input [7:0] a, input [7:0] b, input sel, input en,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Inpu... | problem_id: '046'
title: Tri-state MUX
level: 1
category: multiplexers
description: 2-to-1 MUX with enable
module_name: tri_state_mux
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
sel:
direction: input
width: 1
en:
direction: input
width: 1
y:
direction: ... | `timescale 1ns/1ps
module tb_tri_state_mux;
reg [7:0] a;
reg [7:0] b;
reg sel;
reg en;
wire [7:0] y;
// Instantiate the module under test
tri_state_mux uut (
.a(a),
.b(b),
.sel(sel),
.en(en),
.y(y)
);
integer pass_count = 0;
integer fai... |
047_priority_mux | bundles/L1_basic/047_priority_mux | Priority MUX | L1_basic | L1 | 047 | # Priority MUX
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
4-input priority MUX (highest bit priority)
## Module Interface
```verilog
module priority_mux(
input [7:0] in0, input [7:0] in1, input [7:0] in2, input [7:0] in3, input [3:0] valid,
output [7:0] y
);
... | problem_id: '047'
title: Priority MUX
level: 1
category: multiplexers
description: 4-input priority MUX (highest bit priority)
module_name: priority_mux
ports:
in0:
direction: input
width: 8
in1:
direction: input
width: 8
in2:
direction: input
width: 8
in3:
direction: input
width... | `timescale 1ns/1ps
module tb_priority_mux;
reg [7:0] in0;
reg [7:0] in1;
reg [7:0] in2;
reg [7:0] in3;
reg [3:0] valid;
wire [7:0] y;
// Instantiate the module under test
priority_mux uut (
.in0(in0),
.in1(in1),
.in2(in2),
.in3(in3),
.valid(vali... |
048_barrel_mux2 | bundles/L1_basic/048_barrel_mux2 | 2-bit Barrel MUX | L1_basic | L1 | 048 | # 2-bit Barrel MUX
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
Selects 2 consecutive bits from 4-bit input
## Module Interface
```verilog
module barrel_mux2(
input [3:0] in, input [1:0] shift,
output [1:0] y
);
```
## Specifications
**Inputs:**
- `in` (4-bit... | problem_id: 048
title: 2-bit Barrel MUX
level: 1
category: multiplexers
description: Selects 2 consecutive bits from 4-bit input
module_name: barrel_mux2
ports:
in:
direction: input
width: 4
shift:
direction: input
width: 2
y:
direction: output
width: 2
testbench_file: testbench.v
timeout_... | `timescale 1ns/1ps
module tb_barrel_mux2;
reg [3:0] in;
reg [1:0] shift;
wire [1:0] y;
// Instantiate the module under test
barrel_mux2 uut (
.in(in),
.shift(shift),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("... |
049_bit_select | bundles/L1_basic/049_bit_select | Bit Selector | L1_basic | L1 | 049 | # Bit Selector
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
Select one bit from 8-bit input
## Module Interface
```verilog
module bit_select(
input [7:0] in, input [2:0] sel,
output y
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
- `sel` (3... | problem_id: 049
title: Bit Selector
level: 1
category: multiplexers
description: Select one bit from 8-bit input
module_name: bit_select
ports:
in:
direction: input
width: 8
sel:
direction: input
width: 3
y:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout... | `timescale 1ns/1ps
module tb_bit_select;
reg [7:0] in;
reg [2:0] sel;
wire y;
// Instantiate the module under test
bit_select uut (
.in(in),
.sel(sel),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing bit_se... |
050_byte_select | bundles/L1_basic/050_byte_select | Byte Selector | L1_basic | L1 | 050 | # Byte Selector
**Level**: 1 (Basic Combinational Logic)
**Category**: multiplexers
## Problem Description
Select one byte from 32-bit input
## Module Interface
```verilog
module byte_select(
input [31:0] in, input [1:0] sel,
output [7:0] y
);
```
## Specifications
**Inputs:**
- `in` (32-bit): Input valu... | problem_id: '050'
title: Byte Selector
level: 1
category: multiplexers
description: Select one byte from 32-bit input
module_name: byte_select
ports:
in:
direction: input
width: 32
sel:
direction: input
width: 2
y:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
... | `timescale 1ns/1ps
module tb_byte_select;
reg [31:0] in;
reg [1:0] sel;
wire [7:0] y;
// Instantiate the module under test
byte_select uut (
.in(in),
.sel(sel),
.y(y)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testi... |
051_decoder_2to4 | bundles/L1_basic/051_decoder_2to4 | 2-to-4 Decoder | L1_basic | L1 | 051 | # 2-to-4 Decoder
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
2-to-4 binary decoder
## Module Interface
```verilog
module decoder_2to4(
input [1:0] in,
output [3:0] out
);
```
## Specifications
**Inputs:**
- `in` (2-bit): Input value
**Outputs:**
- `out... | problem_id: '051'
title: 2-to-4 Decoder
level: 1
category: encoders_decoders
description: 2-to-4 binary decoder
module_name: decoder_2to4
ports:
in:
direction: input
width: 2
out:
direction: output
width: 4
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false... | `timescale 1ns/1ps
module tb_decoder_2to4;
reg [1:0] in;
wire [3:0] out;
// Instantiate the module under test
decoder_2to4 uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing decoder_2to4...");
... |
052_decoder_3to8 | bundles/L1_basic/052_decoder_3to8 | 3-to-8 Decoder | L1_basic | L1 | 052 | # 3-to-8 Decoder
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
3-to-8 binary decoder
## Module Interface
```verilog
module decoder_3to8(
input [2:0] in,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (3-bit): Input value
**Outputs:**
- `out... | problem_id: '052'
title: 3-to-8 Decoder
level: 1
category: encoders_decoders
description: 3-to-8 binary decoder
module_name: decoder_3to8
ports:
in:
direction: input
width: 3
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false... | `timescale 1ns/1ps
module tb_decoder_3to8;
reg [2:0] in;
wire [7:0] out;
// Instantiate the module under test
decoder_3to8 uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing decoder_3to8...");
... |
053_decoder_2to4_en | bundles/L1_basic/053_decoder_2to4_en | 2-to-4 Decoder with Enable | L1_basic | L1 | 053 | # 2-to-4 Decoder with Enable
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
2-to-4 decoder with enable
## Module Interface
```verilog
module decoder_2to4_en(
input [1:0] in, input en,
output [3:0] out
);
```
## Specifications
**Inputs:**
- `in` (2-bit): In... | problem_id: '053'
title: 2-to-4 Decoder with Enable
level: 1
category: encoders_decoders
description: 2-to-4 decoder with enable
module_name: decoder_2to4_en
ports:
in:
direction: input
width: 2
en:
direction: input
width: 1
out:
direction: output
width: 4
testbench_file: testbench.v
timeo... | `timescale 1ns/1ps
module tb_decoder_2to4_en;
reg [1:0] in;
reg en;
wire [3:0] out;
// Instantiate the module under test
decoder_2to4_en uut (
.in(in),
.en(en),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("T... |
054_encoder_4to2 | bundles/L1_basic/054_encoder_4to2 | 4-to-2 Encoder | L1_basic | L1 | 054 | # 4-to-2 Encoder
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
4-to-2 priority encoder
## Module Interface
```verilog
module encoder_4to2(
input [3:0] in,
output [1:0] out, output valid
);
```
## Specifications
**Inputs:**
- `in` (4-bit): Input value
**O... | problem_id: '054'
title: 4-to-2 Encoder
level: 1
category: encoders_decoders
description: 4-to-2 priority encoder
module_name: encoder_4to2
ports:
in:
direction: input
width: 4
out:
direction: output
width: 2
valid:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10... | `timescale 1ns/1ps
module tb_encoder_4to2;
reg [3:0] in;
wire [1:0] out;
wire valid;
// Instantiate the module under test
encoder_4to2 uut (
.in(in),
.out(out),
.valid(valid)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$displa... |
055_encoder_8to3 | bundles/L1_basic/055_encoder_8to3 | 8-to-3 Encoder | L1_basic | L1 | 055 | # 8-to-3 Encoder
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
8-to-3 priority encoder
## Module Interface
```verilog
module encoder_8to3(
input [7:0] in,
output [2:0] out, output valid
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
**O... | problem_id: '055'
title: 8-to-3 Encoder
level: 1
category: encoders_decoders
description: 8-to-3 priority encoder
module_name: encoder_8to3
ports:
in:
direction: input
width: 8
out:
direction: output
width: 3
valid:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10... | `timescale 1ns/1ps
module tb_encoder_8to3;
reg [7:0] in;
wire [2:0] out;
wire valid;
// Instantiate the module under test
encoder_8to3 uut (
.in(in),
.out(out),
.valid(valid)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$displa... |
056_one_hot_encoder | bundles/L1_basic/056_one_hot_encoder | One-Hot Encoder | L1_basic | L1 | 056 | # One-Hot Encoder
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
Binary to one-hot encoder (3-to-8)
## Module Interface
```verilog
module one_hot_encoder(
input [2:0] bin,
output [7:0] onehot
);
```
## Specifications
**Inputs:**
- `bin` (3-bit): Input valu... | problem_id: '056'
title: One-Hot Encoder
level: 1
category: encoders_decoders
description: Binary to one-hot encoder (3-to-8)
module_name: one_hot_encoder
ports:
bin:
direction: input
width: 3
onehot:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
req... | `timescale 1ns/1ps
module tb_one_hot_encoder;
reg [2:0] bin;
wire [7:0] onehot;
// Instantiate the module under test
one_hot_encoder uut (
.bin(bin),
.onehot(onehot)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing one_hot_en... |
057_one_hot_decoder | bundles/L1_basic/057_one_hot_decoder | One-Hot Decoder | L1_basic | L1 | 057 | # One-Hot Decoder
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
One-hot to binary decoder (8-to-3)
## Module Interface
```verilog
module one_hot_decoder(
input [7:0] onehot,
output [2:0] bin, output valid
);
```
## Specifications
**Inputs:**
- `onehot` (8... | problem_id: '057'
title: One-Hot Decoder
level: 1
category: encoders_decoders
description: One-hot to binary decoder (8-to-3)
module_name: one_hot_decoder
ports:
onehot:
direction: input
width: 8
bin:
direction: output
width: 3
valid:
direction: output
width: 1
testbench_file: testbench.v
... | `timescale 1ns/1ps
module tb_one_hot_decoder;
reg [7:0] onehot;
wire [2:0] bin;
wire valid;
// Instantiate the module under test
one_hot_decoder uut (
.onehot(onehot),
.bin(bin),
.valid(valid)
);
integer pass_count = 0;
integer fail_count = 0;
initial beg... |
058_seven_seg_decoder | bundles/L1_basic/058_seven_seg_decoder | 7-Segment Decoder | L1_basic | L1 | 058 | # 7-Segment Decoder
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
BCD to 7-segment decoder
## Module Interface
```verilog
module seven_seg_decoder(
input [3:0] bcd,
output [6:0] seg
);
```
## Specifications
**Inputs:**
- `bcd` (4-bit): Input value
**Outp... | problem_id: 058
title: 7-Segment Decoder
level: 1
category: encoders_decoders
description: BCD to 7-segment decoder
module_name: seven_seg_decoder
ports:
bcd:
direction: input
width: 4
seg:
direction: output
width: 7
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthe... | `timescale 1ns/1ps
module tb_seven_seg_decoder;
reg [3:0] bcd;
wire [6:0] seg;
// Instantiate the module under test
seven_seg_decoder uut (
.bcd(bcd),
.seg(seg)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing seven_seg_decod... |
059_bcd_to_binary | bundles/L1_basic/059_bcd_to_binary | BCD to Binary | L1_basic | L1 | 059 | # BCD to Binary
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
2-digit BCD to 8-bit binary
## Module Interface
```verilog
module bcd_to_binary(
input [7:0] bcd,
output [7:0] bin
);
```
## Specifications
**Inputs:**
- `bcd` (8-bit): Input value
**Outputs:*... | problem_id: 059
title: BCD to Binary
level: 1
category: encoders_decoders
description: 2-digit BCD to 8-bit binary
module_name: bcd_to_binary
ports:
bcd:
direction: input
width: 8
bin:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: ... | `timescale 1ns/1ps
module tb_bcd_to_binary;
reg [7:0] bcd;
wire [7:0] bin;
// Instantiate the module under test
bcd_to_binary uut (
.bcd(bcd),
.bin(bin)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing bcd_to_binary...");
... |
060_gray_to_binary | bundles/L1_basic/060_gray_to_binary | Gray to Binary | L1_basic | L1 | 060 | # Gray to Binary
**Level**: 1 (Basic Combinational Logic)
**Category**: encoders_decoders
## Problem Description
4-bit Gray code to binary
## Module Interface
```verilog
module gray_to_binary(
input [3:0] gray,
output [3:0] bin
);
```
## Specifications
**Inputs:**
- `gray` (4-bit): Input value
**Outputs... | problem_id: '060'
title: Gray to Binary
level: 1
category: encoders_decoders
description: 4-bit Gray code to binary
module_name: gray_to_binary
ports:
gray:
direction: input
width: 4
bin:
direction: output
width: 4
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesi... | `timescale 1ns/1ps
module tb_gray_to_binary;
reg [3:0] gray;
wire [3:0] bin;
// Instantiate the module under test
gray_to_binary uut (
.gray(gray),
.bin(bin)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing gray_to_binary..."... |
061_half_adder | bundles/L1_basic/061_half_adder | Half Adder | L1_basic | L1 | 061 | # Half Adder
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
1-bit half adder
## Module Interface
```verilog
module half_adder(
input a, input b,
output sum, output carry
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Input signal
... | problem_id: '061'
title: Half Adder
level: 1
category: arithmetic
description: 1-bit half adder
module_name: half_adder
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
sum:
direction: output
width: 1
carry:
direction: output
width: 1
testbench_file: testbench.v
t... | `timescale 1ns/1ps
module tb_half_adder;
reg a;
reg b;
wire sum;
wire carry;
// Instantiate the module under test
half_adder uut (
.a(a),
.b(b),
.sum(sum),
.carry(carry)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
... |
062_full_adder | bundles/L1_basic/062_full_adder | Full Adder | L1_basic | L1 | 062 | # Full Adder
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
1-bit full adder
## Module Interface
```verilog
module full_adder(
input a, input b, input cin,
output sum, output cout
);
```
## Specifications
**Inputs:**
- `a` (1-bit): Input signal
- `b` (1-bit): Inp... | problem_id: '062'
title: Full Adder
level: 1
category: arithmetic
description: 1-bit full adder
module_name: full_adder
ports:
a:
direction: input
width: 1
b:
direction: input
width: 1
cin:
direction: input
width: 1
sum:
direction: output
width: 1
cout:
direction: output
... | `timescale 1ns/1ps
module tb_full_adder;
reg a;
reg b;
reg cin;
wire sum;
wire cout;
// Instantiate the module under test
full_adder uut (
.a(a),
.b(b),
.cin(cin),
.sum(sum),
.cout(cout)
);
integer pass_count = 0;
integer fail_count = 0... |
063_adder4_carry | bundles/L1_basic/063_adder4_carry | 4-bit Ripple Carry Adder | L1_basic | L1 | 063 | # 4-bit Ripple Carry Adder
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
4-bit adder with carry in/out
## Module Interface
```verilog
module adder4_carry(
input [3:0] a, input [3:0] b, input cin,
output [3:0] sum, output cout
);
```
## Specifications
**Inputs:**... | problem_id: '063'
title: 4-bit Ripple Carry Adder
level: 1
category: arithmetic
description: 4-bit adder with carry in/out
module_name: adder4_carry
ports:
a:
direction: input
width: 4
b:
direction: input
width: 4
cin:
direction: input
width: 1
sum:
direction: output
width: 4
c... | `timescale 1ns/1ps
module tb_adder4_carry;
reg [3:0] a;
reg [3:0] b;
reg cin;
wire [3:0] sum;
wire cout;
// Instantiate the module under test
adder4_carry uut (
.a(a),
.b(b),
.cin(cin),
.sum(sum),
.cout(cout)
);
integer pass_count = 0;
... |
064_adder16 | bundles/L1_basic/064_adder16 | 16-bit Adder | L1_basic | L1 | 064 | # 16-bit Adder
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
16-bit adder
## Module Interface
```verilog
module adder16(
input [15:0] a, input [15:0] b,
output [15:0] sum
);
```
## Specifications
**Inputs:**
- `a` (16-bit): Input value
- `b` (16-bit): Input valu... | problem_id: '064'
title: 16-bit Adder
level: 1
category: arithmetic
description: 16-bit adder
module_name: adder16
ports:
a:
direction: input
width: 16
b:
direction: input
width: 16
sum:
direction: output
width: 16
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
requir... | `timescale 1ns/1ps
module tb_adder16;
reg [15:0] a;
reg [15:0] b;
wire [15:0] sum;
// Instantiate the module under test
adder16 uut (
.a(a),
.b(b),
.sum(sum)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing adder1... |
065_addsub8 | bundles/L1_basic/065_addsub8 | 8-bit Add/Subtract | L1_basic | L1 | 065 | # 8-bit Add/Subtract
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
8-bit adder/subtractor with mode select
## Module Interface
```verilog
module addsub8(
input [7:0] a, input [7:0] b, input sub,
output [7:0] result
);
```
## Specifications
**Inputs:**
- `a` (8-b... | problem_id: '065'
title: 8-bit Add/Subtract
level: 1
category: arithmetic
description: 8-bit adder/subtractor with mode select
module_name: addsub8
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
sub:
direction: input
width: 1
result:
direction: output
width: 8
t... | `timescale 1ns/1ps
module tb_addsub8;
reg [7:0] a;
reg [7:0] b;
reg sub;
wire [7:0] result;
// Instantiate the module under test
addsub8 uut (
.a(a),
.b(b),
.sub(sub),
.result(result)
);
integer pass_count = 0;
integer fail_count = 0;
initial ... |
066_mult2x2 | bundles/L1_basic/066_mult2x2 | 2x2 Multiplier | L1_basic | L1 | 066 | # 2x2 Multiplier
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
2-bit x 2-bit unsigned multiplier
## Module Interface
```verilog
module mult2x2(
input [1:0] a, input [1:0] b,
output [3:0] product
);
```
## Specifications
**Inputs:**
- `a` (2-bit): Input value
- `... | problem_id: '066'
title: 2x2 Multiplier
level: 1
category: arithmetic
description: 2-bit x 2-bit unsigned multiplier
module_name: mult2x2
ports:
a:
direction: input
width: 2
b:
direction: input
width: 2
product:
direction: output
width: 4
testbench_file: testbench.v
timeout_compile: 10
tim... | `timescale 1ns/1ps
module tb_mult2x2;
reg [1:0] a;
reg [1:0] b;
wire [3:0] product;
// Instantiate the module under test
mult2x2 uut (
.a(a),
.b(b),
.product(product)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testi... |
067_mult4x4 | bundles/L1_basic/067_mult4x4 | 4x4 Multiplier | L1_basic | L1 | 067 | # 4x4 Multiplier
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
4-bit x 4-bit unsigned multiplier
## Module Interface
```verilog
module mult4x4(
input [3:0] a, input [3:0] b,
output [7:0] product
);
```
## Specifications
**Inputs:**
- `a` (4-bit): Input value
- `... | problem_id: '067'
title: 4x4 Multiplier
level: 1
category: arithmetic
description: 4-bit x 4-bit unsigned multiplier
module_name: mult4x4
ports:
a:
direction: input
width: 4
b:
direction: input
width: 4
product:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
tim... | `timescale 1ns/1ps
module tb_mult4x4;
reg [3:0] a;
reg [3:0] b;
wire [7:0] product;
// Instantiate the module under test
mult4x4 uut (
.a(a),
.b(b),
.product(product)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testi... |
068_mult_by_3 | bundles/L1_basic/068_mult_by_3 | Multiply by 3 | L1_basic | L1 | 068 | # Multiply by 3
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
Multiply 8-bit input by 3
## Module Interface
```verilog
module mult_by_3(
input [7:0] a,
output [9:0] product
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
**Outputs:**
- `product`... | problem_id: 068
title: Multiply by 3
level: 1
category: arithmetic
description: Multiply 8-bit input by 3
module_name: mult_by_3
ports:
a:
direction: input
width: 8
product:
direction: output
width: 10
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
chec... | `timescale 1ns/1ps
module tb_mult_by_3;
reg [7:0] a;
wire [9:0] product;
// Instantiate the module under test
mult_by_3 uut (
.a(a),
.product(product)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing mult_by_3...");
... |
069_mult_by_5 | bundles/L1_basic/069_mult_by_5 | Multiply by 5 | L1_basic | L1 | 069 | # Multiply by 5
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
Multiply 8-bit input by 5
## Module Interface
```verilog
module mult_by_5(
input [7:0] a,
output [10:0] product
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
**Outputs:**
- `product... | problem_id: 069
title: Multiply by 5
level: 1
category: arithmetic
description: Multiply 8-bit input by 5
module_name: mult_by_5
ports:
a:
direction: input
width: 8
product:
direction: output
width: 11
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
chec... | `timescale 1ns/1ps
module tb_mult_by_5;
reg [7:0] a;
wire [10:0] product;
// Instantiate the module under test
mult_by_5 uut (
.a(a),
.product(product)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing mult_by_5...");
... |
070_abs_diff | bundles/L1_basic/070_abs_diff | Absolute Difference | L1_basic | L1 | 070 | # Absolute Difference
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
8-bit absolute difference |a - b|
## Module Interface
```verilog
module abs_diff(
input [7:0] a, input [7:0] b,
output [7:0] diff
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
... | problem_id: '070'
title: Absolute Difference
level: 1
category: arithmetic
description: 8-bit absolute difference |a - b|
module_name: abs_diff
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
diff:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
... | `timescale 1ns/1ps
module tb_abs_diff;
reg [7:0] a;
reg [7:0] b;
wire [7:0] diff;
// Instantiate the module under test
abs_diff uut (
.a(a),
.b(b),
.diff(diff)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing abs_... |
071_min_max | bundles/L1_basic/071_min_max | Min/Max | L1_basic | L1 | 071 | # Min/Max
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
Find minimum and maximum of two 8-bit values
## Module Interface
```verilog
module min_max(
input [7:0] a, input [7:0] b,
output [7:0] min, output [7:0] max
);
```
## Specifications
**Inputs:**
- `a` (8-bit... | problem_id: '071'
title: Min/Max
level: 1
category: arithmetic
description: Find minimum and maximum of two 8-bit values
module_name: min_max
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
min:
direction: output
width: 8
max:
direction: output
width: 8
testbench... | `timescale 1ns/1ps
module tb_min_max;
reg [7:0] a;
reg [7:0] b;
wire [7:0] min;
wire [7:0] max;
// Instantiate the module under test
min_max uut (
.a(a),
.b(b),
.min(min),
.max(max)
);
integer pass_count = 0;
integer fail_count = 0;
initial be... |
072_average | bundles/L1_basic/072_average | Average | L1_basic | L1 | 072 | # Average
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
Average of two 8-bit values (truncated)
## Module Interface
```verilog
module average(
input [7:0] a, input [7:0] b,
output [7:0] avg
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
- `b` (8... | problem_id: '072'
title: Average
level: 1
category: arithmetic
description: Average of two 8-bit values (truncated)
module_name: average
ports:
a:
direction: input
width: 8
b:
direction: input
width: 8
avg:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_... | `timescale 1ns/1ps
module tb_average;
reg [7:0] a;
reg [7:0] b;
wire [7:0] avg;
// Instantiate the module under test
average uut (
.a(a),
.b(b),
.avg(avg)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing average..... |
073_sign_extend | bundles/L1_basic/073_sign_extend | Sign Extend | L1_basic | L1 | 073 | # Sign Extend
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
Sign-extend 4-bit to 8-bit
## Module Interface
```verilog
module sign_extend(
input [3:0] in,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (4-bit): Input value
**Outputs:**
- `out` (8-b... | problem_id: '073'
title: Sign Extend
level: 1
category: arithmetic
description: Sign-extend 4-bit to 8-bit
module_name: sign_extend
ports:
in:
direction: input
width: 4
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
check... | `timescale 1ns/1ps
module tb_sign_extend;
reg [3:0] in;
wire [7:0] out;
// Instantiate the module under test
sign_extend uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing sign_extend...");
// ... |
074_neg8 | bundles/L1_basic/074_neg8 | 8-bit Negation | L1_basic | L1 | 074 | # 8-bit Negation
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
Two's complement negation
## Module Interface
```verilog
module neg8(
input [7:0] a,
output [7:0] neg_a
);
```
## Specifications
**Inputs:**
- `a` (8-bit): Input value
**Outputs:**
- `neg_a` (8-bit)... | problem_id: '074'
title: 8-bit Negation
level: 1
category: arithmetic
description: Two's complement negation
module_name: neg8
ports:
a:
direction: input
width: 8
neg_a:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
check_wav... | `timescale 1ns/1ps
module tb_neg8;
reg [7:0] a;
wire [7:0] neg_a;
// Instantiate the module under test
neg8 uut (
.a(a),
.neg_a(neg_a)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing neg8...");
// Test 1
a =... |
075_bcd_adder | bundles/L1_basic/075_bcd_adder | BCD Adder | L1_basic | L1 | 075 | # BCD Adder
**Level**: 1 (Basic Combinational Logic)
**Category**: arithmetic
## Problem Description
1-digit BCD adder with carry
## Module Interface
```verilog
module bcd_adder(
input [3:0] a, input [3:0] b, input cin,
output [3:0] sum, output cout
);
```
## Specifications
**Inputs:**
- `a` (4-bit): Inp... | problem_id: '075'
title: BCD Adder
level: 1
category: arithmetic
description: 1-digit BCD adder with carry
module_name: bcd_adder
ports:
a:
direction: input
width: 4
b:
direction: input
width: 4
cin:
direction: input
width: 1
sum:
direction: output
width: 4
cout:
direction:... | `timescale 1ns/1ps
module tb_bcd_adder;
reg [3:0] a;
reg [3:0] b;
reg cin;
wire [3:0] sum;
wire cout;
// Instantiate the module under test
bcd_adder uut (
.a(a),
.b(b),
.cin(cin),
.sum(sum),
.cout(cout)
);
integer pass_count = 0;
intege... |
076_left_shift | bundles/L1_basic/076_left_shift | Left Shift | L1_basic | L1 | 076 | # Left Shift
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
8-bit left shift by 1
## Module Interface
```verilog
module left_shift(
input [7:0] in,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
**Outputs:**
- `out` (8-bi... | problem_id: '076'
title: Left Shift
level: 1
category: bit_manipulation
description: 8-bit left shift by 1
module_name: left_shift
ports:
in:
direction: input
width: 8
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
check_... | `timescale 1ns/1ps
module tb_left_shift;
reg [7:0] in;
wire [7:0] out;
// Instantiate the module under test
left_shift uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing left_shift...");
// Tes... |
077_right_shift | bundles/L1_basic/077_right_shift | Right Shift | L1_basic | L1 | 077 | # Right Shift
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
8-bit logical right shift by 1
## Module Interface
```verilog
module right_shift(
input [7:0] in,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
**Outputs:**
- ... | problem_id: '077'
title: Right Shift
level: 1
category: bit_manipulation
description: 8-bit logical right shift by 1
module_name: right_shift
ports:
in:
direction: input
width: 8
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: f... | `timescale 1ns/1ps
module tb_right_shift;
reg [7:0] in;
wire [7:0] out;
// Instantiate the module under test
right_shift uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing right_shift...");
// ... |
078_left_shift_n | bundles/L1_basic/078_left_shift_n | Variable Left Shift | L1_basic | L1 | 078 | # Variable Left Shift
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
8-bit left shift by n (0-7)
## Module Interface
```verilog
module left_shift_n(
input [7:0] in, input [2:0] shift,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Inp... | problem_id: 078
title: Variable Left Shift
level: 1
category: bit_manipulation
description: 8-bit left shift by n (0-7)
module_name: left_shift_n
ports:
in:
direction: input
width: 8
shift:
direction: input
width: 3
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compil... | `timescale 1ns/1ps
module tb_left_shift_n;
reg [7:0] in;
reg [2:0] shift;
wire [7:0] out;
// Instantiate the module under test
left_shift_n uut (
.in(in),
.shift(shift),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$d... |
079_right_shift_n | bundles/L1_basic/079_right_shift_n | Variable Right Shift | L1_basic | L1 | 079 | # Variable Right Shift
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
8-bit logical right shift by n
## Module Interface
```verilog
module right_shift_n(
input [7:0] in, input [2:0] shift,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit)... | problem_id: 079
title: Variable Right Shift
level: 1
category: bit_manipulation
description: 8-bit logical right shift by n
module_name: right_shift_n
ports:
in:
direction: input
width: 8
shift:
direction: input
width: 3
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_c... | `timescale 1ns/1ps
module tb_right_shift_n;
reg [7:0] in;
reg [2:0] shift;
wire [7:0] out;
// Instantiate the module under test
right_shift_n uut (
.in(in),
.shift(shift),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
... |
080_rotate_left | bundles/L1_basic/080_rotate_left | Rotate Left | L1_basic | L1 | 080 | # Rotate Left
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
8-bit rotate left by 1
## Module Interface
```verilog
module rotate_left(
input [7:0] in,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
**Outputs:**
- `out` (8... | problem_id: 080
title: Rotate Left
level: 1
category: bit_manipulation
description: 8-bit rotate left by 1
module_name: rotate_left
ports:
in:
direction: input
width: 8
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
check... | `timescale 1ns/1ps
module tb_rotate_left;
reg [7:0] in;
wire [7:0] out;
// Instantiate the module under test
rotate_left uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing rotate_left...");
// ... |
081_rotate_right | bundles/L1_basic/081_rotate_right | Rotate Right | L1_basic | L1 | 081 | # Rotate Right
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
8-bit rotate right by 1
## Module Interface
```verilog
module rotate_right(
input [7:0] in,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
**Outputs:**
- `out`... | problem_id: 081
title: Rotate Right
level: 1
category: bit_manipulation
description: 8-bit rotate right by 1
module_name: rotate_right
ports:
in:
direction: input
width: 8
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false
ch... | `timescale 1ns/1ps
module tb_rotate_right;
reg [7:0] in;
wire [7:0] out;
// Instantiate the module under test
rotate_right uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing rotate_right...");
... |
082_rotate_left_n | bundles/L1_basic/082_rotate_left_n | Variable Rotate Left | L1_basic | L1 | 082 | # Variable Rotate Left
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
8-bit rotate left by n
## Module Interface
```verilog
module rotate_left_n(
input [7:0] in, input [2:0] rot,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input va... | problem_id: 082
title: Variable Rotate Left
level: 1
category: bit_manipulation
description: 8-bit rotate left by n
module_name: rotate_left_n
ports:
in:
direction: input
width: 8
rot:
direction: input
width: 3
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10... | `timescale 1ns/1ps
module tb_rotate_left_n;
reg [7:0] in;
reg [2:0] rot;
wire [7:0] out;
// Instantiate the module under test
rotate_left_n uut (
.in(in),
.rot(rot),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$displ... |
083_bit_reverse | bundles/L1_basic/083_bit_reverse | Bit Reversal | L1_basic | L1 | 083 | # Bit Reversal
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
Reverse bits of 8-bit value
## Module Interface
```verilog
module bit_reverse(
input [7:0] in,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
**Outputs:**
- `o... | problem_id: 083
title: Bit Reversal
level: 1
category: bit_manipulation
description: Reverse bits of 8-bit value
module_name: bit_reverse
ports:
in:
direction: input
width: 8
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false... | `timescale 1ns/1ps
module tb_bit_reverse;
reg [7:0] in;
wire [7:0] out;
// Instantiate the module under test
bit_reverse uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing bit_reverse...");
// ... |
084_count_ones | bundles/L1_basic/084_count_ones | Count Ones | L1_basic | L1 | 084 | # Count Ones
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
Count number of 1s in 8-bit value
## Module Interface
```verilog
module count_ones(
input [7:0] in,
output [3:0] count
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
**Outputs:**... | problem_id: 084
title: Count Ones
level: 1
category: bit_manipulation
description: Count number of 1s in 8-bit value
module_name: count_ones
ports:
in:
direction: input
width: 8
count:
direction: output
width: 4
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: ... | `timescale 1ns/1ps
module tb_count_ones;
reg [7:0] in;
wire [3:0] count;
// Instantiate the module under test
count_ones uut (
.in(in),
.count(count)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing count_ones...");
... |
085_parity | bundles/L1_basic/085_parity | Parity Generator | L1_basic | L1 | 085 | # Parity Generator
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
Generate even parity bit for 8-bit data
## Module Interface
```verilog
module parity(
input [7:0] in,
output parity
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
**Outputs... | problem_id: 085
title: Parity Generator
level: 1
category: bit_manipulation
description: Generate even parity bit for 8-bit data
module_name: parity
ports:
in:
direction: input
width: 8
parity:
direction: output
width: 1
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_sy... | `timescale 1ns/1ps
module tb_parity;
reg [7:0] in;
wire parity;
// Instantiate the module under test
parity uut (
.in(in),
.parity(parity)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing parity...");
// Test 1
... |
086_swap_nibbles | bundles/L1_basic/086_swap_nibbles | Swap Nibbles | L1_basic | L1 | 086 | # Swap Nibbles
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
Swap upper and lower nibbles of 8-bit value
## Module Interface
```verilog
module swap_nibbles(
input [7:0] in,
output [7:0] out
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
... | problem_id: 086
title: Swap Nibbles
level: 1
category: bit_manipulation
description: Swap upper and lower nibbles of 8-bit value
module_name: swap_nibbles
ports:
in:
direction: input
width: 8
out:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require... | `timescale 1ns/1ps
module tb_swap_nibbles;
reg [7:0] in;
wire [7:0] out;
// Instantiate the module under test
swap_nibbles uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing swap_nibbles...");
... |
087_bit_mask | bundles/L1_basic/087_bit_mask | Bit Mask | L1_basic | L1 | 087 | # Bit Mask
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
Create mask with n lowest bits set
## Module Interface
```verilog
module bit_mask(
input [3:0] n,
output [7:0] mask
);
```
## Specifications
**Inputs:**
- `n` (4-bit): Input value
**Outputs:**
- `ma... | problem_id: 087
title: Bit Mask
level: 1
category: bit_manipulation
description: Create mask with n lowest bits set
module_name: bit_mask
ports:
n:
direction: input
width: 4
mask:
direction: output
width: 8
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synthesis: false... | `timescale 1ns/1ps
module tb_bit_mask;
reg [3:0] n;
wire [7:0] mask;
// Instantiate the module under test
bit_mask uut (
.n(n),
.mask(mask)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing bit_mask...");
// Test 1
... |
088_leading_zeros | bundles/L1_basic/088_leading_zeros | Count Leading Zeros | L1_basic | L1 | 088 | # Count Leading Zeros
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
Count leading zeros in 8-bit value
## Module Interface
```verilog
module leading_zeros(
input [7:0] in,
output [3:0] count
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input value
... | problem_id: 088
title: Count Leading Zeros
level: 1
category: bit_manipulation
description: Count leading zeros in 8-bit value
module_name: leading_zeros
ports:
in:
direction: input
width: 8
count:
direction: output
width: 4
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
requir... | `timescale 1ns/1ps
module tb_leading_zeros;
reg [7:0] in;
wire [3:0] count;
// Instantiate the module under test
leading_zeros uut (
.in(in),
.count(count)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing leading_zeros...");
... |
089_trailing_zeros | bundles/L1_basic/089_trailing_zeros | Count Trailing Zeros | L1_basic | L1 | 089 | # Count Trailing Zeros
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
Count trailing zeros in 8-bit value
## Module Interface
```verilog
module trailing_zeros(
input [7:0] in,
output [3:0] count
);
```
## Specifications
**Inputs:**
- `in` (8-bit): Input val... | problem_id: 089
title: Count Trailing Zeros
level: 1
category: bit_manipulation
description: Count trailing zeros in 8-bit value
module_name: trailing_zeros
ports:
in:
direction: input
width: 8
count:
direction: output
width: 4
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
req... | `timescale 1ns/1ps
module tb_trailing_zeros;
reg [7:0] in;
wire [3:0] count;
// Instantiate the module under test
trailing_zeros uut (
.in(in),
.count(count)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing trailing_zeros..."... |
090_reverse_bytes | bundles/L1_basic/090_reverse_bytes | Reverse Bytes | L1_basic | L1 | 090 | # Reverse Bytes
**Level**: 1 (Basic Combinational Logic)
**Category**: bit_manipulation
## Problem Description
Reverse byte order of 16-bit value
## Module Interface
```verilog
module reverse_bytes(
input [15:0] in,
output [15:0] out
);
```
## Specifications
**Inputs:**
- `in` (16-bit): Input value
**Ou... | problem_id: 090
title: Reverse Bytes
level: 1
category: bit_manipulation
description: Reverse byte order of 16-bit value
module_name: reverse_bytes
ports:
in:
direction: input
width: 16
out:
direction: output
width: 16
testbench_file: testbench.v
timeout_compile: 10
timeout_simulate: 30
require_synt... | `timescale 1ns/1ps
module tb_reverse_bytes;
reg [15:0] in;
wire [15:0] out;
// Instantiate the module under test
reverse_bytes uut (
.in(in),
.out(out)
);
integer pass_count = 0;
integer fail_count = 0;
initial begin
$display("Testing reverse_bytes...");
... |
091_abs_8bit | bundles/L1_basic/091_abs_8bit | 8-bit Absolute Value | L1_basic | L1 | 091 | # 8-bit Absolute Value
## Description
Calculate absolute value of 8-bit signed number.
## Module Interface
```verilog
module abs_8bit (
input [7:0] in, output [7:0] out
);
```
## Port Specification
- `in`: input/8
- `out`: output/8
## Functionality
Implement the functionality as described above.
## Test... | problem_id: 91
title: 8-bit Absolute Value
difficulty: L1
module_name: abs_8bit
description: Calculate absolute value of 8-bit signed number.
ports:
in: input/8
out: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_abs_8bit;
reg [7:0] in;
wire [7:0] out;
abs_8bit dut(.in(in), .out(out));
integer i, pass_count, fail_count;
reg [7:0] expected;
initial begin
pass_count = 0; fail_count = 0;
for (i = 0; i < 256; i = i + 1) begin
in = i[7:0]; #10;
... |
092_sat_adder_4bit | bundles/L1_basic/092_sat_adder_4bit | 4-bit Saturating Adder | L1_basic | L1 | 092 | # 4-bit Saturating Adder
## Description
4-bit adder with saturation on overflow.
## Module Interface
```verilog
module sat_adder_4bit (
input [3:0] a, input [3:0] b, output [3:0] sum, output overflow
);
```
## Port Specification
- `a`: input/4
- `b`: input/4
- `sum`: output/4
- `overflow`: output/1... | problem_id: 92
title: 4-bit Saturating Adder
difficulty: L1
module_name: sat_adder_4bit
description: 4-bit adder with saturation on overflow.
ports:
a: input/4
b: input/4
sum: output/4
overflow: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_sat_adder;
reg [3:0] a, b;
wire [3:0] sum;
wire overflow;
sat_adder_4bit dut(.a(a), .b(b), .sum(sum), .overflow(overflow));
integer i, j, pass_count, fail_count;
reg [4:0] fs;
reg exp_ovf;
reg [3:0] exp_sum;
initial begin
pass_count = 0; fail_coun... |
093_min_max_3 | bundles/L1_basic/093_min_max_3 | Min/Max 3 Numbers | L1_basic | L1 | 093 | # Min/Max 3 Numbers
## Description
Find minimum and maximum of three 8-bit numbers.
## Module Interface
```verilog
module min_max_3 (
input [7:0] a, input [7:0] b, input [7:0] c, output [7:0] min, output [7:0] max
);
```
## Port Specification
- `a`: input/8
- `b`: input/8
- `c`: input/8
- `min`... | problem_id: 93
title: Min/Max 3 Numbers
difficulty: L1
module_name: min_max_3
description: Find minimum and maximum of three 8-bit numbers.
ports:
a: input/8
b: input/8
c: input/8
min: output/8
max: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_min_max_3;
reg [7:0] a, b, c;
wire [7:0] min, max;
min_max_3 dut(.a(a), .b(b), .c(c), .min(min), .max(max));
integer i, pass_count, fail_count;
reg [7:0] exp_min, exp_max, t;
initial begin
pass_count = 0; fail_count = 0;
for (i = 0; i < 100; i = i + 1... |
094_avg_8bit | bundles/L1_basic/094_avg_8bit | 8-bit Average Calculator | L1_basic | L1 | 094 | # 8-bit Average Calculator
## Description
Calculate average of two 8-bit numbers.
## Module Interface
```verilog
module avg_8bit (
input [7:0] a, input [7:0] b, output [7:0] avg
);
```
## Port Specification
- `a`: input/8
- `b`: input/8
- `avg`: output/8
## Functionality
Implement the functionality a... | problem_id: 94
title: 8-bit Average Calculator
difficulty: L1
module_name: avg_8bit
description: Calculate average of two 8-bit numbers.
ports:
a: input/8
b: input/8
avg: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_avg_8bit;
reg [7:0] a, b;
wire [7:0] avg;
avg_8bit dut(.a(a), .b(b), .avg(avg));
integer i, pass_count, fail_count;
reg [7:0] exp;
initial begin
pass_count = 0; fail_count = 0;
for (i = 0; i < 100; i = i + 1) begin
a = $random; b = $random... |
095_cla_4bit | bundles/L1_basic/095_cla_4bit | Carry-Lookahead Adder 4-bit | L1_basic | L1 | 095 | # Carry-Lookahead Adder 4-bit
## Description
4-bit carry-lookahead adder.
## Module Interface
```verilog
module cla_4bit (
input [3:0] a, input [3:0] b, input cin, output [3:0] sum, output cout
);
```
## Port Specification
- `a`: input/4
- `b`: input/4
- `cin`: input/1
- `sum`: output/4
- `cout... | problem_id: 95
title: Carry-Lookahead Adder 4-bit
difficulty: L1
module_name: cla_4bit
description: 4-bit carry-lookahead adder.
ports:
a: input/4
b: input/4
cin: input/1
sum: output/4
cout: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_cla_4bit;
reg [3:0] a, b;
reg cin;
wire [3:0] sum;
wire cout;
cla_4bit dut(.a(a), .b(b), .cin(cin), .sum(sum), .cout(cout));
integer i, j, k, pass_count, fail_count;
reg [4:0] exp;
initial begin
pass_count = 0; fail_count = 0;
for (i = 0; i < ... |
096_parity_16bit | bundles/L1_basic/096_parity_16bit | Bit Parity Generator 16-bit | L1_basic | L1 | 096 | # Bit Parity Generator 16-bit
## Description
Generate even and odd parity for 16-bit data.
## Module Interface
```verilog
module parity_16bit (
input [15:0] data, output even_parity, output odd_parity
);
```
## Port Specification
- `data`: input/16
- `even_parity`: output/1
- `odd_parity`: output/1
##... | problem_id: 96
title: Bit Parity Generator 16-bit
difficulty: L1
module_name: parity_16bit
description: Generate even and odd parity for 16-bit data.
ports:
data: input/16
even_parity: output/1
odd_parity: output/1
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_parity;
reg [15:0] data;
wire even_parity, odd_parity;
parity_16bit dut(.data(data), .even_parity(even_parity), .odd_parity(odd_parity));
integer i, pass_count, fail_count, cnt;
initial begin
pass_count = 0; fail_count = 0;
for (i = 0; i < 100; i = i + 1)... |
097_leading_zeros | bundles/L1_basic/097_leading_zeros | Leading Zero Counter | L1_basic | L1 | 097 | # Leading Zero Counter
## Description
Count leading zeros in 16-bit data.
## Module Interface
```verilog
module leading_zeros (
input [15:0] data, output [4:0] count
);
```
## Port Specification
- `data`: input/16
- `count`: output/5
## Functionality
This counter should count on positive clock edge. Rese... | problem_id: 97
title: Leading Zero Counter
difficulty: L1
module_name: leading_zeros
description: Count leading zeros in 16-bit data.
ports:
data: input/16
count: output/5
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_lzc;
reg [15:0] data;
wire [4:0] count;
leading_zeros dut(.data(data), .count(count));
integer i, j, pass_count, fail_count;
reg [4:0] exp;
initial begin
pass_count = 0; fail_count = 0;
// Test zero
data = 0; #10;
if (count !== 5'd16) ... |
098_trailing_ones | bundles/L1_basic/098_trailing_ones | Trailing One Counter | L1_basic | L1 | 098 | # Trailing One Counter
## Description
Count trailing ones in 16-bit data.
## Module Interface
```verilog
module trailing_ones (
input [15:0] data, output [4:0] count
);
```
## Port Specification
- `data`: input/16
- `count`: output/5
## Functionality
This counter should count on positive clock edge. Rese... | problem_id: 98
title: Trailing One Counter
difficulty: L1
module_name: trailing_ones
description: Count trailing ones in 16-bit data.
ports:
data: input/16
count: output/5
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_trailing_ones;
reg [15:0] data;
wire [4:0] count;
trailing_ones dut(.data(data), .count(count));
integer i, j, pass_count, fail_count;
reg [4:0] exp;
initial begin
pass_count = 0; fail_count = 0;
data = 0; #10;
if (count !== 0) fail_count = fa... |
099_bit_mask_gen | bundles/L1_basic/099_bit_mask_gen | Bit Mask Generator | L1_basic | L1 | 099 | # Bit Mask Generator
## Description
Generate bit mask starting at position 'start' with 'length' bits.
## Module Interface
```verilog
module bit_mask_gen (
input [2:0] start, input [2:0] length, output [7:0] mask
);
```
## Port Specification
- `start`: input/3
- `length`: input/3
- `mask`: output/8
##... | problem_id: 99
title: Bit Mask Generator
difficulty: L1
module_name: bit_mask_gen
description: Generate bit mask starting at position 'start' with 'length' bits.
ports:
start: input/3
length: input/3
mask: output/8
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_mask_gen;
reg [2:0] start, length;
wire [7:0] mask;
bit_mask_gen dut(.start(start), .length(length), .mask(mask));
integer i, j, k, pass_count, fail_count;
reg [7:0] exp;
initial begin
pass_count = 0; fail_count = 0;
for (i = 0; i < 8; i = i + 1)
... |
100_bit_extract | bundles/L1_basic/100_bit_extract | Bit Field Extractor | L1_basic | L1 | 100 | # Bit Field Extractor
## Description
Extract bit field from data.
## Module Interface
```verilog
module bit_extract (
input [15:0] data, input [3:0] start, input [3:0] length, output [15:0] extracted
);
```
## Port Specification
- `data`: input/16
- `start`: input/4
- `length`: input/4
- `extracted... | problem_id: 100
title: Bit Field Extractor
difficulty: L1
module_name: bit_extract
description: Extract bit field from data.
ports:
data: input/16
start: input/4
length: input/4
extracted: output/16
testbench: testbench.v
timeout: 10
test_cases: 100
| `timescale 1ns/1ps
module tb_bit_extract;
reg [15:0] data;
reg [3:0] start, length;
wire [15:0] extracted;
bit_extract dut(.data(data), .start(start), .length(length), .extracted(extracted));
integer i, j, pass_count, fail_count;
reg [15:0] exp;
initial begin
pass_count = 0; fail_cou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.