5.78 · exercise

Intermediate quiz: binary arithmetic

How fixed-width arithmetic wraps, what a carry out of the most significant bit means, which flags the signed and unsigned branch conditions read, and how shift-and-add multiplication works.

0 of 8 correct

Multiple choice

Arithmetic in an N-bit register wraps modulo M. For a 4-bit register, what is M?

Multiple choice

An add produces a carry out of the most significant bit. What happens to that carry?

Multiple choice

Which branching condition should be used to check if one unsigned integer is strictly greater than another?

Multiple choice

Why do the unsigned branch conditions ignore the Negative (N) and Overflow (V) flags?

Multiple choice

In the shift-and-add multiplication algorithm, what extra step is needed at the end when the original multiplier is negative?

Multiple choice

How is a multi-bit binary adder built out of full adders?

Multiple choice

Why does the ALU perform subtraction by negating the number being subtracted and then adding?

Multiple choice

After a subs or cmp on signed integers, why is the lt condition true exactly when N is not equal to V?