Let's start with Bruce Lee. His signature move of half-squatting with arms outstretched after a kick with a "Yo-ho" has been imitated by countless people around the world. But we know that there is only one Bruce Lee in the world. No matter how vividly you imitate his "moves", you can't achieve that effect. The reason is actually very simple. We don't have his speed and strength. Using the reverse thinking method, if we have his speed and strength, any move will be extremely powerful. From this, we can see how important basic skills are. In the previous sections, we talked about how to "reduce the burden" and try to remove the unnecessary learning parts for completing the project. This section is about how to work hard to fully master the core knowledge points. We often encounter such a situation that we "feel" that we have understood and know it, but we are helpless when we enter the actual project. Why? In this case, most of the time, it is because the basic core knowledge points have not been fully learned and are in a state of half-understanding. For example: It is not clear what the difference is between add_flag and sel_flag, the conditions for using variables, and the relationship between how many counters are needed and the counters. So what standard should be reached for the core knowledge points to be considered truly mastered? Example: When en1=1 is received, perform the following operations a. After an interval of 2 clock cycles, dout generates a high-level pulse with a width of 5, and then b. After an interval of 2 clock cycles, dout generates a high-level pulse with a width of 7 A high level pulse is generated, and then c.After an interval of 2 clock cycles, dout generates a high level pulse with a width of 3, and then d.After an interval of 2 clock cycles, dout generates a high level pulse with a width of 6. When en2=1 is received, perform the following operations a.After an interval of 4 clock cycles, dout generates a high-level pulse with a width of 3, and then [size=1 4.0pt]After an interval of 1 clock cycle, dout generates a high-level pulse with a width of 6, and then c.After an interval of 6 clock cycles, dout generates a high-level pulse with a width of 3, and then d. After an interval of 2 clock cycles, dout generates a high-level pulse with a width of 5. (The answer is as follows) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41424344454647484950515253545556575859606162636465666768 69707172737475767778798081828384858687888990919293949596979899 | always @(posedge clk or negedge rst_n)begin if(!rst_n)begin cnt0 <= 0; end else if(add_cnt0)begin if(end_cnt0) cnt0 <= 0; else cnt0 <= cnt0 + 1; end end assign add_cnt0 = add_flag ; assign end_cnt0 = add_cnt0 && cnt0==x-1 ; always @(posedge clk or negedge rst_n)begin if(!rst_n)begin cnt1 <= 0; end else if(add_cnt1)begin if(end_cnt1) cnt1 <= 0; else cnt1 <= cnt1 + 1; end end assign add_cnt1 = end_cnt0; assign end_cnt1 = add_cnt1 && cnt1==4-1 ; always @(posedge clk or negedge rst_n)begin if(rst_n==1'b0)begin[ /align] dout <= 0; end else if(en_dout) begin dout <= 1; end else if(end_cnt0)begin dout <= 0; end end assign en_dout = add_cnt0 && cnt0 == y-1; always @(posedge clk or negedge rst_n)begin if(rst_n==1'b0)begin add_flag <= 0;[/font ] end else if(en1||en2)begin [size= 10.0pt] add_flag <= 1; end else if(end_cnt1)begin add_flag <= 0; end end always @(posedge clk or negedge rst_n)begin if(rst_n==1'b0)begin sel_flag <= 0; end [font =宋体] else if(en1)begin sel_flag <= 0; end [font =宋体] else if(en2)begin sel_flag <= 1;[ /align] end end[ /size] always @(*)begin if(sel_flag==0)begin if(cnt ==0)begin x = 7; y = 2; end [font =宋体] else if (cnt1==1)begin x = 9; y = 2; [ font=宋体] end else if (cnt1==2)begin[/ font] x = 5; [size =10.0pt] y = 2; end [ align=left] else begin x = 8;[ /size] y = 2; end [font =宋体] end else begin[/ align] if(cnt==0)begin [size =10.0pt] x = 7; y = 4;[/ align] end else if (cnt1==1)begin [size= 10.0pt] x = 7; y = 1;[/align ] end else if [/ size](cnt1==2)begin [size=10.0 pt] x = 9; y = 6; end[ /size] else begin x = 7; y = 2;[/font ] end end end |
Exercises like these should be practiced until they no longer require thinking, but rather form a natural reaction similar to a conditioned reflex. The key to mastering them is to practice repeatedly. There is no shortcut to this point. The only thing you can rely on is - diligence. The profound content is composed of the most basic elements. Once you have a solid basic foundation, you will have the "speed and power of Bruce Lee", and many profound problems in "moves" will be solved easily. In this section, we use the metaphor of "Kung Fu" to illustrate the importance of basic skills and their relationship with advanced content.
|