7

This isn't the first time the question occurred to me, but I was playing an old SNES game today when I thought about it again and wanted to seek an answer from people who know more about it than I do.

Take the Super Nintendo for example. It's a 16-bit system. With 16 bits, you can count up to 65536, or 2^16. So how does the machine cope with me having, for instance, a score of greater than 65536?

Ryan Ries
  • 2,381
  • 1
  • 24
  • 33
  • Related question: http://stackoverflow.com/questions/12718536/how-does-a-32bit-computer-work-with-large-bit-numbers-ex-512bit-integers – reima May 26 '13 at 01:06

2 Answers2

5

In reality it's a bit more complex, but the simple explanation is that a 16bit processor can do a operations on 16 bit numbers in a single operation, and to deal with larger numbers you need to break things up. For example to add two 32-bit numbers, you would add least significant words in one operation, then add the most significant words and then add any carry bits.

Obviously this is much slower (3 instructions instead of one), but almost any operation can be done if needed. This is a reason that processors with larger words can be faster; they can do larger operations with a single instruction instead of several instructions. From the programmers point of view, the compiler will usually take care of this, you'd never do it by hand unless you're writing assembly.

In reality though, many processors have dedicated hardware to do math operations, so calling a processor 32-bit or 64-bit really has more to do with memory addressing and the size of registers.

  • 2
    It's almost always two instructions, not three. Most processor families have a special instruction for adding two numbers and the carry bit, it turns out the hardware cost to add a carry bit is minimal. This makes sense, if you imagine that numbers are already broken up into smaller chunks with propagating carry bits--who would notice an extra carry bit going into the LSB, which normally doesn't have one. – Dietrich Epp May 26 '13 at 07:13
  • 1
    @DietrichEpp In MIPS there's no flag and you must use 3 instructions to do that. That's one really strange exception in high performance computer architectures – phuclv Feb 24 '16 at 05:55
0

The real limitation of a processor with fewer bits is that it cannot address as much memory, 32bits can only address 4gb. In terms of mathematical operations both a 16 bit and 32but processor are equivalent to A FTTM( finite tape turing machine) and thus have the similar computation power. For example java's BigInteger can be as big as you want

Steven Lu
  • 41,389
  • 58
  • 210
  • 364
aaronman
  • 18,343
  • 7
  • 63
  • 78