BiscuitDuke
Newbie level 6
- Joined
- Sep 4, 2014
- Messages
- 13
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 112
I need help with his homework problem:
Create a festive lights display with 8 light bulbs (B7-B0). When activated (A0=1),
the appearance is of two balls bouncing off each other, as follows: 10000001,
01000010, 00100100, 00011000, 00100100, 01000010, 10000001, repeat. Each
output configuration lasts for one second. Use bit-manipulation methods rather than
numerous states. When deactivated, the display turns off all bulbs within 1 second.
I have no clue how to use bit manipulation and my textbook doesnt do a good job at explaining. I am able to get the effect of 10000000,01000000,00100000,...,00000001 and repeat, but im having trouble shifting the left most bit to the right and right most bit to the left. any help is appreciated. thanks in advance.
Create a festive lights display with 8 light bulbs (B7-B0). When activated (A0=1),
the appearance is of two balls bouncing off each other, as follows: 10000001,
01000010, 00100100, 00011000, 00100100, 01000010, 10000001, repeat. Each
output configuration lasts for one second. Use bit-manipulation methods rather than
numerous states. When deactivated, the display turns off all bulbs within 1 second.
I have no clue how to use bit manipulation and my textbook doesnt do a good job at explaining. I am able to get the effect of 10000000,01000000,00100000,...,00000001 and repeat, but im having trouble shifting the left most bit to the right and right most bit to the left. any help is appreciated. thanks in advance.