feat: small inline things
This commit is contained in:
@@ -27,15 +27,15 @@
|
||||
// if (no == 1) sets out = !out // bitwise not
|
||||
|
||||
CHIP ALU {
|
||||
IN
|
||||
x[16], y[16], // 16-bit inputs
|
||||
IN
|
||||
x[16], y[16], // 16-bit inputs
|
||||
zx, // zero the x input?
|
||||
nx, // negate the x input?
|
||||
zy, // zero the y input?
|
||||
ny, // negate the y input?
|
||||
f, // compute (out = x + y) or (out = x & y)?
|
||||
no; // negate the out output?
|
||||
OUT
|
||||
OUT
|
||||
out[16], // 16-bit output
|
||||
zr, // if (out == 0) equals 1, else 0
|
||||
ng; // if (out < 0) equals 1, else 0
|
||||
@@ -64,12 +64,12 @@ CHIP ALU {
|
||||
|
||||
// no
|
||||
Not16(in=fOut, out=notF);
|
||||
Mux16(a=fOut, b=notF, sel=no,
|
||||
Mux16(a=fOut, b=notF, sel=no,
|
||||
// variable wire
|
||||
out[0..7]=finalResultp1,
|
||||
out[8..15]=finalResultp2,
|
||||
// out
|
||||
out=out,
|
||||
out=out,
|
||||
out[15]=ng
|
||||
);
|
||||
//zr
|
||||
@@ -82,9 +82,4 @@ CHIP ALU {
|
||||
|
||||
//ng
|
||||
// output from Mux16 in no
|
||||
|
||||
|
||||
|
||||
//// Replace this comment with your code.
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user