Instruction Encoding [assembly]

AI Thread Summary
A 1-address computer, like MARIE, uses instructions with one operand address, requiring careful consideration of opcode and memory address encoding. The minimum value of k for 100 distinct opcodes is determined to be 7 bits, while the minimum value of n is suggested to be 9 bits. There is confusion regarding the interpretation of "128M words," with participants debating whether it refers to 128 million or 128 megabytes. The discussion also touches on the implications of word size needing to be an integer number of bytes, leading to further questions about addressing limits. Clarification on these points may be sought from the professor due to ambiguities in the assignment.
twoski
Messages
177
Reaction score
2

Homework Statement



A 1-address computer is one whose instruction can contain at most one operand address. MARIE is an example of such a computer. Typically each instruction is stored as a single word in the memory. Assume the following machine details.

(i) A word contains n bits, and k bits (k < n) are used to encode each opcode. The remaining bits are used to specify memory address(es).
(ii) There are 100 distinct opcodes in the ISA.
(iii) The largest program requires 128M words of memory to run.

(a) What is the minimum value of k required? What is the minimum value of n required? Keeping minimum value of k, what is the maximum number of opcodes that can be used?

(b) If the size of each word must be an integer number of bytes, what is the minimum value of n required? What is largest memory that can be used in this computer then?


The Attempt at a Solution



A) The minimum value for k is 7 since the ISA has 100 distinct opcodes. The minimum value for n is 9 since the lowest possible size for instructions is 1 bit (our professor's slides say that possible sizes for instructions are 8,16,32 or 64 and i don't think having 1 bit for the address makes any sense). If k = 7, then the maximum amount of opcodes is 128.

B) I don't get this... It's saying that i can only have 8/16/32/etc bits which i have already assumed. Did i miss something?
 
Physics news on Phys.org
twoski said:
(iii) The largest program requires 128M words of memory to run.
Does this mean 128,000 or 128,000,000 words or 128*1024 or 128*1024*1024 words?

twoski said:
(a)What is the minimum value of n required?
This part of a is not restricting the word size to be a multiple of 8 bits.
 
The assignment just says 128M, i was hoping someone here would be able to hazard a guess as to what that means. It's ambiguous so maybe i'll email the professor about it.

If the minimum bits for k is 7 (since 128 is the closest to 100 without being lower than 100) then the minimum size for n would be 1 which makes the minimum amount of total bits 8. Although i don't know how smart this would be since having 1 bit for addresses would be absurd - is there a specific limit on how small addresses can be?
 
twoski said:
the minimum size for n would be 1
The minimum size for n is the the number of bits required to address 128M words, except I don't know that M stands for in this case, but mostly likely it's 1024*1024 = 1048576 (asssuming that small m would mean 1,000,000).
 
Last edited:
Well in similar questions he uses "128 Mbits" so maybe it was just a typo and he meant 128 Mbits instead of 128M words?

So if the total words is size m, the minimum size would be n where n^2 = m, right?
 
twoski said:
Well in similar questions he uses "128 Mbits" so maybe it was just a typo and he meant 128 Mbits instead of 128M words?
Just assume he mean 128M words.

twoski said:
So if the total words is size m, the minimum size would be n where n^2 = m, right?
Yes, if total bits size is m, then n^2 = m / 8.
 
Back
Top