Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

32 and 16 bit

  1. Feb 28, 2009 #1
    our textbook says that the output of a C program deepends on whether the machine is 32 bit or 16 bit. So i was wondering what that means and if today 16 bit machines are still used???
  2. jcsd
  3. Feb 28, 2009 #2
    The default size of int used will depend based on the machine. Largest unsigned integer that can be stored in 16 bit is 65,535, and 32 bit is 4,294,967,296. This is why it's advised you explicitly declare the size of integers. Most modern machines are actually 64 bit now, but I don't think anything would default to 64 bit, someone should confirm this though.
  4. Feb 28, 2009 #3


    User Avatar

    Staff: Mentor

    LOL, some uCs are still 8-bit -- we sell them in the bzillions. Each machine and its C implementation will have different limits and sizes for various standard variables and structures. You can design your C code to accommodate that, though, if you run on multiple platforms. Not sure how hard it is to bridge 64-bit and old 8-bit platforms, though.
  5. Feb 28, 2009 #4
    i have an XP and a VISTA .So how do I know whether they are 64 or 32 bits??
  6. Feb 28, 2009 #5


    User Avatar
    Staff Emeritus
    Science Advisor

  7. Feb 28, 2009 #6
    but how can i find out how many bits my operating system works on?
  8. Feb 28, 2009 #7


    User Avatar
    Homework Helper

    Unless you have some type of extender, it depends on the version of the OS. XP X64 and Vista 64 bit are 64 bit OS'es, based on the AMD64 (AMD) == EMT64 (Intel) instruction set. You need a CPU that supports the EMT64 instruction set, and a 64 bit version of XP or Vista. In the case of XP, the default desktop shows it's the 64 bit version. If you still have your software box, it should clearly state if it's the 64 bit version, if not, it's 32 bit only. I'm not aware of 64 bit extenders that run under 32 bit OSes.

    Trivia #1: Intel also has Itanium cpu's that use the IA64 instruction set which is different and you need one of the Windows Servers or older Windows NT versions meant for the Itanium CPU's that implement the IA64 instruction set. Desktop systems don't use the Itanium CPUs (I'm not aware of Windows XP or Vista versions that run on Itaniums).

    Trivia#2: Back in the "olden" days, there were 32 bit extenders for both 16 bit DOS and 16 bit Windows 3.1. For DOS, some created a Windows NT like environment, called TNT extenders, I'm not sure about DOS4GW. Windows 3.1 included a 32 bit winmem32 memory model, but the Watcom c/c++ compiler (10.0) was one the few compilers that implemented winmem32 as a standard memory model. The primary extender for Windows 3.1 was win32s, sort of a precursor to Windows 95, but required win32s be installed, while winmen32 was a native part of Windows 3.1.
    Last edited: Feb 28, 2009
  9. Feb 28, 2009 #8
    It depends on the compiler, but an old C/C++ compiler will probably give you the option to compile your code as 16 or 32 bit. 16 bit Microsoft operating systems went out with DOS and windows 3.11. Very few people have the 64 bit version of Windows XP, but the 64 bit version of vista is very popular, and if you have it, then you can use a 64 bit compiler. Since 32 bit is still the defacto standard, if you do have a 64 bit OS, and a 64 bit compiler, then you can explicitly compile your code as 64 bit.

    To give an example, the last few versions of visual studio ship with a 64 bit compiler, but it is not installed by default (also, I believe you can compile 64 bit code with it on a 32 bit machine, but, of course, cannot run it).

    A lot of UNIX/Linux distributions ship in a 64 bit flavor.
  10. Feb 28, 2009 #9
    i right clicked on my computer and then properties and it said 1.46 GHz,0.99 GB RAM.

    so how do i know it in bits?
  11. Feb 28, 2009 #10
    If it is Vista, it will say either 32 or 64 bit operating system next to System Type:

    If it is XP, it is 32 bits, unless you got a 64 bit XP disk and installed it yourself.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook