|
|
|
|
|
by SilasX
3252 days ago
|
|
Correct me if I'm horribly misunderstanding [1], but isn't there a more general point here? A CPU is, at root, a massive Boolean circuit wrapped in a flip-flop and some persisted state. The binary [sequence corresponding to an] opcode is just an input that determines which inputs go where. Thus, for an n-bit opcode width, there are 2^n valid opcodes. Only m of them will correspond to intelligible, "I might want to use that some day" instructions. (Others, as you note, will be functionally equivalent versions of the m and ignorable as well.) And so you will have 2^n - m "undocumented opcodes". [1] based on reading NAND to Tetris |
|
Not quite, there will be 2^n - m possible opcodes, but not all of them will have functionality attached. Many may end up being illegal.
So you could have a processor with m=400 and n=16, but no valid opcodes besides the 400. All 2^16 - 400, could throw an Illegal instruction exception.