版本 b964334b6d3cf0ebef0647fdd6a1afc900185474
Changes from b964334b6d3cf0ebef0647fdd6a1afc900185474 to current
---
title: Computer Architecture
toc: no
...
- Instructor: [Jim Huang](/User/jserv) (黃敬群) `<jserv.tw@gmail.com>`
- Facebook Group: [https://www.facebook.com/groups/system.software2024/](https://www.facebook.com/groups/system.software2024)
- Facebook Group: [https://www.facebook.com/groups/system.software2025/](https://www.facebook.com/groups/system.software2025)
- Policy
* Follow the classes: [CS 61C at UC Berkeley](https://cs61c.org/), [CMU 18-447: Introduction to Computer Architecture](https://users.ece.cmu.edu/~jhoe/doku/doku.php?id=18-447_course_schedule_spring_2024)
- Course grading
* Quiz (30%), Homework (30%), Final/Term Project (40%)
* NOTICE: You must participate in at least one post-quiz or homework oral discussion in person before December 30, 2025; otherwise, no credit will be awarded for quizzes.
- [Guidelines for Student Use of AI Tools](https://hackmd.io/@sysprog/arch2025-ai-guidelines)
- **Schedule is tentative and subject to change!**
Computer Architecture (Fall 2024)
Computer Architecture (Fall 2025)
------------------------------------------------------
* Week 1 (Sep 10): Introduction
* Week 1 (Sep 9): Introduction
- Announcement
* Despite September 17th being a national holiday for Mid-Autumn Festival, our class will continue as scheduled, and students are required to complete an online quiz. For information on how to participate and access the remote class, please refer to this website.
- **[Course Introduction](https://docs.google.com/presentation/d/19nSmimXfaZ9JyViZSgmWdsmNlWXjKUxx3c3Ptw7x0UM/edit?usp=sharing)**
- [David Patterson](https://en.wikipedia.org/wiki/David_Patterson_(computer_scientist)): [A New Golden Age for Computer Architecture: History, Challenges and Opportunities](https://content.riscv.org/wp-content/uploads/2018/12/A-New-Golden-Age-for-Computer-Architecture-History-Challenges-and-Opportunities-David-Patterson-.pdf) / [video](https://youtu.be/uyc_pDBJotI)
* [Article](https://cacm.acm.org/magazines/2019/2/234352-a-new-golden-age-for-computer-architecture/fulltext), [note](https://github.com/cristiean/notes/blob/4c4ceb291ba68c55659ab0d4571385c8cccacd21/a-new-golden-age-for-computer-architecture.md)
- David Patterson: [From Mainframe CPUs to Neural-Network TPUs and Open RISC-V](https://riscv.org/wp-content/uploads/2017/05/Mon0915-RISC-V-50-Years-Computer-Arch.pdf) / [video](https://youtu.be/eH9_ygsio3I)
* There will be a quiz next week. After the quiz, we will begin oral discussions, and you are expected to attend them in person.
- **[Course Introduction](https://docs.google.com/presentation/d/15UftnjHE0OJqmmiW4YR2eBZ7VqpF3c4iImqA7csi26s/edit?usp=sharing)**
- [David Patterson](https://en.wikipedia.org/wiki/David_Patterson_(computer_scientist)): [A New Golden Age for Computer Architecture: History, Challenges and Opportunities](https://cacm.acm.org/magazines/2019/2/234352-a-new-golden-age-for-computer-architecture/fulltext) / [video](https://youtu.be/uyc_pDBJotI) / [note](https://github.com/cristiean/notes/blob/4c4ceb291ba68c55659ab0d4571385c8cccacd21/a-new-golden-age-for-computer-architecture.md)
- David Patterson: From Mainframe CPUs to Neural-Network TPUs and Open RISC-V / [video](https://youtu.be/eH9_ygsio3I)
- [Great Ideas in Computer Architecture](https://drive.google.com/file/d/1WsImIWJIqGoXFsHBm8m4rkM1W6KxLwTd/view?usp=sharing) / [video](https://youtu.be/Skwq81uEETk)
- [Number Representation](https://docs.google.com/presentation/d/16Cb__TYt97kCZ87WTg8VFWcYGsaiC4CmDNJTWpoM_ZI/edit?usp=sharing) / [video](https://www.youtube.com/watch?v=DWmHvlFFfLI&list=PLDoI-XvXO0aqgoMQvogzmf7CKiSMSUS3M&index=4)
- [Understanding Floating Point Struggles](https://youtu.be/8RvnnUuoHTA) / [Floating Point](https://docs.google.com/presentation/d/1aGP15qHuOsLi_K4xiWhTZD36-D_eECox2LWxbP3Rvgk/edit?usp=sharing) ([video](https://youtu.be/RWj8ZmzeHNw))
- [C Memory Management](https://docs.google.com/presentation/d/1WLn7-SNW7QtSMQO_Zz4K1M4e1oChb0jiy8OVDcqap5k/edit?usp=sharing) / [video](https://youtu.be/njNpPYlRXuM)
- [RISC-V Instructions](https://docs.google.com/presentation/d/1qNVK8ULddo6luq0Rrjj_bmOShhcx9hlESN36AK91n6I/edit?usp=sharing)
* Week 2 (Sep 17): Quiz
- Announcement
* The first assignment, consisting of RISC-V assembly programming, will be given next week.
- [Quiz1](https://hackmd.io/@sysprog/arch2024-quiz1): C programming, bit-wise operations, number representation, floating-point / [Solutions](https://hackmd.io/@sysprog/arch2024-quiz1-sol)
* Week 2 (Sep 16): Quiz
- [Quiz1](https://hackmd.io/@sysprog/arch2025-quiz1): C programming, bit-wise operations, number representation, floating-point / [Solutions](https://hackmd.io/@sysprog/arch2025-quiz1-sol)
- Follow-ups: [Approximating sine function](https://hackmd.io/@Max042004/bf16_sin), [Square Root](https://hackmd.io/tzLRtKLUT5GfSQTf94Aecg), [callback function](https://hackmd.io/@wilicw/arch2025-quiz1-A), [bfloat16](https://hackmd.io/iFvwiPX8Rxqn0QYoSeByrg)
- [Principles of this course](https://docs.google.com/presentation/d/1V_X3jKMotcwaiNIXhUbS7t2gWb0s7okWhYXbZeDc3jM/edit?usp=sharing)
- [Intro to RISC-V](https://docs.google.com/presentation/d/1PeBOPGgaBSbqng00PM_NaqddFOoz-5__N8lLAk2MKho/edit?usp=sharing) / [video](https://youtu.be/xdma5w1_iVI)
* [RISC-V Assembly Programmer's Manual](https://github.com/riscv-non-isa/riscv-asm-manual/blob/main/src/asm-manual.adoc)
* [The RISC-V Instruction Set Manual: Volume I: Unprivileged ISA](https://content.riscv.org/wp-content/uploads/2019/06/riscv-spec.pdf)
- [RISC-V Instructions](https://docs.google.com/presentation/d/1qNVK8ULddo6luq0Rrjj_bmOShhcx9hlESN36AK91n6I/edit?usp=sharing)
* Week 3 (Sep 24): RISC-V
* Week 3 (Sep 23): RISC-V
- Announcement:
+ Quiz2 is scheduled on Oct 1: Due to the possibility that the classroom capacity may not accommodate the number of enrolled students, additional classrooms may be arranged as test venues. Please make sure to check this page on the evening of September 30th for related announcements.
+ [Guidelines for Student Use of AI Tools](https://hackmd.io/@sysprog/arch2025-ai-guidelines)
+ Quiz2 is scheduled on Sep 30.
* [2024 Quiz2](https://hackmd.io/@sysprog/arch2024-quiz2): RISC-V assembly and C programming / [solution](https://hackmd.io/@sysprog/arch2024-quiz2-sol)
* [2023 Quiz2](https://hackmd.io/@sysprog/arch2023-quiz2): RISC-V assembly and C programming / [solution](https://hackmd.io/@sysprog/arch2023-quiz2-sol)
* [2022 Quiz2](https://hackmd.io/@sysprog/arch2022-quiz2): RISC-V assembly and C programming / [solution](https://hackmd.io/@sysprog/arch2022-quiz2-sol)
* [2021 Quiz2](https://hackmd.io/@sysprog/arch2021-quiz2): RISC-V assembly and C programming / [solution](https://hackmd.io/@sysprog/arch2021-quiz2-sol)
+ [Homework 1](https://hackmd.io/@sysprog/2024-arch-homework1) is out.
+ Code Review for [Homework 1](https://hackmd.io/@sysprog/2024-arch-homework1) on Oct 8
- [Principles of this course](https://docs.google.com/presentation/d/1V_X3jKMotcwaiNIXhUbS7t2gWb0s7okWhYXbZeDc3jM/edit?usp=sharing)
- [Intro to RISC-V](https://docs.google.com/presentation/d/1PeBOPGgaBSbqng00PM_NaqddFOoz-5__N8lLAk2MKho/edit?usp=sharing) / [video](https://youtu.be/xdma5w1_iVI)
* [RISC-V Assembly Programmer's Manual](https://github.com/riscv-non-isa/riscv-asm-manual/blob/main/src/asm-manual.adoc)
* [The RISC-V Instruction Set Manual: Volume I: Unprivileged ISA](https://content.riscv.org/wp-content/uploads/2019/06/riscv-spec.pdf)
+ [Homework 1](https://hackmd.io/@sysprog/2025-arch-homework1) is out.
+ Code Review for [Homework 1](https://hackmd.io/@sysprog/2025-arch-homework1) on Oct 7
+ If you voluntarily participate in the class discussions for [Quiz1](https://hackmd.io/@sysprog/arch2025-quiz1), please email the instructor afterward, including your responses to the instructor's questions and any follow-up contributions. You will receive an additional 10 points for Quiz 1.
- [RISC-V Data Transfer](https://docs.google.com/presentation/d/1N1ZyPLwJDN2hEqKT59nDunYWbXnVZsVDq5rg32Vckv8/edit?usp=sharing) / [video](https://youtu.be/-i6BmbdyftI)
- [RISC-V Decision Making and Logical Operations](https://docs.google.com/presentation/d/1-vTyUiY8LeQZ1yD2x1EVsu85iXfJ0iSYiyWvLQ9QzLI/edit?usp=sharing) / [video](https://youtu.be/_qIYRafGUUs)
- [RISC-V Procedures](https://docs.google.com/presentation/d/18F1vHY5Mv5E6WU6BvktXzkVbZrTZ3jQUbkWOjEPGE4I/edit?usp=sharing) / [video](https://youtu.be/slyeHO64sWg)
- [Lab0: Web-based Emulators](https://hackmd.io/@sysprog/SJ7ht_MuS)
- [Lab1: RV32I Assembly](https://hackmd.io/@sysprog/H1TpVYMdB)
- Assignment: [Homework1: RISC-V Assembly and Instruction Pipeline](https://hackmd.io/@sysprog/2024-arch-homework1) (Due: Oct 14, 2024)
- Assignment: [Homework1: RISC-V Assembly and Instruction Pipeline](https://hackmd.io/@sysprog/2025-arch-homework1) (Due: Oct 13, 2025)
* Week 4 (Oct 1): Quiz + RISC-V
* Week 4 (Sep 30): Quiz + RISC-V
- Announcement
* Due to the impact of Typhoon Krathon, Quiz 2 will be conducted online instead of in-person. Please refresh this web page to obtain the latest information on how to participate in the online quiz and attend the course remotely.
* Access the live-streamed course on [YouTube](https://youtube.com/live/pVjSV5l6aNA). Watch the live stream carefully: Quiz 2 participation instructions will be provided during the broadcast.
- [Quiz2](https://hackmd.io/@sysprog/arch2024-quiz2): RISC-V assembly and C programming / [solution](https://hackmd.io/@sysprog/arch2024-quiz2-sol)
+ Code Review on [Homework1: RISC-V Assembly and Instruction Pipeline](https://hackmd.io/@sysprog/2025-arch-homework1) next week
- [Quiz2](https://hackmd.io/@sysprog/arch2025-quiz2): RISC-V assembly and C programming / [solution](https://hackmd.io/@sysprog/arch2025-quiz2-sol)
* Follow-ups: [LED matrix](https://hackmd.io/@zYoyoYv7SiG-PRNw39_9xQ/BytwOti3gl), [Tower of Hanoi](https://hackmd.io/@vicLin/Hy3CeSzagg)
- [Recursion as a Problem-Solving Technique](https://hackmd.io/@sysprog/SyTFEhxyJe)
- [Fixed-point Arithmetic](https://hackmd.io/@maromaSamsa/HkjefPbFs)
- RISC-V Instruction Formats [Part I](https://docs.google.com/presentation/d/1pXcXcBjmUCXFJNFi4DpFLtpyDKsol5SaKfVce1hKdXE/edit?usp=sharing) / [video](https://youtu.be/VqzPnKPjcj8)
- RISC-V Instruction Formats [Part II](https://docs.google.com/presentation/d/1rYJeuDUPezDdk01M8ib3XTo15IGLdsMJclzD4Vv9XGQ/edit?usp=sharing) / [video](https://youtu.be/6L5EeJl7T9w)
* Week 5 (Oct 8): RV32I + Code Review
* Week 5 (Oct 7): RV32I + Code Review
- Announcement
* In today’s class, we will discuss the progress of [Homework 1](https://hackmd.io/@sysprog/2025-arch-homework1) with the students. Whether you are voluntarily or non-voluntarily participating in the Q&A, you should follow the assignment guidelines, prepare your HackMD notes, and set them to *public*. When the instructor talks with you, you should paste the link to your HackMD notes for [Homework 1](https://hackmd.io/@sysprog/2025-arch-homework1) here. $\to$ [2025-10-07](https://hackmd.io/AG3wlG02QuKPnjj5Y6p1Iw)
* Quiz 3 is scheduled for Oct 21. Be sure to carefully review past quizzes, understand their level of difficulty, and practice thoroughly.
- Review: [RISC-V Architecture Instruction Encoding](https://youtu.be/NmxhoMCeH8I)
* Revisit the RV32I specification and instruction encoding, as they serve as the foundation for implementing RISC-V processor cores in HDL.
* The system instructions: `ecall`, `ebreak`, and `csr*`.
* [online tool for RISC-V Instruction Encoder/Decoder](https://luplab.gitlab.io/rvcodecjs/) / [source code](https://gitlab.com/luplab/rvcodecjs)
- [Recursion as a Problem-Solving Technique](https://hackmd.io/@sysprog/SyTFEhxyJe)
- Code Review on [Homework1: RISC-V Assembly and Instruction Pipeline](https://hackmd.io/@sysprog/2024-arch-homework1)
- Code Review on [Homework1: RISC-V Assembly and Instruction Pipeline](https://hackmd.io/@sysprog/2025-arch-homework1)
* Week 6 (Oct 15): Toolchain + Digital Systems
* Week 6 (Oct 14): Toolchain + Digital Systems
- Announcement
- Quiz 3 is scheduled for Oct 22 and will cover RISC-V assembly programming, software optimizations, instruction encoding, sequential logic, and combinational logic.
- Quiz 3 is scheduled for Oct 21 and will cover RISC-V assembly programming, software optimizations, instruction encoding, sequential logic, and combinational logic.
- [2020-Quiz3](https://hackmd.io/@sysprog/arch2020-quiz3) / [solution](https://hackmd.io/@sysprog/arch2020-quiz3-sol)
- [2021-Quiz3](https://hackmd.io/@sysprog/arch2021-quiz3) / [solution](https://hackmd.io/@sysprog/arch2021-quiz3-sol)
- [2021-Quiz4](https://hackmd.io/@sysprog/arch2021-quiz4) / [solution](https://hackmd.io/@sysprog/arch2021-quiz4-sol)
- [2022-Quiz3](https://hackmd.io/@sysprog/arch2022-quiz3) / [solution](https://hackmd.io/@sysprog/arch2022-quiz3-sol)
- [2023-Quiz3](https://hackmd.io/@sysprog/arch2023-quiz3) / [solution](https://hackmd.io/@sysprog/arch2023-quiz3-sol)
- [2024-Quiz3](https://hackmd.io/@sysprog/arch2024-quiz3) / [solution](https://hackmd.io/@sysprog/arch2024-quiz3-sol)
- The follow-ups for Quizzes 1 and 2, including lecture discussions and further improvements, have been updated in the syllabus. Please review them carefully.
- Homework 2 will be assigned next week, focusing on bare-metal programming, an essential skill for embedded system engineers. Search [bare-metal](https://www.google.com/about/careers/applications/jobs/results/?q=bare-metal) via Google Career.
- [Compiling, Assembling, Linking, and Loading](https://docs.google.com/presentation/d/1uAURy-tL-K9oMtUP1gY9034gsOrxbhhDL9MnoTm1NKM/edit?usp=sharing) / [video-1](https://youtu.be/oeRTvGGLRZI) + [video-2](https://youtu.be/Y8d6igTajtQ)
* [Lab2: RISC-V + VENUS](https://cs61c.org/fa24/labs/lab03/) / [slides](https://docs.google.com/presentation/d/1vsXYoqsyJtZTE1_z2wtnXgsnbZaVFHGLjQdJsckxFIc/edit?usp=sharing)
- [Freestanding RISC-V Programs](https://youtu.be/iml0DBo5yqo)
+ [bare metal](https://en.wikipedia.org/wiki/Bare_machine)
* [Lab2: RISC-V](https://hackmd.io/@sysprog/Sko2Ja5pel) for RV32I bare-metal programming
- Revisit [Quiz 1](https://hackmd.io/@sysprog/arch2025-quiz1-sol)
* [World's Fastest Square Root: Newton's Method](https://youtu.be/FpOEx6zFf1o) (The subject line is somewhat misleading; we can improve it further.)
* [Binary marble adding machine](https://woodgears.ca/marbleadd/) / [video](https://youtu.be/GcDshWmhF4A)
- Yes, you can implement a few logic-like elements without electricity.
- Logic gates are primarily implemented using diodes or transistors acting as electronic switches, but can also be constructed using vacuum tubes, electromagnetic relays (relay logic), fluidic logic, pneumatic logic, optics, molecules, or even mechanical elements. Now, most logic gates are made from MOSFETs (metal–oxide–semiconductor field-effect transistors).
- [Synchronous Digital Systems (SDS)](https://docs.google.com/presentation/d/1xP8Vc1i_9QY4t2GQhcpI2MsWsrhr-mvTY7jVXnso6yE/edit?usp=sharing) / [video](https://youtu.be/GOu6BW-R_cs)
- [Combinational Logic](https://docs.google.com/presentation/d/1P6-AFWlwillUVtY-6p66SUldojB9R59Mcj_lKDF53S0/edit?usp=sharing) / [video](https://youtu.be/DPEE8ILCXMs)
+ sequential logic is a type of logic circuit whose output depends on the present value of its input signals and on the sequence of past inputs, the input history.
- [SDS State](https://docs.google.com/presentation/d/1qXyH6xN_1QxII2YjoyuF5DUIst-A7pB1JG1PKdwKkgE/edit?usp=sharing) / [video](https://youtu.be/wOohQuD9wAg)
- [Combinational Logic Blocks](https://docs.google.com/presentation/d/1JahtX4WzKs2JGx_qYfjkdJE5pQwBfXBX46w4NnQOV_E/edit?usp=sharing) / [video](https://youtu.be/S6TNo2jSu9A)
* Week 7 (Oct 22): Quiz
- [Quiz3](https://hackmd.io/@sysprog/arch2024-quiz3): RISC-V programming and instruction encoding + Digital systems / [solution](https://hackmd.io/@sysprog/arch2024-quiz3-sol)
* Week 7 (Oct 21): Quiz
- Announcement:
- [Homework 2](https://hackmd.io/@sysprog/2025-arch-homework2) is out. Deadline: Nov 12, 2025
- [Quiz3](https://hackmd.io/@sysprog/arch2025-quiz3): RISC-V programming and instruction encoding + Digital systems / [solution](https://hackmd.io/@sysprog/arch2025-quiz3-sol)
* Week 8 (Oct 29): Review + Datapath and Control
* Week 8 (Oct 28): Review + Datapath and Control
- Announcement:
- [Homework 2](https://hackmd.io/@sysprog/2024-arch-homework2) is undergoing significant revisions. Please keep an eye on your email for updates.
- The instructor has been grappling with the LLM for several weeks though.
* The textual description of Problem D in [Quiz3](https://hackmd.io/@sysprog/arch2025-quiz3) is correct, but the accompanying image is incorrect. As compensation, all participants of Quiz 3 will receive a 15-point increase.
* If you voluntarily participate in the class discussions for [Quiz3](https://hackmd.io/@sysprog/arch2025-quiz3), please email the instructor afterward, including your responses to the instructor's questions and any follow-up contributions. You will receive an additional 10 points for Quiz 3.
- "What I cannot create, I do not understand." - On Richard Feynman's blackboard at the time of his death in 1988 / [Build Your Own X](https://build-your-own-x.vercel.app/)
- Revisit [Quiz 3](https://hackmd.io/@sysprog/arch2024-quiz3-sol)
* [RISC-V Architecture Instruction Encoding](https://youtu.be/NmxhoMCeH8I)
* [World's Fastest Square Root: Newton's Method](https://youtu.be/FpOEx6zFf1o)
- video: [Circuits recap](https://youtu.be/N36wWh0DriA)
- [RISC-V Datapath I](https://docs.google.com/presentation/d/1kYFjJROF0OVFPPXCrPXBnlY7d9lP2rwcLxNJvI6DuAE/edit?usp=sharing) / [video](https://youtu.be/hPJXX91kurw)
- [RISC-V Datapath II](https://docs.google.com/presentation/d/1nJknDrB402GuriZuqeYOVpoJv9bvYoZeFRSPKzqjdqw/edit?usp=sharing) / [video](https://youtu.be/wQC7mjjfJDw)
* Week 9 (Nov 5): Datapath and Control + Pipeline
* Week 9 (Nov 4): Datapath and Control + Pipeline
- Announcement:
- [Homework 2](https://hackmd.io/@sysprog/2024-arch-homework2) is out. Deadline: Nov 18, 2024
+ Submit [Homework 2](https://hackmd.io/@sysprog/2025-arch-homework2) through Google Form.
+ Homework 3 will be finalized on Nov 6
+ Quiz 4 is scheduled for Nov 18
- [2020 Quiz4](https://hackmd.io/@sysprog/arch2020-quiz4) / [solution](https://hackmd.io/@sysprog/arch2020-quiz4-sol)
- [2021 Quiz5](https://hackmd.io/@sysprog/arch2021-quiz5) / [solution](https://hackmd.io/@sysprog/arch2021-quiz5-sol) / [annotated with Ripes](https://hackmd.io/@wIVnCcUaTouAktrkMVLEMA/rkm8OkOjF)
- [2022 Quiz4](https://hackmd.io/@sysprog/arch2022-quiz4) / [solution](https://hackmd.io/@sysprog/arch2022-quiz4-sol) / [annotated](https://hackmd.io/@0SHE18LgRsqRjsgqxIFjVA/SJxvlqOds)
- [2023 Quiz4](https://hackmd.io/@sysprog/arch2023-quiz4) / [solution](https://hackmd.io/@sysprog/arch2023-quiz4-sol) / [annotated](https://hackmd.io/@c3WNnG7RRK2J17ifSiezZA/Bk1mQfKuT)
- [2024 Quiz4](https://hackmd.io/@sysprog/arch2024-quiz4) / [solution](https://hackmd.io/@sysprog/arch2024-quiz4-sol)
- [Easy RISC-V](https://dramforever.github.io/easyriscv/)
* an interactive tutorial created by dramforever that introduces the fundamentals of RISC-V assembly programming through hands-on experimentation. Inspired by Easy 6502, it uses a browser-based simulator to let learners observe every step of program execution — from instruction decoding to register and memory state changes — without requiring any software installation or toolchain setup.
* The tutorial focuses on the minimalist yet complete RV32I + Zicsr instruction set, guiding readers from their first simple instruction sequence (addi, ebreak) to more complex topics such as arithmetic and logic operations, branches, jumps, memory access, stack management, function calls, control and status registers (CSRs), privilege levels, exceptions, and even the construction of a bare-bones operating system.
- video: [Are Computers Still Getting Faster?](https://youtu.be/IuLxX07isNg)
- video: [Circuits recap](https://youtu.be/N36wWh0DriA)
- [RISC-V Datapath II](https://docs.google.com/presentation/d/1nJknDrB402GuriZuqeYOVpoJv9bvYoZeFRSPKzqjdqw/edit?usp=sharing) / [video](https://youtu.be/wQC7mjjfJDw)
- [RISC-V Processor Design Control](https://docs.google.com/presentation/d/1EoTcGYgOlqO7ytnzHmQi_2JB1g-fyXpyYp7AV7dvwMs/edit?usp=sharing) / [video](https://youtu.be/bTM2t0uiv6I)
- Constructing Hardware in a Scala Embedded Language ([Chisel](https://github.com/chipsalliance/chisel)) is an open-source hardware description language (HDL) used to describe digital electronics and circuits at the register-transfer level that facilitates advanced circuit generation and design reuse for both ASIC and FPGA digital logic designs.
* [slides](https://docs.google.com/presentation/d/1gMtABxBEDFbCFXN_-dPyvycNAyFROZKwk-HMcnxfTnU/edit#slide=id.p)
* [Finite impulse response](https://en.wikipedia.org/wiki/Finite_impulse_response) (FIR)
* [Learn Chisel online!](https://mybinder.org/v2/gh/freechipsproject/chisel-bootcamp/master)
+ Please run the cell blocks by either pressing SHIFT+ENTER on your keyboard
- MIT 6.191 [L15: Introduction to Pipelining](https://youtu.be/5NQkhqZe8_8), [L16: Processor Pipelining](https://youtu.be/TMpjvAvQCWA)
* [note](https://computationstructures.org/lectures/pbeta/pbeta.html)
- [Lab3: Construct a single-cycle CPU with Chisel](https://hackmd.io/@sysprog/B1Qxu2UkZx)
* Week 10 (Nov 12): Pipelined Processors
* Week 10 (Nov 11): Pipelined Processors
- Announcement:
+ [Homework3](https://hackmd.io/@sysprog/2023-arch-homework3) is out.
+ Next week, we will continue reviewing all the assignments.
+ Quiz4 is scheduled next week.
- [2020 Quiz4](https://hackmd.io/@sysprog/arch2020-quiz4) / [solution](https://hackmd.io/@sysprog/arch2020-quiz4-sol)
- [2021 Quiz5](https://hackmd.io/@sysprog/arch2021-quiz5) / [solution](https://hackmd.io/@sysprog/arch2021-quiz5-sol) / [annotated with Ripes](https://hackmd.io/@wIVnCcUaTouAktrkMVLEMA/rkm8OkOjF)
- [2022 Quiz4](https://hackmd.io/@sysprog/arch2022-quiz4) / [solution](https://hackmd.io/@sysprog/arch2022-quiz4-sol) / [annotated](https://hackmd.io/@0SHE18LgRsqRjsgqxIFjVA/SJxvlqOds)
- [2023 Quiz4](https://hackmd.io/@sysprog/arch2023-quiz4) / [solution](https://hackmd.io/@sysprog/arch20223-quiz4-sol) / [annotated](https://hackmd.io/@c3WNnG7RRK2J17ifSiezZA/Bk1mQfKuT)
- [rv32emu](https://github.com/sysprog21/rv32emu) development, [capable of running Linux kernel smoothly](https://www.facebook.com/groups/system.software2024/posts/1722546388523252/) ([#508](https://github.com/sysprog21/rv32emu/pull/508))
- [0 to ASIC](https://docs.google.com/presentation/d/14npvuiGxsS3C-yo2vOsbZpNKGehwTtIYRFN6k3ZVR4M/edit#slide=id.p)
- [L16: Processor Pipelining](https://youtu.be/TMpjvAvQCWA), [L17: Implementing Pipelining](https://youtu.be/Pr3-iFE-nCQ), [L18: Implementing Pipelined Processors](https://youtu.be/WdbCaCoOgVY) / [note](https://computationstructures.org/lectures/pbeta/pbeta.html)
+ Moved to self-study, no in-class session today!
+ Next week, we will review all the assignments.
+ [Homework 3](https://hackmd.io/@sysprog/2025-arch-homework3) is out. Deadline: Dec 10, 2025
- [0 to ASIC](https://docs.google.com/presentation/d/14npvuiGxsS3C-yo2vOsbZpNKGehwTtIYRFN6k3ZVR4M/edit#slide=id.p) / [video](https://youtu.be/ILZ6fDHZ_eo)
- [L17: Implementing Pipelining](https://youtu.be/Pr3-iFE-nCQ), [L18: Implementing Pipelined Processors](https://youtu.be/WdbCaCoOgVY) / [note](https://computationstructures.org/lectures/pbeta/pbeta.html)
- [RISC-V 5-Stage Pipeline](https://docs.google.com/presentation/d/1v-Squx8lK-oOrflFOwBZh-ue94seVHZudqDOgJmFf5Q/edit?usp=sharing) / [video-1](https://youtu.be/LJt737KqWzI), [video-2](https://youtu.be/UxMLmMdFzTI), [video-3](https://youtu.be/oPmRV9MzuIU)
- [Lab3: Construct a single-cycle CPU with Chisel](https://hackmd.io/@sysprog/r1mlr3I7p)
- Assignment: [Homework3: Single-cycle CPU in Chisel](https://hackmd.io/@sysprog/2023-arch-homework3) (Due: Dec 1, 2023)
* Week 11 (Nov 19): Quiz + Homework Review
- [Quiz4](https://hackmd.io/@sysprog/arch2023-quiz4): RISC-V programming + datapath + control + pipelined processor / [solution](https://hackmd.io/@sysprog/arch2023-quiz4-sol)
- [Homework1](https://hackmd.io/@sysprog/2023-arch-homework1), [Homework2](https://hackmd.io/@sysprog/2023-arch-homework2)
- [Complex Pipelines, Out-of-Order Issue, Register Renaming](https://inst.eecs.berkeley.edu/~cs152/sp19/lectures/L10-ComplexPipes.pdf)
* Week 11 (Nov 18): Quiz + Homework Review
- Announcement
* In today’s class, we will discuss the progress of [Homework 2](https://hackmd.io/@sysprog/2025-arch-homework2) and [Homework 3](https://hackmd.io/@sysprog/2025-arch-homework3) with the students. Whether you are voluntarily or non-voluntarily participating in the Q&A, you should follow the assignment guidelines, prepare your HackMD notes, and set them to *public*. When the instructor talks with you, you should paste the link to your HackMD notes for [Homework 2](https://hackmd.io/@sysprog/2025-arch-homework2) here. $\to$ [2025-11-18](https://hackmd.io/QERe1qMbSra0UqdfEPUhMw)
- [Quiz4](https://hackmd.io/@sysprog/arch2025-quiz4): RISC-V programming + datapath + control + pipelined processor / [solution](https://hackmd.io/@sysprog/arch2025-quiz4-sol)
- [Homework1](https://hackmd.io/@sysprog/2025-arch-homework1), [Homework2](https://hackmd.io/@sysprog/2025-arch-homework2)
* Week 12 (Nov 26): Cache
* Announcement
* Quiz 5 is scheduled on Dec 10
* Week 12 (Nov 25): Cache
- Announcement
* In today’s class, we will discuss the progress of [Homework 2](https://hackmd.io/@sysprog/2025-arch-homework2) and [Homework 3](https://hackmd.io/@sysprog/2025-arch-homework3) with the students. Whether you are voluntarily or non-voluntarily participating in the Q&A, you should follow the assignment guidelines, prepare your HackMD notes, and set them to *public*. When the instructor talks with you, you should paste the link to your HackMD notes for [Homework 2](https://hackmd.io/@sysprog/2025-arch-homework2) here. $\to$ [2025-11-18](https://hackmd.io/QERe1qMbSra0UqdfEPUhMw)
* This semester, we will conduct 7 quizzes. Out of these, the best 4 will be selected for grading purposes.
* The instructor will submit the grades on the school’s [designated deadline](https://web.ncku.edu.tw/p/412-1000-6149.php?Lang=zh-tw) (Jan 23, 2026) for grade registration. This means that students will have ample time to dedicate to the final project assigned in this course.
* [Term projects](https://hackmd.io/@sysprog/arch2025-projects): Contact the instructor as early as possible. You must provide the materials and demonstrate to the instructor before Jan 20, 2026. Deliverables
- A development log and accompanying report
- Complete source code sufficient for full reproduction
- An illustrated video of at least 15 minutes.
* Quiz 5 is scheduled for Dec 9
- [2024-Quiz5](https://hackmd.io/@sysprog/arch2024-quiz5) / [solution](https://hackmd.io/@sysprog/arch2024-quiz5-sol)
- [2023-Quiz5](https://hackmd.io/@sysprog/arch2023-quiz5) / [solution](https://hackmd.io/@sysprog/arch2023-quiz5-sol) / [annotated](https://hackmd.io/@c3WNnG7RRK2J17ifSiezZA/Bk1mQfKuT)
- [2022-Quiz5](https://hackmd.io/@sysprog/arch2022-quiz5) / [solution](https://hackmd.io/@sysprog/arch2022-quiz5-sol) / [annotated](https://hackmd.io/@0SHE18LgRsqRjsgqxIFjVA/ry3j69OOo)
- [2021-Quiz6](https://hackmd.io/@sysprog/arch2021-quiz6) / [solution](https://hackmd.io/@sysprog/arch2021-quiz6-sol) / [with Ripes simulation](https://hackmd.io/@arthur-chang/SyLa2qb3Y)
- [2020-Quiz5](https://hackmd.io/@sysprog/arch2020-quiz5) / [solution](https://hackmd.io/@sysprog/arch2020-quiz5-sol)
* This semester, we will conduct 7 quizzes. Out of these, the best 4 will be selected for grading purposes.
* The instructor will submit the grades on the school's designated deadline ([Jan 17, 2024](https://www.ncku.edu.tw/p/412-1000-6149.php?Lang=zh-tw)) for grade registration. This means that students will have ample time to dedicate to the final project assigned in this course.
* [Caches: Direct-mapped, set-associative](https://inst.eecs.berkeley.edu/~cs61c/su20/pdfs/lectures/lec16.pdf) / [video](https://www.youtube.com/playlist?list=PLDoI-XvXO0apRiQ2QPjzyq8APGEjnqW1w)
* [Multi-level Caches, Cache Questions](https://inst.eecs.berkeley.edu/~cs61c/su20/pdfs/lectures/lec17.pdf) / [video](https://www.youtube.com/playlist?list=PLDoI-XvXO0aqHsuO6U2bIpwDGqO6UAetk)
- [Lab4: Cache](https://inst.eecs.berkeley.edu/~cs61c/fa22/labs/lab07/)
+ [Requirements](https://inst.eecs.berkeley.edu/~cs61c/fa20/labs/lab08/) / [Reference work](https://hackmd.io/@Lt35rTMeTi22rWqrBgSQzg/SkXXQ_LJ8)
* [Cache (1)](https://docs.google.com/presentation/d/1dv9zkRV5mS2heGojIPm00Ms0fAqKDQ2D7yE26P4MgJI/edit?usp=sharing) / [video](https://youtu.be/nsdIU-S0pp4)
* [Cache (2)](https://docs.google.com/presentation/d/1rmFD2GZBMjCSsNuHikNiFiDgoDWORYT9anz52l7bgzc/edit?usp=sharing) / [video](https://youtu.be/APK4_rEDT_U)
* [Cache (3)](https://docs.google.com/presentation/d/1dN876ETDdJATOV0JYQJzvHadBcXAgA03NqG311es7QU/edit?usp=sharing) / [video](https://youtu.be/pQkplfQtIfM)
* [Cache (4)](https://docs.google.com/presentation/d/18ISfU5CJujmOwekab3fJ8A8W6z2cFgZ_BNy6moyX8Po/edit?usp=sharing) / [video](https://youtu.be/SQLmn3VgABc)
* Recall: [The golden age of ever-changing computer architecture](https://hackaday.com/2019/11/27/the-golden-age-of-ever-changing-computer-architecture/)
* [The next big tech war front: RISC-V](https://asiatimes.com/2023/11/the-next-big-tech-war-front-risc-v/)
* [Computing on Andromeda: Chip Company Releases 13.5M Core Supercomputer](https://www.allaboutcircuits.com/news/computing-on-andromeda-chip-company-releases-13.5m-core-supercomputer/)
* [Designing in 2023: 10 Problems to Solve w/ Jim Keller](https://youtu.be/o70yKYWgtVI) - [Tenstorrent](https://tenstorrent.com/)
8-wide Ascalon RISC-V core.
* Week13 (Dec 3): Virtual Memory + Operating System + Vector Extension
- Announcement:
+ Term projects will be listed on Dec 5. [Term projects of 2022](https://hackmd.io/@sysprog/arch2022-projects)
* [Virtual Memory](https://youtu.be/TsxZlXOrt8U) / UCB: [Virtual Memory](https://inst.eecs.berkeley.edu/~cs61c/su20/pdfs/lectures/lec19.pdf) / [video](https://www.youtube.com/playlist?list=PLDoI-XvXO0ar2Wia7JngBFMmwRlr4s79j)
- [Operating Systems](https://inst.eecs.berkeley.edu/~cs61c/su20/pdfs/lectures/lec18.pdf) / [video](https://www.youtube.com/playlist?list=PLDoI-XvXO0arq3vh2gcLvr5isLK4CuK3B)
- [Freestanding RISC-V Programs](https://youtu.be/iml0DBo5yqo)
+ [bare metal](https://en.wikipedia.org/wiki/Bare_machine)
- RISC-V Vector extension
* [Designing in 2023: 10 Problems to Solve](https://youtu.be/o70yKYWgtVI) - Jim Keller, [Tenstorrent](https://tenstorrent.com/)
- [Oral History of Jim Keller](https://youtu.be/Xh8nhK7WS80)
* Week13 (Dec 2): Virtual Memory + Operating System + Vector Extension
- Announcement
* In today’s class, we will discuss the progress of [Homework 3](https://hackmd.io/@sysprog/2025-arch-homework3) and [Term project](https://hackmd.io/@sysprog/arch2025-projects) with the students. Whether you are voluntarily or non-voluntarily participating in the Q&A, you should follow the assignment guidelines, prepare your HackMD notes, and set them to *public*. When the instructor talks with you, you should update HackMD note here. $\to$ [2025-12-02](https://hackmd.io/@sysprog/SJsiu3ib-l)
* Quiz 5 next week
* [Virtual Memory](https://youtu.be/TsxZlXOrt8U)
- UCB: [Virtual Memory I](https://docs.google.com/presentation/d/1_KtUjyxALrATgiT9JsiK8GKQXNw5M0BAllsdz78Lm74/edit?usp=sharing) / [video](https://youtu.be/lU0MDQHmGxA)
- UCB: [Virtual Memory II](https://docs.google.com/presentation/d/1KB2HKnvqsKq65udERzMw9imTMtV8KREMWmKc7w8XOfk/edit?usp=sharing) / [video](https://youtu.be/YtBlu56U3Lw)
- [The Future of Mission Critical Edge Compute Is RISC-V](https://youtu.be/Clvg2q3cC8M)
* [Lockstep systems](https://en.wikipedia.org/wiki/Lockstep_(computing)) are fault-tolerant computers that simultaneously perform identical operations in parallel. Borrowed from military marching terminology, these systems use redundancy to detect and correct errors. With two systems (dual modular redundancy), errors can be identified, and with three systems (triple modular redundancy), errors can be automatically corrected through majority voting.
* [Customizing Linux Systems in Aerospace](https://docs.google.com/presentation/d/1pRThP2vP78nNeb3Ds2563eNJne8QeAC2mWF67_FnLKw/edit?usp=sharing)
- UCB: [Operating Systems](https://www.youtube.com/playlist?list=PLDoI-XvXO0arq3vh2gcLvr5isLK4CuK3B)
- RISC-V Vector extension (RVV)
* [The Magic of RISC-V Vector Processing](https://youtu.be/Ozj_xU0rSyY)
* [Introduction to the RISC-V Vector Extension](https://eupilot.eu/wp-content/uploads/2022/11/RISC-V-VectorExtension-1-1.pdf)
* [The RISC-V Vector ISA Tutorial](https://riscv.org/wp-content/uploads/2018/05/15.20-15.55-18.05.06.VEXT-bcn-v1.pdf)
* [RISC-V "V" Vector Extension](https://inst.eecs.berkeley.edu/~cs152/sp22/handouts/sp22/riscv-v-spec-0.10.pdf)
* [RISC-V "V" Vector Extension](https://github.com/riscvarchive/riscv-v-spec/blob/master/v-spec.adoc)
* Week14 (Dec 10): Quiz + Synchronization
- Announcement:
* Check the listing of [final/term projects](https://hackmd.io/@sysprog/arch2023-projects) and fill in your names.
- [Quiz5](https://hackmd.io/@sysprog/arch2023-quiz5): pipelined processor + cache + virtual memory / [solution](https://hackmd.io/@sysprog/arch2023-quiz5-sol)
* [Virtual Memory](https://youtu.be/TsxZlXOrt8U) / UCB: [Virtual Memory](https://inst.eecs.berkeley.edu/~cs61c/su20/pdfs/lectures/lec19.pdf) / [video](https://www.youtube.com/playlist?list=PLDoI-XvXO0ar2Wia7JngBFMmwRlr4s79j)
- [Apple Silicon Guide](https://github.com/mikeroyal/Apple-Silicon-Guide)
* Week14 (Dec 9): Quiz + Synchronization
- [Quiz5](https://hackmd.io/@sysprog/arch2024-quiz5): pipelined processor + cache + virtual memory / [solution](https://hackmd.io/@sysprog/arch2024-quiz5-sol)
- [Debunking CISC vs RISC code density](https://www.bitsnbites.eu/cisc-vs-risc-code-density/)
- [Synchronization](https://youtu.be/r8H_af_dCF0)
+ Please check your operating system textbook for such topic.
* Week15 (Dec 17): Operating System, Multithreading
* Week15 (Dec 16): Operating System, Multithreading
- Announcement:
* Quiz6 is scheduled on Dec 24
- [2022-Quiz6](https://hackmd.io/@sysprog/arch2022-quiz6): pipelined processor + cache + virtual memory / [solution](https://hackmd.io/@sysprog/arch2022-quiz6-sol)
- [2023-Quiz6](https://hackmd.io/@sysprog/arch2023-quiz6) / [solution](https://hackmd.io/@sysprog/arch2023-quiz6-sol)
- [2022-Quiz6](https://hackmd.io/@sysprog/arch2022-quiz6) / [solution](https://hackmd.io/@sysprog/arch2022-quiz6-sol)
- [2021-Quiz7](https://hackmd.io/@sysprog/arch2021-quiz6) / [solution](https://hackmd.io/@sysprog/arch2021-quiz7-sol)
- [2021-Quiz6](https://hackmd.io/@sysprog/arch2021-quiz6) / [solution](https://hackmd.io/@sysprog/arch2021-quiz6-sol)
- [2020-Quiz6](https://hackmd.io/@sysprog/arch2020-quiz6) / [solution](https://hackmd.io/@sysprog/arch2020-quiz6-sol)
* [Term Projects](https://hackmd.io/@sysprog/arch2024-projects): You must provide the materials and demonstrate to the lecturer before **Jan 23, 2025**
- [Synchronization](https://youtu.be/r8H_af_dCF0)
+ Please check your operating system textbook for such topic.
- [Multithreading Issues + Cache Coherency](https://inst.eecs.berkeley.edu/~cs61c/su20/pdfs/lectures/lec23.pdf) / [video](https://www.youtube.com/playlist?list=PLDoI-XvXO0aqgj_8Og51XoE7iyAu5yEWZ)
- [Multithreading Issues + Cache Coherency](https://www.youtube.com/playlist?list=PLDoI-XvXO0aqgj_8Og51XoE7iyAu5yEWZ)
+ Let's skip OpenMP part
- video: [The Future of Operating Systems on RISC-V](https://youtu.be/emnN9p4vhzk) / [transcript](https://www.infoq.com/presentations/risc-v-future/)
- [Multithreaded Application Synchronization Part I](https://youtu.be/kk8q5rwm1ZI) / [Part II](https://youtu.be/dAVZTHxC16w)
+ Taken from [CSCI 463: Computer Architecture and Systems Organization](https://faculty.cs.niu.edu/~winans/CS463/2022-fa/)
+ RISC-V AMOSWAP instruction
+ [RISC-V spec references the word 'hart' - what does 'hart' mean?](https://stackoverflow.com/questions/42676827/risc-v-spec-references-the-word-hart-what-does-hart-mean)
* Week16 (Dec 24): Quiz + Memory Model, Synchronization, I/O
- [Quiz6](https://hackmd.io/@sysprog/arch2023-quiz6) / [solution](https://hackmd.io/@sysprog/arch2023-quiz6-sol)
* Week16 (Dec 23): Quiz + Memory Model, I/O
- Announcement:
* The class will be held online next week. (Happy New Year!) Please check this page for updates.
* Quiz7 is scheduled on Jan 7, 2025.
* [The term projects](https://hackmd.io/@sysprog/arch2024-projects) will be reviewed on Jan 7.
- [Quiz6](https://hackmd.io/@sysprog/arch2024-quiz6) / [solution](https://hackmd.io/@sysprog/arch2024-quiz6-sol)
- [Memory Model](https://youtu.be/QkbWgCSAEoo) / [slides](https://riscv.org/wp-content/uploads/2018/05/14.25-15.00-RISCVMemoryModelTutorial.pdf)
- [Advanced topics on Synchronization - 1](https://inst.eecs.berkeley.edu/~cs152/sp20/lectures/L19-MCM.pdf)
- [Advanced topics on Synchronization - 2](https://inst.eecs.berkeley.edu/~cs152/sp20/lectures/L22-Synch.pdf)
- [I/O: Devices, Polling, Interrupts](https://drive.google.com/drive/folders/1NRoyYSbAyarMhmPD5LiY6YEqYpLoZx_s) / [video](https://youtu.be/0dyqcFC_q2Q?t=1247)
* Traps/Interrupts/Exceptions
* Trap Handling in 5-Stage Pipeline
* Week17 (Dec 31): Modern Processors
* Week17 (Dec 30): Modern Processors | [online via YouTube](https://youtube.com/live/OnW1YjgTew8) start at 09:15AM
- Announcements
* Due to the instructor's significant involvement in a confidential project, there has been limited participation in this course. Consequently, the instructor proposes a modification to the course grading structure.
- The new breakdown will be as follows: Quiz (30%), Homework (30%), Final/Term Project (25%), and an additional "Base" component (15%). This "Base" component ensures that each student's starting score is at least 15%.
* Quiz7 is scheduled on Jan 7, 2024
- [rv32emu](https://github.com/sysprog21/rv32emu) introduces tier-1 JIT compiler to accelerate RISC-V simulation.
* Execute `make ENABLE_JIT=1 clean all` and then run `build/rv32emu build/smolnes.elf` to play NES games.
- [listing of final/term projects](https://hackmd.io/@sysprog/arch2023-projects)
* You must provide the materials and demonstrate to the lecturer before Jan 14, 2023.
* Summarize what you did and send email to `<jserv.tw@gmail.com>`.
* Quiz7 is scheduled on Jan 7, 2025
* Update [term projects](https://hackmd.io/@sysprog/arch2024-projects) and contact the instructor if you didn't receive the confirmation letter
- [Modern Processor Architecture](https://youtu.be/sbGtFtxqkkg)
* [Modern Microprocessors: A 90-Minute Guide!](https://www.lighterra.com/papers/modernmicroprocessors/)
- [Introduction to Dynamic Branch Prediction](https://youtu.be/PFmx2p6NA0A), [Advanced Branch Prediction](https://youtu.be/avp3bDqCXYM)
* Week 18 (Jan 7): Modern Processors
- [Quiz7](https://hackmd.io/@sysprog/arch2023-quiz7) / [solution](https://hackmd.io/@sysprog/arch2023-quiz7-sol)
- [Tournament Predictors and Branch Prediction Accuracy](https://youtu.be/-T8yDJ8vTuI)
- Project: [Analyze and improve srv32](https://hackmd.io/@peishan/HkJrtKpoY)
- [Hardware Based Speculation](https://youtu.be/mFtX28lH4O8)
* [Speculative Processor Vulnerability](https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability)
* [Spectre-BHB](https://developer.arm.com/Arm%20Security%20Center/Spectre-BHB)
- Case study: [SoomRV](https://github.com/mathis-s/SoomRV) - simple superscalar out-of-order RISC-V core. It can execute up to 4 instructions per cycle and is able to boot Linux.
- [RISC vs. CISC](https://yarchive.net/comp/risc_definition.html) by [John Mashey](https://en.wikipedia.org/wiki/John_Mashey), one of the founders of the Standard Performance Evaluation Corporation (SPEC) benchmarking group.
* [HackerNews](https://news.ycombinator.com/item?id=34196370)
* Week 18 (Jan 6): Review
- [Quiz7](https://hackmd.io/@sysprog/arch2024-quiz7) / [solution](https://hackmd.io/@sysprog/arch2024-quiz7-sol)
- Review [term projects](https://hackmd.io/@sysprog/arch2024-projects)