Re: 32 bit processors / 64 bit processors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 21 Oct 2009 13:13:03 +0530, askb <askb23@xxxxxxxxx> wrote:
> On Wed, 2009-10-21 at 11:09 +0530, Siddu wrote:
>> 
>> 
>> On Wed, Oct 21, 2009 at 8:32 AM, Rick Brown <rick.brown.3@xxxxxxxxx>
>> wrote:
>>         Hi,
>>         
>>         Firstly, I'm trying to understand what exactly characterizes a
>>         procesor or an operating system as 32bit / 64 bit. I've read
>>         that it
>>         means the "native word size" of a machine. But what exactly is
>>         that?
>>         Register size? Address bus size? Anything else?
>>         
>> 
>> When they say its 32/64 bit machine its the capability of the system
>> or processor to process so many bits at once !
> 
> Additionally, the virtual memory address is 64 bit. Also the main
> difference is with sizeof(long int) and sizeof(void *) on both archs. 
> 
>> 
>>  
>> 
>>         Secondly, I'm trying to understand what exactly does a
>>         sizeof(int)
>>         depend on when we say it is "platform specific". Is it
>>         dependent of
>>         compiler being 32bit / 64 bit? Or the OS being 32bit / 64 bit?
>>         Or the
>>         processor being 32 / 64 bit?
>>         
>> its dependent on processor being 32/64 bit
>> 
>> 
>>         Lastly, How are "sizes" of compiler / OS / processor inter
>>         related?
>>         Here is my understanding. A 32 bit processor can only be
>>         running a 32
>>         bit OS.
>> 
>> No ... 32 bit OS can run anything <= 32 bit
>>  
>>         A 64 bit processor may run a 32 or a 64 bit OS.
>> 
>> yes thats right !
>>  
>> 
>>         A 32 bit
>>         compiler genrates code only to be run on a 32 bit OS; ditto
>>         for 64
>>         bit. 
>> 
>> Not sure about this let others have their say ! 
>> 
>>         Is this right?
> 
> It is possible to use the -m32 and -m64 flags with gcc for generating
> 32/64 bit compatible code.
> 
> 
> 
> 
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ

Hi,

>> means the "native word size" of a machine. But what exactly is
>> that?
>> Register size? Address bus size? Anything else?

To make it more generic, native word size is the bit width of the ALU
in the CPU IMO. Some MCUs will use microcode to "reflect" the ALU into
several registers,
even as much as 4096. These are referred to as "Accumulator mapped"
CPUs/MCUs.
So the registers (typically) will be the same size as the ALU, but the
register bit width can be larger in some
CPUs and vice-versa.

Also note that you could have an 8 bit CPU with 32 bit address bus - for
example.
Or conversely, a 32 bit CPU might only need 64K (16 bits) or more to hold
its actual program code.
In conclusion the address bus is really irrelevant to the native word
size.

HTH
B rgds
Kris



--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux