Mar 21, 2011 #1 S spartanthewarrior Full Member level 2 Joined Jun 13, 2007 Messages 122 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,296 Activity points 2,142 Hi All, There is a question, which was asked by me. Question Is: You a flip-flop to which serial bits are coming as an input. At output you have too look for a combination of bits whether the number is divisibal by 5 or not. The input stream don't have any limitation on number of bits.
Hi All, There is a question, which was asked by me. Question Is: You a flip-flop to which serial bits are coming as an input. At output you have too look for a combination of bits whether the number is divisibal by 5 or not. The input stream don't have any limitation on number of bits.
Apr 8, 2011 #2 D dhaval4987 Full Member level 3 Joined Oct 17, 2009 Messages 161 Helped 12 Reputation 24 Reaction score 12 Trophy points 1,298 Location AZ Activity points 2,325 did you get the answer? I have been trying to solve it but kinda stuck!
Apr 8, 2011 #3 E ebuddy Full Member level 3 Joined May 15, 2007 Messages 177 Helped 35 Reputation 70 Reaction score 34 Trophy points 1,308 Activity points 2,372 OP, if you would rephrase the question and give us an example, we can understand it better.
Apr 10, 2011 #4 W wsong0210 Member level 3 Joined Mar 11, 2009 Messages 59 Helped 22 Reputation 44 Reaction score 21 Trophy points 1,288 Location Manchester, UK Activity points 1,670 Say the old data is D_old the incoming digit is D_i the new data is D_old*2+D_i Assume you know the value of D_old%5, say it is D_old_mod5 Then the new D_old_mod5 is (D_old_mod5*2 + D_i)%5 Now we can set the initial states as D_old = 0, D_old_mod5 = 0, D_i =0; begin the process, update D_old and D_old_mod5 using D_i in every cycle. When D_old_mod5 is 0, output 1 as D_old is divided by 5
Say the old data is D_old the incoming digit is D_i the new data is D_old*2+D_i Assume you know the value of D_old%5, say it is D_old_mod5 Then the new D_old_mod5 is (D_old_mod5*2 + D_i)%5 Now we can set the initial states as D_old = 0, D_old_mod5 = 0, D_i =0; begin the process, update D_old and D_old_mod5 using D_i in every cycle. When D_old_mod5 is 0, output 1 as D_old is divided by 5
Apr 15, 2011 #5 trav1s Full Member level 1 Joined Nov 11, 2010 Messages 98 Helped 29 Reputation 60 Reaction score 28 Trophy points 1,318 Location Japan Activity points 2,025 That is a start, but how can you retain the value of D_old_mod5 for the next cycle if you only have one flop? I feel bad for whatever sap was given this poorly worded question in an interview. How unfair. Last edited: Apr 15, 2011
That is a start, but how can you retain the value of D_old_mod5 for the next cycle if you only have one flop? I feel bad for whatever sap was given this poorly worded question in an interview. How unfair.