Introduction to 32 Bit and 64 Bit CPU
Introduction to CPU
CPU (central processing unit) or processor is electronic circuitry within a computer that is processing instructions by performing arithmetic, logic, controlling, and input/output (I/O) operations specified by the instructions. This cycle of performing operations by the CPU depends on its clock-rate, which is measured with Hz (Hertz), there are bigger units like kHz, MHz, GHz, etc.
- 1Hz - CPU will run the cycle once in a second
- 1MHz - CPU will run 1 000 000 cycles in a second
- 1GHz - CPU will run 1.000.000.000 cycles in a second
32 Bit and 64 Bit CPU
A 64-bit processor is capable of processing more data than a 32-bit processor because the 64-bit processor can store more computational values, memory addresses, etc, which means that 64-bit can access over four billion times physical memory than 32-bit.
- A 32-bit processor can handle a memory RAM size of 2^32 (4 GB)
- A 64-bit processor can handle a memory RAM size of 2^64 (16 Exabyte)
Datatypes Size Example
Let's see a simple example in C programming language where we will print some datatypes.
#include <stdio.h>
#include <limits.h>
int main() {
printf("char", sizeof(char));
printf("short", sizeof(short));
printf("int", sizeof(int));
printf("int 64 t", sizeof(int64_t));
printf("float", sizeof(float));
printf("double", sizeof(double));
printf("long double", sizeof(long double));
return 0;
}
Here is the result that we got from running our program in C.
type size in byte
char 1
short 2
int 4
int 64 t 8
float 4
double 8
long double 16
This means an int of 4 bytes on a 32-bit processor you can process a number in the range of 2^32. You can use the int64_t (which in this case the int is 8 bytes) on a 64-bit processor to use the whole range of 2^64. This means the 32-bit processor can execute 4 bytes of data in one instruction cycle while 64-bit means that the processor can execute 8 bytes of data in one instruction cycle.
Backward Compatible
On a computer with a 32-bit processor, you cannot have a 64-bit operating system installed, it can only run a 32-bit operating system. Where on the 64-bit processor you can have a 64-bit or 32-bit operating system, however, there is a downside of using 32-bit OS where the processor will not run at its full capability. If we talk about programs, you cannot run legacy 16-bit programs on a 64-bit processor, where many 32-bit programs are still compatible.
Conclusion
The 64-bit CPU is much more powerful than the 32-bit CPU, and it is becoming more and more common in computers, most of the users are now using 64-bit operating systems and programs.
Tweet