Presentation is loading. Please wait.

Presentation is loading. Please wait.

Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP 2610 1.

Similar presentations


Presentation on theme: "Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP 2610 1."— Presentation transcript:

1 Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP 2610 1

2 Finite State Machines The behavior of a system can be best understood by a finite state machine It has 5 elements: 1. Finite number of states 2. Finite number of external inputs 3. Finite number of external outputs 4. Explicit specification of all state transitions 5. Explicit specification of what determines each external output value

3 State Diagram A finite state machine can be represented by a state diagram like we used last time We draw circles to represent states The connections with arrows show the possible transitions between each state

4 State Diagram The term arc is used for the arrow The arrow tells where the state is coming from and going to The destination state is the one with the arrow

5 State Diagram We refer to the state the system is coming from as the current state The state it is going to, is called the next state

6 State Diagram

7 The Clock One important property that we have not discussed is the mechanism to trigger a transition This circuit is commonly done by a clock circuit

8 The Clock The clock circuit or clock, is a signal whose value oscillates from 0 to 1 and back again The transition from one state to another occurs at the start of a clock cycle

9 The Clock “1” “0” time  One Cycle

10 Implementing Finite State Machines Combinational logic – Determine outputs and next state. Storage elements – Maintain state representation.

11 Implementing Finite State Machines State Machine Combinational Logic Circuit Storage Elements InputsOutputs Clock

12 Master-Slave Flip-flop During 1 st phase (clock=1), previously-computed state becomes current state and is sent to the logic circuit. During 2 nd phase (clock=0), next state, computed by logic circuit, is stored in Latch A.

13 Master-Slave Flip-flop Each master-slave flipflop stores one state bit. The number of storage elements (flipflops) needed is determined by the number of states (and the representation of each state).

14 Sign Example A blinking traffic sign – No lights on – 1 & 2 on – 1, 2, 3, & 4 on – 1, 2, 3, 4, & 5 on – (repeat as long as switch is turned on)

15 Sign Example DANGER MOVE RIGHT 1 2 3 4 5

16 Sign Example State bit S 1 State bit S 0 Switch on Switch off Outputs

17 Sign Example Outputs (depend only on state: S 1 S 0 ) S1S1 S0S0 ZYX 00000 01100 10110 11111 Lights 1 and 2 Lights 3 and 4 Light 5 Next State: S 1 ’S 0 ’ (depend on state and input) InS1S1 S0S0 S1’S1’S0’S0’ 0XX00 10001 10110 11011 11100 Switch Whenever In=0, next state is 00.

18 Sign Example Master-slave flipflop

19 From Logic to Data Path The data path of a computer is all the logic used to process information. – See the data path of the LC-3 on next slide. Combinational Logic – Decoders -- convert instructions into control signals – Multiplexers -- select inputs and outputs – ALU (Arithmetic and Logic Unit) -- operations on data Sequential Logic – State machine -- coordinate control signals and data movement – Registers and latches -- storage elements

20 LC-3 Data Path Combinational Logic State Machine Storage


Download ppt "Digital Logic Structures: Chapter 3 COMP 2610 Dr. James Money COMP 2610 1."

Similar presentations


Ads by Google