디지털회로설계에 도움될만한 자료가 있어 공유한다.
Steve Golson의 State machine design techniques for Verilog and VHDL이다.
본 자료에서 소개하는 state encoding method는 3가지가 있다.
1. Highly-encoded state assignment
2. One-hot encoding
3. Almost one-hot encoding
Highly-encoded state assigment
- Minimal state encoding이라고도 불린다.
- 단순하게 state이 4개가 있으면 각각을 00, 01, 10, 11로 encoding하는 방법이다.
- 장점 : 사용하는 FF의 수가 적다. log2(#states)만큼의 FF이 필요하다.
- 단점 : State을 decoding하기 위한 combinational logic이 비교적 복잡하다.
One-hot encoding
- State 하나당 하나의 FF을 할당한다. 예를 들어, state이 4개가 있으면 각각을 0001, 0010, 0100, 1000으로 encoding한다.
- 장점 : State을 decoding하기 위한 combinational logic이 굉장히 단순하다. State의 갯수가 많아지더라도 회로의 speed 감소가 일어나지 않는다. STA(Static Timing Analysis) 진행 시 critical path를 쉽게 찾을 수 있다.
- 단점 : 사용하는 FF의 수가 많다. (#states)만큼의 FF이 필요하다.
Almost one-hot encoding
- 하나의 flag bit를 활용한다. 예를 들어, read mode인지 write mode인지 나타내는 flag bit를 선언할 수 있다:
reg mode;
mode가 0인 경우 read mode, 1인 경우 write mode에서 동작한다고 하자.
Read mode와 write mode의 state diagram이 유사하거나 동일하다면 해당 state를 one-hot encoding할 수 있다.
Read mode와 write mode의 state를 모두 one-hot encoding하는 것에 비해 FF의 갯수가 반으로 줄 것이다.
- 장단점 : One-hot encoding과 유사
'Digital Circuit' 카테고리의 다른 글
Mealy machine state assignment 규칙 (0) | 2024.02.28 |
---|---|
밀리머신과 무어머신 비교설명 (1) | 2024.02.28 |