当前位置:网站首页>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
边栏推荐
- Basic embedded concepts
- Train your dataset with yolov4
- [popular science] some interesting things that I don't know whether they are useful or not
- Screen record of the opening ceremony of the Beijing winter olympics 2
- Programming knowledge -- basis of C language
- [professional literacy] core conferences and periodicals in the field of integrated circuits
- C language enhancement -- pointer
- Process communication mode between different hosts -- socket
- Halcon's practice based on shape template matching [2]
- Global and Chinese markets for anesthesia, breathing and sleep apnea devices 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

C language uses arrays to realize the intersection, union, difference and complement of sets

PMSM dead time compensation

Significance and requirements of semiconductor particle control

The printer encountered an abnormal configuration problem 0x8007007e (win10)

如何将EasyCVR平台RTSP接入的设备数据迁移到EasyNVR中?

Communication standard -- communication protocol
![C WinForm [help interface - send email] - practice five](/img/2a/c4e7abe054e6fdd45acc7d297a033d.jpg)
C WinForm [help interface - send email] - practice five

After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
![[untitled] record the visual shock of the Winter Olympics and the introduction of the display screen](/img/43/7f8becc09c5ce7fe401bed140608f3.jpg)
[untitled] record the visual shock of the Winter Olympics and the introduction of the display screen

The firmware of the connected j-link does not support the following memory access
随机推荐
C # joint configuration with Halcon
Pointnet++ classification practice
Adaptive filter
Global and Chinese market of urban rail connectors 2022-2028: Research Report on technology, participants, trends, market size and share
UEFI development learning 2 - running ovmf in QEMU
The browser cannot access Baidu
C WinForm [exit application] - practice 3
PMSM dead time compensation
Detailed explanation of C language pointer
Shell脚本基本语法
C language uses arrays to realize the intersection, union, difference and complement of sets
Global and Chinese markets for anesthesia, breathing and sleep apnea devices 2022-2028: Research Report on technology, participants, trends, market size and share
. Net service governance flow limiting middleware -fireflysoft RateLimit
Altium designer 19.1.18 - Import frame
UEFI development learning 3 - create UEFI program
Class of color image processing based on Halcon learning_ ndim_ norm. hdev
Ads learning record (lna_atf54143)
Hardware 1 -- relationship between gain and magnification
Factors affecting the quality of slip rings in production
Random function usage notes