I am stuck at how to use a specific bit 'a', 'b' and so on for Dmux8Way. The syntax is very confusing, both in HDL survival guide and the appendix.
What am I doing wrong in the following? I am repeatedly getting the error, "sub-bus of an internal node may be used..." or after tweaking, "specified sub-bus not in range...".
Finally, assuming my implementation is correct, when load=1, the addressed register gets the value of 'in'. Now, won't the value for the seven non-addressed registers be overwritten by 0000 in this case?
The specific problem here is that the 'a' .. 'h' outputs of a DMux8Way are 1-bit, so they may only be connected to 1-bit internal wires. (There is no way to tell the simulator that it should allocate an internal bus that will have wires connected to it later.)
More generally, though, this is not how you want to make your RAM8.
You don't need to demultiplex "in". In hardware, you can directly connect a circuit input to all the pats that may need it. If an individual part is not supposed to do anything with its input, it will ignore the value that is connected to it.
the addressed register gets the value of 'in'. Now, won't the value for the seven non-addressed registers be overwritten by 0000 in this case?
That is correct. Therefore, this is not a correct implementation.
What should the "load" pin for the non-addressed Registers be? You can't directly connect load=load. There is a part that will directly generate the load signals required for the Registers.
Re: How to use a specific bit of an internal port?
Thank you for your hint. I was able to implement a working code. I would like to know whether this code gives the best Performance/(Area*power), or whether there is a better implementation. My code is as follows.