算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
build-sequential-circuit【设计与创意】Build sequential (stateful) logic circuits including latches, flip-flops, registers, counters, and finite state machines. Covers SR latch, D and JK flip-flops, binary/BCD/ring counters, and Mealy/Moore FSM design with clock signal and timing analysis. Use when a circuit must remember past inputs, count events, or implement a state-dependent control s…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
辨所需記憶與狀類、構狀圖與轉表、為所擇之 flip-flop 類推激勵方程、以 flip-flop 與組合邏輯於閘級實作電路、以時序圖分析與狀序模擬驗正確,以設計時序邏輯電路。
定電路須憶何,須幾異狀:
## State Requirements
- **Number of states**: [N]
- **State encoding**: [binary / one-hot / Gray]
- **Flip-flops needed**: [count and type]
- **Machine type**: [Mealy / Moore]
- **Inputs**: [list with descriptions]
- **Outputs**: [list with descriptions]
- **Reset behavior**: [synchronous / asynchronous / none]
預期: 完整狀清單,編碼已擇、flip-flop 類已選,機已類為 Mealy 或 Moore。
失敗時: 若狀數自規不明,以過所有輸入序至電路記憶深度而列狀。若數超實用限(手設計超十六狀),考分解為更小互動之 FSM。
將電路行為化為狀圖與等價之表:
## State Transition Table
| Present State | Input | Next State | Output |
|--------------|-------|------------|--------|
| S0 | 0 | S0 | 0 |
| S0 | 1 | S1 | 0 |
| S1 | 0 | S0 | 0 |
| S1 | 1 | S2 | 0 |
| ... | ... | ... | ... |
- **Unreachable states**: [list, or "none"]
- **Equivalent state pairs**: [list, or "none"]
預期: 完整狀轉表,覆每當前狀/輸入組合,諸狀皆可達於初態。
失敗時: 若轉表有缺,規不全。返需而解其曖昧。若有不可達狀,或加轉以達之,或移之並減狀編碼。
自轉表算 flip-flop 輸入方程(激勵方程):
## Excitation Equations
- **Flip-flop type**: [D / JK / T]
- **State encoding**: [binary assignment table]
| Flip-Flop | Excitation Equation |
|-----------|------------------------------|
| Q1 | D1 = [minimized expression] |
| Q0 | D0 = [minimized expression] |
## Output Equations
| Output | Equation |
|--------|------------------------------|
| Y | [minimized expression] |
預期: 極小化之激勵方程與輸出方程,諸 don't-care 已用。
失敗時: 若激勵方程似過繁,重考狀編碼。異編碼(如由二元轉獨熱、或重指狀碼)可顯簡組合邏輯。試至少二編碼並比文字數。
自 flip-flop 與組合邏輯閘建全電路:
## Circuit Implementation
- **Flip-flops**: [count] x [type], [edge type]-triggered
- **Combinational gates for excitation**: [count and types]
- **Combinational gates for output**: [count and types]
- **Total gate count**: [flip-flops + combinational gates]
- **Reset mechanism**: [asynchronous CLR / synchronous mux / none]
預期: 完整閘級網表,含 flip-flop、激勵邏輯、輸出邏輯、時鐘分配、重置機制,每信號恰有一驅。
失敗時: 若實作 flip-flop 外有反饋,則已引組合環。同步時序電路中諸反饋須過 flip-flop。追犯路並改之過暫存器。
確電路跨多時鐘週期正確行為:
## Timing Verification
| Cycle | Clock | Input | Present State | Next State | Output |
|-------|-------|-------|---------------|------------|--------|
| 0 | rst | - | - | S0 | 0 |
| 1 | rise | 1 | S0 | S1 | 0 |
| 2 | rise | 1 | S1 | S2 | 0 |
| ... | ... | ... | ... | ... | ... |
- **All transitions match state diagram**: [Yes / No]
- **Setup/hold violations**: [None / list]
- **Reset verified**: [Yes / No]
預期: 時序圖中每週期合狀轉表,每週期輸出正,無時序違。
失敗時: 若某狀轉誤,追該當前狀與輸入組合之激勵邏輯。若輸出誤而轉正,錯於輸出邏輯。若電路入非意之狀,查重置不全或缺自未用狀碼之轉。
design-logic-circuit — 設計組合激勵與輸出邏輯塊simulate-cpu-architecture — 於 CPU 數據徑中用時序塊(暫存器、計數器、控制 FSM)model-markov-chain — 有限狀機與離散時馬爾可夫鏈共形式框架