Section 7.4
Register Transfer Language

When CSC-1 performs ADD 3570, the effect is to add the contents of the A register to the contents of the memory word addressed by 3570, and to store the sum back into the A register. We can write this more succinctly in the following language:

A <- A + m[3570]

This form of writing down the function of the ADD instruction is called RTL, or register transfer language, since it shows the transfers of data from one register to another.

The notation used for memory resembles arrays in a high level programming language like C. m[3570] means the memory word addressed by 3570. Addresses in the CSC-1 go from 0 up to 4095, since there are 12 bits in addresses. In the RTL statement above, the memory operation is read and the WR wire would be set to low since m[3570] appears on the right hand side of the assignment arrow.

Here is what the STD 2148 instruction would be encoded as:

m[2148] <- A

Since m[2148] is on the left side of the arrow, the memory operation is write and the WR wire would be 1, while MA is set to 1.

The expression m[2148] is deceptively simple. Though we seem to intuitively understand that it is reading from or writing to memory, what is really happening is that the address, 2148 in this case, is copied into the MAR, MA is set to 1, WR is set to 0 or 1 depending upon what we want done, wait for the memory to complete its task, and then get the value out of MBR. For a write, we first put a value into the MBR. However, the beauty of RTL is that these details are hidden and all timing considerations are waved away as if by magic.

RTL resembles an extremely simple version of a high level programming language, like C. Imagine there is a large one-dimensional integer array called m, and several integer variables called A, PC, etc. The left pointing arrow is just the assignment operator: = in C or := in Pascal and Modula-2 and Ada.

The only expressions that can appear on the left hand side of an RTL statement are those that are permitted by the hardware, namely the functions of the ALU and the shifter. For example, when the binary addition function is used, we will write:

A <- A + TMP

The shifter's direction will be designed by using the C language's operators: << for shift left 1 bit and >> for shift right 1 bit.

A <- A << 1

The ALU can also pass through A or TMP unchanged. We will write either A or TMP on the right hand side of <- to indicate this. For example, if we wanted to copy TMP's value into A, we could write:

A <- TMP

The following table presents the functions of the ALU using RTL:

F2 F1 F0     function of ALU        RTL
----------------------------------------
0  0  0      identity A             A
0  0  1      identity TMP           TMP
0  1  0      A and TMP              A & TMP
0  1  1      A or TMP               A | TMP
1  0  0      not A                  -A
1  0  1      A + TMP                A + TMP
1  1  0      A - TMP                A - TMP
1  1  1      unused

These RTL instructions are actually implemented by setting the control points and it is the job of the control unit to implement RTL this way. Each machine instruction of CSC-1 could be written using RTL.