Memory consists of bits represented as 0s and 1s.

Memory is usually addressed by bytes (8 bits), though some machines may use word (32 bits) or double word (64 bits) addressing.

In artificial intelligence, quantization techniques can utilize sub-byte data types like 2-bit or 4-bit representations. However, the smallest addressable unit in memory remains the byte. To access individual bits, operations such as shifting and extraction must be employed.

image.png

image.png

sltu : 无符号比较指令,sltu a3,a2,a0 # 若a2 < a0 (无符号比较), a3=1, 否则a3=0

Instructions are composed of:

image.png

Unsigned and Signed Numbers

image.png

image.png

Remember: In 2’s complement numbers, positive integer numbers have leading zero’s, 0000xxx; negative integer numbers have leading one’s, 1111yyy.

Why not 1’s complement?