# Math Help - logic - register machines

1. ## logic - register machines

Hey just a quick question i need help with,

Find register machine programs that compute the unary(one-place) partial functions:

$f(x)=2x+2$

and

$f(x)= \left\{
\begin{array}{c 1}
0 & \mbox{if x is odd;}\\
\perp & \mbox{otherwise}
\end{array}
\right.
$

cheers.

2. To answer your question, one has to know some context. A register machine is basically a programming language (syntax) with the description how it works (semantics). As you know, there are hundreds of programming languages, and programs that compute your functions and that are written in Java and Pascal are different. Even though register machines have very simple languages, they still differ between courses and textbooks. One has to know how numbers are represented, what the primitive operations are, etc.

It may be easier if you wrote draft programs. Also, indicate what your difficulty with this problem is.