I want to implement a LIFO-stack (LIFO) with 4 cells using shift registers. I want to be able to do the following operations:
I'm not sure how to do this yet, but I'm thinking it might work to connect the shift registers in series. I.e. connect outputs QA-QD from the first shift register to inputs A-D on the next, and so on. What do you think, could this work?
- Push - put in one element at the top of the stack, so that the others get pushed down one cell each (the element in the bottom cell disappears)
- Pop - pull out one element out from the top of the stack, and add one at the bottom
- Clear - set all cell elements to zero
- Change - change only the element in the top cell (other cell elements are unchanged)
I'm not sure how to do this yet, but I'm thinking it might work to connect the shift registers in series. I.e. connect outputs QA-QD from the first shift register to inputs A-D on the next, and so on. What do you think, could this work?
Attachments
-
464.1 KB Views: 87