feat(docs): restructure API design guide with interactive demos and practical examples

refactor(components): replace static API design components with interactive demos
- Add ApiRequestDemo, RestfulUrlDemo, StatusCodeDemo, ErrorHandlingDemo, and ApiVersioningDemo
- Remove outdated ResourceAnalogy, RequestStructureDemo, and VersioningStrategyDemo

docs(api-design): completely rewrite API design chapter with restaurant analogy
- Add clear problem scenarios and solutions
- Include practical e-commerce API examples
- Add terminology glossary
- Improve error handling and versioning sections

style(ai-history): enhance FoundationDemo with better visual hierarchy
- Add section blocks for core theories and early breakthroughs
- Improve typography and highlighting

chore: remove unused components (CpuArchitectureDemo, EvolutionFlowDemo)
This commit is contained in:
sanbuphy
2026-02-22 23:20:27 +08:00
parent e5a5b9df5b
commit 5b622800b8
26 changed files with 3217 additions and 4784 deletions
@@ -193,7 +193,16 @@
### 4.1 CPU 的核心组件
<CpuArchitectureDemo />
CPU 不是单一部件,而是多个功能单元协作工作:
| 组件 | 做什么 | 类比 |
| ------------ | ------------------------------ | ------------------------ |
| **控制器** | 取指、解码、发出控制信号 | 像指挥员,安排谁何时工作 |
| **ALU** | 加减、与、或、比较等运算 | 像计算器,做算术与逻辑 |
| **寄存器组** | 保存最常用的数据和中间结果 | 像桌面便签,比内存更快 |
| **内部总线** | 在模块间传数据、地址、控制信息 | 像高速通道,把组件连成整体 |
一句话:控制器负责调度,ALU 负责计算,寄存器负责高速暂存,总线负责连接与传输。
### 4.2 CPU 是如何执行指令的?
@@ -231,9 +240,29 @@ CPU 执行一条指令,需要经过四个阶段:
## 5. 总结:从沙子到智能
让我们回顾一下从晶体管到 CPU 的完整路径:
每一层都是对下一层的抽象封装,从沙子到可运行软件的完整路径如下
<EvolutionFlowDemo />
1. **沙子(硅)** — 原材料:地球上最丰富的元素之一,提炼出高纯度硅。
↓ 提纯 → 切割成晶圆
2. **硅晶圆** — 基底:直径约 30cm 的单晶硅片,表面极其光滑。
↓ 光刻 → 蚀刻 → 掺杂
3. **晶体管(开关)** — 数百亿个/芯片:Gate=1 导通,Gate=0 断开,用电压控制电流。
↓ 组合成逻辑电路
4. **逻辑门** — 数十亿个:AND / OR / NOT / XOR,实现基本布尔运算。
↓ 组合成功能模块
5. **功能单元** — 数百个:加法器、寄存器、多路选择器……各司其职。
↓ 集成为完整处理器
6. **CPU 核心** — 1128 核:ALU + 控制器 + 寄存器组,执行取指→解码→执行→写回。
↓ 软件编程
7. **软件应用** — 无限可能:操作系统 / AI 模型 / 游戏 / 网页……一切皆指令。
计算机的本质是「开关的组合」:通过一层层抽象封装,最底层的物理材料最终变成能执行任意逻辑的通用计算平台。
::: tip 核心启示
**计算机的本质是"开关的组合"**