• 2022-06-29 问题

    关于以下程序,下列说法中正确的是module Learn10_2 (clk,rst_n,din,pos_clk,neg_clk)input clk,rst_n,din;output pos_clk,neg_clk;reg ctrl_this,ctrl_last;always@(posedge clk or negedge rst_n)beginif(!rst_n)beginctrl_this <= 0;ctrl_last <= 0;endelse beginctrl_this <= din;ctrl_last <=ctrl_thisendendassign pos_clk = ctrl_this&(!ctrl_last)endmodule A: 该程序的功能是上升沿检测 B: 该程序是同步复位 C: pos_clk是一个长度为两个时钟周期的脉宽信号 D: 该程序的功能是下降沿检测

    关于以下程序,下列说法中正确的是module Learn10_2 (clk,rst_n,din,pos_clk,neg_clk)input clk,rst_n,din;output pos_clk,neg_clk;reg ctrl_this,ctrl_last;always@(posedge clk or negedge rst_n)beginif(!rst_n)beginctrl_this <= 0;ctrl_last <= 0;endelse beginctrl_this <= din;ctrl_last <=ctrl_thisendendassign pos_clk = ctrl_this&(!ctrl_last)endmodule A: 该程序的功能是上升沿检测 B: 该程序是同步复位 C: pos_clk是一个长度为两个时钟周期的脉宽信号 D: 该程序的功能是下降沿检测

  • 2022-06-12 问题

    对于包含[img=69x25]1803dee74863dfb.png[/img]个正数元素的数组[img=54x25]1803dee75013ec4.png[/img],我们希望找出数组中的一些元素,使得这些元素在数组中互不相邻并且元素之和最大。例如在数组[img=75x25]1803dee757e6d00.png[/img]中,应当选择[img=33x25]1803dee760331fd.png[/img]和[img=33x25]1803dee767b1800.png[/img],元素之和为[img=18x18]1803dee76f6ce17.png[/img]。给出该问题的解决算法如下,空白处应填入____输入:正数数组[img=14x19]1803dee77816338.png[/img],元素个数[img=11x14]1803dee780ab3c0.png[/img]输出:选择的元素,最大不相邻元素之和创建数组[img=49x25]1803dee78908872.png[/img],[img=25x25]1803dee791533d8.png[/img]表示数组[img=49x25]1803dee79999d04.png[/img]中的最大不相邻元素之和创建数组[img=70x25]1803dee7a1c0f34.png[/img]记录选择方案[img=88x25]1803dee7a9d7046.png[/img][img=179x25]1803dee7b2c94ef.png[/img]if[img=126x25]1803dee7bb69c17.png[/img] then[img=130x25]1803dee7c3e0d95.png[/img][img=86x25]1803dee7cc17682.png[/img][img=86x25]1803dee7d4bf257.png[/img][img=72x25]1803dee7dd6730b.png[/img] endelse[img=51x25]1803dee7e5c8f09.png[/img] [img=86x25]1803dee7ee5a9f8.png[/img] [img=86x25]1803dee7f64585d.png[/img] [img=86x25]1803dee7fe9ae54.png[/img]endfor[img=82x18]1803dee806bc6b6.png[/img] doif then [img=84x25]1803dee80f88210.png[/img]endelse[img=101x25]1803dee81864d13.png[/img][img=84x25]1803dee820dcc1a.png[/img]endendreturn [img=65x25]1803dee82886a45.png[/img] A: [img=390x25]1803dee833a7746.png[/img] B: [img=390x25]1803dee83ef03f5.png[/img] C: [img=414x25]1803dee849caffa.png[/img] D: [img=390x25]1803dee856875dc.png[/img]

    对于包含[img=69x25]1803dee74863dfb.png[/img]个正数元素的数组[img=54x25]1803dee75013ec4.png[/img],我们希望找出数组中的一些元素,使得这些元素在数组中互不相邻并且元素之和最大。例如在数组[img=75x25]1803dee757e6d00.png[/img]中,应当选择[img=33x25]1803dee760331fd.png[/img]和[img=33x25]1803dee767b1800.png[/img],元素之和为[img=18x18]1803dee76f6ce17.png[/img]。给出该问题的解决算法如下,空白处应填入____输入:正数数组[img=14x19]1803dee77816338.png[/img],元素个数[img=11x14]1803dee780ab3c0.png[/img]输出:选择的元素,最大不相邻元素之和创建数组[img=49x25]1803dee78908872.png[/img],[img=25x25]1803dee791533d8.png[/img]表示数组[img=49x25]1803dee79999d04.png[/img]中的最大不相邻元素之和创建数组[img=70x25]1803dee7a1c0f34.png[/img]记录选择方案[img=88x25]1803dee7a9d7046.png[/img][img=179x25]1803dee7b2c94ef.png[/img]if[img=126x25]1803dee7bb69c17.png[/img] then[img=130x25]1803dee7c3e0d95.png[/img][img=86x25]1803dee7cc17682.png[/img][img=86x25]1803dee7d4bf257.png[/img][img=72x25]1803dee7dd6730b.png[/img] endelse[img=51x25]1803dee7e5c8f09.png[/img] [img=86x25]1803dee7ee5a9f8.png[/img] [img=86x25]1803dee7f64585d.png[/img] [img=86x25]1803dee7fe9ae54.png[/img]endfor[img=82x18]1803dee806bc6b6.png[/img] doif then [img=84x25]1803dee80f88210.png[/img]endelse[img=101x25]1803dee81864d13.png[/img][img=84x25]1803dee820dcc1a.png[/img]endendreturn [img=65x25]1803dee82886a45.png[/img] A: [img=390x25]1803dee833a7746.png[/img] B: [img=390x25]1803dee83ef03f5.png[/img] C: [img=414x25]1803dee849caffa.png[/img] D: [img=390x25]1803dee856875dc.png[/img]

  • 2022-06-18 问题

    下面给出了最长公共子序列问题中输出最长公共子序列的函数Print-LCS([img=74x23]1803dee92de4aa2.png[/img])伪代码,其中空白处应分别填入____输入:追踪数组[img=30x19]1803dee9365dfdb.png[/img],序列[img=15x19]1803dee93e380fd.png[/img],当前位置[img=7x18]1803dee945ba22c.png[/img]和[img=8x22]1803dee94e71e8b.png[/img] 输出:[img=104x25]1803dee956ba607.png[/img]的最长公共子序列if then return [img=52x19]1803dee95e6d615.png[/img]endif [img=116x26]1803dee9670d417.png[/img] then Print-LCS([img=30x19]1803dee97068138.png[/img],[img=15x19]1803dee978e55b2.png[/img], , ) print [img=15x17]1803dee98172499.png[/img]else if [img=73x25]1803dee989d4159.png[/img] then Print-LCS([img=30x19]1803dee97068138.png[/img],[img=15x19]1803dee978e55b2.png[/img],[img=30x20]1803dee9a2100d9.png[/img],[img=8x22]1803dee9ae9ca95.png[/img])endelse Print-LCS([img=30x19]1803dee97068138.png[/img],[img=15x19]1803dee978e55b2.png[/img],[img=7x18]1803dee9c855314.png[/img],[img=39x22]1803dee9d0d9610.png[/img])end A: [img=235x26]1803dee9d8e4640.png[/img] B: [img=240x26]1803dee9e157294.png[/img] C: [img=178x26]1803dee9e9d12e3.png[/img] D: [img=189x26]1803dee9f2766a1.png[/img]

    下面给出了最长公共子序列问题中输出最长公共子序列的函数Print-LCS([img=74x23]1803dee92de4aa2.png[/img])伪代码,其中空白处应分别填入____输入:追踪数组[img=30x19]1803dee9365dfdb.png[/img],序列[img=15x19]1803dee93e380fd.png[/img],当前位置[img=7x18]1803dee945ba22c.png[/img]和[img=8x22]1803dee94e71e8b.png[/img] 输出:[img=104x25]1803dee956ba607.png[/img]的最长公共子序列if then return [img=52x19]1803dee95e6d615.png[/img]endif [img=116x26]1803dee9670d417.png[/img] then Print-LCS([img=30x19]1803dee97068138.png[/img],[img=15x19]1803dee978e55b2.png[/img], , ) print [img=15x17]1803dee98172499.png[/img]else if [img=73x25]1803dee989d4159.png[/img] then Print-LCS([img=30x19]1803dee97068138.png[/img],[img=15x19]1803dee978e55b2.png[/img],[img=30x20]1803dee9a2100d9.png[/img],[img=8x22]1803dee9ae9ca95.png[/img])endelse Print-LCS([img=30x19]1803dee97068138.png[/img],[img=15x19]1803dee978e55b2.png[/img],[img=7x18]1803dee9c855314.png[/img],[img=39x22]1803dee9d0d9610.png[/img])end A: [img=235x26]1803dee9d8e4640.png[/img] B: [img=240x26]1803dee9e157294.png[/img] C: [img=178x26]1803dee9e9d12e3.png[/img] D: [img=189x26]1803dee9f2766a1.png[/img]

  • 1