Why did Noam and/or Shimon choose to communicate as a 4, 4-bit composition?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Why did Noam and/or Shimon choose to communicate as a 4, 4-bit composition?

ouverson
6.2 Hack Assembly-to-Binary Translation Specification > 6.2.2 Instructions:

The graphic shows the 16-bit A-instruction and C-instruction as a 4, 4-bit composition.

https://www.screencast.com/t/JDL0KpaCowF

It was the C-instruction that caught my eye, as the 16-bit C-instruction is also a composite of the following bits:

1 opcode
2 throw-away
7 comp
3 dest
3 jump

Why did Noam and/or Shimon choose to communicate as a 4, 4-bit composition in addition to the spec?

I can't see how this detail should influence the Assembler I'm writing?

Maybe it has to do with something further up the software stack?
Reply | Threaded
Open this post in threaded view
|

Re: Why did Noam and/or Shimon choose to communicate as a 4, 4-bit composition?

WBahn
Administrator
It is simply a very common convention to organize bit sequences in groupings of four to make them more readable for humans. It's directly analogous to the difference between writing

12345678 vs 12,345,678

The leading bit is not the opcode -- it is merely a flag that indicates which type of instruction it is.

For A-type instructions there is no opcode (or you could consider the flag to be the entire opcode)

For C-type instructions, the 7-bit combination of the a-bit and comp bits are essentially the opcode, though you could include the jump bits and/or the leading 1 bit with some justification. Traditionally the opcode excludes immediate values or bits that indicate source and destination locations.
Reply | Threaded
Open this post in threaded view
|

Re: Why did Noam and/or Shimon choose to communicate as a 4, 4-bit composition?

ouverson
Thank you for the explanation of "grouping of four" convention.

And thank you for clarifying the definition of opcode.

Although I meant to write "instruction code" I think there was still some fuzziness - hence my slip.