大作业1-终期提交:各指令的微程序设计(方框图、微程序清单)。(50%)
时间: 2024-02-09 11:13:39 浏览: 233
以下是常见指令的微程序设计方框图和微程序清单:
1. MOV指令微程序设计
微程序设计方框图:
```
+---------+---------+-------------+
| Fetch | Decode | Execute |
+---------+---------+---------+-------------+
| T0 | MAR<-PC | IR<-M(MAR) | |
| T1 | | OP<-IR[5:3] | |
| T2 | | D<-IR[2:0] | |
| T3 | | | MAR<-D |
| T4 | | | M(MAR)<-M(IR)|
+---------+---------+---------+-------------+
```
微程序清单:
```
T0: MAR <- PC
IR <- M(MAR)
T1: OP <- IR[5:3]
D <- IR[2:0]
T2:
T3: MAR <- D
T4: M(MAR) <- M(IR)
```
2. ADD指令微程序设计
微程序设计方框图:
```
+---------+---------+-------------+
| Fetch | Decode | Execute |
+---------+---------+---------+-------------+
| T0 | MAR<-PC | IR<-M(MAR) | |
| T1 | | OP<-IR[5:3] | |
| T2 | | D<-IR[2:0] | |
| T3 | | | MAR<-D |
| T4 | | | R<-M(MAR) |
| T5 | | | MAR<-MAR+1 |
| T6 | | | S<-M(MAR) |
| T7 | | | R<-R+S |
| T8 | | | M(MAR)<-R |
+---------+---------+---------+-------------+
```
微程序清单:
```
T0: MAR <- PC
IR <- M(MAR)
T1: OP <- IR[5:3]
D <- IR[2:0]
T2:
T3: MAR <- D
T4: R <- M(MAR)
MAR <- MAR + 1
T5: S <- M(MAR)
T6: R <- R + S
T7: M(MAR) <- R
T8:
```
3. SUB指令微程序设计
微程序设计方框图:
```
+---------+---------+-------------+
| Fetch | Decode | Execute |
+---------+---------+---------+-------------+
| T0 | MAR<-PC | IR<-M(MAR) | |
| T1 | | OP<-IR[5:3] | |
| T2 | | D<-IR[2:0] | |
| T3 | | | MAR<-D |
| T4 | | | R<-M(MAR) |
| T5 | | | MAR<-MAR+1 |
| T6 | | | S<-M(MAR) |
| T7 | | | R<-R-S |
| T8 | | | M(MAR)<-R |
+---------+---------+---------+-------------+
```
微程序清单:
```
T0: MAR <- PC
IR <- M(MAR)
T1: OP <- IR[5:3]
D <- IR[2:0]
T2:
T3: MAR <- D
T4: R <- M(MAR)
MAR <- MAR + 1
T5: S <- M(MAR)
T6: R <- R - S
T7: M(MAR) <- R
T8:
```
4. PUSH指令微程序设计
微程序设计方框图:
```
+---------+---------+-------------+
| Fetch | Decode | Execute |
+---------+---------+---------+-------------+
| T0 | MAR<-PC | IR<-M(MAR) | |
| T1 | | OP<-IR[5:3] | |
| T2 | | D<-IR[2:0] | |
| T3 | | | MAR<-SP |
| T4 | | | M(MAR)<-D |
| T5 | | | SP<-SP-1 |
+---------+---------+---------+-------------+
```
微程序清单:
```
T0: MAR <- PC
IR <- M(MAR)
T1: OP <- IR[5:3]
D <- IR[2:0]
T2:
T3: MAR <- SP
T4: M(MAR) <- D
T5: SP <- SP - 1
```
5. POP指令微程序设计
微程序设计方框图:
```
+---------+---------+-------------+
| Fetch | Decode | Execute |
+---------+---------+---------+-------------+
| T0 | MAR<-PC | IR<-M(MAR) | |
| T1 | | OP<-IR[5:3] | |
| T2 | | D<-IR[2:0] | |
| T3 | | | SP<-SP+1 |
| T4 | | | MAR<-SP |
| T5 | | | D<-M(MAR) |
| T6 | | | MAR<-D |
+---------+---------+---------+-------------+
```
微程序清单:
```
T0: MAR <- PC
IR <- M(MAR)
T1: OP <- IR[5:3]
D <- IR[2:0]
T2:
T3: SP <- SP + 1
T4: MAR <- SP
T5: D <- M(MAR)
MAR <- D
T6:
```
6. JMP指令微程序设计
微程序设计方框图:
```
+---------+---------+-------------+
| Fetch | Decode | Execute |
+---------+---------+---------+-------------+
| T0 | MAR<-PC | IR<-M(MAR) | |
| T1 | | OP<-IR[5:3] | |
| T2 | | D<-IR[2:0] | |
| T3 | | | PC<-D |
+---------+---------+---------+-------------+
```
微程序清单:
```
T0: MAR <- PC
IR <- M(MAR)
T1: OP <- IR[5:3]
D <- IR[2:0]
T2:
T3: PC <- D
```
以上是常见指令的微程序设计方框图和微程序清单,它们对应各自的功能、寻址方式、汇编指令和机器指令。在实际应用中,需要根据具体的情况选择合适的微程序设计,以实现所需的功能。
阅读全文