Up-Counter
Hey there,
in "cells/logic/counter.lua" I noticed this comment: "The counter is down-counting, since this can be implemented more regularly than an upcounting counter. (At least that's what I think, if you see this differently, let me know.)"
I want to let you know :D
If you replace all XNORs by XORs and all ORs by ANDs and replace the constant vss 0 by a constant vdd 1, you create an up-counter in - I believe - a similar footprint.
Merry Christmas :)
Hi and thanks for this message! I was not aware of this. It makes sense, I guess simply for the symmetry. The comment in the cell stems from a simplification with regularity in mind from a up/down counter based on two's complement, where you would either feed 11111...1 or 00000...1 into a series of adders, calculating the next value of the counter. Since the string of 1s is regular and the 00....1 is not, I took that case and simplified the corresponding logic gates.
This property can of course be leveraged in the implementation of the counter pcell, with a parameter for up/down. However, the 'logic' library and especially the 'stdcells' are horribly out-dated and need major overhaul. That is quite low on my priority list, so I hope you were digging through stuff and not actually using this ;)
Don't worry :D I was just digging through the pcells and found this comment.