12 votes 12 votes A computer uses expanding opcode. It has 16 bit instructions 6 bit addresses, it supports one address, two address instructions only. If there are n two address instructions, the maximum number of one address instructions are? CO and Architecture co-and-architecture addressing-modes machine-instruction instruction-format + – Tehreem asked Sep 9, 2015 retagged Nov 13, 2017 by Arjun Tehreem 11.7k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 24 votes 24 votes We have 16 bits for instructions- no. of encoding = $2^{16}$ Since, 6 bit addresses are used, and we have $n$ two address instructions it would take $2^6 \times 2^6 \times n$ encoding. Given, only one address and two address instructions are present. So, all remaining encoding can be used for one address instructions which will be $2^{16} - 2^{12} \times n$ which will correspond to $\left(2^{16} - 2^{12} \times n \right) /2^6 = 2^{10} - n \times 2^6 $ one address instructions as address field needs $2^6$ bits. http://www.personal.kent.edu/~aguercio/CS35101Slides/Tanenbaum/CA_Ch05_PartII.pdf Arjun answered Sep 9, 2015 selected Nov 24, 2016 by srestha Arjun comment Share Follow See all 11 Comments See all 11 11 Comments reply Show 8 previous comments Arjun commented Nov 24, 2016 reply Follow Share ^Yes, Here opcode length is not fixed. That is why it is called "expanding opcode". 1 votes 1 votes David commented Dec 1, 2016 reply Follow Share unable to understand through the shared link as well :( 0 votes 0 votes ankitgupta.1729 commented Jul 23, 2017 reply Follow Share nice explanation sir.. Thank you :) 1 votes 1 votes Please log in or register to add a comment.
14 votes 14 votes 16 bit instruction 6 bit address so no of bits for opcode =4 so 16 instructions are possible out of them n are two address so no of one address instruction possible=(16-n)*2^6=(16-n)* 64 Pooja Palod answered Sep 9, 2015 Pooja Palod comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments Tehreem commented Sep 9, 2015 reply Follow Share Thanks 0 votes 0 votes Arjun commented Sep 9, 2015 reply Follow Share @Pooja Method is not fully correct. 1 votes 1 votes vineet tiwari commented Dec 5, 2016 reply Follow Share for one address instruction we can not use 10 bit becoz there are (16-n) 4 bit and all pairs of 6bit therefore maximum(16 - n) 2^6 instructions 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes This is the ans Tendua answered Sep 9, 2015 Tendua comment Share Follow See all 2 Comments See all 2 2 Comments reply Tehreem commented Sep 9, 2015 reply Follow Share Your answer is right, but my confusion is: The number of opcodes for one address will be 10 right, since the computer uses expanding opcode?? So wont we get 2^10 instructions for opcode for one address? 1 votes 1 votes Tendua commented Sep 9, 2015 reply Follow Share i think pooja just resolved your query . 0 votes 0 votes Please log in or register to add a comment.