5.5: Implementing the CU
- Page ID
- 27270
It is now possible to specify how to set the control wires from the CU. First the ALU opt is the value of bits 8-11 of the ALU, so these are split off and sent to control the ALU.
The top 4 bits, bits 12-15, are used to set the other control wires, and from the previous discussion can be set according to the following table2.
Operation |
Code |
WriteAc |
ALUSrc |
ClrAc |
MemWr |
Beqz |
Immediate Operation3 |
0x1 |
1 |
1 |
0 |
0 |
0 |
Memory Operation4 |
0x2 |
1 |
0 |
0 |
0 | 0 |
clac |
0x3 |
1 |
x |
1 |
0 | 0 |
stor |
0x4 |
0 |
x |
x |
1 |
0 |
beqz |
0x5 |
0 |
x |
x |
0 |
1 |
To implement this table, a decoder is implemented to split out the individual operations. These operations are then combined to produce the correct output behavior. The CU is shown in the figure below.
2 An “x” in the table means a don’t care condition, e.g. the value can be either 0 or 1 as it does not affect the working of the CPU. As a convention, all x values should be coded as 0.
3 addi, subi, etc.
4 add, sub, etc.