design-logic-circuit
О программе
Этот навык Claude проектирует комбинационные логические схемы на уровне логических элементов по функциональным спецификациям или таблицам истинности. Он реализует схемы с использованием базовых элементов, выполняет универсальные преобразования NAND/NOR и создаёт стандартные компоненты, такие как сумматоры и мультиплексоры. Используйте его для преобразования булевой логики в проверенную, реализуемую на аппаратном уровне сеть.
Быстрая установка
Claude Code
Рекомендуетсяnpx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/design-logic-circuitСкопируйте и вставьте эту команду в Claude Code для установки этого навыка
Документация
Design Logic Circuit
Spec → combinational circuit. Define I/O, derive min Bool expr, map → gate schematic, (optional) convert to universal gate basis (NAND/NOR), verify via exhaustive sim.
Use When
- Bool fn → gate net (physical or sim)
- Std combinational blocks (adders, muxes, decoders, comparators)
- Convert arbitrary → NAND-only / NOR-only for mfg
- Teach/review digital logic spec → schematic
- Prep combinational datapath for build-sequential-circuit or simulate-cpu-architecture
In
- Required: Spec — truth table, Bool expr, verbal I/O desc, or std block name (e.g., "4-bit ripple-carry adder")
- Required: Target gate lib — unrestricted (AND/OR/NOT), NAND-only, NOR-only, or std cell lib
- Optional: Optimize goal — min gate count, min prop delay (critical path), min fan-out
- Optional: Max fan-in (e.g., 2-input only)
- Optional: Don't-cares
Do
Step 1: Spec
Interface + behavior before synthesis:
- Inputs: Names, widths, ranges. Multi-bit → bit order (MSB/LSB-first).
- Outputs: Names + widths.
- Truth table: Every input combo → outputs. Many inputs → algebraic or minterms/maxterms.
- Don't-cares: Input combos that can't occur (BCD 1010-1111) → mark.
- Timing: Prop delay constraints. Combinational = no clock → worst-case gate delay through critical path.
## Circuit Specification
- **Name**: [descriptive name]
- **Inputs**: [list with bit widths]
- **Outputs**: [list with bit widths]
- **Function**: [verbal description]
- **Truth table or minterm list**: [table or Sigma notation]
- **Don't-care set**: [d(...) or "none"]
→ Unambiguous spec, every legal input → exactly one output.
If err: Ambiguous (missing cases, conflicting outputs) → clarify. Don't assume don't-care unless told.
Step 2: Derive min Bool expr
evaluate-boolean-expression skill:
- Single-output: Each bit → min SOP (or POS, whichever fewer gates).
- Multi-output: Shared sub-exprs → factor out. Fewer gates + more routing.
- XOR detection: Checkerboard patterns in K-map. XOR expensive in NAND/NOR-only, efficient in std libs.
- Record: Min expr each output + literal count + term count.
## Minimal Expressions
| Output | Minimal SOP | Literals | Terms |
|--------|-------------|----------|-------|
| F1 | [expression] | [count] | [count] |
| F2 | [expression] | [count] | [count] |
- **Shared sub-expressions**: [list, if any]
→ Min expr each output + shared sub-exprs ID'd.
If err: Non-minimal (more literals than expected) → re-run K-map or Quine-McCluskey. >6 vars → Espresso.
Step 3: Map → gate schematic
Bool → gate network:
- Direct SOP: Product term → multi-input AND. Sum → OR fed by ANDs. Complemented var → NOT (or use NAND/NOR to absorb).
- Gate assignment: Each gate:
- Type (AND, OR, NOT, XOR, NAND, NOR)
- Inputs (name or from other gate)
- Output name
- Fan-in
- Fan-in decomp: Exceeds max → tree of smaller. 4-input AND w/ 2-input → 2 two-input ANDs feeding 3rd.
- Notation: Text netlist or structured.
## Gate-Level Netlist
| Gate ID | Type | Inputs | Output | Fan-in |
|---------|------|-------------|--------|--------|
| G1 | NOT | A | A' | 1 |
| G2 | AND | A', B | w1 | 2 |
| G3 | AND | A, C | w2 | 2 |
| G4 | OR | w1, w2 | F | 2 |
- **Total gates**: [count]
- **Critical path depth**: [number of gate levels from input to output]
→ Complete netlist, every output traceable to primary inputs, no floating.
If err: Dangling wires or feedback loops (invalid combinational) → recheck. Every signal = exactly one driver, every gate input connects.
Step 4: Convert → universal basis (optional)
NAND-only or NOR-only:
- NAND-only:
- AND → NAND + NOT (NAND tied inputs)
- OR → De Morgan:
A + B = ((A')*(B'))' = NAND(A', B')→ NOTs then NAND - NOT →
A' = NAND(A, A) - Bubble pushing: Cancel adjacent inversions. 2 NOTs series cancel. NAND → NOT = AND.
- NOR-only:
- OR → NOR + NOT
- AND → De Morgan:
A * B = ((A')+(B'))' = NOR(A', B') - NOT →
NOR(A, A) - Bubble push cancels inversions.
- Gate count: Before + after. NAND/NOR-only typ more gates but simplify mfg.
## Universal Gate Conversion
- **Target basis**: [NAND-only / NOR-only]
- **Gates before conversion**: [count]
- **Gates after conversion**: [count]
- **Gates after bubble-push optimization**: [count]
- **Conversion netlist**: [updated table]
→ Functionally equiv, redundant inversions eliminated via bubble push.
If err: More inversions than expected → re-examine bubble push. Common: forgetting NAND/NOR self-dual under complementation. De Morgan consistently from outputs back → inputs.
Step 5: Verify via exhaustive sim
Correct for every input:
- Approach: ≤16 inputs (65,536 combos) → exhaustive. Larger → targeted vectors + corner cases + random.
- Propagate: Each combo, propagate gate by gate in topological order.
- Compare: Check each output vs truth table. Don't-cares → 0 or 1.
- Record: Mismatches w/ input + expected vs actual.
- Timing (optional): Count gate levels longest path. × per-gate delay → worst-case prop.
## Simulation Results
- **Total test vectors**: [count]
- **Vectors passed**: [count]
- **Vectors failed**: [count, with details if any]
- **Critical path**: [gate sequence, e.g., G1 -> G3 -> G7 -> G9]
- **Critical path depth**: [N gate levels]
- **Estimated worst-case delay**: [N * gate_delay]
→ All vectors pass. Functional + critical path docs.
If err: Vector fails → trace path gate by gate. First gate w/ incorrect output. Common: wire wrong input, missing inversion, NAND/NOR conversion err.
Check
- All I/O named + widths spec'd
- Truth table covers all legal combos
- Bool exprs min (K-map/Quine-McCluskey)
- Every gate all inputs connected + exactly one output
- No combinational feedback
- Fan-in constraints respected
- NAND/NOR conversion preserves equivalence
- Bubble push eliminates redundant inversions
- Exhaustive sim passes (non-don't-cares)
- Critical path depth docs
Traps
- Combinational feedback: Output → own input chain = latch, not combinational. State needed → build-sequential-circuit.
- Forget inversions in NAND/NOR: Most common err = dropping NOT in De Morgan. Bubble push systematically outputs → inputs, not ad hoc.
- Exceed fan-in w/o decomp: 5-input AND not in 2-input lib. Balanced tree min delay, not linear chain.
- Ignore don't-cares: Unexploited → bigger circuit. Always include when avail.
- Gate vs wire delay: Intro design → gate delay dominates. Real VLSI → wire delay can exceed. Note when estimating.
- Multi-output hazards: Shared gates → change one affects shared sub-expr. Verify all outputs after any mod.
→
evaluate-boolean-expression— derive min Bool expr for this skillbuild-sequential-circuit— add state (flip-flops) → sequentialsimulate-cpu-architecture— use blocks (ALU, mux, decoder) as datapath
GitHub репозиторий
Frequently asked questions
What is the design-logic-circuit skill?
design-logic-circuit is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform design-logic-circuit-related tasks without extra prompting.
How do I install design-logic-circuit?
Use the install commands on this page: add design-logic-circuit to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does design-logic-circuit belong to?
design-logic-circuit is in the Meta category, tagged design.
Is design-logic-circuit free to use?
Yes. design-logic-circuit is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
Похожие навыки
Этот навык предоставляет проверенную в продакшене настройку для Content Collections — TypeScript-ориентированного инструмента, который преобразует файлы Markdown/MDX в типобезопасные коллекции данных с валидацией Zod. Используйте его при создании блогов, сайтов документации или контентных приложений на Vite + React для обеспечения типобезопасности и автоматической проверки содержимого. Он охватывает всё: от настройки плагина Vite и компиляции MDX до оптимизации развертывания и валидации схем.
Этот навык позволяет разработчикам создавать приложения на платформе прогнозных рынков Polymarket, включая интеграцию с API для торговли и получения рыночных данных. Он также обеспечивает потоковую передачу данных в реальном времени через WebSocket для отслеживания текущих сделок и рыночной активности. Используйте его для реализации торговых стратегий или создания инструментов, обрабатывающих обновления рынка в реальном времени.
Этот навык помогает разработчикам создавать плагины OpenCode, которые подключаются к более чем 25 типам событий, таким как команды, файлы и операции LSP. Он предоставляет структуру плагина, спецификации API событий и шаблоны реализации для модулей на JavaScript/TypeScript. Используйте его, когда вам нужно перехватывать, отслеживать или расширять жизненный цикл ассистента OpenCode AI с помощью пользовательской событийно-ориентированной логики.
SGLang — это высокопроизводительный фреймворк для обслуживания больших языковых моделей (LLM), специализирующийся на быстрой структурированной генерации JSON, regex и рабочих процессов агентов с использованием кэширования префиксов RadixAttention. Он обеспечивает значительно более высокую скорость вывода, особенно для задач с повторяющимися префиксами, что делает его идеальным для сложных структурированных результатов и многократных диалогов. Выбирайте SGLang вместо альтернатив, таких как vLLM, когда вам требуется ограниченное декодирование или вы создаете приложения с интенсивным совместным использованием префиксов.
