Formal Definition
The Counter machine reference model consists of a finite set of registers r1 ... rn, each of which can hold a non-negative integer, r0 (always zero), and a finite list of instructions I1 ... Im. Each of the instructions in this list is one of the following:
INC(j)— increment the value of register rj by 1; go to the successor instruction (e.g. instruction that is numerically next-in-sequence).DEC(j)— If the contents of r is not 0 (not empty) then decrement the value of register rj by 1, else the contents of r=0; go to the successor instruction.JZ (j, z)— If the contents of register rj equals Zero then Jump to instruction Iz else go to the successor instruction.HALT— halts the computation.
Formal Semantic:
| Instruction | Effect on register | Effect on Instruction Counter (IC) |
|---|---|---|
| INC ( j ) | + 1 → j | + 1 → IC |
| DEC ( j ) | IF > 0 THEN - 1 → j ELSE 0 → j | + 1 → IC |
| JZ ( j, z ) | IF =0 THEN Iz → IC ELSE + 1 ) → IC |
Read more about this topic: Counter Machine Reference Model
Famous quotes containing the words formal and/or definition:
“That anger can be expressed through words and non-destructive activities; that promises are intended to be kept; that cleanliness and good eating habits are aspects of self-esteem; that compassion is an attribute to be prizedall these lessons are ones children can learn far more readily through the living example of their parents than they ever can through formal instruction.”
—Fred Rogers (20th century)
“... if, as women, we accept a philosophy of history that asserts that women are by definition assimilated into the male universal, that we can understand our past through a male lensif we are unaware that women even have a historywe live our lives similarly unanchored, drifting in response to a veering wind of myth and bias.”
—Adrienne Rich (b. 1929)