Hello, World
module main;
initial begin
$display("Hello, World!");
$finish;
end
endmoduleTap Run to execute
main.v · output appears here
Press Run to execute
Output streams here as your program runs.
Verilog is the hardware description language used to design and verify digital circuits, from a single flip-flop to a full processor. Instead of describing steps for a CPU to execute, a Verilog module describes hardware: wires, registers and the always blocks that update them on a clock edge. CompileBytes runs your code with Icarus Verilog 13.0, compiling it with iverilog and simulating it with vvp, so testbench output from $display and $monitor appears in the console instantly.
The playground accepts Verilog-2005 and the SystemVerilog subset Icarus supports with the -g2012 flag, including logic, always_ff and always_comb. Put your top-level module in main.v, add more .v files from the file explorer for separate modules, and end the simulation with $finish so the run completes. Because the simulator runs on the server, there is nothing to install: it works for learning the language, checking a testbench before synthesis, or trying a design idea in the browser.
main.v is the entry point. Add helper files from the explorer and import them into your project.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
module main;
initial begin
$display("Hello, World!");
$finish;
end
endmodulemodule main;
reg clk = 0;
reg [3:0] count = 0;
always #5 clk = ~clk;
always @(posedge clk) count <= count + 1;
initial begin
$monitor("t=%0t count=%0d", $time, count);
#50 $finish;
end
endmodulemodule adder (
input [3:0] a,
input [3:0] b,
output [4:0] sum
);
assign sum = a + b;
endmodule
module main;
reg [3:0] a, b;
wire [4:0] sum;
adder dut (
.a (a),
.b (b),
.sum(sum)
);
initial begin
a = 4'd7;
b = 4'd9;
#1 $display("%0d + %0d = %0d", a, b, sum);
a = 4'd15;
b = 4'd1;
#1 $display("%0d + %0d = %0d", a, b, sum);
$finish;
end
endmodulemodule main;
reg [7:0] x = 8'b1010_1100;
initial begin
$display("bin=%b hex=%h dec=%0d", x, x, x);
$display("shift left: %b", x << 2);
$display("inverted: %b", ~x);
$display("and mask: %b", x & 8'h0F);
$finish;
end
endmodulemodule main;
integer i;
initial begin
for (i = 1; i <= 5; i = i + 1) $display("%0d squared is %0d", i, i * i);
$finish;
end
endmodulemodule main;
reg [1:0] op;
reg [7:0] a = 12, b = 5, r;
integer k;
initial begin
for (k = 0; k < 4; k = k + 1) begin
op = k[1:0];
case (op)
2'b00: r = a + b;
2'b01: r = a - b;
2'b10: r = a & b;
default: r = a | b;
endcase
$display("op=%b result=%0d", op, r);
end
$finish;
end
endmodulemodule main;
function [7:0] double(input [7:0] n);
double = n * 2;
endfunction
task show(input [7:0] n);
$display("value %0d, doubled %0d", n, double(n));
endtask
initial begin
show(21);
show(100);
$finish;
end
endmodulemodule main;
integer stdin, n, ok;
initial begin
stdin = 32'h8000_0000;
ok = $fscanf(stdin, "%d", n);
$display("Doubled: %0d", n * 2);
$finish;
end
endmoduleThe editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Type or paste your code into the editor, then click Run (or press Ctrl/Cmd + Enter) to execute it.
Output streams into the console panel, including runtime errors, exit status, and execution time.
Nothing to install and no account to create — code runs in an isolated hosted runtime.
Language-aware autocomplete and IntelliSense suggestions where the editor has a matching language service
Syntax highlighting, with native compiler and runtime errors shown in the console
Bracket matching, auto-indentation, code folding, and a minimap
Multi-cursor editing plus find & replace (Ctrl/Cmd + F)
Full undo/redo history and copy to clipboard
Built on Monaco — the same editor that powers VS Code
Run on demand with Run or Ctrl/Cmd + Enter, or turn on Auto-run in the editor settings to execute after each typing pause
Stop long-running or infinite programs at any time
A real console shows standard output, errors, exit status, and execution time
Pass standard input (stdin) to your program from the Input panel — one value per line
Switch between light and dark themes
Adjust font size and other editor settings
Toggle side-by-side or top/bottom layouts
Enter distraction-free fullscreen mode
Generate a shareable link to your exact code in one click — no login needed
Your work autosaves to your browser, so you can pick up where you left off
Copy the active file to your clipboard
Run code: Ctrl/Cmd + Enter
Find & replace: Ctrl/Cmd + F
Open the full shortcut list from the keyboard icon in the toolbar
Verilog is one of 24 linked-project compilers. Run always starts main.v; selecting a helper tab changes what you edit, not the entry file.
All source tabs are submitted together so main.v can use sibling files.
Linked-project languages (24): Node.js, TypeScript, Deno, Python, C, Go, Dart, Swift, Rust, Ruby, PHP, Java, Kotlin, C++, C#, Nim, Crystal, Haxe, Zig, Scala, D, Verilog, Bun, Objective-C.
Single-file scratchpads (46): Matplotlib, NumPy, pandas, Haskell, Clojure, Perl, Lua, Tcl, jq, Raku, Elixir, Bash, Zsh, Nushell, R, Assembly (NASM), Julia, Octave, Groovy, PowerShell, Visual Basic .NET, Odin, Pascal, Lisp, Erlang, CoffeeScript, COBOL, BASIC, V, Racket, OCaml, Prolog, AWK, Emacs Lisp, Emojicode, Forth, F#, Fortran, Assembly (NASM64), Solidity, Mojo, Ada, WASM (WAT), Gleam, Shell Script (sh), Scheme. Their extra project files are not submitted to the runtime.
Download project exports every Verilog tab and a README in one ZIP archive.