C{-6.000,8.000}{-6.000,1.000}{-19.000,-7.000}{-34.000,5.000}{-33.000,21.000}{-23.000,28.000}{0.000,28.000}E如何取出数字
时间: 2023-11-23 16:46:10 浏览: 119
C{-6.000,8.000}{-6.000,1.000}{-19.000,-7.000}{-34.000,5.000}{-33.000,21.000}{-23.000,28.000}{0.000,28.000}E中的数字可以通过以下方法取出:
1. 首先,将C和E之间的内容提取出来,得到:-6.000,8.000}{-6.000,1.000}{-19.000,-7.000}{-34.000,5.000}{-33.000,21.000}{-23.000,28.000}{0.000,28.000
2. 将上述内容按照}分割为多个子串,得到:-6.000,8.000, -6.000,1.000, -19.000,-7.000, -34.000,5.000, -33.000,21.000, -23.000,28.000, 0.000,28.000
3. 再将每个子串按照,分割为两个数字,得到:-6.000 和 8.000, -6.000 和 1.000, -19.000 和 -7.000, -34.000 和 5.000, -33.000 和 21.000, -23.000 和 28.000, 0.000 和 28.000
4. 最后,将每个子串的第一个数字提取出来即可得到所需的数字:-6.000, -6.000, -19.000, -34.000, -33.000, -23.000, 0.000
相关问题
根据实验所测数据F:0.160; w:1.005; lgw:0.002; DA:2.000; AD:2.004; M:1.002; DB:0.017; DU:-0.778; Re:1.002; Im:-0.014; F:0.200; w:1.257; lgw:0.099; DA:2.000; AD:2.006; M:1.003; DB:0.026; DU:-1.224; Re:1.003; Im:-0.021; F:0.250; w:1.571; lgw:0.196; DA:2.000; AD:2.011; M:1.006; DB:0.048; DU:-2.610; Re:1.004; Im:-0.046; F:0.320; w:2.011; lgw:0.303; DA:2.000; AD:2.018; M:1.009; DB:0.078; DU:-2.045; Re:1.008; Im:-0.036; F:0.400; w:2.513; lgw:0.400; DA:2.000; AD:2.031; M:1.016; DB:0.134; DU:-2.880; Re:1.014; Im:-0.051; F:0.500; w:3.142; lgw:0.497; DA:2.000; AD:2.050; M:1.025; DB:0.214; DU:-6.120; Re:1.019; Im:-0.109; F:0.630; w:3.958; lgw:0.597; DA:2.000; AD:2.079; M:1.040; DB:0.336; DU:-8.838; Re:1.027; Im:-0.160; F:0.800; w:5.027; lgw:0.701; DA:2.000; AD:2.133; M:1.067; DB:0.559; DU:-8.208; Re:1.056; Im:-0.152; F:1.000; w:6.283; lgw:0.798; DA:2.000; AD:2.219; M:1.110; DB:0.903; DU:-14.040; Re:1.076; Im:-0.269; F:1.260; w:7.917; lgw:0.899; DA:2.000; AD:2.363; M:1.182; DB:1.449; DU:-15.869; Re:1.136; Im:-0.323; F:1.590; w:9.990; lgw:1.000; DA:2.000; AD:2.634; M:1.317; DB:2.392; DU:-24.638; Re:1.197; Im:-0.549; F:2.000; w:12.566; lgw:1.099; DA:2.000; AD:3.056; M:1.528; DB:3.682; DU:-43.200; Re:1.114; Im:-1.046; F:2.520; w:15.834; lgw:1.200; DA:2.000; AD:3.303; M:1.652; DB:4.358; DU:-78.466; Re:0.330; Im:-1.618; F:3.180; w:19.981; lgw:1.301; DA:2.000; AD:2.475; M:1.238; DB:1.851; DU:-116.222; Re:-0.547; Im:-1.110; F:4.000; w:25.133; lgw:1.400; DA:2.000; AD:1.437; M:0.719; DB:-2.871; DU:-140.400; Re:-0.554; Im:-0.458; F:5.000; w:31.416; lgw:1.497; DA:2.000; AD:0.834; M:0.417; DB:-7.597; DU:-156.600; Re:-0.383; Im:-0.166; F:6.340; w:39.835; lgw:1.600; DA:2.000; AD:0.473; M:0.237; DB:-12.523; DU:-161.259; Re:-0.224; Im:-0.076; F:8.000; w:50.265; lgw:1.701; DA:2.000; AD:0.253; M:0.127; DB:-17.958; DU:-166.320; Re:-0.123; Im:-0.030; F:10.000; w:62.832; lgw:1.798; DA:2.000; AD:0.226; M:0.113; DB:-18.938; DU:-165.600; Re:-0.109; Im:-0.028; ,求出其对应的相位角φ(w)
根据公式 φ(w) = arctan(Im/Re),可以计算出每个频率对应的相位角φ(w):
当F=0.160时,φ(w) = arctan(-0.014/1.002) = -0.014
当F=0.200时,φ(w) = arctan(-0.021/1.003) = -0.021
当F=0.250时,φ(w) = arctan(-0.046/1.004) = -0.045
当F=0.320时,φ(w) = arctan(-0.036/1.008) = -0.036
当F=0.400时,φ(w) = arctan(-0.051/1.014) = -0.050
当F=0.500时,φ(w) = arctan(-0.109/1.019) = -0.107
当F=0.630时,φ(w) = arctan(-0.160/1.027) = -0.155
当F=0.800时,φ(w) = arctan(-0.152/1.056) = -0.144
当F=1.000时,φ(w) = arctan(-0.269/1.076) = -0.246
当F=1.260时,φ(w) = arctan(-0.323/1.136) = -0.267
当F=1.590时,φ(w) = arctan(-0.549/1.197) = -0.424
当F=2.000时,φ(w) = arctan(-1.046/1.114) = -0.776
当F=2.520时,φ(w) = arctan(-1.618/0.330) = -1.378
当F=3.180时,φ(w) = arctan(-1.110/-0.547) = 1.147
当F=4.000时,φ(w) = arctan(-0.458/-0.554) = 0.725
当F=5.000时,φ(w) = arctan(-0.166/-0.383) = 0.422
当F=6.340时,φ(w) = arctan(-0.076/-0.224) = 0.325
当F=8.000时,φ(w) = arctan(-0.030/-0.123) = 0.244
当F=10.000时,φ(w) = arctan(-0.028/-0.109) = 0.255
注意:相位角φ(w)的单位为弧度。
仿真代码:verilog设计一个数字秒表,其计时范围从000.0-999.9秒,使用四位数码管显示。具有复位开关,启停开关
好的,下面是Verilog代码:
```verilog
module stopwatch(
input clk,
input reset,
input start_stop,
output reg [3:0] digit_select,
output reg [6:0] segment_output
);
reg [19:0] count = 20'd0;
reg [3:0] counter = 4'b0000;
reg [3:0] sec = 4'b0000;
reg [3:0] frac_sec = 4'b0000;
reg running = 1'b0;
always @ (posedge clk) begin
if (reset) begin
count <= 20'd0;
counter <= 4'b0000;
sec <= 4'b0000;
frac_sec <= 4'b0000;
running <= 1'b0;
end else if (start_stop) begin
running <= ~running;
end
if (running) begin
count <= count + 1;
if (count == 20'd50000000) begin
count <= 20'd0;
frac_sec <= frac_sec + 4'b0001;
if (frac_sec == 4'd10) begin
frac_sec <= 4'd0;
sec <= sec + 4'b0001;
if (sec == 4'd10) begin
sec <= 4'd0;
counter <= counter + 4'b0001;
if (counter == 4'd10) begin
counter <= 4'd0;
end
end
end
end
end
end
assign digit_select = ~counter[3:0];
always @* begin
case (digit_select)
4'b0000: segment_output = 7'b0000001; // 0
4'b0001: segment_output = 7'b1001111; // 1
4'b0010: segment_output = 7'b0010010; // 2
4'b0011: segment_output = 7'b0000110; // 3
4'b0100: segment_output = 7'b1001100; // 4
4'b0101: segment_output = 7'b0100100; // 5
4'b0110: segment_output = 7'b0100000; // 6
4'b0111: segment_output = 7'b0001111; // 7
4'b1000: segment_output = 7'b0000000; // 8
4'b1001: segment_output = 7'b0001100; // 9
default: segment_output = 7'b1111111;
endcase
end
assign segment_output[6] = running;
assign segment_output[5] = frac_sec[3];
assign segment_output[4] = sec[0];
assign segment_output[3] = sec[1];
assign segment_output[2] = sec[2];
assign segment_output[1] = counter[2];
assign segment_output[0] = counter[3];
endmodule
```
该模块包含一个时钟输入`clk`、复位输入`reset`、启停输入`start_stop`、四位数字位选输出`digit_select`和七位数码管段选输出`segment_output`。使用一个20位计数器实现计时,每当计数器达到50000000时,分别更新秒的整数部分`sec`、秒的小数部分`frac_sec`和四位数码管的值。启停开关控制计时器是否运行,复位开关用于将计时器复位为0。
由于数码管需要显示秒表的时间,因此需要将计数器的值分解为秒的整数部分、秒的小数部分和四位数码管的值。其中,秒的小数部分每50000000时钟周期加1,需要用到一个4位计数器`frac_sec`来计数;秒的整数部分每10个小数部分时加1,需要用到一个4位计数器`sec`来计数;四位数码管的值需要根据四位数字位选信号`digit_select`来选择输出,根据对应的数码管段选编码来输出。
同时,为了显示秒表正在运行的状态,我们可以将小数点设置为一个闪烁的标志,表示计时器正在运行。最后,由于是共阴极数码管,需要将`segment_output`取反输出。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)