How to produce this sequence using shift register?

Status
Not open for further replies.

anantha_09

Member level 4
Joined
Jan 28, 2007
Messages
75
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,771
Can you produce this sequence? Draw the schematic, hint: use a
shift register.
0 0 0 0
1 0 0 0
1 1 0 0
1 1 1 0
1 1 1 1
0 1 1 1
0 0 1 1
0 0 0 1
 

Re: interview question

shift right, invert the bit that falls off the right and feed it into the left end of the shift register.
 

Re: interview question

hav u got any more problems of this kind or let me know wher can i find some of these kind
 

Re: interview question

anantha_09 said:
Can you produce this sequence? Draw the schematic, hint: use a
shift register.
0 0 0 0
1 0 0 0
1 1 0 0
1 1 1 0
1 1 1 1
0 1 1 1
0 0 1 1
0 0 0 1

hum.....not sure which is the best answer but my answer would be.
RTL:

reg shift [3:0];

always @(posedge clk or reset_n) begin
if (!reset_n)
shift <= 4'b0000;
else
shift <= {!shift[0], shift[3], shift[2], shift[1]}
end

correct? if wrong pls let me know
 

interview question

hi anantha
u are given that sequence is the detected johanson counter.it is working the last ff output inverte to the feed back of the first ff input.u want more details u r study the johanson counter
vamsi
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…