Register Machine

The Computability Concept

Herbert B. Enderton , in Computability Theory, 2011

1.two.four Register Machines

Here is another programming language. On the 1 hand, it is extremely simple – even simpler than the linguistic communication for loop-while programs. On the other hand, the linguistic communication is "unstructured"; information technology incorporates (in effect) go-to commands. This formalization was presented by Shepherdson and Sturgis in a 1963 article.

A register automobile is to exist thought of as a computing device with a finite number of "registers," numbered 0,1,2,…,M. Each register is capable of storing a natural number of any magnitude – there is no limit to the size of this number. The operation of the machine is determined past a program. A program is a finite sequence of instructions, drawn from the following list:

"Increment r," I r (where 0 ≤ rK): The issue of this teaching is to increase the contents of register r by one. The machine and then proceeds to the next instruction in the program (if whatever).

"Decrement r," D r (where 0 ≤ rThou): The result of this instruction depends on the contents of annals r. If that number is nonzero, it is decreased past one, and the machine proceeds not to the next instruction, but to the following one. But if the number in annals r is zero, the automobile simply proceeds to the next instruction. In summary, the machine tries to decrement register r, and if it is successful, and then it skips 1 educational activity.

"Jump q," J q (where q is an integer – positive, negative, or zero): All registers are left unchanged. The machine takes every bit its side by side didactics the qthursday instruction following this ane in the programme (if q ≥ 0), or the |q|th instruction preceding this ane (if q < 0). The machine halts if there is no such instruction in the program. An instruction of J 0 results in a loop, with the car executing this ane education over and over again.

And that is all. The language has only these three types of instructions. (Strictly speaking, in these instructions, r and q are numerals, not numbers. That is, an instruction should be a sequence of symbols. If we use base-10 numerals, and then the alphabet is {I, D, J, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, −}. An instruction is a correctly formed give-and-take over this alphabet.)

Examples

ane.

Clear 7: a programme to clear register seven.

D   7   Endeavor to decrement 7.

J   2   Go back and echo.

J   −2   Halt.

2.

Motion from r to s: a program to move a number from register r to register due south (where rdue south).

CLEAR s.   Utilize the program of the first example.

  D r  Take i from r.

  J   3   Halt when zero.

  I s  Add together 1 to s.

  J   −3   Repeat.

This program has seven instructions birthday. Information technology leaves a zero in annals r.

3.

Add one to 2 and three: a plan to add register 1 to registers 2 and iii.

This plan leaves a null in annals 1. It is articulate how to adapt the program to add register i to more than (or fewer) than two registers.

4.

Re-create from r to s (using t): a program to re-create a number from annals r to annals south (leaving register r unchanged). We combine the previous examples.

CLEAR southward.   Use the showtime example.

MOVE from r to t.   Utilize the 2d example.

Add together t to r and s.   Use the third case.

This program has xv instructions. Information technology uses a third register, register t. At the end, the contents for register r are restored. But during execution, annals r must be cleared; this is the just manner of determining its contents. (It is assumed here that r, s, and t are distinct.)

five.

(Improver) Say that ten and y are in registers one and ii. We want x + y in register 0, and we want to get out x and y still in registers 1 and 2 at the finish.

Annals contents

CLEAR 0.   0   x   y

Motion from 1 to 3.   0   0   y   x

Add 3 to 1 and 0.   ten   x   y   0

MOVE from 2 to 3.   x   ten   0   y

Add 3 to 2 and 0.   x + y   ten   y   0

This program has 27 instructions as it is written, just 3 of them are unnecessary. (In the fourth line, we brainstorm past clearing register 3, which is already clear.)

Now suppose f is an n-place fractional function on ℕ. Perhaps, there will be a plan P such that if nosotros kickoff a register automobile (having all the registers to which P refers) with x 1, …, xn in registers one, …, n and 0 in the other registers, and we apply program P , then the following conditions hold:

If f(10 1, …, xn ) is divers, so the computation eventually terminates with f(x i, …, xn ) in register 0. Furthermore, the ciphering terminates by seeking a (p + 1)st teaching, where p is the length of P .

If f(x one, …, xdue north ) is undefined, so the computation never terminates.

If there is such a program P , nosotros say that P computes f.

Which functions are computable by register-car programs? The language is so unproblematic – it appears to exist a toy linguistic communication – that 1's kickoff impression might be that only very unproblematic functions are computable. This impression is misleading.

Theorem

Let f exist a partial function. Then, in that location is a register-machine program that computes f if and only if f is a general recursive partial function.

Thus past using register machines, nosotros arrive at exactly the class of general recursive partial functions, a form we originally divers in terms of primitive recursion and search.

Read total chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9780123849588000016

Embedded Software

Colin Walls , in Embedded Software (Second Edition), 2012

EABI and Annals Usage

EABI dictates the way the auto registers are applied by a compiler. Three categories of register are defined:

Dedicated registers are used for i specific purpose at all times; for example, gpr1 is the stack pointer.

Volatile registers may be corrupted through a office telephone call; the calling function must preserve them if their values are required later.

Nonvolatile registers are preserved through a function call; the called function must preserve them if their use is required.

The following table illustrates the resource allotment of registers and condition register (CR) fields:

Register Type Application
grp0 Volatile Language-specific use
grp1 Defended Stack pointer
grp2 Defended Read-only data area ballast
grp31/Ngrp4 Volatile Parameter passing/return values
grp51/Ngrp10 Volatile Parameter passing
grp111/Ngrp12 Volatile
grp13 Dedicated Modest data surface area anchor
grp141/Ngrp31 Nonvolatile
fpr0 Volatile Language-specific use
fpr1 Volatile Parameter passing/return values
fpr21/Nfpr8 Volatile Parameter passing
fpr91/Nfpr13 Volatile
fpr141/Nfpr31 Nonvolatile
Fields CR21/NCR4 Nonvolatile
Other CR fields Volatile

Read total affiliate

URL:

https://www.sciencedirect.com/science/article/pii/B9780124158221000015

Embedded Platform Boot Sequence

Peter Barry , Patrick Crowley , in Mod Embedded Computing, 2012

CPU Initialization

This consists of unproblematic configuration of processor and machine registers. There is no DRAM bachelor, so the lawmaking may accept to operate in a stackless environs. On nigh modernistic processors there is an internal cache that can exist configured as RAM (cache as RAM or CAR) to provide a software stack. Developers must write extremely tight lawmaking when using Car, as an eviction would be paradoxical to the system at this point in the kicking sequence; in that location is no retention to maintain coherency with at this time. There is a special mode for processors operate in cache as RAM chosen "no evict mode" (NEM), where a cache line miss in the processor will not crusade an eviction. The motivation for having a stack frame is to exist able to run C code, hence all the code that runs without stack would use register-based calling conventions. Developing code with an available software stack is much easier, and initialization code ofttimes performs the minimal setup to utilise a stack even prior to DRAM initialization.

Read full chapter

URL:

https://www.sciencedirect.com/scientific discipline/article/pii/B9780123914903000060

MCSA/MCSE 70-291: NetBIOS Proper noun Resolution and WINS

Deborah Littlejohn Shinder , ... Laura Hunter , in MCSA/MCSE (Exam 70-291) Report Guide, 2003

Searching for WINS Records

WINS is a database, and like all databases must be maintained to meet the functioning requirements of hundreds to thousands of communicative NetBIOS clients on your network. Every WINS client on your network must register its NetBIOS name and IP accost with your WINS server. Along with their name, NetBIOS clients annals whatever bachelor NetBIOS service they have running on their car. Some of these services and applications require special NetBIOS identifiers in society for other NetBIOS clients to locate them. They register themselves as hexadecimal address numbers in the WINS server database as shown under the Type field in Figure 4.30.

Figure 4.30. Registration of NetBIOS Services Prove Up every bit Hex Numbers in WINS

These are the same hexadecimal service locator record identifiers that nosotros discussed earlier for employ in your LMHOSTS file. These hex numbers are actually appended every bit the sixteenth byte in the NetBIOS fifteen byte proper name.

Based on these facts, you may discover that some machines register iii, four, maybe 5 times with the same WINS server. This can pb to rather big and complex databases. For this reason, the WINS MMC console allows for you lot to search for records and filter them past name or IP address. The searchable feature in WINS leads to easier troubleshooting when you lot are trying to track down a NetBIOS naming disharmonize or resolution trouble. To search the WINS database, follow these two steps:

i.

Click Start | Administrative Tools | WINS to open your WINS MMC snap-in console.

2.

Correct-click your WINS server proper name and select Display Records.

New & Noteworthy…

New Ways to Search the WINS Database

Windows Server 2003 has introduced a new style to search for WINS records within the WINS MMC snap-in console interface. Though the WINS database has not been significantly changed, the way you can search for records within the database has a new look and feel every bit well as some new functionality. The ability to cache searched records is at present bachelor, enabling administrators to speed upwardly futurity searches on similar records. Earlier the Windows Server 2003 and Windows XP Administrative Tools MMC snap-ins, WINS records had to exist searched on by record name (Detect by Name) or tape owner (Find by Owner) exclusively. This was apparent in the inter-face and limited the ability to group these two together for a more detailed centric search. In Windows 2000, y'all could search for WINS records only past one of ii methods:

By Record Proper name exclusively

By Record Owner and record type exclusively

In Windows Server 2003 you lot tin search for WINS records in any of the following combinations:

By Record Proper name

By Owner

By Blazon

Any combination of the three

Post-obit these numbered steps will teach you how to pinpoint specific records in your WINS database:

one.

You lot can search your WINS database using the preceding combinations by right-clicking Active Registrations in your WINS MMC console and selecting Brandish Records every bit shown in Effigy 4.31.

Effigy 4.31. Displaying Records in Your WINS Database

2.

Yous volition exist presented with a Display Records dialogue window and three configurable tabs (shown in Figure iv.32):

Record Mapping

Record Owners

Record Types

Figure four.32. Choosing How Records Are to Be Displayed in WINS

iii.

Each one of the tabs tin can incorporate its own information, and the search will be issued as a combination of all of them. The new searching panel has two other nice features, shown in Effigy 4.32:

The ability to filter your record search by a specific IP accost or IP subnet

The power to cache your results

The filter selection just gives you one more way to zero in and fine melody your records search. The caching option, on the other hand, helps when you have a very large database and are doing many searches against the same data sorts. Past checking the Enable result caching option checkbox, all searches that are run confronting that WINS database, regardless of query type, are cached locally. Thus, if you lot were going to be running the same query five times in one day, the last four times would be significantly faster every bit they would exist read from enshroud. These results are cached locally on the automobile running the query, not the WINS server itself. If ane query is buried locally, and a different query is run that may incorporate a subset of the previous query, information in that subset is obtained locally, whereas the newer data must be obtained from the alive WINS server database.

Examination Warning

Exist careful when using Enable result caching option as there are two potential caveats:

one.

Buried queries are stored in local memory and depending on the query size can degrade local arrangement performance.

two.

Cached queries are static and thus do non modify with the dynamic changes of your WINS database. Don't rely on cached queries over a period of time every bit by pattern, WINS records change frequently.

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B978193183692050010X

Programs and Machines

Herbert B. Enderton , in Computability Theory, 2011

Publisher Summary

This chapter discusses another way of formalizing the concept of effective calculability, namely register-automobile programs. The main aim is to show that all general recursive partial functions are too computable by register machines. Information technology provides half of a significant fact that formalizing the effective calculability concept past means of general recursiveness and formalizing the effective calculability concept by means of register machines lead to exactly the aforementioned class of partial functions. The register machines are capable of doing much more than might accept been apparent initially from their very simple definition. The methods used here to obtain the equivalence of general recursiveness to register-automobile computability are adaptable to obtaining equivalence betwixt other formalizations of effective calculability.

Read full chapter

URL:

https://www.sciencedirect.com/science/article/pii/B978012384958800003X

Handbook of Computability Theory

Robert I. Soare , in Studies in Logic and the Foundations of Mathematics, 1999

3.5 Annals Machines

Closely related to Turing machines is the formalism proposed much later of register machines by Shepherdson and Sturgis [1963]. (See also Cutland [1980], or Shoenfield [1991].) These have the advantage of more closely resembling mod digital computers which manipulate data and instructions stored in various "registers" rather than having to go back and forth through the data on a unmarried tape. In the version of Cutland [1980, p. 9] the register automobile contains an infinite number of registers {Rn } n∈ω each of which contains an integer, r n . The program P is a finite set of instructions built up from the four basic instructions: zero Z(northward) (supersede rnorth by 0), successor South(n) (replace rnorthward by rnorth + 1), transfer T(m, n) (replace rn by rm ), and jump instructions J(grand, n, q) (if rm = rdue north go to the qth pedagogy of P, and otherwise go to the next instruction of P). It is easily shown that Turing machines can compute the same class of functions as annals machines.

Read full affiliate

URL:

https://www.sciencedirect.com/scientific discipline/article/pii/S0049237X99800172

Programs

Marilyn Wolf , in Loftier-Performance Embedded Computing (Second Edition), 2014

L3-1

Compare the compiled code for a DSP and a general-register machine. Compare how they apply registers and instructions.

L3-two

Analyze the enshroud behavior of a simple plan such as a motion estimation algorithm.

L3-three

Analyze the worst-case execution time for a radix-16 fast Fourier transform (FFT).

L3-iv

Clarify the worst-case execution time for a block move estimation algorithm, such equally a iii-step search.

L3-five

Pick a sample program and endeavour to determine past inspection the worst-case execution path through the program. Compare your result with that of a WCET assay tool.

L3-6

Write an Esterel program for an antilock braking organization. The antilock brake controller pulses the brakes during a skid.

Read full chapter

URL:

https://world wide web.sciencedirect.com/science/commodity/pii/B9780124105119000034

Recursive Enumerability

Herbert B. Enderton , in Computability Theory, 2011

Publisher Summary

The form of general recursive partial functions is exactly the aforementioned as the form of register-machine computable partial functions. The fact that two different approaches yield the same class of functions is bear witness that one has here a "natural" course. The members of this form are chosen computable partial functions. Information technology covers both the total and nontotal functions; information technology tin be omitted in cases where ane knows that the role is total. Church'south thesis is the assertion that the concept of beingness a computable partial function is the correct formalization of the informal thought of existence an effectively calculable fractional part. The grade of computable partial functions includes all of the primitive recursive functions. A fractional role is a computable partial part if and only if its graph is a recursively enumerable relation.

Read full chapter

URL:

https://www.sciencedirect.com/scientific discipline/article/pii/B9780123849588000041

Handbook of Computability Theory

Helmut Schwichtenberg , in Studies in Logic and the Foundations of Mathematics, 1999

ii Collapsing Results

To set the stage, we testify the failure of some natural attempts to classify the recursive functions. Here we assume knowledge of certain introductory cloth from recursion theory, eastward.thou., the Csillag–Kalmár definition of the elementary functions, Minsky'south register machines and also Kleene's arrangement O of ordinal notations, Π ane ane sets and paths through O.

2.i Annals Machines

Minsky [1961] has introduced (meet also Shepherdson and Sturgis [1963] ) a type of idealized calculating machines now called register machines. These machines allow a rather direct and perspicuous proof that all recursive functions are computable. In particular one can show in the well-known fashion the following theorem.

Theorem (Normal form theorem)

Let f be a unary recursive function, p exist the Gödel number of a register machine computing f and sf (x) the number of steps performed by this car when computing f(x). And then f tin be written in the form

f ( ten ) = D ( C ( p , ten , due south f ( ten ) ) )

with unproblematic functions D ("decoding role") and C ("configuration role").

2.two

Now we can evidence our get-go collapse result, due to Myhill [1953] and Routledge [1953].

Theorem

For whatever recursive function f nosotros can find an unproblematic well-ordering y of the natural numbers with order type ω and a recursive function h such that f is elementary in h, and h can be divers in the course

h ( 0 ) = 0 , h ( u ) = 1 + h ( g ( u ) ) f o r u 0 ,

with grand an simple function such that g(u) ≺ u for u ≠ 0.

Proof

It clearly suffices to prove the theorem for unary functions f. Let p exist the Gödel number of a register machine calculating f and let southwardf (x) be the number of steps performed by this machine when calculating f(x); nosotros may assume Southf (x) ≥ ane for all x. Note first that the relation t < southf (ten) is uncomplicated, since

t < s f ( x ) C ( p , 10 , t ) C ( p , ten , t + 1 )

with C the configuration function from 2.1. The pairs (t, 10) with t < sf (ten) tin be well-ordered by

( t one , 10 1 ) ( t 2 , x ii ) x ane < x 2 ( x ane = x ii t 1 > t two ) .

Permit B be the image of all these pairs under the mapping λtλx(π(t, 10) + one), i.due east.

B ( u ) : t 10 u ( t < s f ( x ) π ( t , x ) + 1 = u ) .

Here π is an elementary pairing function with unproblematic inverses πone, πtwo. Conspicuously B is elementary. The "induced" well-ordering on B tin can be extended easily to an elementary well-ordering ≺ on all natural numbers with to the lowest degree element 0 (notation that ¬B(0), B(i)). Let

b ( u ) : = μ v u [ B ( v ) ω u ( B ( ω ) ω v ) ] , t ( u ) : = π 1 ( b ( u ) . i ) , x ( u ) : = π 2 ( b ( u ) . ) .

Then nosotros define ≺ past

u five [ u = 0 5 0 ] [ u 0 ( x ( u ) < 10 ( five ) ( x ( u ) = ten ( v ) t ( u ) > t ( u ) ) ( ten ( u ) = 10 ( v ) t ( u ) = t ( five ) u < v ) ) ] .

Now consider the office

g ( u ) : = { π ( t ( u ) + 1 , 10 ( u ) ) + 1 if B ( u ) and t ( u ) + 1 < due south f ( x ( u ) ) , 0 otherwise

And then clearly we accept yard(u) < u for all u ≠ 0, and from π(0, ten) + 1 we come up to 0 by exactly sf (x) applications of g. Moreover, g is unproblematic. So if we define h past

h ( 0 ) = 0 , h ( u ) = 1 + h ( g ( u ) ) for u 0 ,

then we have

due south f ( x ) = h ( π ( 0 , x ) + one ) .

Now the merits follows, since past the normal grade 2.1 we have

f ( 10 ) = D ( C ( P , x , s f ( ten ) ) ) .

2.3

It is tempting to attempt to avoid this "collapse" by allowing bounded recursion only. This may seem specially promising, since Rósza Péter has proved that bounded multiple recursion does not lead out of the primitive recursive functions (Péter [1957, p. 94]). All the same, the collapse cannot exist avoided in this simple way.

Theorem

For any recursive 0–ane-valued function f we tin can find an uncomplicated well-ordering ≺ of the natural numbers with order type ω and a recursive 0–1-part h such that f is simple in h, and h can be defined in the form

h ( 0 ) = 0 , h ( u ) = g 0 ( u , h ( g ( u ) ) ) f o r u 0 , h ( u ) 1 ,

with g, g 0 elementary functions such that g(u) < u for u ≠ 0.

Proof

We proceed every bit in the previous proof, upward to and including the definition of g. Then allow

h ( 0 ) : = 0 , h ( u ) : = { h ( yard ( u ) ) if g ( u ) 0 , s g ( D ( C ( P , x ( u ) , t ( u ) + 1 ) ) ) otherwise .

So h(u) ⩽ i and we accept f(x) = h(π(0, x) + 1) and hence the claim.

two.iv A General Plummet Result

We at present testify a rather full general result, which says that it is impossible to alphabetize the recursive functions in any "reasonable" way by ways of a Πone 1-path through Kleene's system O of notations for constructive ordinals. I take learned this result from Stan Wainer, who in turn attributed it to some unpublished work of Yiannis Moschovakis.

We will need in this section some cognition of Kleene'due south system O, Π 1 1 -sets and the like (cf. Shoenfield [1967], Rogers [1967], Sacks [1990], Hinman [1978] or other papers in the present Handbook). For definiteness, here is a list of what we demand. A subset P of O is called a path through O if

(P1) P is linearly ordered by < O ,

(P2) b ∈ P and a < O b implies a ∈ P, and

(P3) any constructive ordinal is denoted past a bP.

We will make employ of the following facts.

(F1) In that location is a recursively enumerable relation < O extending < O, such that for any bO we have

(F2) (Feferman, Spector). In that location is a Π ane 1 path through O.

(F3) There is no ane one -path through O.

Let us at present codify what we mean by a "reasonable" hierarchy. Offset, it should exist indexed by a path P through O, i.e. be of the form (fa ) a ∈ P . Moreover, the property R(a, 10, y) that the a-thursday function fa at statement x has value y should not be too complex. By this we mean that at to the lowest degree it should be inductively definable from arithmetical (or even Π1 1-) relations, hence R itself should be a 1 1 realation . And so let united states of america assume that we take a one 1 realation R satisfying

and define fa (x) to exist the unique y such that R(a, x, y). We then require the following backdrop of our bureaucracy (fa ) a ∈ P.

(H1) a, bP(a ≠ b → fa b ).

(H2) a ∈ P(fa Rec).

(H3) fRec aP (f = fa ).

Here Rec denotes the set of all unary total recursive functions. Then (H1)–(H3) expresses that our causeless hierarchy (fa ) aP provides a unique indexing of all fRec by ways of the path P through O.

Nosotros now show that from all these assumptions we tin derive a i 1 definition of P, in the form

(*) a P { east } REC b P [ x R ( b , x , { e } ( x ) ) a < O b ] .

Clearly the right mitt side has Σ i i -grade, since {e} ∈ Rec is arithmetical, the one 1 -relation P and R appear every bit bounds and <′ O in the conclusion is recursively enumerable by (F1). Since past (F3) in that location is no ane 1 definition of P, we have the desired contradiction.

It remains to prove (*). (⇒). Let aP. Then past (P3) there is a bP such that a < O b, hence fb Rec by (H2). Selection due east such that fb = {e}. And then by (H1) b is uniquely determined by fb = {e}, i.e. by the i 1 -relation x R (b, 10, {e}(x)). Since bPO, we besides accept a <′ O b by (F1).

( ) . Let {e} ∈ Rec such that b P [ f p = { east } a < O b ] . By (H3) at that place is a bP such that fb = {e}, and once more by (H1) b is uniquely determined. Since b P O , from a < O b nosotros can conclude a <O b by (F1), and hence aP by (P2).

Read full chapter

URL:

https://www.sciencedirect.com/science/commodity/pii/S0049237X99800329

Instruction Option Using Binate Covering for Lawmaking Size Optimization

Stan Liao , ... Steve Tjiang , in Readings in Hardware/Software Co-Design, 2002

A Previous Work

In [2] Aho et al. presented optimal code generation algorithms (on DAGs) for ii different models of one-register machines:

Non-commutative machines, in which available operations are:

1.

aa op m

2.

am (load)

3.

1000a (shop)

where a denotes the accumulator and thou denotes memory.

Commutative machines, in which available operations are:

ane.

aa op yard

ii.

achiliad op a

3.

achiliad (load)

4.

ma (shop)

We find the models above inadequate for the following reasons. First, in our application the given DAG can have ternary or higherarity operators depending on the complex patterns chosen in the kickoff pace of binate covering. Second, the non-commutative model of [2] does not accept commutative operators into account. For example, in evaluating the expression (b + c), the value of b must exist first loaded to the accumulator and then added with c. However, if b and c are themselves expressions, the accumulator may already incorporate c immediately earlier the evaluation of (b + c). Since addition is commutative, adding the accumulator with b is perfectly adequate. The commutative model, on the other hand, assumes that the first operand of any operation can be in memory. In general, machines will have both commutative and non-commutative operators.

We believe the best way to handle commutativity is to treat each operation independently, using a carve up pattern for the commutative forms of the operations wherever necessary, rather than assuming commutativity in the machine model.

Nosotros present a compact binate-covering formulation for the optimal lawmaking generation for the non-commutative 1-register machine taking into business relationship the commutativity of individual operators in the following sections. The operators tin exist binary, ternary or higherarity operators. For ease of exposition we will concentrate on binary operators; however, the techniques generalize to higherarity operators.

Read total chapter

URL:

https://www.sciencedirect.com/science/article/pii/B9781558607026500442