Learning Log
Adjusting How I Learn
1. Reconstructing execution from static knowledge
One of my biggest obstacles has been seeing an instruction and treating it only as a rule about how to write code. For example:
lui a1, 0x11111When I encountered this instruction, AI explained the LUI rule: place the 20-bit immediate in bits 31–12 of the result and fill the lowest 12 bits with zeros. In this example, a1 receives 0x11111000.
But my instinct was to ask “why.” That question has two different layers: 1. What conventions are defined for this instruction? 2. Why were those conventions chosen?
Until now, my understanding has remained static. I have been thinking about an instruction and how to understand it, without placing it in the process of a real computer running a program.
This is an instruction: an operation the CPU must carry out.
Once I reconstruct that process, I have a concrete reason to ask:
If the CPU needs to identify the operation, destination register, and immediate, how can all that information fit into a 32-bit instruction?
This shifts me from memorizing LUI's conventions to discovering why instruction-encoding conventions are needed. A LUI instruction allocates 7 bits to the opcode, 5 bits to identify the destination register, and the remaining 20 bits to the immediate. Now I can think about how information fits into a limited number of bits.
I can also connect this approach to MMIO. The CPU needs to change a peripheral's state, which is controlled by values in its peripheral registers. Those registers belong to the peripheral, so the CPU needs a mechanism for accessing them. The actual solution uses an address map defined by the hardware designers, allowing the CPU to access peripheral registers through reads and writes similar to memory accesses.
I can understand this learning process as follows: understanding how a system performs its task helps me recognize that some rule must exist, and gradually work out what I should look up.
2. Starting from a real need and retracing the design process
I have seen many scattered facts in the slides, but they have given me little to hold on to. I do not know their concrete use cases.
For example, I know that one register can hold the operating modes of a group of pins, with individual fields determining each pin's mode. Yet when I actually needed to configure eight pins as outputs, I thought of changing them one at a time. I did not connect the task to what I had already learned.
Having a problem and a need gave me something concrete to work with. AI reminded me that, in this GPIO configuration-register example, the modes of eight pins are controlled by values within the same register. Updating the relevant fields changes the pins' operating modes. Each pin's mode field occupies 4 bits, so a 32-bit register can hold the mode fields for eight pins.
Only then did I connect “why one register can hold configuration for multiple pins” to the task in front of me.
I should actively look for the underlying problem and reconstruct how it plays out in a computer. Then I can consider possible solutions from a designer's perspective, before comparing them with the actual implementation.
A real solution often involves several components or systems interacting and cooperating. This is where I need to narrow my focus: temporarily treat other parts as black boxes and open only the few nodes most relevant to the current problem.
3. Changing how I use slides
The most important part is still doing labs and assignments, and working on concrete problems.
4. Changing how I work with AI
1. First identify which kind of “why” I am asking
I have noticed that when I ask AI “why,” it often assumes I am questioning the architecture and trying to deduce its entire design rationale.
What I actually want is to understand the convention: what exactly did the designers specify? Where possible, I also want to reason about it using knowledge I already have.
So I want to emphasize this:
Do not automatically interpret my “why” as a challenge to the architecture's design. First determine whether I am missing a basic rule. If so, explain that rule first. Go deeper into implementation principles when I want to explore design tradeoffs, or when not understanding the design rationale directly blocks my current task.
2. Help me fill knowledge gaps and connect ideas to use cases
Slides are highly condensed. To me, much of their content is still a collection of isolated facts. Without use cases, those facts do not connect.
I want AI to avoid treating concepts I have not yet thought of as things I should already know. Instead, it should work with my current learning stage: identify gaps, connect ideas across materials, support my learning, and translate condensed lecture rules into criteria I can use to make decisions in real engineering problems.
Finally, another equally important point:
Make my reasoning as visible as possible. My role is to express my own ideas; AI's role is to help me identify mechanisms and constraints I have not yet recognized.
LUI encoding reference: the official RISC-V ISA specification.
一、从静态知识恢复动态执行过程
我之前遇到的最大障碍之一,就是看到某条指令,就只把它当作一条写法规则。比如:
lui a1, 0x11111当我遇到这条指令的时候,AI 给我解释 LUI 的规则:将 20 位立即数放到结果的第 31~12 位,低 12 位填 0。对这个例子来说,a1 得到的值是 0x11111000。
但对我来说,我下意识就会想问“为什么”。这里的“为什么”有两个层次: 1. 这条指令背后到底有哪些约定? 2. 为什么要这样约定?
可是到目前为止,我的理解还是静态的。我想的都是一条指令,以及怎么去理解这条指令,没有把它放到真实的计算机运行过程中去想。
这是一条指令,是 CPU 要执行的一次操作。
有了这个动态过程,我才有理由追问:
既然 CPU 要识别操作、目标寄存器和立即数,那么在一条 32 位的指令里,应该怎样装下这些信息?
这时,我才会从死记 LUI 的约定,转向发现“为什么需要指令编码约定”这个问题:一条 LUI 指令中,需要留 7 位放操作码,留 5 位指定目标寄存器,其余 20 位放立即数。这样,我才会去想如何在有限的位数里存放信息。
这里也可以联系 MMIO 来想。CPU 需要改变外设的状态,而外设的状态由相应外设寄存器中的值控制。这些寄存器位于外设中,CPU 需要一种访问它们的机制。再往下看,实际的方案是设计者事先约定好地址映射,让 CPU 可以通过类似访问内存的读写方式,访问外设寄存器。
其实,这个过程也可以理解为:理解一个系统怎样完成任务本身,就能帮助学习者发现这里一定有某种规则,并逐步弄清应该查什么。
二、从实际需求出发,重新经历设计过程
我在 slide 里看了很多零散的知识,但是这些知识都没有抓手,我不知道它们具体的使用场景。
比如,我知道可以把一组 pin 的工作模式放进一个寄存器,寄存器中各个字段的值决定对应 pin 的模式。但当我实际需要把 8 个 pin 都设为输出时,我想到的却是一个一个去修改,没有把之前学过的知识联系起来。
有了问题、有了需求,我才有了抓手。AI 提醒我:在这个 GPIO 配置寄存器的例子里,8 个 pin 的模式由同一个寄存器中的值决定,修改其中相应的字段,就能改变 pin 的工作模式。每个 pin 的模式字段占 4 位,一个寄存器是 32 位,所以可以容纳 8 个 pin 的模式字段。
这时,我才把“一个寄存器里为什么可以放多个引脚的配置”和实际任务联系起来。
所以,我应该主动寻找原始问题,再根据这个问题,尽可能想清楚它在计算机里是怎样运行的;接着从设计者的角度想,可以有哪些实现方案;最后再对照现实中的实际方案。
一个实际方案里往往有多个组件、多个系统相互影响、协作。这时又需要“打桩”:暂时把其他部分当作黑盒,只深入拆开当前最关键的几个节点。
三、调整 slide 的使用策略
最重要的还是做 Lab、Assignment,拿具体的问题去解决。
四、调整我与 AI 的协作方式
1. 先分清我在问哪一种“为什么”
我发现,最近向 AI 问“为什么”的时候,它常常觉得我是在质疑架构,想完全通过推理弄清为什么这样设计。
实际上,我是想知道背后的约定:设计者到底做了什么规定?如果可以,也希望能用我已有的知识推导和理解。
所以我强调:
不要再把我的“为什么”自动理解为对架构设计的质疑。先判断我是不是不知道基本规则;如果是,先讲规则。只有当我想继续追问设计取舍,或者不理解设计原因会直接阻碍当前任务时,才深入实现原理。
2. 帮我补齐知识缺口,连接具体场景
slide 非常浓缩,很多内容对我而言只是零散的知识点。没有使用场景,知识点就串不起来。
所以我希望 AI 不要把我暂时没想到的概念,当作我本来就应该知道的东西。而是针对我当前的学习阶段,找到知识缺口,建立跨材料的关联,辅助我学习,把讲义中浓缩的规则翻译成实际工程问题中的判断依据。
最后,还有同样非常重要的一点:
尽可能地暴露我的思考链。我负责把自己的想法表达出来,AI 负责帮助我识别尚未意识到的机制和约束。
LUI 编码规则核对:RISC-V 官方指令集规范。