Or8Way trouble

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Or8Way trouble

dev_2048
I have been able to successfully create all chips except for any of the 8Way or 4Way chips. I started with Or8Way as I figured once I had it the others would be easy as the were with the [16] chips.

What I do not understand is if there is an in[8] but the OR takes (a, b), which bits make up a and b? Is it [0],[1] and [1],[2] etc. I am just having trouble grasping this.

I have tried:

Or (a=in[0], b=in[0], out=outout1);
Or (a=in[1], b=in[1], out=out2);
etc

and

Or (a=in[0], b=in[1], out=outout1);
Or (a=in[2], b=in[3], out=out2);
etc

If I could just be pointed in the right direction, it would be much appreciated.

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Or8Way trouble

cadet1620
Administrator
The input to Or8Way is, as you noted, the 8-bit bus in[8].

The comment in the file says
    out = (in[0] or in[1] or ... or in[7])

Since you only have Or with 2 inputs, you need to put some extra () in that equation:
    out = ( ( (in[0] or in[1]) or in[2] ) or ... )

Your Or8Way should end up using 7 Or parts.  The first one will be
    Or(a=in[0], b=in[1], out=or01);
[I like more descriptive names than 'w1' or 'out1'.]


Note: the N-Way for Mux and DMux means something slightly different than it does for Or8Way. For Or8Way it means Or the 8 input bits together; for Mux and DMux it means choose 1 of N inputs or outputs.


--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Or8Way trouble

dev_2048
Thanks for your prompt response. I attempted with your example, adding the remaining parts and it is still not working. I don't know what I am missing. I will think on it for a while and check back tomorrow and give an update.
Reply | Threaded
Open this post in threaded view
|

Re: Or8Way trouble

cadet1620
Administrator
If you want, you may email me your Or8Way.hdl and I'll be happy take a look at it and give you some more guidance.

--Mark