Datapaths Flashcards
RTN(s) for the TRAP instruction
R7 ⇐ PC; PC ⇐ Mem[ ZEXT(IR[7:0]) ]
RTN(s) for the JMP instruction
PC ⇐ BaseR
RTN(s) for the ADD instruction - register mode -
DR ⇐ SR1 + SR2
RTN(s) for the ADD instruction - immediate mode -
DR ⇐ SR1 + SEXT(IR[4:0])
RTN(s) for the AND instruction - register mode -
DR ⇐ SR1 . SR2
RTN(s) for the AND instruction - immediate mode -
DR ⇐ SR1 . SEXT(IR[4:0])
RTN(s) for the JSR instruction
R7⇐PC; PC ⇐ PC + SEXT(IR[10:0])
RTN(s) for the NOT instruction
DR ⇐ (SR1’)
RTN(s) for the ST instruction
Mem[ PC + SEXT(IR[8:0]) ] ⇐ SR
RTN(s) for the LD instruction
DR ⇐ Mem[ PC + SEXT(IR[8:0]) ]
RTN(s) for the LDR instruction
DR ⇐ Mem[ IR[8:6] + SEXT(IR[5:0]) ]
RTN(s) for the LEA instruction
DR ⇐ PC + SEXT(IR[8:0])
RTN(s) for the STI instruction
Mem[ Mem[ PC + SEXT(IR[8:0]) ] ] ⇐ SR
RTN(s) for the BR instruction
PC ⇐ PC + SEXT(IR[8:0]) iff (N.n + Z.z + P.p)
RTN(s) for the STR instruction
Mem[ IR[8:6] + SEXT(IR[5:0]) ] ⇐ SR
RTN(s) for the JSRR instruction
R7 ⇐ PC; PC ⇐ (BaseR)
Control Instructions for BR
- ADDR1MUX selects PC
- ADDR2MUX selects SEXT(IR[8:0])
- PCMUX selects ADDR ADD
- LD.PC iff (N.n + Z.z + P.p)
Control Instructions for JSRR
- GatePC
- DRMUX selects [111]
- LD.REG
- SR1MUX selects IR[8:6]
- ADDR1MUX selects SR1OUT
- ADDR2MUX selects 0
- PCMUX selects ADDR ADD
- LD.PC
Control Instructions for TRAP
- GatePC
- DRMUX selects [111]
- LD.REG
- MARMUX selects ZEXT(IR[7:0)
- Gate.MARMUX
- LD.MAR
- MEM.EN/R
a. Wait for R - MDRMUX selects MEM.
- LD.MDR
- Gate.MDR
- PCMUX selects bus.
- LD.PC
Control Instructions for LDR
- SR1MUX selects IR[8:6]
- ADDR1MUX selects SR1OUT
- ADDR2MUX selects SEXT(IR[5:0])
- MARMUX selects ADDR ADD
- Gate.MARMUX
- LD.MAR
- MEM.EN/R
a. Wait for R - MDRMUX selects Memory
- LD.MDR
- Gate.MDR
- DRMUX selects IR[11:9]
- LD.REG
Control Instructions for ST
- ADDR1MUX selects PC
- ADDR2MUX select SEXT(IR[8:0])
- MARMUX selects ADDR ADD
- Gate.MARMUX
- LD.MAR
- SR1MUX selects IR[11:9]
- ALUK selects Pass Through
- Gate.ALU
- MDRMUX selects bus
- LD.MDR
- MEM.EN/W
Control Instructions for STI
- ADDR1MUX selects PC
- ADDR2MUX selects SEXT(IR[8:0])
- MARMUX selects ADDR ADD
- Gate.MARMUX
- LD.MAR
- MEM.EN/R
a. Wait for R - MDRMUX selects Memory
- LD.MDR
- Gate.MDR
- LD.MAR
- SR1MUX selects IR[11:9]
- ALUK selects Pass Through
- Gate.ALU
- MDRMUX selects Bus
- LD.MDR
- MEM.EN/W
Control Instructions for STR
- SR1MUX selects IR[8:6]
- ADDR1MUX selects SR1OUT
- ADDR2MUX selects SEXT(IR[5:0])
- MARMUX selects ADDR ADD
- Gate.MARMUX
- LD.MAR
- SR1MUX selects IR[11:9]
- ALUK selects Pass Through
- Gate.ALU
- MDRMUX selects Bus
- LD.MDR
- MEM.EN/W
Control Instructions for JMP/RET
- SR1MUX selects IR[8:6]
- ADDR1MUX selects SR1OUT
- ADDR2MUX selects 0
- PCMUX selects ADDR ADD
- LD.PC