Building a new type of CPU chip, can't understand the pin change
This post was updated on .
I'm working on a new type of CPU chip for an assignment, the difference is that the D register is replace by a bank of 4 register and the input to that bank is controlled by 2 read access outa and outb, 1 write access inc. on top of that their is an added Jump instruction. I have modified the code to suit the new changes but the problem is that every time after the new input line shows up the register banks load pin would change after the register has been loaded, but the input line does not have a bit that set register load to 1, but it would stay on 1 from the previous line and change after the data in A register is sent to register bank.
And(a=instruction,b=instruction,out=Dinst); CHANGES HERE
RegisterBank4(in=ALUOut,load=loadD,ina=instruction[5..6],inb=instruction[3..4],inc=instruction[0..1],outa=Da,outb=Db); CHANGES HERE IN inc
every time after the new input line shows up the register banks load pin would change after the register has been loaded, but the input line does not have a bit that set register load to 1, but it would stay on 1 from the previous line and change after the data in A register is sent to register bank.
Are you talking about the values shown in the compare/output at time Tn and time Tn+? If so, you may be have been misled by the built-in D- and ARegister displaying their value changing at time Tn+. The D- and ARegister outputs do not change at Tn+1. What is being shown is their 'in' value at that time.
You should look at the output from CPU-external.tst and compare that timing to your new CPU's timing.
Two things that I see in your HDL:
I suspect ny, f, no s/b inst[9, 8, 7]
writeM decoding appears to be incorrect; think about @ instructions.
I will try my best to write the new encoding
A instruction are as normal 0xxxxxxxxxxxxxxx
D instruction are 11s1s2 c1c2c4c5c6 a1a2 b1b2 d1d2d3
11 indicates this is an D instruction s1s2 refers to operand 2, c1-6 is for the ALU, a1a2 is operand 1 and is for selecting 1 of the 4 register in registerbank do A read access, b1b2 is no an operand but is for selecting 1 of the register to do B read access, d1-d3 is the destination bits
d1 d2 d3 a1/b1 a2/b2 s1 s2
0 0 0 D_0 0 0 D_0 0 0 0
0 0 1 D_1 0 1 D_1 0 1 d_b
0 1 0 D_2 1 0 D_2 1 0 A
0 1 1 D_3 1 1 D_3 1 1 AM
1 0 0 null
1 0 1 A
1 1 0 M
1 1 1 AM
The J instruction is the same as D instruction but starts with 10 and d1-d3 changes j1-j3
j1 j2 j3
0 0 0 null
0 0 1 JGT
0 1 0 JEQ
0 1 1 JGE
1 0 0 JLT
1 0 1 JNE
1 1 0 JLE
1 1 1 JMP
The major difference between this structure and the diagram on the chapter 5 note is that D register is replace with 4 data register bank, and the Mux before the ALU changes to a 4 way Mux where 00=false, 01=d_b,10=A,11=M, also the data register bank also output an d_a straight to the ALU, but you probably notice that from the code.
This is a assignment for a uni course, the course corriculum had a change so the lecturer decides to make the new 4D bit as a continued assignment from project 05, I couldn't get much help from the lecturer so all I can do is seek help somewhere else.