Education & Online Learning

What are machine words and their meaning?

The processor’s registers and bus are the actual workhorses of the computer. Initially, the size of computer scratchpad was 4 bits, then 8 bits, 16 bits, 32 bits, and now 64 bits.

What are machine words?

“Machine words” are units of data that can be moved between a computer’s memory and processor. The longer the machine word, the more operations the processor can complete in one operation. Historically, “danzi” used to be a term used to refer to memory. For example, programmers used to use terms like “writing a word” or “processing an instruction word.”

The size of the “machine word” depends on the processor. It is predetermined by the configuration of the processor instruction set hardware. “Word size” is the number of bits that the processor can process at one time.

  • Intel 4004 – 4-bit word length – the world’s first commercial microprocessor introduced in 1971
  • Intel 8008 – 8-bit word length – the world’s first widely used 8-bit processor
  • Intel 8085 – 8-bit word length
  • Intel 8086 – 16-bit word size (data or word size: 16 bits, address bus size: 20 bits)
  • Intel 8087 – 16-bit word length – first introduced floating point arithmetic
  • Intel Pentium I – 32-bit word length
  • Intel Pentium II – 32-bit word length
  • Intel Pentium III – 32-bit word length
  • Pentium IV versions before Prescott were 32-bit, and since Prescott are 64-bit in size
  • i3/i5/i7 – word sizes are all 64 bits
  • All processors from Intel and AMD now have 64-bit word lengths

A word in modern 64-bit processors is 8 bytes, a DWORD (double word) is 16 bytes, and a QWORD (four bytes) is 32 bytes.

The pointer size is the word size of the machine

The word size of a processor (never really a precise term) is best loosely defined as the maximum natural size for arithmetic, usually the size of the scratchpad in the machine. This is typically the width of the data path (significantly different from the data bus). The data path is the width of the ALU. The pointer size is usually the machine’s word size.

Common misconceptions about virtual table sizes

A common misunderstanding is that the maximum size of the virtual address space is determined by the word size, that is, if the word size is n bits, the maximum virtual address space is 2^n -1. However, this is not necessarily true!

The size of the virtual address space is simply determined by the number of virtual page numbers in the page table (and TLB). On current AMD64-based computers, only 48-bit virtual addresses are available. The upper 16 bits are the sign extension of bit 47. These physical address bits are sent on the bus. Today, many machines use address busses that are narrower than the number of address bits. These bits are simply divided and sent across the bus using multiple clock cycles. DDRx DRAM is an example of this process.

Combinational Language Programming

I distinctly remember from my computer science engineering days struggling to actually code in assembly language (8086) for my microprocessor subject. Assembly language works by loading directly into scratchpad registers and performing operations between registers. For example, in the following “BP aka. “Base Pointer” is the pointer register. Likewise, SP is the stack pointer and IP is the instruction pointer. Similarly, “LDR” is an instruction that loads a value from a memory address into a temporary register. Likewise, “STR” is an instruction that stores a value in a temporary register at a memory address.

Likewise, the “PC, also known as the program counter,” is a register in the CPU that keeps track of the memory address of the next instruction that needs to be executed. The “PUSH” instruction puts the current value of the “PC” register onto the stack in preparation for execution. The “MOV” command copies data from source to destination. Likewise, the “ADD” and “SUB” instructions are self-explanatory.

The size of these registers depends on the processor word size. A 16-bit word processor has a 16-bit wide (or 2 bytes) register. This means that the scratchpad can hold 0 to 65,535 (unsigned binary numbers) and -32768 to 32767 (signed binary numbers).

The significance of 32/64-bit processors and 32/64-bit operating systems

32-bit processors can run 32-bit operating systems. However, you cannot run a 64-bit operating system (OS) on a 32-bit processor. Installing a 64-bit operating system will provide 64-bit instructions to the processor (a 32-bit operating system will provide 32-bit instructions to the processor). Now, if the processor is 32-bit and the operating system is 64-bit, then you are effectively feeding 64-bit instructions to a processor that can only handle 32-bit instructions at a time. If you plan to do this, the operating system will most likely not even start. You won’t be able to run it. A 32-bit process cannot load a 64-bit DLL for execution.

Instead, you will be able to run 32-bit operating systems on 64-bit processors. Likewise, 32-bit applications on 64-bit processors. 64-bit processors can run 32-bit and 64-bit applications. However, if you are running a 32-bit application on a 64-bit processor, this is not a very efficient way to run it. You’re not using your processor to its full potential.

floating point instructions

Floating point instructions are processed through a set of registers because floating point cannot be stored in regular registers.

Assembly language instructions

Assembly language programs must be written according to the instruction set and architecture of a specific processor (such as CPU registers, memory locations, and input/output device registers). Low-level code is translated into machine code through a simple transliteration process, often called Assembler.

The output of the assembler (“object code”) can then be “linked” with any library routines or external subroutines called from the program and “located” by inserting into the file the absolute addresses of the memory locations where the program code and data will be loaded into the target system. Because it relies on the target machine and the translated code is unstructured, debugging such software and testing the assembler output becomes very difficult.

Assembly language programming requires a detailed understanding of the instruction set and processor architecture, typically only in applications that require correct support at the machine level for the processing models and programming structures used in the design. Typical examples are compilers, operating system kernels, interface software including interrupt handling, and certain aspects of real-time software. This is the domain of a “systems programmer”, not an “applications programmer”. For general application programming, knowledge of assembly language programming is not necessary.

Hope this helps, thanks.

You may want to read: All About GPUs, Artificial Intelligence for Kids, Space Programming for Kids, and Using Music to Teach Binary Code to Children

refer to:



Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
×

Adblock Detected

*We Appreciate Your Visit!*

To enjoy all the features and content on our website, please consider disabling your ad blocker. Our site relies on ads to provide you with quality content and a seamless experience. Thank you for your understanding!