Thread: What does the 32-bit in 32-bit CPUs Refer to?

  1. #1
    Set Apart -- jrahhali's Avatar
    Join Date
    Nov 2002
    Posts
    256

    What does the 32-bit in 32-bit CPUs Refer to?

    Does it refer to the size of the external data bus, the address bus, or the registers? Do all three have to at least be 32-bits wide for the CPU to be called a 32-bit CPU, or, does just one have to be 32-bits wide?
    Clear the mines from our Shazbot!
    Get the enemy Shazbot!

  2. #2
    Registered User
    Join Date
    Jul 2007
    Posts
    131
    It can be any of those or some combination.

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Generally when you hear "32bit" they are referring to the size of the CPU's general purpose registers, which is usually also the size of the data buss... That's not merely a coincedence, it's so that data can be fetched from memory in a sensible manner... A system with 32 bit registers and an 8 bit data buss would be horridly inefficient as it would take 4 memory fetches to get a single 32 bit value, so the smart money is on having the registers and external data buss the same size.

    The address buss can be any width the engineers decide, although it is generally in multiples of 8 bits. A 32bit cpu with a 128bit address buss is entirely doable... as is a 32 bit cpu with a 16 bit data buss (although the latter would be kind of silly since it could only access 64k of memory).

    You will also hear the "32bit" reference used with compilers (for various languages)... in this case referring to the size of an "integer" value in the code... Again, the smart money is on matching the CPU's register sizes.

    Quite often you will hear people here (including me) chiding people with ancient compilers to update to a more modern one... this is generally because these older compilers (turbo c++ being the worst offender) actually work on 16bit integers that come from the days of 16 bit processors such as the 8086 and iapx286... These old 16 bit compilers are woefully inadequate in today's world of 64 bit CPUs...

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by CommonTater View Post
    You will also hear the "32bit" reference used with compilers (for various languages)... in this case referring to the size of an "integer" value in the code... Again, the smart money is on matching the CPU's register sizes.

    Quite often you will hear people here (including me) chiding people with ancient compilers to update to a more modern one... this is generally because these older compilers (turbo c++ being the worst offender) actually work on 16bit integers that come from the days of 16 bit processors such as the 8086 and iapx286... These old 16 bit compilers are woefully inadequate in today's world of 64 bit CPUs...
    I don't think that is the case.
    32-bit software simply means it's designed to run on a 32-bit CPU.
    16-bit software means it's designed to run on a 16-bit CPU.
    As you can imagine, 32-bit cpus and operating systems are generally backwards compatible. The same is true for 64-bit.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    That's true -- using 16-bit software is one thing, but I can't imagine wanting to write a new 16-bit program for a 32-bit or 64-bit CPU as the target. That's how it is inadequate.

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by whiteflags View Post
    That's true -- using 16-bit software is one thing, but I can't imagine wanting to write a new 16-bit program for a 32-bit or 64-bit CPU as the target. That's how it is inadequate.
    Exactly...

    It won't be long until our present 32bit compilers are getting the same screech...

  7. #7
    Password:
    Join Date
    Dec 2009
    Location
    NC
    Posts
    587
    It also has implications on the size of the address bus. 16bit means you can address 2^16 bytes of memory(although segmentation allows for a total of 2^20 bytes), 32bit means you can address 2^32 bytes of memory, and 64bit means you can address 2^64 bytes(though only 2^48 bytes of physical memory can be directly referenced on the AMD64 arch because AMD thought 2^64 of memory is insanely excessive.)

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That's alright. We can still access up to ~250ish billion bytes, that is ~250 TB of memory.
    Although the idea of ~10ish exabytes of memory sounds kindof nice.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Password:
    Join Date
    Dec 2009
    Location
    NC
    Posts
    587
    You'd have to have ~4166666666 times more money than Bill Gates to buy all that RAM.

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Oh, but I still have 50 years to buy all that ram, don't I?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #11
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Elysia View Post
    As you can imagine, 32-bit cpus and operating systems are generally backwards compatible. The same is true for 64-bit.
    Well, that's the thing... Win7 X64 no longer supports 8 or 16bit applications.
    Last edited by CommonTater; 02-19-2011 at 08:41 PM.

  12. #12
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Not an easy answer to give to the OP, if you think about it:

    We can pretty much exclude the address bus, since historically not always it has matched the data bus. We should probably also exclude the general purpose registers since some architectures offered coupled registers along with instructions (the so-called 8-bit Z80, for instance, offers coupled 8-bit registers and can perform 16-bit arithmetic and addressing). We should finally also exclude data buses since these have been having varied sizes, not always conforming with the term being used.

    What makes an architecture 8-bit, 16 or 32, seems sometimes what someone decided to call it and nothing much more. The new 32/64 processors are essentially a proof of this concept, when you consider that even an operating system might have a saying on what type of machine you will be running. And if I'm currently writing this on a 32-bit i5 simply because I installed the x86 version of windows here, what's there to say that the 8-bit Z80 was after all a 16-bit processor because I could write 16-bit instruction for it?
    Last edited by Mario F.; 02-19-2011 at 09:53 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  13. #13
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    For what it's worth Mario... it's usually the GP accumulator that determines the stated bit width... it was 8 bits (AX) in the z80, now usually 64bits (EAX) in the newer machines.

    There is a relatinship to hardware...

  14. #14
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    General purpose registers are usually the same width as the data bus, but address bus varies quite a bit.

    8051, an 8-bit architecture, has both 8-bit address bus and 16-bit address bus (in different addressing spaces). This is the case for many 8-bit architectures, because 256 bytes are just not enough.

    Anything higher than 8-bit, though, address bus is usually the same width as data bus. There are some exceptions. For example they tried to hack the x86's 32-bit addressing bus to support more than 4GB RAM, but the "natural" addressing space is still 32-bit.

    x86-64 is kind of odd. I tend to think of it as a CPU that supports 2 architectures. It has a 32-bit mode where everything (GP, data and addressing buses) is 32-bit, and a 64-bit mode where everything is 64-bit.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. question about 32 bit addresses??
    By newbie02 in forum C++ Programming
    Replies: 3
    Last Post: 09-12-2003, 02:02 PM
  2. binary numbers
    By watshamacalit in forum C Programming
    Replies: 4
    Last Post: 01-14-2003, 11:06 PM
  3. 16 bit or 32 bit
    By Juganoo in forum C Programming
    Replies: 9
    Last Post: 12-19-2002, 07:24 AM
  4. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-20-2002, 11:35 PM
  5. 32 bit or 16 ???
    By GiraffeMan in forum C Programming
    Replies: 11
    Last Post: 04-24-2002, 12:56 PM