|
CHIP CPU {
IN inM[16], // M value input (M = contents of RAM[A])
instruction[16], // Instruction for execution
reset; // Signals whether to re-start the current
// program (reset==1) or continue executing
// the current program (reset==0).
OUT outM[16], // M value output
writeM, // Write to M?
addressM[15], // Address in data memory (of M)
pc[15]; // address of next instruction
PARTS:
Mux16(b=instruction, sel=instruction[15],
out[0]=c0, out[1]=c1, out[2]=c2,
out[3]=writeM, out[4]=c4, out[5]=cmdsel,
out[6]=c6, out[7]=c7, out[8]=c8, out[9]=c9,
out[10]=c10, out[11]=c11, out[12]=c12,
out=cmd); //decode command
Mux16(a=instruction, b=alu-out, sel=cmdsel, out[15]=sn, out=Areg); //firstMux
Not(in=sn, out=NAreg);
Register(in=Areg, load=NAreg, out=AandM, out[0..14]=addressM); //Areg
Mux16(a=AandM, b=inM, sel=c12, out=AorM,); //A/M
Register(in=alu-out, load=c4, out=D); //Dreg
ALU(x=D, y=AorM, zx=c11, nx=c10, zy=c9, ny=c8, f=c7, no=c6, zr=out0, ng=outMin, out=alu-out, out=outM);
PC(in=AandM, load=Jump, inc=, reset=reset, out=pc);
And(a=out0, b=outMin, out=outPlu);
And(a=outMin, b=c2, out=Jm);
And(a=out0, b=c1, out=J0);
And(a=outPlu, b=c0, out=Jp);
Or(a=Jm, b=J0, out=Jout);
Or(a=Jout, b=Jp, out=Jump);
}
Also I am out with "Error: A pin name is expected" error also change the "A pin" name many times.
A pin = Mux16(a=AandM), PC(in=AandM)
Can you please kindly help me?(´・ω・`)
|