Can somebody please explain this problem to me?

A computer has 20 bit instructions with 8 bit addresses. Suppose that there are 12 two-address instructions. How many 1-address instructions are theoretically possible?

Would the instruction set be set up like this?
0000|00000000|00000000

Would it be 4*2^16

Why don't you just count? Each two-address instruction eats up enough of the available instruction space to represent 2 addresses. Each one-address instruction eats up enough of the available instruction space to represent 1 address. If you don't understand what this means, ask.

Why don't you just count? Each two-address instruction eats up enough of the available instruction space to represent 2 addresses. Each one-address instruction eats up enough of the available instruction space to represent 1 address. If you don't understand what this means, ask.

Yeah, I'm not really sure what that means.

To represent an N-bit value whose value could be anything, you need.... N bits. Which eats up 2^N possible numbers. You have 2^20 available numbers.

Ok. I appreciate your help, but I still really don't understand. There is a problem similar to this in our book:

A computer has 32-bit instructions and 12-bit addresses. Suppose there are 250 2-address instructions. How many 1-address instructions can be formulated?

The answer in the book is 6*2^24.

Where do these numbers come from?

If there are 32-bit instructions, that means there are 2^32 total values these instructions could have. If addresses are 12 bits, each 2-address instruction has 2^24 values it could have. So subtract the amount of values it could have from the total number of available values and that's how much you have left over.

Thank you! That makes so much since to me now. So I take it that you do nothing with the 250?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.