4
$\begingroup$

While reading a chapter about FSM, I was stuck on the following slide:

enter image description here

In fact, I have been unable to determine what are "state registers" and "code registers", which were not explained in the course. Therefore, I have used to search for the definitions on the net, but I haven't yet found any result.

$\endgroup$
  • $\begingroup$ Where does your image come from? Referencing the source would probably, apart from respecting to the authors, make it easier for others to help you. $\endgroup$ – Discrete lizard Jan 23 '18 at 15:08
  • $\begingroup$ @Discretelizard I updated the question - just click on the hyperlink. $\endgroup$ – Kais Jan 23 '18 at 17:02
5
$\begingroup$

While I've not heard those exact terms, my guess would be that "code registers" are the registers that code you would write set. For example, on an Intel x86 platform, that would be the general purpose registers like the AX, BX, CX, etc. and EAX, EBX, ECX, etc. registers. These are registers that you can either use directly if you're writing assembly code, or that are used by the code generated by your compiler.

Meanwhile, the computer also has a set of registers for its own use. Things like the program counter (or instruction pointer) register which points to the next instruction to execute in memory. They can also indicate statuses; things like carry registers that indicate whether there was a carry out of an addition between 2 other registers. (For example if you add 1 to MAX_INT, you'll generate a 1-bit carry that the registers can't hold.)

Each processor is different. The 6502 had 2 registers (labeled X and Y) and an accumulator as general purpose (or code) registers. Then it has one status register that held 7 bits of status flags, a stack pointer, and a program counter, which would be "state registers".

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.