A question on chip's parts sequesnce (RAM8)

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

A question on chip's parts sequesnce (RAM8)

coykto
Hi, i've found this course few days ago and i really love it, thanks to everyone involved in it's creation. Ok, so i just finished RAM8 chip, parts look something like this:

DMux8Way() // Selecting address to write to

Register() // Writing to appropriate address
Register()
...
Register()

Mux8Way16() // Reading some address

So i just wanted to check other people's implementations to see if it can be done more efficient, or easy and i found this code:

Register() // Writing to appropriate address
Register()
...
Register()

DMux8Way() // Selecting address to write to
Mux8Way16() // Reading some address


Almost the same, as you can see, but DMux8Way goes after writing register, so it seems like we would always write registers with load=0, since it's value not set in the first place. But i've tried that code and it worked just as my version.
I'm probably missing something, but i can't see what. Is order of parts is not important? I can post the full code if needed, i just didn't want to create spoilers.
Reply | Threaded
Open this post in threaded view
|

Re: A question on chip's parts sequesnce (RAM8)

ybakos
A great question! Remember, HDL is really a representation of real hardware - not software code. While many programming languages are indeed procedural, where order matters, HDL is not procedural. It is declarative.

Imagine you are sitting at a workbench wiring all this stuff together. The order in which you wire it all up doesn't quite matter. As long as all the parts are connected, you're good.
Reply | Threaded
Open this post in threaded view
|

Re: A question on chip's parts sequesnce (RAM8)

coykto
Oh right, that makes sense. Thank you!