From 1cb42461db073312c7a19da364067eeb487758a1 Mon Sep 17 00:00:00 2001 From: Sven Riwoldt Date: Sun, 30 Jul 2023 10:38:04 +0200 Subject: [PATCH] CPU bearbeitet --- projects/05/CPU.hdl | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/projects/05/CPU.hdl b/projects/05/CPU.hdl index 658f47a..dfd8a63 100644 --- a/projects/05/CPU.hdl +++ b/projects/05/CPU.hdl @@ -41,7 +41,25 @@ CHIP CPU { PARTS: // Put your code here: - // 1. A/C-Instruction - Not(in=instruction[15],out=inst) - Mux(a=outM,) + + //Controlbus + // A/C-Instruction and Controlbus + Not(in=instruction[15],out=on); + OR(a=on,b=instruction[5],out=); + AND(a=instruction[15],b=instruction[12],out=); + AND(a=instruction[15],b=instruction[4],out=); + AND(a=instruction[15],b=instruction[3],out=); + AND(a=instruction[15],b=instruction[0],out=); + AND(a=instruction[15],b=instruction[1],out=); + AND(a=instruction[15],b=instruction[2],out=); + Not(in=zr,out=notzr); + Not(in=ng,out=notng); + AND(a=notzr,b=notng,out=); + AND(a=,b=,out=); + AND(a=,b=,out=); + AND(a=,b=,out=); + OR(a=,b=,out=); + OR(a=,b=,out=); + + Mux16(a=outM,b=instruction,sel=on,out=) } \ No newline at end of file