Docsity

Homework 8: Counters and State Machines for ECE 2030 A, B - Prof. David Schimmel, Assignments of Electrical and Electronics Engineering

Partial preview of the text

Download Homework 8: Counters and State Machines for ECE 2030 A, B - Prof. David Schimmel and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Homework 8 : Counters, State Machines

ECE 2030 A, B (Schimmel)

  1. Use D flip-flops and XOR gates as the main components to build a 3-bit down counter. You may use other combinational logic to create the down counting logic. Draw neatly , and label everything. There are multiple solutions, here is one of them.
  2. Draw a k-map and find the minimal equation for the function that is needed to make an up- counter into a modulo- 10 up-counter.
  1. A sequential circuit has 2 D flip-flops and an input S as shown below. Both the state assignment and output are made up of JK, where J is the MSB. (a) Derive the state table. J K S J+ K+ 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1 0 0 (b) Draw the state diagram. (Moore)
  2. Below is a state diagram of a “1101” sequence detector. An input, I, is fed into a register. When “1101” is detected, the output is 1; otherwise the output is 0. The last detected 1 in the sequence can overlap as the first 1 in the sequence. For example, the sequence “11110 1101 ” will result in the output being 1 during the 2 different inputs highlighted in blue. In the state diagram, the top label (i.e. “State0”) is state name and the bottom label is a description of the state (i.e. “initial”).

(c) Find the minimal equation for the output and each next state bit. (d) Implement this state machine using the equations found in (c) and d flip-flops as your memory component.

  1. You’re designing the controller for a retro Coca-Cola machine where a soft drink costs 15 cents and accepts only nickels (5 cents) and dimes (10 cents.) The machine has 1 input, I, which is 1 when a dime is inserted and 0 when a nickel is inserted. The machine has 2 outputs, Y and Z. Y is active when a soft drink is dispensed, and Z is active when change is returned. (a) Draw a Mealy state diagram for this controller. Include state names (Si) where i=0,1,2... and a state description. (b) Draw a Moore state diagram for this controller. Include state names (Si) where i=0,1, and the output of that state. Note that I’ve added a description in the quotation marks inside each state (“ “). Also, to stress the difference between 1’s and I’s, the 1’s (one’s) are marked in red. This means that it ALWAYS performs this action.  Alternative solution