device for converting binary strings into states for switches

May 16, 2006 1 Replies

Hi,



I need to buid a device connected to a computer. The computer will generate binary strings (each position will be either 0 or 1) of length N. Based on this string my device has to set the state (on/off) of N switches.



Example:



The computer generates the string 00110. I also have 5 switches which must be set by my device as follows: first



2 switches and the last switch must be turned OFF and the 3rd and the
4th must be turned ON.

I have a hard constrain for this problem: the operation described above must be performed in O(1) steps. This means that it should be INDEPENDENT of the value of N. All switches must be set in the same moment.



I DONT want to check the value of each position and to set the state of the corresponding switch accordingly. This will means O(N) steps and I want only O(1) steps.



How can I make such device? I should use some properties of the computer ports, but I dont know how.



Even some small values for N (16 or 32) are of interest for me.



Thanks. Laura



sounds like a homework assignment.

anyway look into using a serial-in parallel-out shift register with a latching output. (you may need to daisy-chain many.)

you'l also need an N counter to trigger the latch after N bits have been loaded.

Bye. Jasen

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required