![]() Alternative instruction-sets are discussed in the supplement Register-machine models. The atomization of instructions or the inclusion of convenience instructions causes no change in conceptual power, as any program in one variant can be straightforwardly translated to the other. set 1: Some models have either further atomized some of the above into no-parameter instructions, or combined them into a single instruction such as "Decrement" preceded by conditional jump-if-zero "JZ ( r, z )".Using the instructions mentioned above, various authors have discussed certain counter machines: In addition, a machine usually has a HALT instruction, which stops the machine (normally after the result has been computed). JE (r j, r k, z): IF the contents of register r j Equals the contents of register r k THEN Jump to instruction z ELSE continue in sequence.JZ (r, z): IF register r contains Zero THEN Jump to instruction z ELSE continue in sequence.CPY (r j, r k): CoPY the contents of register r j to register r k leaving the contents of r j intact.DEC (r): DECrement the contents of register r.INC (r): INCrement the contents of register r.Three base models, each using three instructions, are drawn from the following collection. Most models contain a few arithmetic operations and at least one conditional operation (if condition is true, then jump). 8 A practical example of calculation by countingįor a given counter machine model the instruction set is tiny-from just one to six or seven instructions.7.4 The caveat: *If* its counters are initialised to N and 0, then a 2CM cannot calculate 2 N.7.3 Step 3: Four counters can be simulated by two counters.7.2 Step 2: A stack can be simulated by two counters.7.1 Step 1: A Turing machine can be simulated by two stacks.7 Two-counter machines are Turing equivalent (with a caveat).6 Problems with the counter machine model.5 The partial recursive functions: building "convenience instructions" using recursion.4 Example: COPY the count from register #2 to #3.2 Alternative names, alternative models.By modeling computations in relation to the memory accesses for each respective computational step, parallel algorithms may be designed in such a matter to avoid interlocking, the simultaneous writing operation by two (or more) threads to the same memory address. When used in this manner, the counter machine is used to model the discrete time-steps of a computational system in relation to memory accesses. The counter machine is typically used in the process of designing parallel algorithms in relation to the mutual exclusion principle. A counter machine comprises a set of one or more unbounded registers, each of which can hold a single non-negative integer, and a list of (usually sequential) arithmetic and control instructions for the machine to follow. It is the most primitive of the four types of register machines. Abstract machine used in a formal logic and theoretical computer scienceĪ counter machine is an abstract machine used in a formal logic and theoretical computer science to model computation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |