Computer Organization & Embedded System — Computer Arithmetic and Memory System, NEC licence examination syllabus (Nepal Engineering Council).
Addition looks easy. Multiplication and division are where exams get you.
Every time a game engine calculates where a bullet lands, or your calculator app multiplies two numbers, it all comes down to circuits that only really know how to do one thing well: add. At the hardware level, every arithmetic operation eventually reduces to addition and subtraction of binary numbers, done using two's complement so the same adder circuit handles both positive and negative numbers.
To subtract A − B in two's complement, hardware doesn't build a separate subtractor — it just complements B and adds 1, then feeds it into the same adder used for addition. This is why two's complement is used almost everywhere in CPU design — one circuit, two jobs.
Booth's algorithm multiplies signed numbers efficiently by scanning pairs of bits and deciding to add, subtract, or do nothing, then shifting.
Registers used: A (accumulator, starts at 0), Q (multiplier), M (multiplicand), plus an extra bit Qn+1 initialized to 0 to compare with Q's last bit. After n cycles, A:Q holds the signed product.
RestoringShift-subtract, and if the result goes negative, add the divisor back ("restore") before continuing.
Non-restoringSkips the restore step entirely — instead of always subtracting, it subtracts or adds depending on the sign of the previous remainder. Faster, since no wasted restore cycle.
Every time a game physics engine handles a fraction of a second, or a spreadsheet stores 3.14159, it's using this exact format. Real (fractional) numbers are stored as sign, exponent, and mantissa — similar to scientific notation, but in binary.
Single (32-bit)1 sign + 8 exponent (bias 127) + 23 mantissa bits.
Double (64-bit)1 sign + 11 exponent (bias 1023) + 52 mantissa bits — this is what most programming languages use by default for decimals (e.g. Python's float, Java's double).
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.
Loading…