retagged by
5,503 views
3 votes
3 votes
Consider a hypothetical processor which support both 1 address and zero address instruction. It contain 6 bit instruction and four bit address if there exists 2 one address instruction than how many zero address instruction can be formulated?
retagged by

2 Answers

Best answer
9 votes
9 votes
6 bit instruction, so totally we can have $2^6 = 64$ possible encodings.

There are 2 one address instructions, which would take $2 \times 2^4 = 32$ encodings as an address is of 4 bits. The remaining 32 encodings can be used for zero address ones and since they don't need any address part, each of them can be a separate instruction. So, answer should be 32.
selected by
1 votes
1 votes
The address size is 4 bit.

For one address instruction, we can use 2 bit for opcode. So 4 one address instructions are possible. As per the problem, there are only 2 one address instructions. Rest 2 opcode can be used as zero address instruction. As there is no address field in zero address instruction, so 4 bit can be used as opcode.

Total number of zero address instruction is 2*16 = 32

Related questions

1 votes
1 votes
0 answers
4
prashastinama asked Oct 3, 2021
330 views
Where are 4 Address Instructions are used and how?