For my ALU design I wanted to determine if a number is negative or positive by looking at its' last bit
// checks if zx is 1 then turns all bits to zeros
Mux16(a=false,b=x,sel=zx,out=xzero);
// negates xzero
Not16(in=xzero,out=notx);
// checks if nx is 1 then negates x
Mux16(a=notx,b=xzero,sel=nx,out=xnegated);
// checks if x is negative
My issue lies in the fact that I can't access xnegated as its own bit in the bus of xnegated. As a result , I keep getting "sub bus of internal node may not be used". So is there a way around this issue??
I would like to apologies for my naming convention I couldn't think of any good names at the time.
I can't figure out what it is you are trying to accomplish from a logic standpoint (in terms of the ALU implementation), but the "sub bus of internal node" error is addressed toward the end of the Hardware Construction Survival Kit, which is linked at the top of the Chapter 1 forum page.
// if (f == 1) set out = x + y // integer 2's complement addition
reading this I thought we would have to do all the operations
i.e if (zx == 1) set x = 0 , // if (nx == 1) set x = !x
then once we preform the addition operation after either setting the bits to zero or negating it or both then if the most significant bit of x is 1 x[15] = 1 that would mean it is a negative number so we would negate all the bits and increment it by one which was why I wanted to use that bit as my select line if (x[15] == 1) then negate it and increment it by one.Otherwise, just output x and use the add16 chip to to the addition of bits, am I overthinking this ??
You are trying to use a one-bit sub bus of an internal signal.
Say I have a chip named Fred that has an 8-bit output named out. I need to connect the full 8-bits to one part and just the next to least significant bit to another part.
OOOOOOOh okay that makes much more sense thank you sooooo much for clarifying it. I would have spent all night trying to figure it out if you hadn't replied so again I really appreciate it.