# What is the least expensive way to build a three-bit shift register?

I'd like to build a queue of three internal bits as inexpensively as possible. Externally, the queue has two input bits and one output bit. The inputs are (dataIn) and (shift), and the output is (dataOut). The internal bits are arranged from the left to the right, and can be implemented in any way imaginable, as long as it's as inexpensive as possible. In my mind's eye I'm thinking of something like a DRAM, where there's just one transistor/capacitor pair per each bit, but I don't know if that's possible.

The output (dataOut) always has the value of the internal bit on the right. While (shift) is low, all three internal bits just retain their current value. When (shift) goes high, the internal bit on the left takes the value of (dataIn), the internal bit in the middle takes the former value of the bit on the left, and the internal bit on the right takes the former value of the bit in the middle.

In particular, I'm interested in whether or not this can occur with just three internal bits, or whether instead each bit has to have a master (set on one edge of changing (shift)) and a slave (set from the value of the master on the other edge).

Also, a size of three is just a fairly simple example of what I want to have; ultimately my design is going to need much larger groups of internal bits.

• How many of these systems do you need? The answer will be different if you're building 10 of them vs building 10 million of them. Commented Mar 22, 2019 at 20:37
• you're right, but i think he is talking about design options for now, the manufacture scale is not still being argued Commented Mar 22, 2019 at 20:44
• I see that an ON semiconductor MC74HC595 can be purchased for 28 cents. It gets you 8 bits of shift register in a straightforward solution. Do you need a significantly lower cost? Commented Mar 22, 2019 at 22:29
• The Photon posted, "How many of these systems do you need? The answer will be different if you're building 10 of them vs building 10 million of them." The prototype I'm thinking of building will have precisely 30,182,209,528 bits. To be perfectly honest, I don't need any three-bit queues at all. That prototype will have 143 queues, each of which's size will be a power of two, ranging from two to the zero (1) to two to the 24 (16,777,216), and each element of each queue will be a 257-bit value, not a single bit. Commented Mar 23, 2019 at 19:24
• But it seemed to me that the crucial question is whether I can implement each bit in the three-bit shift register inexpensively, because if my end product is ten times as expensive as a computer with similar size, then I may have to seriously rethink its marketability. Commented Mar 23, 2019 at 19:25