X

Register (thanh ghi) là gì?

Khái niệm "sơ khai": Là một nơi lưu trữ dữ liệu (can store or remember a value over time), có width nhất định, cái width đó được gọi là word (measured by the number of bits they can hold). Tập hợp của một hay nhiều byte có cùng chức năng gọi là một thanh ghi.

Khi nói Register thì mọi người thường ám chỉ processor register: a quickly accessible location available to a computer's processor (Register có thể hiểu là bộ nhớ gắn trực tiếp vào CPU. Bộ nhớ gián tiếp (secondary) thì có [[Cache]] (nhiều tầng) rồi tới RAM rồi tới disks).

Memory access is a relatively slow operation, requiring long instruction formats (an address may require 32 bits). For this reason, most processors are equipped with several registers, each capable of holding a single value. Located in the processor’s immediate proximity, the registers serve as a high-speed local memory, allowing the processor to manipulate data and instructions quickly.

Cấu trúc cơ bản của thanh ghi (trong chương 3 - nand2tetris): ![[img/Pasted image 20250526205327.png]]