当前位置:网站首页>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 WinForm [display real-time time in the status bar] - practical exercise 1
- .NET服务治理之限流中间件-FireflySoft.RateLimit
- Factors affecting the quality of slip rings in production
- UEFI development learning 2 - running ovmf in QEMU
- Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine
- String judgment
- Global and Chinese market of resistivity meter 2022-2028: Research Report on technology, participants, trends, market size and share
- Embedded AI intelligent technology liquid particle counter
- ·Practical website·
- Some tips for using source insight (solve the problem of selecting all)
猜你喜欢
研究發現,跨境電商客服系統都有這五點功能!
After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
The printer encountered an abnormal configuration problem 0x8007007e (win10)
Carrier period, electrical speed, carrier period variation
Class of color image processing based on Halcon learning_ ndim_ norm. hdev
Beijing Winter Olympics opening ceremony display equipment record 3
Communication standard -- communication protocol
Shell script basic syntax
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
万字详解八大排序 必读(代码+动图演示)
随机推荐
Global and Chinese markets for waste treatment air switches 2022-2028: Research Report on technology, participants, trends, market size and share
IEEE access personal contribution experience record
Class of color image processing based on Halcon learning_ ndim_ norm. hdev
Interview catalogue
mysql 盲注常见函数
Process communication mode between different hosts -- socket
UEFI development learning 3 - create UEFI program
A simple method to prove 1/t Fourier transform
Programming knowledge -- assembly knowledge
[untitled] record the visual shock of the Winter Olympics and the introduction of the display screen
[popular science] some interesting things that I don't know whether they are useful or not
matlab timeserise
Explain STM32 startup file in detail
Some thoughts on extracting perspectives from ealfa and Ebeta
STM32 knowledge points
. Net service governance flow limiting middleware -fireflysoft RateLimit
Measurement fitting based on Halcon learning [i] fuse Hdev routine
万字详解八大排序 必读(代码+动图演示)
High end electronic chips help upgrade traditional oil particle monitoring
Adaptive filter