a simple state machine with five states.
whatever mod by 5, there are five results, 0,1,2,3,4..based on these five results, you can easily draw a state machine diagram.
BTW: assuming it's a infinite width shift register and MSB first...
原帖由 snowboyfly 于 2008-7-29 07:40 发表
a simple state machine with five states.
whatever mod by 5, there are five results, 0,1,2,3,4..based on these five results, you can easily draw a state machine diagram.
BTW: assuming it's a infinite ...
Looks like most people don't understand the problem. It's not a practical problem, just a conceptual problem!!
A small example:
current input bit current input sequence current output bit current output sequence
1 1 0 0
0 10 0 00
1 101 1 001
0 1010 1 0011
1 10101 0 00110
1 101011 0 001100
1 1010111 0 0011000
...... ...... ............ .............
yadog (2008-7-29 12:05:52)
用10进制看,不管多大的数字,只要最低位是0或者,则输出高
一个0不知道算不算呢
yadog (2008-7-29 12:06:16)
rt
0或者5
yadog (2008-7-29 12:07:19)
这样理解应该比较容易看到结果把
iammujun (2008-7-29 14:34:43)
QUOTE:
原帖由 snowboyfly 于 2008-7-29 07:40 发表
a simple state machine with five states.
whatever mod by 5, there are five results, 0,1,2,3,4..based on these five results, you can easily draw a state machine diagram.
BTW: assuming it's a infinite ...
最新回复
snowboyfly (2008-7-29 07:40:04)
whatever mod by 5, there are five results, 0,1,2,3,4..based on these five results, you can easily draw a state machine diagram.
BTW: assuming it's a infinite width shift register and MSB first...
[ 本帖最后由 snowboyfly 于 2008-7-29 07:57 编辑 ]
cjapple (2008-7-29 08:59:14)
junjun98 (2008-7-29 09:12:23)
hagelee (2008-7-29 09:22:13)
ococ (2008-7-29 09:25:06)
hover_edacn (2008-7-29 09:47:15)
我认为最没有水平的考题就是状态机,完全考察不到面试者的专业知识。
snowboyfly (2008-7-29 09:53:43)
QUOTE:
hehe, this is to evaluate the conceptual knowledge, not professional knowledge...ql_smbj (2008-7-29 09:58:21)
输入的数字序列能被5整除的话,输出1,不能被5整除,输出0,比如输入0101,输出就是1001。
晕 输入1位 输出1位? 怎么输入成0101 而输出是1001?
xueyw (2008-7-29 10:06:37)
QUOTE:
不错,回答得很好啊temp_temp (2008-7-29 10:16:57)
是一个除5取余的电路,也就是生成多项式为X^2+1的LFSR
oyyg (2008-7-29 10:28:23)
店小二 (2008-7-29 10:42:01)
windzjy (2008-7-29 11:01:22)
输入序列开始为110010(50,右边是最先输入的bit),对应的输出应该为100001,过程如下,
当输入到0010的时候4bit数据中保存的仍然是0010,因为不够整除,当输入下一个1的时候,就是0010 + 0001 = 0011,用0011去除5余数为0011,再下一个1来的时候就是0011 + 0010 = 0101,减5 = 0000可以整除,输出为1,如果后面还是1输入进来就是0000 + 0100 = 0100 输出为0,再来一个1就是1000 + 0100 = 1100 减5位0111,大于5再减0010,输出为0,依次类推。
一点想法,没有试验,具体细节有兴趣的再考虑吧
windzjy (2008-7-29 11:03:12)
zp_0409 (2008-7-29 11:05:44)
snowboyfly (2008-7-29 11:23:38)
A small example:
current input bit current input sequence current output bit current output sequence
1 1 0 0
0 10 0 00
1 101 1 001
0 1010 1 0011
1 10101 0 00110
1 101011 0 001100
1 1010111 0 0011000
...... ...... ............ .............
yadog (2008-7-29 12:05:52)
一个0不知道算不算呢
yadog (2008-7-29 12:06:16)
0或者5
yadog (2008-7-29 12:07:19)
iammujun (2008-7-29 14:34:43)
QUOTE:
果然厉害,就是这样的!可惜当时没做出来,在对方的提醒下才做出来的。