Part 5a EEP1.pdf

Part 5a EEP1.pdf

Testing the EEP1 Design

Before starting work on the rest of EEP1, we check that it jumps correctly by running the EEP1_test.ram code.

0 JMP #3 // JUMP OVER TERMINATION POINTS // SUCCESS (SELF−LOOP)
1 JMP #1
2 JMP #2 // FAIL (SELF−LOOP)
3 JNE #5 // SHOULD JUMP (Z=0 INITIALLY)
4 JMP #2
5 JPL #7 // SHOULD JUMP
6 JMP #2
7 JCC #12 // SHOULD JUMP
8 JMP #2
9 MOV R0, #0X45
10 RET#2 //USEIMM8 = 2SO IF RET DOES NORMAL JUMP IT IS A FAILURE 
11 JMP#2 //IF RET DID NOT JUMP WE END UP HERE
12 MOV R0, #0X10
13 ADD R0, #0X20
14 SUB R0, #0X30
15 JNE #2
16 MOV R4, #0X10
17 MOV R0, #0X20
18 ADD R4, R0, #0X0
19 JCS #2
20 SUB R4, #0X30
21 JNE #2
22 JCC #2
23 MOV R5, R4, #−1
24 ADC R5, #1
25 JCC #2
26 JEQ #2
27 MOV R0, #0XFF
28 MOV R1, #0
29 SUB R0, R1
30 JGE #2
31 JLS #2
32 MOV R0, #0
33 MOV R1, #0XFF
34 SUB R0, R1
35 JLT #2
36 JHI #2
37 MOV R0, #0XFE
38 SUB R0, R1
39 JGE #2
40 JHI #2
41 JSR #9 // SHOULD GO TO ADDRESS 3 AND THEN RETURN WITH R0 = 0X45 42 SUB R0, #0X45
43 JNE #2 // THE SUBROUTINE CODE DID NOT SEEM TO EXECUTE?
44 JMP #1 // SUCCESS IF WE GET HERE!

Untitled

Untitled

Terminates on PC = 1 eventually. Phew! This means that all of our code and schematics are working as intended.

Reflections on Boolean logic description

FIG 1.1

FIG 1.1

FIG 1.2

FIG 1.2

Implementing SBC/AND/XOR/LSR

T1

<aside> ✅ Task 1. Change the logic in the decode ****sheet so that F(2:0) and CEn is correct for the SBC instruction as well as ADD, SUB, ADC as in Figure 1.1.

</aside>

Untitled

FIG 1.1

FIG 1.1