What is the difference between AND and ANDI?
AND reads two registers, rs1 and rs2. ANDI reads rs1 and uses a sign-extended 12-bit immediate.
Bitwise AND of rs1 and rs2, result in rd
AND uses the R-type format. It performs bitwise AND of rs1 and rs2 and writes the result to rd. funct7=0000000 and funct3=111.
Starts with machine-code field decoding, then shows operand reads, instruction-specific execution, and ISA-visible state update.
The machine code is split by the current instruction format; the animation starts from encoding/decode.
This animation shows ISA-visible decode and state changes, not any specific CPU pipeline, cache, prediction, or timing implementation.
AND is an RV32I/RV64I base integer R-type logical instruction: it reads two XLEN-wide register values from rs1 and rs2, applies bitwise AND, and writes rd. It is commonly used to keep bits selected by 1s in a mask and clear bits selected by 0s.
Understand this scenario with real code like «and x5, x6, x7 # x5 = x6 & x7».
Understand this scenario with real code like «and x5, x6, x7 # x5 = x6 & x7».
Understand this scenario with real code like «and x5, x6, x7 # x5 = x6 & x7».
AND reads two registers, rs1 and rs2. ANDI reads rs1 and uses a sign-extended 12-bit immediate.
No. The RISC-V base integer ISA has no condition-code flags; AND only writes rd, and a write to x0 is discarded.