cpe229_lec04

# cpe229_lec04 - CPE 229 Course Notes Lecture 4 Copyright...

This preview shows pages 1–2. Sign up to view the full content.

CPE 229 Course Notes: Lecture 4 Copyright: 2005 Bryan Mealy More of the Real FSM Story: State Variable Encoding Approaches In our quest to conquer the wild FSM, we did not pay much attention to the 1’s and 0’s used to represent the state variables. Our only concern in this matter was to have a unique state variable assignment for each state in the FSM. The only thought you may have given to deciding upon what state variables to use was to use as few as possible. By using as few state variables as possible, you minimized the amount of hardware dedicated to storing the state variables (minimized the number of flip-flops). This is a viable approach, and it was especially more viable in days where people actually implemented FSMs using discrete ICs. This focus on minimizing hardware is somewhat less the case today, particularly with the current violent revolution in PLDs, and particularly FPGAs. This set of notes presents some new terminology and some new approaches to encoding state variables. Some of the advantages and disadvantages of using one method of encoding over another are also discussed. Binary and One-Hot Encoding of State Variables The approach of using as few flip-flops as possible to encode the state variables is referred to as binary or full encoding . In this approach, as the name implies, the state variable assignments are given binary-type values 1 . This is the typical approach taken in introductory FSM courses. In this approach, there is an intuitively binary relation between the number of flip-flops (bit storage elements) and the number of states in the FSM. There are two ways to look at this relationship as is represented by the two equations listed in Equation 1. These equations show the relationship between the number of states and the number of flip-flops required to uniquely encode the states when using binary encoding. The operator used in the right-hand equation is the ceiling function which is defined as the smallest integer greater than or equal to its argument. states # 2 flops - flip # states # log flops - flip # 2 = Equation 1: The relation between the number of states and the number of flip-flops for binary encoding. There are actually many different approaches that can be used to encode the state variables. Many of these methods are based upon the availability of hardware back in the days when people commonly used discrete ICs to implement FSMs (these approaches are somewhat cool and include such devices as counter, shift registers, ROMs). Each of these approaches typically had some advantage or disadvantage over other approaches. Some of these approaches include gray codes, sequential codes, Johnson counts, twisted-ring counts, and one-hot encoding. We’ll only be looking at one-hot encoding in this class. In one-hot encoding, no emphasis is placed on minimizing the number of flip-flops as was done when binary

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

cpe229_lec04 - CPE 229 Course Notes Lecture 4 Copyright...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online