From 5ad262486c983833257f8bdf21aa1a807ab445cf Mon Sep 17 00:00:00 2001 From: Apoorva <153853167+stays1lly@users.noreply.github.com> Date: Tue, 7 Jan 2025 00:14:27 +0530 Subject: [PATCH] Update ALU.hdl --- projects/02/ALU.hdl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/02/ALU.hdl b/projects/02/ALU.hdl index ce9d471..2313996 100644 --- a/projects/02/ALU.hdl +++ b/projects/02/ALU.hdl @@ -66,6 +66,9 @@ CHIP ALU { Mux16(a=andout,b=addout,sel=f,out=fout); // if (no==1) set out = ~out + Not16(in=fout, out=nfout); + Mux16(a=fout, b=nfout, sel=no, out=out); + // 1 if (out<0), 0 otherwise Not16(in=fout,out=nfout); Mux16(a=fout,b=nfout,sel=no,out=out,out[0..7]=zr1,out[8..15]=zr2,out[15]=ng); @@ -76,4 +79,4 @@ CHIP ALU { Or(a=or1,b=or2,out=or3); Not(in=or3,out=zr); -} \ No newline at end of file +}