This lab has two in-labs due in successive lab periods. In the first period you will demonstrate your solution to the first design problem, and in the second, you will demonstrate your solution to the more complex problem.
Robbie is the simpler robot which is attempting to drive to the beacon and stop. Robbie has three sensors and two independently controlled wheels. The sensors are mounted on the front, front-right and front-left of the robot, as seen in Figure 1. These sensors detect if the beacon is in a certain area (the cones indicated in Figure 1). If the sensor does detect the beacon it outputs a "1", otherwise it will output a "0".
The two wheels are driven independently. If a "1" is sent to the wheel it turns forward, but if a "0" is sent to the the wheel it doesn't turn. Robbie will go straight if both wheels are turning forward, and will stop if both wheels are stopped. In addition, Robbie turns right if the left wheel is going forward while the right wheel isn't turning, and would turn left in the symmetric case (the left wheel stooped and the right wheel going forward).
Robbie should follow the following rules:

Schematic version
For your schematic design, you are to use dip switches 2, 1 and 0 as the left, forward, and right sensor inputs respectively. You are to turn on the red LED #1 to indicate that the left wheel is going forward, and turn on red LED #0 if the right wheel is going forward. Otherwise those LEDs should be off.
Verilog version
For the Verilog design the inputs should be the same, but you outputs will be different. Instead of using red LED #0 and #1, you will instead use the seven-segment displays. You should display a capital "F" on HEX0 if the right wheel is going forward, and a capital "S" if the right wheel is stopped. You should do the same on HEX1 for the left wheel. Recall that the HEX segments are active low.For the Verilog design, you must use the following module declaration as your top-level module (which should be named robbie.v):
module robbie(ls,fs,rs,lwd,rwd); input ls,fs,rs; output [6:0]lwd,rwd;Further, you must make a second module (it can be in the same file) which handles the display of a "S" or "F" to hex display. It should take one input, which indicates if it is to display an S or an F, and should generate a bus of 7 wires as output. You can then instantiate that module twice, once for each hex digit. See the Verilog combinational reference for examples of doing this.
Renee is similar to Robbie, but there are some significant differences. First, she has only two beacon sensors (left and right), but those sensors provide information about distance. Secondly, she has bumper sensors (which tell her if she has hit something). Lastly, her wheels can go in reverse in addition to going forward. These changes are detailed below:
| Action | Left Wheel | Right Wheel |
|---|---|---|
| Forward | F | F |
| Left | S | F |
| Right | F | S |
| Stop | S | S |
| Hard Left | R | F |
| Hard Right | F | R |
| Left Back | S | R |
| Right Back | R | S |
| Reverse | R | R |
module renee(ls,rs,fb,rb,lb,bb,lwd,rwd); input [2:0] ls,rs; //Beacon sensors input fb, rb, lb, bb; //Bumper sensors output [6:0]lwd,rwd; //wheel outputsYou should use the DE2 board inputs as follows:
| Sensors | Board inputs |
|---|---|
| Right beacon sensor | SW2-SW0 (SW2 is MSB) |
| Left beacon sensor | SW6-SW4 (SW6 is MSB) |
| Left bumper sensor | Key3 |
| Front bumper sensor | Key2 |
| Back bumper sensor | Key1 |
| Right bumper sensor | Key0 |
Notes:
Now, using our test as a model, write a test, using the waveform viewer (that thing you used to do tests in simulation) which tests the following cases. Provide a printout of the input waveform. (15 points)
| ls | rs | fb | lb | rb | bb |
|---|---|---|---|---|---|
| 001 | 010 | 0 | 0 | 0 | 0 |
| 001 | 001 | 0 | 0 | 0 | 0 |
| 101 | 101 | 1 | 0 | 0 | 1 |
The in-lab is turned in on two different days. On the first day of in-lab
the two Robbie simulations are to be demonstrated on the DE2 board. (20
points) On the second day of in-lab, the Renee simulation is to be
demonstrated on the DE2 board. (40 points)