arithmetic and logic instructions
Arithmetic and logic instructions are the processor's pocket calculator: the instructions that actually compute something. An arithmetic instruction adds, subtracts, or otherwise does math on numbers; a logic instruction does bit-by-bit operations like AND, OR, XOR, and shifting bits left or right. They are the workhorses — most of the useful work a program does, from totaling a shopping cart to encrypting a message, eventually comes down to a long stream of these.
In a load-store ISA like RISC-V, these instructions read their inputs from registers and write their result back to a register; they never touch memory. A typical one names three registers: one to receive the result and two to supply the operands. For example 'add x5, x6, x7' computes x6 + x7 and stores it in x5; 'and x5, x6, x7' does a bit-by-bit AND. Many also come in an 'immediate' form where one operand is a small constant baked into the instruction itself, written like 'addi x5, x6, 10' (add 10 to x6). Either way, the inputs and the output are all registers (or a small constant), which is exactly why these instructions are fast.
Where they show up: every calculation in every program, plus a surprising amount of bookkeeping. Computing the address of an array element, adjusting a loop counter, packing two values into one word with shifts and ORs — all of these are arithmetic and logic instructions, even though no obvious 'math' is happening in the source code. They are deliberately simple so the hardware can do one in a single fast step and overlap many of them.
To compute 'y = (a + b) - c' with a, b, c in registers x6, x7, x8: 'add x5, x6, x7' gives a+b in x5, then 'sub x5, x5, x8' subtracts c. Two arithmetic instructions, all in registers, no memory touched.
Multi-step formulas become short chains of register-to-register arithmetic.
These instructions are register-only by design in a load-store ISA. If your data lives in memory you must first 'load' it into a register, compute, then 'store' it back — the arithmetic instruction itself cannot reach into memory.