Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

In Knuth's Fascicle 1 on MMIX, the "Memory and Registers" section on page 4 states:

"thus if x is any octabyte, M[x] is a byte of memory."

and

"thus if x is any byte, $x is an octabyte."

How can x be an octabyte (64 bits) and M[x] be a byte (8 bits)? Conversely, how can x be a byte and $x be an octabyte?

share|improve this question
1  
I am not familiar with the notation, but surely if M[x] is defined as a byte of x then it just is? –  Peter Dec 24 '11 at 13:14

2 Answers 2

MMIX is a notional 64-bit computer, so its address bus has 64 lines and it can be fitted with up to 2^64 memory cells. Each of these cells, however, holds 1 byte (8 bits) and not 64 bits, therefore you have 2^64 bytes (not octobytes) of RAM. (It is customary to measure RAM in bytes and not in double-, quad- or octo-bytes even when the architecture has more than 8 bits. It is also convenient to retrieve individual bytes from memory because many algorithms require only small numbers in many places. In practice, processor caches obscure this distinction anyway.)

The registers, however, are full 64-bit registers, therefore $x is an octobyte, not just a byte. Again, this is a convention for processor architecture rather than a fixed law, but most architectures that claim to be X-bit (for an impressively large value of X) also sport X-bit registers, so that when you do want to load X bits from memory simultaneously, you can receive them in just one register without spilling.

share|improve this answer
    
"most architectures that claim to be X-bit (for an impressively large value of X) also sport X-bit registers", the computer architecture definition of being X-bit for an architecture is that its integer registers are X bits wide. Marketting sometimes modified the technical definition for its own purpose. –  AProgrammer Dec 24 '11 at 14:00
1  
AProgrammer - I wasn't aware that there was a single definition of what an X-bit computer is. The Motorola 68000 processor was typically described as either 16-bit or 16/32 bit - it's integer registers, address registers and ALU were all 32 bits wide, but its data bus was only 16 (and address bus only 24). The 68008 was an instruction-compatible chip (still 32 bit registers etc) that was generally described as 8-bit, because of it's 8 bit data bus. Not exactly marketing - a smaller bit-width isn't that impressive. –  Steve314 Dec 24 '11 at 15:23

Because “plain ol’” memory addresses address bytes. Notice, though, that if you are addressing more than one byte of memory multiple memory addresses point to the same thing.

To be sure, there are 2^(64) bytes of memory, 2^(63) wydes, 2^(62) tetrabytes, and 2^(61) octabytes. You basically end up with 3 ignored bits when addressing octabytes.

In other words, if f(x) is a function from an address x to its memory cell (think of *x in C), f(x) isn’t bijective; moreover, f(x) is only a binary operation when you’re addressing octabytes (i.e., for x in X f(f(x) is in X too).

You can think of it like pointers to int, double, etc.

Nice to see people reading about MMIX!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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