-2

I'd like to ask you what is CPU architecture, in an oversimplified way. I'm learning node.js and recently I saw a code console.log(os.arch()). The result was x64. What does that x means? Thank you!

0

I'd like to ask you what is CPU architecture, in an oversimplified way.

This question isn't relevant to this Stack Exchange community, but I will try answer it before anyone flags or closes this question.

A CPU architecture is basically a name for the design of a CPU; If many CPUs support the same features then it can be said that those CPUs share an 'architecture'. It is especially useful to programmers to know that they can write code once that will run on all CPUs that implement that architecture.

The os.arch() function will usually return one of these two architectures on a PC:

  • x86
  • x64

The 'x' in 'x86' is a sort of wildcard to represent any CPU from a family of CPUs which all shared a similar design & instruction set. One such CPU was the Intel 80486, which is where the '86' comes from. Thus, 'x86' was adopted to refer to CPUs that implement this common architecture.

Later on when AMD introduced 64-bit CPUs, they initially called this architecture amd64, but then Intel came up with their own design and soon the 'x64' term was invented to refer to 64-bit CPUs in general.

The purpose of the os.arch() function is to identify the CPU architecture that your node application is running on.

2
  • Please don't answer questions that are off-topic here. – user1691 Jun 24 '19 at 15:34
  • @SiXandSeven8ths I will remember not to. I believe I was also the first person to flag this post as off-topic though. – Romen Jun 24 '19 at 16:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.