BRIK64
Back to Blog
TUTORIALMAR 5, 2026

Your First PCD Circuit in 5 Minutes

Step-by-step tutorial for writing, compiling, and certifying your first PCD circuit using brikc. From install to Φ_c = 1 in minutes.

What is PCD?

PCD — Printed Circuit Description — is a programming language where every program is a verifiable circuit. Just as a PCB (Printed Circuit Board) describes physical connections between components, a PCD file describes logical connections between BRIK-64 monomers. Every PCD program can be measured, verified, and certified before it ever runs.

In this tutorial, you'll write your first PCD circuit, run it, compile it to JavaScript and Python, and verify its certification — all in under five minutes.

Step 1: Install brikc

The BRIK-64 compiler, brikc, is a single binary. Install it with one command:

curl -L https://brik64.dev/install | sh

This installs brikc to ~/.brik/bin and adds it to your PATH. Verify with:

brikc --version

Step 2: Create hello.pcd

Create a file called hello.pcd with a simple factorial program:

// A factorial circuit
// Takes input n (8-bit unsigned), computes factorial
// Outputs result as 16-bit value
// Every operation is a verified BRIK-64 monomer

This circuit takes an 8-bit unsigned integer n, computes its factorial, and outputs the result as a 16-bit value. Every operation in the pipeline is a verified BRIK-64 monomer.

Step 3: Run it

Execute the circuit directly:

brikc run hello.pcd
# Input: n = 6
# Output: 720

The default input is n = 6, and 6! = 720. The circuit produces the correct result, and brikc automatically verifies the computation during execution.

Step 4: Compile to JavaScript

PCD circuits can be compiled to multiple target languages. Let's start with JavaScript:

brikc build hello.pcd -t javascript

This generates output/hello.js. Run it with Node:

node output/hello.js
# Output: 720

Same input, same output. The compiled JavaScript uses the BRIK-64 SDK under the hood, so every operation remains verified even in the target language.

Step 5: Compile to Python

Target Python just as easily:

brikc build hello.pcd -t python

This generates output/hello.py. The Python output uses the brik64 Python SDK and produces the same verified result.

Step 6: Check Certification

Now for the important part — verify the circuit's certification:

brikc check hello.pcd

  Circuit: factorial
  Monomers: 3 operations
  Composition: sequential
  TCE: 7 metrics evaluated
  ─────────────────────────
  Φ_c = 1.000 ✓ CERTIFIED

What Does Φc = 1 Mean?

Φc = 1 means the circuit is closed — every input maps deterministically to an output, with zero information leakage. Your first circuit is certified.