You鈥檙e responsible for a portion of the logic in an electronic vending machine. Specifically, your subsystem determines the change to be returned. All items cost 75垄 and the machine accepts dollar bills, so your system must deliver 25垄 in change using the fewest number of coins. Your inputs are a 2鈥恇it counter D1 D0 indicating the number of dimes available to dispense and a 3鈥恇it counter N2 N1 N0 indicating the number of nickels available to dispense. Your outputs should indicate the number of dimes and nickels to dispense. An additional output, NC (No Change) should be 1 if you鈥檙e unable to give change with the coins available, 0 otherwise. You do not need to update the counters. Their values are provided as inputs to your module. Be sure to show truth tables, K鈥恗aps, and reduced equations. Make effective use of don鈥檛 cares. Describe your circuit using a Verilog behavioral dataflow description and simulate it by writing a testbench. Assume the device has a propagation delay of 6 time units. Your solution should employ sum of products form. You can compile and simulate your Verilog program using the Verilogger software system or any other Verilog environment.
I already drew out the thruth tables for the 2 bit D1 and D0 using an OR gate , and the table for the 3 bit using OR gate too. but i dont know where to go from here . I know the output will be in a form of
D N (NC)
2 1 -- 0
1 3 -- 0
0 5 -- 0
0 0 -- 1
I just need a jump start on this thing, any help will be really appreciated. thanks|||Well, I don't have the full solution, but wouldn't you start by drawing just one truth table that has five inputs (D1 D0 N2 N1 N0) and six outputs (M2 M1 K3 K2 K1 NC) where M2 M1 are the number of dimes to dispense and K3 K2 K1 are the number of nickles to dispense? You'd have 32 states. Take each of the six outputs one at a time and reduce the 32 states from there.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment