当前位置:网站首页>Verilog -- state machine coding method
Verilog -- state machine coding method
2022-07-05 08:00:00 【Drink more hot water-】
Contained in the state machine N States usually need to be represented by some coding , Status code , Or status assignment .
Choose the appropriate coding scheme , It will contribute to the utilization of circuit area and resources .
The three most common types of state coding are : Sequential binary encoding 、 Gray code and Hot code alone 、 Johnson code
Sequence code (Sequential State Machine Encoding)
Binary coding is the most compact coding , Each state encoded with sequential binary numbers .
eg. state0 state1 state2 state3 Expressed as '00' '01' '10' '11'
The advantage is that it uses the smallest number of bits of the state vector . But when it changes from one state to another , Many bits may change ,[ There are intermediate states ] Many transients , Easy to produce burr , Cause a logical error
Gray code (Gray Code )
In the transition of adjacent states , Only one bit at a time changes , It can reduce the possibility of burrs and some transients , But it is not suitable for situations with many state jumps .
Recursively generate code table
This method is based on the fact that gray code is reflection code , Use the following rules of recursion to construct :
1 Bit gray code has two codewords
(n+1) The first bit of gray code 2n Codeword equals n Codeword of bit gray code , Write in order , Prefixed 0
(n+1) After... In gray code 2n Codeword equals n Codeword of bit gray code , Write in reverse order , Prefixed 1 [4]
n+1 A collection of bit gray codes = n Bit gray code set ( The order ) Prefixed 0 + n Bit gray code set ( The reverse ) Prefixed 1
2 Bit code | 3 Bit code | 4 Bit code | 4 Bit natural binary code |
---|---|---|---|
00 | 000 | 0000 | 0000 |
01 | 001 | 0001 | 0001 |
11 | 011 | 0011 | 0010 |
10 | 010 | 0010 | 0011 |
110 | 0110 | 0100 | |
111 | 0111 | 0101 | |
101 | 0101 | 0110 | |
100 | 0100 | 0111 | |
1100 | 1000 | ||
1101 | 1001 | ||
1111 | 1010 | ||
1110 | 1011 | ||
1010 | 1100 | ||
1011 | 1101 | ||
1001 | 1110 | ||
1000 | 1111 |
Hot coding alone
namely One-Hot code , Also known as a bit effective code , Only one bit of each symbol value is '1', The others are '0',
Such as S0=3'b001,S1=3'b010,S2=3'b100
namely N A state needs N Trigger . The speed of the hot code state machine is only related to the number of transitions to a particular state, but not to the number of States , fast . And because its state decoding is simple , Therefore, the combinational logic circuit is saved and simplified .FPGA Due to the large number of registers, the logic gate resources of devices are tight , Using heat only coding can effectively improve FPGA Resource utilization and circuit speed . Single hot code also has simple design 、 Flexible modification and easy debugging 、 Easy to integrate 、 Easy to find critical path 、 Easy to carry out static timing analysis and other advantages . Therefore, try to use unique coding .
NEXT PAGE:
Specify the encoding method in the synthesizer
边栏推荐
- C language # and #
- Network communication process
- Can't find real-time chat software? Recommend to you what e-commerce enterprises are using!
- Improve lighting C program
- Hardware 1 -- relationship between gain and magnification
- Class of color image processing based on Halcon learning_ ndim_ norm. hdev
- Global and Chinese market of quenching furnaces 2022-2028: Research Report on technology, participants, trends, market size and share
- PMSM dead time compensation
- 导电滑环磨损快的原因
- Correlation based template matching based on Halcon learning [II] find_ ncc_ model_ defocused_ precision. hdev
猜你喜欢
Reasons for rapid wear of conductive slip rings
About the problem that MySQL connector net cannot be cleared in MySQL
The firmware of the connected j-link does not support the following memory access
Screen record of the opening ceremony of the Beijing winter olympics 2
Some thoughts on extracting perspectives from ealfa and Ebeta
Connection mode - bridge and net
PMSM dead time compensation
Drive LED -- GPIO control
Altium designer 19.1.18 - hide the fly line of a network
Can't find real-time chat software? Recommend to you what e-commerce enterprises are using!
随机推荐
C language # and #
Acwing - the collection of pet elves - (multidimensional 01 Backpack + positive and reverse order + two forms of DP for the answer)
solver. Learning notes of prototxt file parameters
研究发现,跨境电商客服系统都有这五点功能!
C language uses arrays to realize the intersection, union, difference and complement of sets
Cadence learning records
Altium Designer 19.1.18 - 清除测量距离产生的信息
Halcon's practice based on shape template matching [1]
Global and Chinese market of urban rail connectors 2022-2028: Research Report on technology, participants, trends, market size and share
Vofa+ software usage record
[popular science] some interesting things that I don't know whether they are useful or not
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
Connection mode - bridge and net
C WinForm [change the position of the form after running] - Practical Exercise 4
IEEE access personal contribution experience record
C WinForm [view status bar -- statusstrip] - Practice 2
Consul installation
Ads usage skills
How to define guid in AMI code
After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update