xiaohongshu
xiaohongshu
circuit-fibsqrt
Guidance for building digital logic circuits that compute composite functions like Fibonacci of integer square root. This skill applies when implementing combinational and sequential logic in gate-level simulators, particularly when combining algorithms (like isqrt and Fibonacci) under resource c...
Full skill instructions
This skill provides guidance for designing and implementing digital logic circuits that compute composite mathematical functions. The canonical example is computing fib(isqrt(N)) - the Fibonacci number at the index equal to the integer square root of N. These tasks require combining combinational logic (pure functions like isqrt) with sequential logic (stateful computations like Fibonacci iteration) while respecting resource constraints.
Before writing any circuit logic, verify understanding of the simulator's execution model:
out{i} = out{i}) or are passed through automaticallyCreate minimal test cases to validate each assumption before building the full circuit.
Decompose the problem into independent components:
Before implementing, estimate resource usage:
isqrt(2^32-1) ≈ 65535 for 32-bit inputs)The bit-by-bit isqrt algorithm builds the result one bit at a time from MSB to LSB:
result = 0
for bit from (output_bits-1) down to 0:
test = result | (1 << bit)
if test * test <= N:
result = test
Key implementation considerations:
(result + 2^bit)^2 = result^2 + 2*result*2^bit + 2^(2*bit)Fibonacci requires sequential state updates:
state: (a, b, counter)
initial: (0, 1, target_index)
update: (b, a+b, counter-1)
done: counter == 0
output: a
Key implementation considerations:
fib(0) = 0, fib(1) = 1For sequential components, define states explicitly:
Use a counter or explicit state register to track progress. Multiplexers select between:
Test each component in isolation before integration:
Test the combined circuit with progressively complex inputs:
When the circuit produces incorrect output:
A critical bug pattern: setting input signals to constant 0 instead of passing them through. If the simulator expects identity mappings for inputs (out{i} = out{i}), omitting this causes all inputs to read as 0.
Symptom: Circuit produces the same output regardless of input value.
Working through algorithms on paper before implementing prevents:
Multiplexers select between inputs based on a control signal. Reversing the argument order causes inverted selection logic:
mux(sel, a, b) might mean "if sel then a else b" or "if sel then b else a"In sequential circuits with feedback:
Complex operations like multiplication can exceed gate limits:
When implementing, load references/debugging_guide.md for detailed debugging strategies specific to gate-level circuit simulation.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience