You are on page 1of 6

EE-313 LAB #6 ALTERA QUARTUS II DESIGN SOFTWARE CONTROL CIRCUIT FOR THE TAIL LIGHTS ON A 1965 FORD THUNDERBIRD

Name: _______________________________ Section:_______________ Date:__________

1. Purpose:

Design a state machine with combinational logic controls to control the tail lights on a 1965 Ford Thunderbird as described below and implement your design on the Altera PLD board.

2. Equipment: Desktop with Altera Software Altera PLD Board Altera Quartus II Quick Reference 3. Procedure: Pre-calculations: You are designing a control circuit for the tail lights on a 1965 Ford Thunderbird, Figure 1, or at least a simplified version of the taillights.

Figure 1, 1965 Ford Thunderbird Our version will have 4 lights on each side of the rear of the car vice the 6 shown in Figure 1. When you turn on the turn signal, the lights flash in sequence to indicate the direction that you are turning. For Example when turning Right, R1 will turn on and remain on, then R2 will turn on and remain on, then R3 and R4. If turning to the left then L1, L2, L3 and then L4 will turn on in sequence. Refer to Figure 2, which shows the location of the lights.

L4

L3

L2

L1

R1

R2

R3

R4

Figure 2, Simplified Taillights The taillights will blink if the hazards are turned on. In this case the R1, L1 and R2, L2 will light then turn off, then R3, L3 and R4, L4 will light and turn off and the pattern will repeat with the two inboard lights blinking alternately with the two outboard lights on each side. Additionally you will need to turn all the lights on in the event that the brake is pushed. When the blinkers, hazards and brakes are off, the lights all need to be off.
EE313 Lab #6 Spring 09 1

You also need to account for the case when the Hazards and brakes are on at the same time. In this case L4, L3 and R4 and R3 will remain on and L2, L1 and R2, R1 will blink on an off. If the Brakes and a blinker are on at the same time, then the brakes on one side and the blinker in the direction of the turn will operate. The above description indicates that we will have 4 inputs; Brake, Left Turn, Right Turn, and Hazard which will determine when each of the eight output lights are on. We will use the LEDs on the Altera board to represent the eight lights as shown in Figure 2. You will have 4 inputs, a clock signal and 8 outputs in your system: a. Description of inputs. i. Brakes (B) - Indicates the Brake pedal has been pressed, All 8 lights will light up. ii. Hazard Lights (H) - An input that indicates the Hazard Lights are on. R1, L1 and R2, L2 will light then turn off, then R3, L3 and R4, L4 will light and turn off. iii. Left Turn Signal (L) - An input that indicates the Left Turn signal should flash, L1, L2, L3 then L4 as described above. iv. Right Turn Signal (R) - An input that indicates the Right Turn signal should flash, R1, R2, R3, and R4 as described above. v. Clock We will use the One Second Clock for timing. vi. Note: When none of the other input conditions exists all lights are out. b. Description of Outputs. i. R1 Inboard Right Taillight wired to D5 on the Altera Board. ii. R2 Next Right Taillight wired to D6 on Altera Board. iii. R3 Next Right Taillight wired to D7 on Altera Board. iv. R4 Outboard Right Taillight wired to D8 on Altera Board. v. L1 - Inboard Left Taillight wired to D4 on the Altera Board. vi. L2 Next Right Taillight wired to D3 on Altera Board. vii. L3 Next Right Taillight wired to D2 on Altera Board. viii. L4 Outboard Right Taillight wired to D1 on Altera Board. c. Rules governing the operation of the lights. i. If the Hazard lights are on, R1, L1 and R2, L2 will light then turn off, then R3, L3 and R4, L4 will light and turn off. ii. If the Brakes are on and the Hazard Lights are on, both R1 and R2 will light then turn off and the left side will follow the same pattern while R3, L3, R4 and L4 will stay on. iii. Both Turn Signals can not be on at the same time. This input is impossible since the Turn signal switch cannot be turned to left and right at same time. iv. If the Hazards and either blinker are on at the same time, then go into Hazard mode. v. If a Blinker is on and the brake is pushed, Continue the blinker function and activate the opposite side brake light. d. Notes concerning circuit construction i. The same state machine can be used for both the Left and the Right Turn, provided you route the output to L4, L3, L2, L1 for the left signal and the output to R4, R3, R2, R1 for the right signal.
EE313 Lab #6 Spring 09 2

ii. You will need some type of combinational logic to control which state machine is active based on the input conditions. iii. The LED lights are active low, which means that you will need to invert the outputs that you are sending to the LEDs. Active Low means a zero turns them on. iv. The last note on the construction is an overview of the logic needed to turn on the lights. Table 1 shows the 4 inputs, Brake (B), Hazard (H), Left Turn (L), and Right turn (R). A one in each of these inputs indicates that the input is on. The results of each of the conditions are shown on the right of the table. This table can be used to design the combinational logic needed to activate each state machine and the combinational logic needed to turn on each of the output lights. B 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 H 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 L 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 R Results 0 All Lights will be off 1 The Right Turn will be on 0 The Left Turn will be on 1 Impossible due to mechanical switch 0 Hazards are on 1 Hazards are on 0 Hazards are on 1 Impossible due to mechanical switch 0 Brake is on, all lights are on 1 Brake on Left is on, Right Turn is on 0 Brake on Right is on, Left Turn is on 1 Impossible due to mechanical switch 0 Brake and Hazard are on 1 Brake and Hazard are on 0 Brake and Hazard are on 1 Impossible due to mechanical switch Table 1: Summary of Input conditions

e. You will need a separate state machine for each condition. Your solution could have as many as 6 state Machines and as few as 2. You will also need some type of decoder to light all the lights when the break is pressed and none of the lights when no input is detected (B=0, H=0, L=0 and R=0 case). We need one flip flop per unique output variable. The JK flip flop would be a wise choice. Use K Maps provided on the following pages to find the Simplified Sum of Products solution. Wire the given JK Flip Flops to reflect your design.

EE313

Lab #6

Spring 09 3

1) The Truth Table for possible input conditions is shown below in Table 2. This table has input conditions of B = Brake on, H= Hazard on, L = Left Blinker is on, R = Right Blinker is on. The output conditions are Rout = Turn on Right Turn State Machine. Lout = Turn on Left Turn State Machine. BHout = Turn on brake Hazard State Machine BRout = Turn on Right Turn and Left side Brake. BLout = Turn on Left Turn and Right side brake. Hout = Turn on the Hazard State Machine. Fill in Table 2, use a 1 to turn on an output value, 0 to turn it off and an X for dont care conditions. B 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 H 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 L 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 R 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Rout Lout BHout BRout BLout Hout

Table 2: Input condition Logic 2) Complete Truth Tables for each of the output columns in Table 2. Write the equations for the input conditions. Rout = ____________________________________ Lout = ____________________________________ BHout = ____________________________________ BRout = ____________________________________ BLout = ____________________________________ Hout = ____________________________________

3) Design your state machines. If you chose to use block diagrams, you make show all K maps, state transition tables, and equations.

EE313

Lab #6

Spring 09 4

4) Build, Compile and Program your project into the Altera board. a. Use the following input and output pins and devices for your project. Input/Output Left Turn Signal Right Turn Signal Brake Pedal Hazard Light Switch L1 L2 L3 L4 R1 R2 R3 R4 One SecondClock Symbol L R B H N/A N/A N/A N/A N/A N/A N/A N/A N/A Pin 22 24 28 30 54 55 56 57 45 46 48 49 83 Connection SW1 - Dip Switch 1 SW1 - Dip Switch 8 SW2 Dip Switch 1 SW2 - Dip Switch 8 Diode D4 Diode D3 Diode D2 Diode D1 Diode D5 Diode D6 Diode D7 Diode D8 Clock for State Machines

5) Figure 3 shows the top level logic for the Taillight Design. Figure 3 is not intended to represent a detailed overview of the project, but does represent the logic needed to drive the outputs. Enclosure 1 shows a printout from Altera of a possible solution which contains more detail than Figure 3. State Machines Outputs Inputs

Left Turn

L4

L3 L Right Turn

Encoder Used to activate correct State Machine

Hazard

Decoder Used to activate the correct Taillight

L2

L1

Brake and Hazard

R4

R3 Left Turn and Brake R2 Right Turn and Brake

R1

Figure 3: Top Level Logic for Taillight Design


EE313 Lab #6 Spring 09 5

6) Record the state of the 3 LEDs in Table 3 for the given inputs. Demonstrate the proper operation of your circuit to Maj Caldwell. Remember the Diodes (LEDs) are active low so you need to invert your outputs in Altera so that a 1 will turn on the Diode. L 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 R 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 H 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 L4 L3 L2 L1 R1 R2 R3 R4

Table 3: Verify your Results 4. Deliverables a. Create an entry in your lab notebook as per the course guidelines with K-maps and equations for your state machine, and a copy of your block diagram. You must demonstrate your tail light system to Maj Caldwell. Your lab report will be written in the following format: i. ii. iii. iv. v. Purpose Equipment Procedure Results Conclusion

b. c.

EE313

Lab #6

Spring 09 6

You might also like