wire / wire-format / alu

ALU (Arithmetic Logic Unit)

The ALU performs arithmetic and logical operations on integer operands. Typical operations: ADD, SUB, AND, OR, XOR, NOT, SHL (shift left), SHR (shift right), SAR (arithmetic shift right), ROL (rotate left), ROR (rotate right), CMP (compare, sets flags), TEST (AND without storing result). Flags: ZF (zero), SF (sign), CF (carry), OF (overflow), PF (parity).

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: ALU (Arithmetic Logic Unit)

wire format

spec: Computer architecture

The ALU performs arithmetic and logical operations on integer operands. Typical operations: ADD, SUB, AND, OR, XOR, NOT, SHL (shift left), SHR (shift right), SAR (arithmetic shift right), ROL (rotate left), ROR (rotate right), CMP (compare, sets flags), TEST (AND without storing result). Flags: ZF (zero), SF (sign), CF (carry), OF (overflow), PF (parity).

fieldsizemeaning
Operation select4-6 bitsSelects the ALU operation (ADD, SUB, AND, OR, XOR, etc.).
Operand An bitsFirst operand (from register or immediate).
Operand Bn bitsSecond operand (from register or immediate).
Resultn bitsOperation result.
Carry out1 bitCarry/borrow out of the most significant bit.
Zero flag (ZF)1 bit1 if result is zero.
Sign flag (SF)1 bit1 if result is negative (MSB=1).
Overflow flag (OF)1 bit1 if signed overflow occurred.
Carry flag (CF)1 bit1 if unsigned carry/borrow occurred.
Parity flag (PF)1 bit1 if even number of 1 bits in low byte.

example:

00 00 00 00

ALU (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/alu or /wire-format/alu.json