Enter any two integers (positive or negative). The accumulator (A) and multiplier (Q, with extra
bit Q₀) use signed two's‑complement arithmetic throughout — negative inputs are handled natively.
Inputs
integer, −99 to 99
integer, −99 to 99
Binary setup
Register trace
—
Press Run to start.
Decision rules
Init — A = 0, Q = two's‑complement(A), Q₀ = 0
Q₁Q₀ = 00 / 11 → no operation, then shift
Q₁Q₀ = 10 → A = A − M, then shift
Q₁Q₀ = 01 → A = A + M, then shift
Shift — arithmetic right shift of [A, Q, Q₀]; sign bit preserved