diff --git a/404.html b/404.html new file mode 100644 index 0000000..9ebac27 --- /dev/null +++ b/404.html @@ -0,0 +1,20 @@ + + + + + + Personal Blog --from OutisLi + + + + + + + + +

404

There's nothing here.
+ Take me home. +
+ + + diff --git "a/Chip/Chip/1. \344\270\200\347\224\237\344\270\200\350\212\257\350\256\241\345\210\222.html" "b/Chip/Chip/1. \344\270\200\347\224\237\344\270\200\350\212\257\350\256\241\345\210\222.html" new file mode 100644 index 0000000..0081c7b --- /dev/null +++ "b/Chip/Chip/1. \344\270\200\347\224\237\344\270\200\350\212\257\350\256\241\345\210\222.html" @@ -0,0 +1,150 @@ + + + + + + 1. 一生一芯计划 | Personal Blog --from OutisLi + + + + + + + + +

# 1. 一生一芯计划

# 预学习阶段

+ + + diff --git a/Chip/Chip/2. 2024.02.21-Chisel.html b/Chip/Chip/2. 2024.02.21-Chisel.html new file mode 100644 index 0000000..67709fd --- /dev/null +++ b/Chip/Chip/2. 2024.02.21-Chisel.html @@ -0,0 +1,154 @@ + + + + + + 2. 2024.02.21-Chisel | Personal Blog --from OutisLi + + + + + + + + +

# 2. 2024.02.21-Chisel

# 2024.02.21-Chisel Bootcamp

+ + + diff --git "a/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/01.Verilog \345\237\272\347\241\200\350\257\255\346\263\225.html" "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/01.Verilog \345\237\272\347\241\200\350\257\255\346\263\225.html" new file mode 100644 index 0000000..868c013 --- /dev/null +++ "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/01.Verilog \345\237\272\347\241\200\350\257\255\346\263\225.html" @@ -0,0 +1,163 @@ + + + + + + 1. Verilog 基础语法 | Personal Blog --from OutisLi + + + + + + + + +

# 1. Verilog 基础语法

# 格式

Verilog 是区分大小写的。

格式自由,可以在一行内编写,也可跨多行编写。

每个语句必须以分号为结束符。空白符(换行、制表、空格)都没有实际的意义,在编译阶段可忽略。例如下面两中编程方式都是等效的。

# 不换行(不推荐)

wire [1:0]  results ;assign results = (a == 1'b0) ? 2'b01(b==1'b0) ? 2'b102'b11 ;
+

# 换行(推荐)

wire [1:0]  results ;
+assign      results = (a == 1'b0) ? 2'b01(b==1'b0) ? 2'b102'b11 ;
+

# 注释

Verilog 中有 2 种注释方式:

用  //  进行单行注释:

reg [3:0] counter ;  // A definition of counter register
+

/* */进行跨行注释:

wire [11:0]  addr ;
+/*
+Next are notes with multiple lines.
+Codes here cannot be compiled.
+*/
+assign   addr = 12'b0 ;
+

# 标识符与关键字

标识符(identifier)可以是任意一组字母、数字、$  符号和  _(下划线)符号的合,但标识符的第一个字符必须是字母或者下划线,不能以数字或者美元符开始。

另外,标识符是区分大小写的。

关键字是 Verilog 中预留的用于定义语言结构的特殊标识符。

Verilog 中关键字全部为小写。

# 实例

reg [3:0] counter ; *//reg 为关键字, counter 为标识符*
+input clk; *//input 为关键字,clk 为标识符*
+input CLK; *//CLK 与 clk是 2 个不同的标识符*
+
+ + + diff --git "a/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/02.Verilog \346\225\260\345\200\274\350\241\250\347\244\272.html" "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/02.Verilog \346\225\260\345\200\274\350\241\250\347\244\272.html" new file mode 100644 index 0000000..493762f --- /dev/null +++ "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/02.Verilog \346\225\260\345\200\274\350\241\250\347\244\272.html" @@ -0,0 +1,173 @@ + + + + + + 2. Verilog 数值表示 | Personal Blog --from OutisLi + + + + + + + + +

# 2. Verilog 数值表示

# 数值种类

Verilog HDL 有下列四种基本的值来表示硬件电路中的电平逻辑:

  • 0:逻辑 0 或 "假"
  • 1:逻辑 1 或 "真"
  • x 或 X:未知
  • z 或 Z:高阻

x  意味着信号数值的不确定,即在实际电路里,信号可能为 1,也可能为 0。

z  意味着信号处于高阻状态,常见于信号(input, reg)没有驱动时的逻辑结果。例如一个 pad 的 input 呈现高阻状态时,其逻辑值和上下拉的状态有关系。上拉则逻辑值为 1,下拉则为 0 。

# 整数数值表示方法

数字声明时,合法的基数格式有 4 中,包括:十进制('d 或 'D),十六进制('h 或 'H),二进制('b 或 'B),八进制('o 或 'O)。数值可指明位宽,也可不指明位宽。

# 指明位宽:

4'b1011         *// 4bit 数值*
+32'h3022_c0de   *// 32bit 的数值    一个16进制的数需要4bit来表示*
+

其中,下划线  _  是为了增强代码的可读性。

# 不指明位宽:

一般直接写数字时,默认为十进制表示,例如下面的 3 种写法是等效的:

counter = 'd100; *//一般会根据编译器自动分频位宽,常见的为32bit*
+counter = 100;
+counter = 32'h64;
+

# 负数表示

通常在表示位宽的数字前面加一个减号来表示负数。例如:

-6'd15
+-15
+
  • 15 在 5 位二进制中的形式为 5'b10001, 在 6 位二进制中的形式为 6'b11_0001。

需要注意的是,减号放在基数和数字之间是非法的,例如下面的表示方法是错误的:

4'd-2 //非法说明
+

# 实数表示方法

实数表示方法主要有两种方式:

# 十进制:

30.123
+6.0
+3.0
+0.001
+

# 科学计数法:

1.2e4         //大小为12000
+1_0001e4      //大小为100010000
+1E-3          //大小为0.001
+

# 字符串表示方法

字符串是由双引号包起来的字符队列。字符串不能多行书写,即字符串中不能包含回车符。Verilog 将字符串当做一系列的单字节 ASCII 字符队列。例如,为存储字符串 "www.runoob.com", 需要 14*8bit 的存储单元。例如:

reg [0: 14*8-1]   str ;
+initial begin   
+			str = "www.runoob.com";
+end
+
+ + + diff --git "a/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/03.Verilog \346\225\260\346\215\256\347\261\273\345\236\213.html" "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/03.Verilog \346\225\260\346\215\256\347\261\273\345\236\213.html" new file mode 100644 index 0000000..6b1324e --- /dev/null +++ "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/03.Verilog \346\225\260\346\215\256\347\261\273\345\236\213.html" @@ -0,0 +1,232 @@ + + + + + + 3. Verilog 数据类型 | Personal Blog --from OutisLi + + + + + + + + +

# 3. Verilog 数据类型

Verilog 最常用的 2 种数据类型就是线网(wire)与寄存器(reg),其余类型可以理解为这两种数据类型的扩展或辅助。

# 线网(wire)

wire 类型表示硬件单元之间的物理连线,由其连接的器件输出端连续驱动。如果没有驱动元件连接到 wire 型变量,缺省值一般为 "Z"。举例如下:

wire   interrupt;
+wire   flag1, flag2;
+wire   gnd = 1'b0;
+

线网型还有其他数据类型,包括 wand,wor,wri,triand,trior,trireg 等。这些数据类型用的频率不是很高,这里不做介绍。

# 寄存器(reg)

寄存器(reg)用来表示存储单元,它会保持数据原有的值,直到被改写。声明举例如下:

reg    clk_temp;
+reg    flag1, flag2;
+

例如在 always 块中,寄存器可能被综合成边沿触发器,在组合逻辑中可能被综合成 wire 型变量。寄存器不需要驱动源,也不一定需要时钟信号。在仿真时,寄存器的值可在任意时刻通过赋值操作进行改写。例如:

reg rstn ;
+initial begin   
+		rstn = 1'b0;
+    #100;
+    rstn = 1'b1;
+end
+

# 向量

当位宽大于 1 时,wire 或 reg 即可声明为向量的形式。例如:

reg [3:0]      counter ;    *//声明4bit位宽的寄存器counter*
+wire [32-1:0]  gpio_data;   *//声明32bit位宽的线型变量gpio_data*
+wire [8:2]     addr ;       *//声明7bit位宽的线型变量addr,位宽范围为8:2*
+reg [0:31]     data ;       *//声明32bit位宽的寄存器变量data, 最高有效位为0*
+

对于上面的向量,我们可以指定某一位或若干相邻位,作为其他逻辑使用。例如:

wire [9:0]     data_low = data[0:9] ;addr_temp[3:2] = addr[8:7] + 1'b1 ;
+

Verilog 支持可变的向量域选择,例如:

reg [31:0]     data1 ;
+reg [7:0]      byte1 [3:0];
+integer j ;
+always@* begin
+    for (j=0; j<=3;j=j+1) begin
+        byte1[j] = data1[(j+1)*8-1 : j*8];
+        *//把data1[7:0]…data1[31:24]依次赋值给byte1[0][7:0]…byte[3][7:0]*
+    end
+end
+

Verilog 还支持指定 bit 位后固定位宽的向量域选择访问。

  • [bit+: width] : 从起始 bit 位开始递增,位宽为 width。
  • [bit-: width] : 从起始 bit 位开始递减,位宽为 width。
*//下面 2 种赋值是等效的*
+A = data1[31-: 8] ;
+A = data1[31:24] ;
+*//下面 2 种赋值是等效的*
+B = data1[0+ : 8] ;
+B = data1[0:7] ;
+

对信号重新进行组合成新的向量时,需要借助大括号。例如:

wire [31:0]    temp1, temp2 ;
+assign temp1 = {byte1[0][7:0], data1[31:8]};  *//数据拼接*
+assign temp2 = {32{1'b0}};  *//赋值32位的数值0*
+

# 整数,实数,时间寄存器变量

整数,实数,时间等数据类型实际也属于寄存器类型。

# 整数(integer)

整数类型用关键字 integer 来声明。声明时不用指明位宽,位宽和编译器有关,一般为 32 bit。reg 型变量为无符号数,而 integer 型变量为有符号数。例如:

reg [31:0]      data1 ;
+reg [3:0]       byte1 [7:0]; *//数组变量,后续介绍*
+integer j ;  *//整型变量,用来辅助生成数字电路*
+always@* begin
+    for (j=0; j<=3;j=j+1) begin
+        byte1[j] = data1[(j+1)*8-1 : j*8];
+        *//把data1[7:0]…data1[31:24]依次赋值给byte1[0][7:0]…byte[3][7:0]*
+        end
+end
+

此例中,integer 信号 j 作为辅助信号,将 data1 的数据依次赋值给数组 byte1。综合后实际电路里并没有 j 这个信号,j 只是辅助生成相应的硬件电路。

# 实数(real)

实数用关键字 real 来声明,可用十进制或科学计数法来表示。实数声明不能带有范围,默认值为 0。如果将一个实数赋值给一个整数,则只有实数的整数部分会赋值给整数。例如:

real        data1 ;
+integer     temp ;
+initial begin
+    data1 = 2e3 ;
+    data1 = 3.75 ;
+end
+
+initial begin
+    temp = data1 ; *//temp 值的大小为3*
+end
+

# 时间(time)

Verilog 使用特殊的时间寄存器 time 型变量,对仿真时间进行保存。其宽度一般为 64 bit,通过调用系统函数 $time 获取当前仿真时间。例如:

time       current_time ;
+initial begin
+       #100 ;
+       current_time = $time ; *//current_time 的大小为 100*
+end
+

# 数组

在 Verilog 中允许声明 reg, wire, integer, time, real 及其向量类型的数组。

数组维数没有限制。线网数组也可以用于连接实例模块的端口。数组中的每个元素都可以作为一个标量或者向量,以同样的方式来使用,形如:数组名[下标]。对于多维数组来讲,用户需要说明其每一维的索引。例如:

integer          flag [7:0] ; *//8个整数组成的数组*
+reg  [3:0]       counter [3:0] ; *//由4个4bit计数器组成的数组*
+wire [7:0]       addr_bus [3:0] ; *//由4个8bit wire型变量组成的数组*
+wire             data_bit[7:0][5:0] ; *//声明1bit wire型变量的二维数组*
+reg [31:0]       data_4d[11:0][3:0][3:0][255:0] ; *//声明4维的32bit数据变量数组*
+

下面显示了对数组元素的赋值操作:

flag [1]   = 32'd0 ; *//将flag数组中第二个元素赋值为32bit的0值*
+counter[3] = 4'hF ;  *//将数组counter中第4个元素的值赋值为4bit 十六进制数F,等效于counter[3][3:0] = 4'hF,即可省略宽度;*
+assign addr_bus[0]        = 8'b0 ; *//将数组addr_bus中第一个元素的值赋值为0*
+assign data_bit[0][1]     = 1'b1;  *//将数组data_bit的第1行第2列的元素赋值为1,这里不能省略第二个访问标号,即 assign data_bit[0] = 1'b1; 是非法的。*
+data_4d[0][0][0][0][15:0] = 15'd3 ;  *//将数组data_4d中标号为[0][0][0][0]的寄存器单元的15~0bit赋值为3*
+

虽然数组与向量的访问方式在一定程度上类似,但不要将向量和数组混淆。向量是一个单独的元件,位宽为 n;数组由多个元件组成,其中每个元件的位宽为 n 或 1。它们在结构的定义上就有所区别。

# 存储器

存储器变量就是一种寄存器数组,可用来描述 RAM 或 ROM 的行为。例如:

reg               membit[0:255] ;  *//256bit的1bit存储器*
+reg  [7:0]        mem[0:1023] ;    *//1Kbyte存储器,位宽8bit*
+mem[511] = 8'b0 ;                  *//令第512个8bit的存储单元值为0*
+

# 参数

参数用来表示常量,用关键字 parameter 声明,只能赋值一次。例如:

parameter      data_width = 10'd32 ;
+parameter      i=1, j=2, k=3 ;
+parameter      mem_size = data_width * 10 ;
+

但是,通过实例化的方式,可以更改参数在模块中的值。此部分以后会介绍。

局部参数用 localparam 来声明,其作用和用法与 parameter 相同,区别在于它的值不能被改变。所以当参数只在本模块中调用时,可用 localparam 来说明。

# 字符串

字符串保存在 reg 类型的变量中,每个字符占用一个字节(8bit)。因此寄存器变量的宽度应该足够大,以保证不会溢出。

字符串不能多行书写,即字符串中不能包含回车符。如果寄存器变量的宽度大于字符串的大小,则使用 0 来填充左边的空余位;如果寄存器变量的宽度小于字符串大小,则会截去字符串左边多余的数据。例如,为存储字符串 "run.runoob.com", 需要 14*8bit 的存储单元:

reg [0: 14*8-1]       str ;
+initial begin
+    str = "run.runoob.com";
+end
+

有一些特殊字符在显示字符串中有特殊意义,例如换行符,制表符等。如果需要在字符串中显示这些特殊的字符,则需要在前面加前缀转义字符  \ 。例如下表所示:

转义字符 显示字符
\n 换行
\t 制表符
%% %
\ \
" "
\ooo 1 到 3 个 8 进制数字字符

其实,在 SystemVerilog(主要用于 Verilog 仿真的编程语言)语言中,已经可以直接用关键字 string 来表示字符串变量类型,这为 Verilog 的仿真带来了极大的便利。有兴趣的学者可以简单学习下 SystemVerilog。

+ + + diff --git "a/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/04.Verilog \350\241\250\350\276\276\345\274\217.html" "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/04.Verilog \350\241\250\350\276\276\345\274\217.html" new file mode 100644 index 0000000..3b0bc7c --- /dev/null +++ "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/04.Verilog \350\241\250\350\276\276\345\274\217.html" @@ -0,0 +1,262 @@ + + + + + + 4. Verilog 表达式 | Personal Blog --from OutisLi + + + + + + + + +

# 4. Verilog 表达式

# 表达式

表达式由操作符和操作数构成,其目的是根据操作符的意义得到一个计算结果。表达式可以在出现数值的任何地方使用。例如:

# 实例

a^b ;          *//a与b进行异或操作*
+address[9:0] + 10'b1 ;  *//地址累加*
+flag1 && flag2 ;  *//逻辑与操作*
+

# 操作数

操作数可以是任意的数据类型,只是某些特定的语法结构要求使用特定类型的操作数。

操作数可以为常数,整数,实数,线网,寄存器,时间,位选,域选,存储器及函数调用等。

# 实例

module test;
+*//实数*
+real a, b, c;
+c = a + b ;
+*//寄存器*
+reg  [3:0]       cprmu_1, cprmu_2 ;
+always @(posedge clk) begin
+        cprmu_2 = cprmu_1 ^ cprmu_2 ;
+end
+         
+*//函数*
+reg  flag1 ;
+flag = calculate_result(A, B);
+ *//非法操作数*
+reg [3:0]         res;
+wire [3:0]        temp;
+always@*begin
+    res    = cprmu_2 – cprmu_1 ;
+    *//temp = cprmu_2 – cprmu_1 ; //不合法,always块里赋值对象不能是wire型*
+end
+endmodule
+

# 操作符

Verilog 中提供了大约 9 种操作符,分别是算术、关系、等价、逻辑、按位、归约、移位、拼接、条件操作符。

大部分操作符与 C 语言中类似。同类型操作符之间,除条件操作符从右往左关联,其余操作符都是自左向右关联。圆括号内表达式优先执行。例如下面每组的 2 种写法都是等价的。

//自右向左关联,两种写法等价
+A+B-C ;
+(A+B)-C ;
+
+//自右向左关联,两种写法等价,结果为 B、D 或 F
+A ? B : C ? D : F ;
+A ? B : (C ? D : F) ;
+
+//自右向左关联,两种写法不等价
+(A ? B : C) ? D : F ;  //结果 D 或 F
+A ? B : C ? D : F ; //结果为 B、D 或 F
+

不同操作符之间,优先级是不同的。下表列出了操作符优先级从高至低的排列顺序。当没有圆括号时,Verilog 会根据操作符优先级对表达式进行计算。为了避免由操作符优先级导致的计算混乱,在不确定优先级时,建议用圆括号将表达式区分开来。

操作符 操作符号 优先级
单目运算 + - ! ~ 最高
乘、除、取模 * / %
加减 + -
移位 <<  >>
关系 <  <=  >  >=
等价 ==  !=  ===  !===
归约 & ~&
^ ~^
~
逻辑 &&
条件 ?: 最低

# 算术操作符

算术操作符包括单目操作符和双目操作符。

双目操作符对 2 个操作数进行算术运算,包括乘(*)、除(/)、加(+)、减(-)、求幂()、取模(%)。

# 实例

reg [3:0]  a, b;reg [4:0]  c ;
+a = 4'b0010 ;
+b = 4'b1001 ;
+c = a+b;        *//结果为c=b'b1011*
+c = a/b;          *//结果为c=4,取整*
+

如果操作数某一位为 X,则计算结果也会全部出现 X。例如:

# 实例

b = 4'b100x ;
+c = a+b ;       *//结果为c=4'bxxxx*
+

对变量进行声明时,要根据变量的操作符对变量的位宽进行合理声明,不要让结果溢出。上述例子中,相加的 2 个变量位宽为 4bit,那么结果寄存器变量位宽最少为 5bit。否则,高位将被截断,导致结果高位丢失。无符号数乘法时,结果变量位宽应该为 2 个操作数位宽之和。

# 实例

reg [3:0]        mula ;reg [1:0]        mulb;reg [5:0]        res ;
+mula = 4'he   ;
+mulb = 2'h3   ;
+res  = mula * mulb ; *//结果为res=6'h2a, 数据结果没有丢失位数*
+
  • 和 - 也可以作为单目操作符来使用,表示操作数的正负性。此类操作符优先级最高。
-4  //表示负4
++3  //表示正3
+

负数表示时,可以直接在十进制数字前面增加一个减号 -,也可以指定位宽。因为负数使用二进制补码来表示,不指定位宽来表示负数,编译器在转换时,会自动分配位宽,从而导致意想不到的结果。例如:

# 实例

mula = -4'd4 ;
+mulb = 2 ;
+res = mula * mulb ;      *//计算结果为res=-6'd8, 即res=6'h38,正常*
+res = mula * (-'d4) ;    *//(4的32次幂-4) * 2, 结果异常*
+

# 关系操作符

关系操作符有大于(>),小于(<),大于等于(>=),小于等于(<=)。

关系操作符的正常结果有 2 种,真(1)或假(0)。

如果操作数中有一位为 x 或 z,则关系表达式的结果为 x。

# 实例

A = 4 ;
+B = 3 ;
+X = 3'b1xx ;
+   
+A > B     *//为真*
+A <= B    *//为假*
+A >= Z    *//为X,不确定*
+

# 等价操作符

等价操作符包括逻辑相等(==),逻辑不等(!=),全等(===),非全等(!==)。

等价操作符的正常结果有 2 种:为真(1)或假(0)。

逻辑相等/不等操作符不能比较 x 或 z,当操作数包含一个 x 或 z,则结果为不确定值。

全等比较时,如果按位比较有相同的 x 或 z,返回结果也可以为 1,即全等比较可比较 x 或 z。所以,全等比较的结果一定不包含 x。举例如下:

# 实例

A = 4 ;
+B = 8'h04 ;
+C = 4'bxxxx ;
+D = 4'hx ;
+A == B        *//为真*
+A == (B + 1)  *//为假*
+A == C        *//为X,不确定*
+A === C       *//为假,返回值为0*
+C === D       *//为真,返回值为1*
+

# 逻辑操作符

逻辑操作符主要有 3 个:&&(逻辑与), ||(逻辑或),!(逻辑非)。

逻辑操作符的计算结果是一个 1 bit 的值,0 表示假,1 表示真,x 表示不确定。

如果一个操作数不为 0,它等价于逻辑 1;如果一个操作数等于 0,它等价于逻辑 0。如果它任意一位为 x 或 z,它等价于 x。

如果任意一个操作数包含 x,逻辑操作符运算结果不一定为 x。

逻辑操作符的操作数可以为变量,也可以为表达式。例如:

# 实例

A = 3;
+B = 0;
+C = 2'b1x ;
+   
+A && B    *//     为假*
+A || B    *//     为真*! A       *//     为假*! B       *//     为真*
+A && C    *//     为X,不确定*
+A || C    *//     为真,因为A为真*(A==2) && (! B)  *//为真,此时第一个操作数为表达式*
+

# 按位操作符

按位操作符包括:取反(~),与(&),或(|),异或(^),同或(~^)。

按位操作符对 2 个操作数的每 1 bit 数据进行按位操作。

如果 2 个操作数位宽不相等,则用 0 向左扩展补充较短的操作数。

取反操作符只有一个操作数,它对操作数的每 1 bit 数据进行取反操作。

下图给出了按位操作符的逻辑规则。

&(与) 0 1 x (或) 0 1 x
0 0 0 0 0 0 1 x
1 0 1 x 1 1 1 1
x 0 x x x x 1 x
^(异或) 0 1 x ~^(同或) 0 1 x
0 0 1 x 0 1 0 x
1 1 0 x 1 0 1 x
x x x x x x x x

# 实例

A = 4'b0101 ;
+B = 4'b1001 ;
+C = 4'bx010 ;
+~A        *//4'b1010*
+A & B     *//4'b0001*
+A | B     *//4'b1101*
+A^B       *//4'b1100*
+A ~^ B    *//4'b0011*
+B | C     *//4'b1011*
+B&C       *//4'bx000*
+

# 归约操作符

归约操作符包括:归约与(&),归约与非(~&),归约或(|),归约或非(~|),归约异或(^),归约同或(~^)。

归约操作符只有一个操作数,它对这个向量操作数逐位进行操作,最终产生一个 1bit 结果。

逻辑操作符、按位操作符和归约操作符都使用相同的符号表示,因此有时候容易混淆。区分这些操作符的关键是分清操作数的数目,和计算结果的规则。

A = 4'b1010 ;
+&A ;      //结果为 1 & 0 & 1 & 0 = 1'b0,可用来判断变量A是否全1
+~|A ;     //结果为 ~(1 | 0 | 1 | 0) = 1'b0, 可用来判断变量A是否为全0
+^A ;      //结果为 1 ^ 0 ^ 1 ^ 0 = 1'b0
+

# 移位操作符

移位操作符包括左移(<<),右移(>>),算术左移(<<<),算术右移(>>>)。

移位操作符是双目操作符,两个操作数分别表示要进行移位的向量信号(操作符左侧)与移动的位数(操作符右侧)。

算术左移和逻辑左移时,右边低位会补 0。

逻辑右移时,左边高位会补 0;而算术右移时,左边高位会补充符号位,以保证数据缩小后值的正确性。

# 实例

A = 4'b1100 ;
+B = 4'b0010 ;
+A = A >> 2 ;        *//结果为 4'b0011*
+A = A << 1;         *//结果为 4'b1000*
+A = A <<< 1 ;       *//结果为 4'b1000*
+C = B + (A>>>2);    *//结果为 2 + (-4/4) = 1, 4'b0001*
+

# 拼接操作符

拼接操作符用大括号 {,} 来表示,用于将多个操作数(向量)拼接成新的操作数(向量),信号间用逗号隔开。

拼接符操作数必须指定位宽,常数的话也需要指定位宽。例如:

# 实例

A = 4'b1010 ;
+B = 1'b1 ;
+Y1 = {B, A[3:2], A[0], 4'h3 };  *//结果为Y1='b1100_0011*
+Y2 = {4{B}, 3'd4};  *//结果为 Y2=7'b111_1100*
+Y3 = {32{1'b0}};  *//结果为 Y3=32h0,常用作寄存器初始化时匹配位宽的赋初值*
+

# 条件操作符

条件表达式有 3 个操作符,结构描述如下:

condition_expression ? true_expression : false_expression
+

计算时,如果 condition_expression 为真(逻辑值为 1),则运算结果为 true_expression;如果 condition_expression 为假(逻辑值为 0),则计算结果为 false_expression。

assign hsel    = (addr[9:8] == 2'b0) ? hsel_p1 : hsel_p2 ;
+//当信号 addr 高 2bit 为 0 时,hsel 赋值为 hsel_p1; 否则,将 hsel_p2 赋值给 hsel。
+

其实,条件表达式类似于 2 路(或多路)选择器,其描述方式完全可以用 if-else 语句代替。

当然条件操作符也能进行嵌套,完成一个多次选择的逻辑。例如:

# 实例

assign   hsel = (addr[9:8] == 2'b00) ? hsel_p1 :
+                (addr[9:8] == 2'b01) ? hsel_p2 :
+                (addr[9:8] == 2'b10) ? hsel_p3 :
+                (addr[9:8] == 2'b11) ? hsel_p4 ;
+
+ + + diff --git "a/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/10.Verilog \345\244\232\350\267\257\345\210\206\346\224\257\350\257\255\345\217\245.html" "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/10.Verilog \345\244\232\350\267\257\345\210\206\346\224\257\350\257\255\345\217\245.html" new file mode 100644 index 0000000..3b16c32 --- /dev/null +++ "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/10.Verilog \345\244\232\350\267\257\345\210\206\346\224\257\350\257\255\345\217\245.html" @@ -0,0 +1,209 @@ + + + + + + 10. Verilog 多路分支语句 | Personal Blog --from OutisLi + + + + + + + + +

# 10. Verilog 多路分支语句

# 关键词:case,选择器

case 语句是一种多路条件分支的形式,可以解决 if 语句中有多个条件选项时使用不方便的问题。

# case 语句

case 语句格式如下:

case(case_expr)
+    condition1     :             true_statement1 ;
+    condition2     :             true_statement2 ;
+    ……
+    default        :             default_statement ;
+endcase
+

case 语句执行时,如果 condition1 为真,则执行 true_statement1 ; 如果 condition1 为假,condition2 为真,则执行 true_statement2;依次类推。如果各个 condition 都不为真,则执行 default_statement 语句。

default 语句是可选的,且在一个 case 语句中不能有多个 default 语句。

条件选项可以有多个,不仅限于 condition1、condition2 等,而且这些条件选项不要求互斥。虽然这些条件选项是并发比较的,但执行效果是谁在前且条件为真谁被执行。

ture_statement1 等执行语句可以是一条语句,也可以是多条。如果是多条执行语句,则需要用 begin 与 end 关键字进行说明。

# case 语句支持嵌套使用。

下面用 case 语句代替 if 语句实现了一个 4 路选择器的功能。仿真结果与 testbench 可参考条件语句 (opens new window)一章,两者完全一致。

# 实例

module mux4to1(
+    input [1:0]     sel ,
+    input [1:0]     p0 ,
+    input [1:0]     p1 ,
+    input [1:0]     p2 ,
+    input [1:0]     p3 ,
+    output [1:0]    sout);
+ 
+    reg [1:0]     sout_t ;
+    always @(*)
+        case(sel)
+            2'b00:   begin      
+                    sout_t = p0 ;
+                end
+            2'b01:       sout_t = p1 ;
+            2'b10:       sout_t = p2 ;
+            default:     sout_t = p3 ;
+        endcase
+    assign sout = sout_t ;
+ endmodule
+

case 语句中的条件选项表单式不必都是常量,也可以是 x 值或 z 值。

当多个条件选项下需要执行相同的语句时,多个条件选项可以用逗号分开,放在同一个语句块的候选项中。

# 例如,对 4 路选择器的 case 语句进行扩展,举例如下:

case(sel)
+    2'b00:   sout_t = p0 ;
+    2'b01:   sout_t = p1 ;
+    2'b10:   sout_t = p2 ;
+    2'b11:     sout_t = p3 ;
+    2'bx0, 2'bx1, 2'bxz, 2'bxx, 2'b0x, 2'b1x, 2'bzx :
+        sout_t = 2'bxx ;
+    2'bz0, 2'bz1, 2'bzz, 2'b0z, 2'b1z :
+        sout_t = 2'bzz ;
+    default:  $display("Unexpected input control!!!");endcase
+

# casex/casez 语句

casex、 casez 语句是 case 语句的变形,用来表示条件选项中的无关项。

casex 用 "x" 来表示无关值,casez 用问号 "?" 来表示无关值。

两者的实现的功能是完全一致的,语法与 case 语句也完全一致。

  1. 在 case 语句中,敏感表达式中与各项值之间的比较是一种全等比较,每一位都相同才认为匹配。
  2. 在 casez 语句中,如果分支表达式某些位的值为高阻 z,那么对这些位的比较就会忽略,不予考虑,而只关注其他位的比较结果。
  3. 在 casex 语句中,则把这种处理方式进一步扩展到对 x 的处理,即如果比较双方有一方的某些位的值是 z 或 x,那么这些位的比较就不予考虑。

Untitled

# 例如用 casez 语句来实现一个 4bit 控制端的 4 路选择选择器。

module mux4to1(
+    input [3:0]     sel ,
+    input [1:0]     p0 ,
+    input [1:0]     p1 ,
+    input [1:0]     p2 ,
+    input [1:0]     p3 ,
+    output [1:0]    sout);
+ 
+    reg [1:0]     sout_t ;
+    always @(*)
+        casez(sel)
+            4'b???1:     sout_t = p0 ;
+            4'b??1?:     sout_t = p1 ;
+            4'b?1??:     sout_t = p2 ;
+            4'b1???:     sout_t = p3 ;  
+        default:         sout_t = 2'b0 ;
+    endcase
+    assign      sout = sout_t ;
+ endmodule
+
+ + + diff --git "a/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/2023.11.15-Vivado.html" "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/2023.11.15-Vivado.html" new file mode 100644 index 0000000..71d2f47 --- /dev/null +++ "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/2023.11.15-Vivado.html" @@ -0,0 +1,172 @@ + + + + + + 2023.11.15-Vivado | Personal Blog --from OutisLi + + + + + + + + +

# 2023.11.15-Vivado

# 1. RTL Schematic & Synthesis Schematic

在 Vivado 或类似的 FPGA 开发环境中,您会遇到 RTL (Register Transfer Level) 分析中的 Schematic 和 Synthesis 过程中的 Schematic。它们虽然看起来相似,但代表了不同阶段的电路设计和功能。

  1. RTL Analysis Schematic:

    • 这个 Schematic 是您用硬件描述语言(如 Verilog)编写的代码的直接可视化表示。
    • 它展示了代码中定义的模块、它们的互联以及信号流。
    • RTL Schematic 重点在于逻辑功能的实现,而不是实际硬件如何实现这些功能。它更多地表示逻辑结构而非物理结构。
    • 这是设计验证的早期阶段,您可以在这里检查逻辑错误或结构问题。

    Untitled

  2. Synthesis Schematic:

    • 经过综合后的 Schematic 是将 RTL 设计转换为实际 FPGA 内部资源(如查找表(LUTs)、寄存器和逻辑单元)的表示。
    • 这个过程涉及优化、逻辑最小化、资源分配和时序分析。
    • Synthesis Schematic 展示了设计如何映射到 FPGA 的实际硬件上,包括使用的具体资源和连接。
    • 这是设计流程的后期阶段,您可以在这里优化性能、资源使用和满足时序要求。

    Untitled

总结来说,RTL Schematic 关注于逻辑设计的表示,而 Synthesis Schematic 则关注于该设计在 FPGA 上的物理实现。理解两者的区别对于 FPGA 开发至关重要,因为这影响着您如何优化设计以及解决可能出现的问题。

# 2. Project 汇总中的 LUT,FF,IO,BUFG

在 Vivado 或类似的 FPGA 设计项目中,您会遇到几个关键的资源指标,如 LUT、FF、IO 和 BUFG。这些指标是 FPGA 设计和资源利用的重要部分。下面是每个术语的简要解释:

  1. LUT (Look-Up Table): +
    • LUT 是 FPGA 中实现逻辑功能的基本单元。
    • 它本质上是一个可编程的真值表,可以配置为执行各种逻辑操作(如 AND、OR、NOT、XOR 等)。
    • LUT 的大小和数量是 FPGA 性能和复杂性的关键决定因素。在设计中,LUT 的使用量通常是衡量设计复杂度的一个重要指标。
  2. FF (Flip-Flop): +
    • FF 是用于存储数据的基本存储元件,通常用于实现寄存器、计数器等。
    • 在 FPGA 中,FF 通常与 LUT 配对使用,以实现存储和逻辑功能的组合。
    • FF 的数量通常表明了设计中的数据存储需求和时序复杂度。
  3. IO (Input/Output Ports): +
    • 这些是 FPGA 与外界通信的端口,包括输入端口和输出端口。
    • IO 的数量和类型(如单端或差分)取决于 FPGA 的物理特性和您的设计需求。
    • 在设计中,您需要确保 FPGA 有足够的 IO 端口来满足您的外部连接需求。
  4. BUFG (Buffered Global Clock): +
    • BUFG 是一种专用的时钟缓冲器,用于分配全局时钟信号。
    • 在复杂的 FPGA 设计中,确保时钟信号的稳定和同步是非常重要的。BUFG 能够在整个芯片上稳定地分配时钟信号。
    • BUFG 的使用和配置对于实现有效的时钟管理和避免时钟偏移非常关键。

理解这些资源对于 FPGA 设计至关重要,因为它们直接影响您的设计能否在特定的 FPGA 上实现,以及该设计的性能和效率。在 Vivado 的项目汇总中,这些参数帮助您评估设计对 FPGA 资源的利用情况。

# 3. FPGA 的组成构造

FPGA (Field-Programmable Gate Array) 是一种高度灵活的可编程硬件,它由多个不同的元件构成,共同实现复杂的数字逻辑功能。以下是 FPGA 内部主要组成部分的概述:

  1. 查找表 (LUTs): +
    • 如您所述,LUTs 是 FPGA 的核心,用于实现基本的逻辑功能。它们通过存储预定义的输出值来模拟逻辑门的行为。
    • LUTs 可以通过编程来实现简单的逻辑操作(如 AND、OR、NOT)或更复杂的组合逻辑。
  2. 多路选择器 (MUXes): +
    • 虽然在传统的逻辑电路中,MUXes 是通过逻辑门实现的,但在 FPGA 中,它们通常与 LUTs 结合或独立实现。
    • MUXes 在 FPGA 设计中用于根据控制信号选择不同的输入路径,这对于创建复杂的数据路径和逻辑结构至关重要。
  3. 触发器 (Flip-Flops): +
    • Flip-Flops 用于存储信息,是实现时序逻辑的关键元件。它们通常与 LUTs 配对,以构成可存储状态的逻辑单元。
  4. 编程互联资源 (Programmable Interconnects): +
    • 这些是连接 FPGA 内部不同部件的路径。它们可以被编程以形成任何所需的逻辑网络,从而将 LUTs、Flip-Flops 和其他资源连接起来。
  5. 输入/输出块 (I/O Blocks): +
    • 这些块连接 FPGA 和外部世界,提供数据输入和输出功能。它们可以配置为不同类型的接口(如单端或差分)。
  6. 专用硬件资源: +
    • 许多 FPGA 还包含专用的硬件资源,如 DSP (数字信号处理) 块、内存控制器、时钟管理模块(如 PLLs 和 BUFGs),以及其他特定功能块。
  7. 存储资源: +
    • 包括 RAM 块 (Block RAM) 或更小的存储单元,用于数据存储和缓冲。

FPGA 的关键优势在于其高度可编程性和灵活性。设计师可以通过编程定义 LUTs、MUXes、Flip-Flops 以及互连的配置和组合方式,从而在没有物理改动硬件的情况下实现几乎任何数字逻辑设计。这种灵活性使得 FPGA 在快速原型制作、定制硬件加速和可重配置系统中非常有价值。

FPGA (Field-Programmable Gate Array) 是一种高度灵活的可编程硬件,它由多个不同的元件构成,共同实现复杂的数字逻辑功能。以下是 FPGA 内部主要组成部分的概述:

  1. 查找表 (LUTs): +
    • 如您所述,LUTs 是 FPGA 的核心,用于实现基本的逻辑功能。它们通过存储预定义的输出值来模拟逻辑门的行为。
    • LUTs 可以通过编程来实现简单的逻辑操作(如 AND、OR、NOT)或更复杂的组合逻辑。
  2. 多路选择器 (MUXes): +
    • 虽然在传统的逻辑电路中,MUXes 是通过逻辑门实现的,但在 FPGA 中,它们通常与 LUTs 结合或独立实现。
    • MUXes 在 FPGA 设计中用于根据控制信号选择不同的输入路径,这对于创建复杂的数据路径和逻辑结构至关重要。
  3. 触发器 (Flip-Flops): +
    • Flip-Flops 用于存储信息,是实现时序逻辑的关键元件。它们通常与 LUTs 配对,以构成可存储状态的逻辑单元。
  4. 编程互联资源 (Programmable Interconnects): +
    • 这些是连接 FPGA 内部不同部件的路径。它们可以被编程以形成任何所需的逻辑网络,从而将 LUTs、Flip-Flops 和其他资源连接起来。
  5. 输入/输出块 (I/O Blocks): +
    • 这些块连接 FPGA 和外部世界,提供数据输入和输出功能。它们可以配置为不同类型的接口(如单端或差分)。
  6. 专用硬件资源: +
    • 许多 FPGA 还包含专用的硬件资源,如 DSP (数字信号处理) 块、内存控制器、时钟管理模块(如 PLLs 和 BUFGs),以及其他特定功能块。
  7. 存储资源: +
    • 包括 RAM 块 (Block RAM) 或更小的存储单元,用于数据存储和缓冲。

FPGA 的关键优势在于其高度可编程性和灵活性。设计师可以通过编程定义 LUTs、MUXes、Flip-Flops 以及互连的配置和组合方式,从而在没有物理改动硬件的情况下实现几乎任何数字逻辑设计。这种灵活性使得 FPGA 在快速原型制作、定制硬件加速和可重配置系统中非常有价值。

+ + + diff --git "a/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/2023.11.16-\351\230\273\345\241\236\344\270\216\351\235\236\351\230\273\345\241\236\350\265\213\345\200\274.html" "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/2023.11.16-\351\230\273\345\241\236\344\270\216\351\235\236\351\230\273\345\241\236\350\265\213\345\200\274.html" new file mode 100644 index 0000000..de0729a --- /dev/null +++ "b/Chip/Chip/2023.11.07-Verilog\350\257\255\346\263\225/2023.11.16-\351\230\273\345\241\236\344\270\216\351\235\236\351\230\273\345\241\236\350\265\213\345\200\274.html" @@ -0,0 +1,154 @@ + + + + + + 2023.11.16-阻塞与非阻塞赋值 | Personal Blog --from OutisLi + + + + + + + + +

# 2023.11.16-阻塞与非阻塞赋值

Untitled

Untitled

组合逻辑电路使用阻塞赋值

时序逻辑电路使用非阻塞赋值

在 Verilog 中,阻塞赋值(Blocking Assignment)和非阻塞赋值(Non-Blocking Assignment)是两种不同的信号赋值方法,它们在时序逻辑的模拟和硬件描述语言(HDL)代码的编写中有着重要的区别。

# 阻塞赋值(Blocking Assignment)

  • 使用符号 = 进行赋值。
  • 阻塞赋值在执行时会“阻塞”代码的进一步执行,直到赋值完成。
  • 在执行下一条语句之前,当前语句必须完成其操作。
  • 在组合逻辑设计中常用,但在时序逻辑中使用可能会导致问题,因为它们可能会引起模拟时序和硬件时序的不一致。

举例:

a = b;
+c = a;
+

在这个例子中,c = a; 会等待 a = b; 完成后才执行。

# 非阻塞赋值(Non-Blocking Assignment)

  • 使用符号 <= 进行赋值。
  • 非阻塞赋值允许代码的后续部分在赋值完成之前继续执行。
  • 这意味着所有非阻塞赋值都是并行发生的(或看起来如此),这更接近于硬件的实际行为。
  • 在时序逻辑,特别是在描述触发器(如寄存器)的行为时非常重要和常用。

举例:

a <= b;
+c <= a;
+

在这个例子中,c <= a; 不会等待 a <= b; 的完成。ac 的赋值看似同时发生。

在一个 always 块中,不同地方对同一个变量的赋值会被同时执行,最终结果是变量变成最后一次赋值的结果(前面的操作被覆盖)

+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.html new file mode 100644 index 0000000..b645b0e --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.html @@ -0,0 +1,146 @@ + + + + + + 2024.02.21-Chisel BootCamp | Personal Blog --from OutisLi + + + + + + + + +
+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1 Introduction to Scala.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1 Introduction to Scala.html new file mode 100644 index 0000000..0815cfa --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1 Introduction to Scala.html @@ -0,0 +1,297 @@ + + + + + + 2024.02.21-1. Introduction to Scala | Personal Blog --from OutisLi + + + + + + + + +

# 2024.02.21-1. Introduction to Scala

# Variables and Constants - var and val

var numberOfKittens = 6
+val kittensPerHouse = 101
+val alphabet = "abcdefghijklmnopqrstuvwxyz"
+var done = false
+
+/*
+numberOfKittens: Int = 6
+kittensPerHouse: Int = 101
+alphabet: String = "abcdefghijklmnopqrstuvwxyz"
+done: Boolean = false
+*/
+

变量使用var声明,常量则使用val

# Conditionals

if (done) {
+    println("we are done")
+}
+else if (numberOfKittens < kittensPerHouse) {
+    println("more kittens!")
+    numberOfKittens += 1
+}
+else {
+    done = true
+}
+

类似于 C++,如果只有一行,可以省略大括号

val likelyCharactersSet = if (alphabet.length == 26)
+    "english"
+else
+    "not english"
+
+println(likelyCharactersSet)
+// likelyCharactersSet: String = "english"
+

if这一串的返回值又所选择的分支的最后一行确定

# Methods (Functions)

// Simple scaling function with an input argument, e.g., times2(3) returns 6
+// Curly braces can be omitted for short one-line functions.
+def times2(x: Int): Int = 2 * x
+
+// More complicated function
+def distance(x: Int, y: Int, returnPositive: Boolean): Int = {
+    val xy = x * y
+    if (returnPositive) xy.abs else -xy.abs
+}
+

# Overloading Functions

// Overloaded function
+def times2(x: Int): Int = 2 * x
+def times2(x: String): Int = 2 * x.toInt
+
+times2(5)   // 10
+times2("7")   // 14
+

# Recursive and Nested Functions

def asciiTriangle(rows: Int) {
+
+    // This is cute: multiplying "X" makes a string with many copies of "X"
+    // Unit means no return value
+    def printRow(columns: Int): Unit = println("X" * columns)
+
+    if(rows > 0) {
+        printRow(rows)
+        asciiTriangle(rows - 1) // Here is the recursive call
+    }
+}
+
+// printRow(1) // This would not work, since we're calling printRow outside its scope
+asciiTriangle(6)
+
+// Output:
+XXXXXX
+XXXXX
+XXXX
+XXX
+XX
+X
+

# Named Parameters and Parameter Defaults

Consider the following method definition.

def myMethod(count: Int, wrap: Boolean, wrapValue: Int= 24): Unit= { ... }
+

When calling the method, you will often see the parameter names along with the passed-in values.

myMethod(count= 10, wrap= false, wrapValue= 23)
+

Using named parameters, you can even call the function with a different ordering.

myMethod(wrapValue= 23, wrap= false, count= 10)
+

For frequently called methods, the parameter ordering may be obvious. But for less common methods and, in particular, boolean arguments, including the names with calls can make your code a lot more readable. If methods have a long list of arguments of the same type, using names also decreases the chance of error. Parameters to class definitions also use this named argument scheme (they are actually just the parameters to the constructor method for the class).

When certain parameters have default values (that don't need to be overridden), callers only have to pass (by name) specific arguments that do not use defaults. Notice that the parameter  wrapValue has a default value of 24. Therefore, this will work as if 24 had been passed in.

myMethod(wrap= false, count= 10)
+

# Lists

val x = 7
+val y = 14
+val list1 = List(1, 2, 3)
+val list2 = x :: y :: y :: Nil       // An alternate notation for assembling a list
+                                     // Nil就是一个空的List[Nothing],即一个可以封装任何类型元素但又没有元素的容器
+
+val list3 = list1 ++ list2           // Appends the second list to the first list
+val m = list2.length
+val s = list2.size
+
+val headOfList = list1.head          // Gets the first element of the list
+val restOfList = list1.tail          // Get a new list with first element removed
+
+val third = list1(2)                 // Gets the third element of a list (0-indexed)
+
+// Output:
+x: Int = 7
+y: Int = 14
+list1: List[Int] = List(1, 2, 3)
+list2: List[Int] = List(7, 14, 14)
+list3: List[Int] = List(1, 2, 3, 7, 14, 14)
+m: Int = 3
+s: Int = 3
+headOfList: Int = 1
+restOfList: List[Int] = List(2, 3)
+third: Int = 3
+

# for Statement

for (i <- 0 to 7) { print(i + " ") } // include 7
+println()
+
+i <- 0 until 7 // exclude 7
+i <- 0 to 10 by 2
+

print 用于连续输出不换行,而 println 用于输出后换行。

<- 是用在 for 循环构造中的一个操作符,表示从一个集合中逐一取出元素

# Packages and Imports

  • package 用于定义一个命名空间,它可以包含类、对象和特质(traits),以及其他包。包主要用于组织和管理代码,防止命名冲突,并提供访问控制。
  • class 是定义数据结构及其行为的蓝图。它可以包含数据成员(属性)和方法。类用于实例化对象,每个对象都可以拥有不同的属性值。

import语句可以用来引入包、类、对象,甚至是特定的方法或属性。这意味着你可以使用import来引用几乎任何你需要的代码实体。以下是一些例子:

  • 引入一个包中的所有成员:import scala.collection.mutable._,这里的_相当于 Java 中的``,表示引入mutable包下的所有成员。
  • 引入一个特定的类:import scala.collection.mutable.ListBuffer,这表示只引入ListBuffer类。
  • 引入一个包中的多个类:import scala.collection.mutable.{ArrayBuffer, LinkedList},这表示同时引入ArrayBufferLinkedList两个类。
  • 引入一个对象中的特定成员:import java.lang.System.{out => stdout},这里还演示了将System.out重命名为stdout,以便在代码中使用简化的名称。
// 从chisel3.iotesters包中引入特定的几个类:ChiselFlatSpec、Driver、和PeekPokeTester
+import chisel3.iotesters.{ChiselFlatSpec, Driver, PeekPokeTester}
+

# Class

// WrapCounter counts up to a max value based on a bit size
+class WrapCounter(counterBits: Int) {
+
+  val max: Long = (1 << counterBits) - 1
+  var counter = 0L
+
+  def inc(): Long = {
+    counter = counter + 1
+    if (counter > max) {
+        counter = 0
+    }
+    counter
+  }
+  println(s"counter created with max value $max")
+}
+
  • class WrapCounter -- This is the definition of WrapCounter.
  • (counterBits: Int) -- Creating a WrapCounter requires an integer parameter, nicely named to suggest it is the bit width of the counter.
  • Braces ({}) delimit a block of code. Most classes use a code block to define variables, constants, and methods (functions).
  • val max: Long = -- the class contains a member variable max, declared as type Long and initialized as the class is created.
  • (1 << counterBits) - 1 computes the maximum value that can be contained in counterBits bits. Since max was created with val it cannot be changed.
  • A variable counter is created and initialized to 0L. The L says that 0 is a long value; thus, counter is inferred to be Long.
  • max and counter are commonly called member variables of the class.
  • A class method inc is defined which takes no arguments and returns a Long value.
  • The body of the method inc is a code block that has: +
    • counter = counter + 1 increments counter.
    • if (counter > max) { counter = 0 } tests if the counter is greater than the max value and sets it back to zero if it is.
    • counter -- The last line of the code block is important. +
      • Any value expressed as the last line of a code block is considered to be the return value of that code block. The return value can be used or ignored by the calling statement.
      • This applies quite generally; for example, since an if then else statement defines its true and false clauses with code blocks, it can return a value i.e., val result = if (10 * 10 > 90) "greater" else "lesser" would create a val with the value "greater".
    • So in this case the function inc returns the value of counter.
  • println(s"counter created with max value $max") prints a string to standard output. Because the println is directly in the defining code block, it is part of the class initialization code and is run, i.e. prints out the string, every time an instance of this class is created.
  • The string printed in this case is an interpolated string. +
    • The leading s in front of the first double quote identifies this as an interpolated string.
    • An interpolated string is processed at run time.
    • The $max is replaced with the value of max.
    • If the $ is followed by a code block, arbitrary Scala can be in that code block. +
      • For example, println(s"doubled max is ${max + max}").
      • The return value of this code block will be inserted in place of ${...}.
      • If the return value is not a string, it will be converted to one; virtually every class or type in scala has an implicit conversion to a string defined).
    • You should generally avoid printing something every time an instance of a class is created to avoid flooding standard output, unless you're debugging.

    # Creating an Instance of a Class

    val x = new WrapCounter(2)
    +x.inc() // Increments the counter
    +
    +// Member variables of the instance x are visible to the outside, unless they are declared private
    +if(x.counter == x.max) {
    +    println("counter is about to wrap")
    +}
    +
    +x inc() // Scala allows the dots to be omitted; this can be useful for making embedded DSL's look more natural
    +
    有时候实例化类时不需要使用new关键字,这通常是因为该类定义了一个或多个apply方法。apply方法可以在类的伴生对象(companion object)中定义,允许你直接通过类名加括号的方式创建类的实例,而不需要显式地使用new关键字。这种方式提供了一种更简洁的语法来创建对象,同时也可以在apply方法内部执行初始化操作或参数处理,为对象创建提供更多的灵活性和控制。 +例如,假设有一个名为Person的类及其伴生对象,伴生对象中定义了apply方法:
    class Person(val name: String)
    +
    +object Person {
    +  def apply(name: String): Person = new Person(name)
    +}
    +
    在这个例子中,可以通过调用Person伴生对象的apply方法来创建Person类的实例,而不需要使用new关键字:
    val person = Person("Alice")  // 相当于调用 Person.apply("Alice")
    +
    这里,Person("Alice")实际上调用的是伴生对象中的apply方法,该方法内部使用new关键字创建了Person类的实例。这种方式使得代码看起来更简洁,同时保留了通过构造函数创建对象的灵活性。

# Code Blocks

Code blocks are delimited by braces. A block can contain zero or more lines of Scala code. The last line of Scala code becomes the return value (which may be ignored) of the code block. A code block with no lines would return a special null-like object called Unit. Code blocks are used throughout Scala: they are the bodies of class definitions, they form function and method definitions, they are the clauses of if statements, and they are the bodies of for and many other Scala operators.

# Parameterized Code Blocks

Code blocks can take parameters. In the case of class and method definitions, these parameters look like those in most conventional programming languages. In the example below, c and s are parameters of the code blocks.

// A one-line code block doesn't need to be enclosed in {}
+def add1(c: Int): Int = c + 1
+
+class RepeatString(s: String) {
+    val repeatedString = s + s
+}
+

IMPORTANT: There is another way in which code blocks may be parameterized. Here is an example.

val intList = List(1, 2, 3)
+val stringList = intList.map { i =>
+    i.toString
+}
+

使用map方法对intList中的每个元素应用一个函数,该函数将整数转换为其对应的字符串表示。具体来说,map方法遍历intList中的每个元素(用i表示),并对每个元素执行i.toString操作,将其转换为字符串。This type of code block is called an anonymous function, and more details on anonymous functions are provided in a later module.

+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1 First Chisel Module.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1 First Chisel Module.html new file mode 100644 index 0000000..2178b76 --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1 First Chisel Module.html @@ -0,0 +1,265 @@ + + + + + + 2024.02.23-2.1 First Chisel Module | Personal Blog --from OutisLi + + + + + + + + +

# 2024.02.23-2.1 First Chisel Module

# Setup

val path = System.getProperty("user.dir") + "/source/load-ivy.sc"
+interp.load.module(ammonite.ops.Path(java.nio.file.FileSystems.getDefault().getPath(path)))
+import chisel3._
+import chisel3.util._
+import chisel3.tester._
+import chisel3.tester.RawTester.test
+import dotvisualizer._
+

这两句代码在使用 Chisel(一种硬件描述语言)时,涉及到 Ammonite 脚本的动态加载。第一句定义了一个path变量,它通过获取系统属性"user.dir"(当前用户目录)并附加上"/source/load-ivy.sc"路径,用于指定一个 Scala 脚本文件的位置。第二句使用 Ammonite 的interp.load.module方法动态加载这个指定路径下的 Scala 脚本文件。

动态加载脚本在使用 Chisel 编写代码时可以有多个用途,如:

  1. 引入依赖:动态加载load-ivy.sc脚本可以用来引入或更新 Ammonite 会话中的 Ivy 依赖,确保代码运行时有必要的库支持。
  2. 执行初始化代码:可以在脚本中执行必要的初始化操作,为后续的 Chisel 硬件设计代码执行设置适当的环境或参数。
  3. 灵活性和模块化:通过动态加载脚本,可以根据需要灵活地加载和卸载模块,使代码结构更加模块化,便于管理和维护。
  • import chisel3._:基础的 Chisel 功能,包括定义硬件组件的基本构建块。
  • import chisel3.util._:提供了一些实用工具和额外的硬件构建块,比如计数器、移位寄存器等。
  • import chisel3.tester._:提供了测试 Chisel 硬件设计的工具和框架。
  • import chisel3.tester.RawTester.test:是chisel3.tester中的一个具体的测试功能,用于执行硬件测试。

# Example Module

class Passthrough extends Module {
+  val io = IO(new Bundle {
+    val in = Input(UInt(4.W))
+    val out = Output(UInt(4.W))
+  })
+  io.out := io.in
+}
+
+// with parameter
+class PassthroughGenerator(width: Int) extends Module {
+  val io = IO(new Bundle {
+    val in = Input(UInt(width.W))
+    val out = Output(UInt(width.W))
+  })
+  io.out := io.in
+}
+
class Passthrough extends Module {
+

我们声明一个叫做Passthrough的新模块。Module是 Chisel 内置的一个类,所有硬件模块都必须扩展它

val io = IO(...)
+

我们在一个特殊的io变量中声明所有的输入和输出端口。它必须被命名为io,并且是一个IO对象或实例,这需要形如IO(_instantiated_bundle_)的东西

在 Chisel 中,ioinout被声明为val(不可变引用)而不是var(可变引用),因为它们代表硬件模块的接口。在硬件设计中,接口的结构(例如信号的数量、类型和方向)在编译时确定且不会改变。虽然信号的值在模拟过程中会变化,但信号的定义(即接口)是固定的。使用val声明这些接口强调了它们是不变的结构,而信号值的变化则通过信号之间的连接和赋值来体现,这与软件编程中变量的概念有所不同。

new Bundle {
+    val in = Input(...)
+    val out = Output(...)
+}
+

我们声明了一个新的硬件结构类型(Bundle),它包含了一些命名的信号inout,分别具有输入和输出的方向。

在 Chisel 中,Bundle是一种用于定义一组相关信号的类,类似于 Verilog 中的module内部信号或 VHDL 中的record。它允许开发者将多个信号组合成一个单一的复合类型,这样可以更方便地管理和传递数据结构。每个Bundle内的信号可以有不同的类型和方向(如输入Input、输出Output),使其成为定义模块接口和内部数据结构的强大工具。

UInt(4.W)
+

我们声明了信号的硬件类型。在这个案例中,它是宽度为 4 的无符号整数。

io.out := io.in
+

我们将我们的输入端口连接到我们的输出端口,这样io.in驱动io.out。注意,:=操作符是一个Chisel操作符,它表示右手边的信号驱动左手边的信号。它是一个有方向的操作符。

硬件构建语言(HCLs)的一个整洁之处在于我们可以使用底层的编程语言作为脚本语言。例如,在声明我们的 Chisel 模块之后,我们接着使用 Scala 调用 Chisel 编译器将 Chisel 的Passthrough翻译成 Verilog 的Passthrough。这个过程被称为精炼

# Generate Verilog

println(getVerilog(new Passthrough))
+
module Passthrough(
+  input        clock,
+  input        reset,
+  input  [3:0] io_in,
+  output [3:0] io_out
+);
+  assign io_out = io_in; // @[cmd2.sc 6:10]
+endmodule
+

# Generate Firrtl

println(getFirrtl(new Passthrough))
+
circuit Passthrough :
+  module Passthrough :
+    input clock : Clock
+    input reset : UInt<1>
+    output io : { flip in : UInt<4>, out : UInt<4>}
+
+    io.out <= io.in @[cmd2.sc 6:10]
+

# Example Tester

// Scala Code: `test` runs the unit test.
+// test takes a user Module and has a code block that applies pokes and expects to the
+// circuit under test (c)
+test(new Passthrough()) { c =>
+    c.io.in.poke(0.U)     // Set our input to value 0
+    c.io.out.expect(0.U)  // Assert that the output correctly has 0
+    c.io.in.poke(1.U)     // Set our input to value 1
+    c.io.out.expect(1.U)  // Assert that the output correctly has 1
+    c.io.in.poke(2.U)     // Set our input to value 2
+    c.io.out.expect(2.U)  // Assert that the output correctly has 2
+}
+println("SUCCESS!!") // Scala Code: if we get here, our tests passed!
+
+// Test with width 10
+test(new PassthroughGenerator(10)) { c =>
+    c.io.in.poke(0.U(10.W))     // Set our input to value 0
+    c.io.out.expect(0.U(10.W))  // Assert that the output correctly has 0
+    c.io.in.poke(1.U(10.W))     // Set our input to value 1
+    c.io.out.expect(1.U(10.W))  // Assert that the output correctly has 1
+    c.io.in.poke(2.U(10.W))     // Set our input to value 2
+		c.io.out.expect(2.U(10.W))  // Assert that the output correctly has 2
+}
+
  • c.io.in.poke(0.U):设置模块的输入in为 0。
  • c.io.out.expect(0.U):检查模块的输出out是否为 0,确保电路按预期工作。
  • 接下来,代码以相同的方式测试输入值 1 和 2,分别使用poke方法设置输入值,并用expect方法验证输出值。

在 Scala 中,可以直接在函数调用后跟一个代码块,这是因为 Scala 支持高阶函数,即可以接受函数作为参数的函数。在这个例子中,test函数接受两个参数:一个是Passthrough模块的实例,另一个是一个匿名函数(或称为代码块),这个匿名函数以c作为参数进行操作。这种语法使得代码更加简洁易读,允许直接在调用函数时定义行为逻辑,非常适合进行单元测试等场景。当一个函数的最后一个参数是函数类型时,可以使用特殊的语法糖允许将这个函数参数写在方法调用的外部。这种语法不仅使得代码更加清晰,而且在使用匿名函数或代码块作为参数时尤其有用,因为它允许代码块在视觉上更为突出,从而提高了代码的可读性。这就是为什么test(new Passthrough())后面可以直接跟一个代码块的原因。

c =>是一个函数字面量(匿名函数)的语法,用于定义一个函数。这里,c是函数的参数,=>后面跟着的是函数体。在这个上下文中,c代表传递给测试代码块的模块实例(如Passthrough模块实例),然后在代码块内部,你可以使用c来访问和操作这个实例的输入和输出端口。在 Scala 的函数字面量中,参数类型通常是通过上下文推断出来的,不需要显式声明。在test(new Passthrough()) { c => ... }这段代码中,c是由test函数根据其参数类型推断出的Passthrough模块实例。也就是说,当你写c =>时,c的类型(在这个例子中是Passthrough模块实例)是由test函数的定义确定的,根据这个函数期望的参数类型。这就是为什么可以直接使用c来访问Passthrough实例的成员,如c.io.inc.io.out,而不需要额外的类型声明。

Note that the `poke` and `expect` use chisel hardware literal notation. Both operations expect literals of the correct type.
+If `poke`ing a `UInt()` you must supply a `UInt` literal (example: `c.io.in.poke(10.U)`, likewise if the input is a `Bool()` the `poke` would expect either `true.B` or `false.B`.
+

# Appendix: A Note on "printf" Debugging

class PrintingModule extends Module {
+    val io = IO(new Bundle {
+        val in = Input(UInt(4.W))
+        val out = Output(UInt(4.W))
+    })
+    io.out := io.in
+
+    printf("Print during simulation: Input is %d\n", io.in)
+    // chisel printf has its own string interpolator too
+    printf(p"Print during simulation: IO is $io\n")
+
+    println(s"Print during generation: Input is ${io.in}")
+// s用于一般的Scala字符串插值,而p专门为Chisel设计,用于更方便地在仿真中打印硬件信号和对象
+}
+
+test(new PrintingModule ) { c =>
+    c.io.in.poke(3.U)
+    c.io.out.expect(3.U)
+    c.clock.step(5) // circuit will print
+
+    println(s"Print during testing: Input is ${c.io.in.peek()}")
+}
+
Elaborating design...
+Print during generation: Input is UInt<4>(IO in unelaborated PrintingModule)
+Done elaborating.
+Print during simulation: Input is   3
+Print during simulation: IO is AnonymousBundle(in ->   3, out ->   3)
+Print during simulation: Input is   3
+Print during simulation: IO is AnonymousBundle(in ->   3, out ->   3)
+Print during simulation: Input is   3
+Print during simulation: IO is AnonymousBundle(in ->   3, out ->   3)
+Print during simulation: Input is   3
+Print during simulation: IO is AnonymousBundle(in ->   3, out ->   3)
+Print during simulation: Input is   3
+Print during simulation: IO is AnonymousBundle(in ->   3, out ->   3)
+Print during testing: Input is UInt<4>(3)
+Print during simulation: Input is   0
+Print during simulation: IO is AnonymousBundle(in ->   0, out ->   0)
+test PrintingModule Success: 0 tests passed in 7 cycles in 0.003471 seconds 2016.88 Hz
+

这段代码定义了一个PrintingModule类,它扩展了 Chisel 的Module,用于演示在不同阶段打印信息:

  1. 模块定义中的printf语句:这些在仿真时每个时钟周期都会打印。printf("Print during simulation: Input is %d\n", io.in)会打印输入信号的值,而printf(p"Print during simulation: IO is $io\n")会打印io对象的信息。这些仅在仿真(运行时)生效。
  2. 模块定义中的println语句:这句话在模块的生成阶段打印,即代码编译时,打印到终端或控制台。它不会在仿真时打印,因为它是 Scala 的打印语句,不是 Chisel 的。
  3. 测试块中的println语句:这在 Scala 测试环境中执行,用于打印测试时的信息。如println(s"Print during testing: Input is ${c.io.in.peek()}")将在测试过程中打印输入信号的当前值。
  • c.io.in.poke(3.U)设置输入为 3。
  • c.io.out.expect(3.U)期望输出为 3,这个测试会通过,因为输出应该与输入相同。
  • c.clock.step(5)推进仿真时钟 5 个周期,这期间printf语句会打印信息。
  1. 最后的Print during simulation: Input is 0 是因为被重置回到默认状态
  2. 7 周期则是因为测试中执行了c.clock.step(5),推进了 5 个时钟周期,加上测试开始前后的各 1 个周期

综上,println用于代码生成阶段和测试代码中,打印到 Scala 的执行环境;printf用于仿真阶段,打印到仿真的输出中。

+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2 Combinational Logic.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2 Combinational Logic.html new file mode 100644 index 0000000..3af1666 --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2 Combinational Logic.html @@ -0,0 +1,322 @@ + + + + + + 2024.02.24-2.2 Combinational Logic | Personal Blog --from OutisLi + + + + + + + + +

# 2024.02.24-2.2 Combinational Logic

# Common Operators

class MyModule extends Module {
+  val io = IO(new Bundle {
+    val in  = Input(UInt(4.W))
+    val out = Output(UInt(4.W))
+  })
+
+	// Scala expression
+  val two  = 1 + 1
+  println(two)
+	// Chisel expression
+  val utwo = 1.U + 1.U
+  println(utwo)
+	// incorrect
+	val twotwo = 1.U + 1
+
+  io.out := io.in
+}
+
class MyOperators extends Module {
+  val io = IO(new Bundle {
+    val in      = Input(UInt(4.W))
+    val out_add = Output(UInt(4.W))
+    val out_sub = Output(UInt(4.W))
+    val out_mul = Output(UInt(4.W))
+  })
+
+  io.out_add := 1.U + 4.U
+  io.out_sub := 2.U - 1.U
+  io.out_mul := 4.U * 2.U
+}
+
+// 没有参数时可以省略小括号
+test(new MyOperators) {c =>
+  c.io.out_add.expect(5.U)
+  c.io.out_sub.expect(1.U)
+  c.io.out_mul.expect(8.U)
+}
+

# Mux and Concatenation

class MyOperatorsTwo extends Module {
+  val io = IO(new Bundle {
+    val in      = Input(UInt(4.W))
+    val out_mux = Output(UInt(4.W))
+    val out_cat = Output(UInt(4.W))
+  })
+
+  val s = true.B
+  io.out_mux := Mux(s, 3.U, 0.U) // should return 3.U, since s is true
+  io.out_cat := Cat(2.U, 1.U)    // concatenates 2 (b10) with 1 (b1) to give 5 (101)
+}
+
+println(getVerilog(new MyOperatorsTwo))
+
+test(new MyOperatorsTwo) { c =>
+  c.io.out_mux.expect(3.U)
+  c.io.out_cat.expect(5.U)
+}
+

The Mux operates like a traditional ternary operator, with the order (select, value if true, value if false)

The Cat ordering is MSB then LSB (where B refers to bit or bits), and only takes two arguments.

# MAC: multiply accumulate function

class MAC extends Module {
+  val io = IO(new Bundle {
+    val in_a = Input(UInt(4.W))
+    val in_b = Input(UInt(4.W))
+    val in_c = Input(UInt(4.W))
+    val out  = Output(UInt(8.W))
+  })
+
+  io.out := (io.in_a * io.in_b) + io.in_c
+}
+
+test(new MAC) { c =>
+  val cycles = 100
+  import scala.util.Random
+  for (i <- 0 until cycles) {
+    val in_a = Random.nextInt(16)
+    val in_b = Random.nextInt(16)
+    val in_c = Random.nextInt(16)
+    c.io.in_a.poke(in_a.U)
+    c.io.in_b.poke(in_b.U)
+    c.io.in_c.poke(in_c.U)
+    c.io.out.expect((in_a * in_b + in_c).U)
+  }
+}
+

# Arbiter

The following circuit arbitrates data coming from a FIFO into two parallel processing units. The FIFO and processing elements (PEs) communicate with ready-valid interfaces. Construct the arbiter to send data to whichever PE is ready to receive data, prioritizing PE0 if both are ready to receive data. Remember that the arbiter should tell the FIFO that it's ready to receive data when at least one of the PEs can receive data. Also, wait for a PE to assert that it's ready before asserting that the data are valid. You will likely need binary operators to complete this exercise.

Untitled

class Arbiter extends Module {
+  val io = IO(new Bundle {
+    // FIFO
+    val fifo_valid = Input(Bool())
+    val fifo_ready = Output(Bool())
+    val fifo_data  = Input(UInt(16.W))
+
+    // PE0
+    val pe0_valid  = Output(Bool())
+    val pe0_ready  = Input(Bool())
+    val pe0_data   = Output(UInt(16.W))
+
+    // PE1
+    val pe1_valid  = Output(Bool())
+    val pe1_ready  = Input(Bool())
+    val pe1_data   = Output(UInt(16.W))
+  })
+
+  io.fifo_ready := io.pe0_ready || io.pe1_ready
+  io.pe0_valid  := io.fifo_valid && io.pe0_ready
+  io.pe1_valid  := io.fifo_valid && !io.pe0_ready && io.pe1_ready
+  io.pe0_data   := io.fifo_data
+  io.pe1_data   := io.fifo_data
+}
+
+test(new Arbiter) { c =>
+  import scala.util.Random
+  val data = Random.nextInt(65536)
+  c.io.fifo_data.poke(data.U)
+
+  for (i <- 0 until 8) {
+    c.io.fifo_valid.poke((((i >> 0) % 2) != 0).B)
+    c.io.pe0_ready.poke((((i >> 1) % 2) != 0).B)
+    c.io.pe1_ready.poke((((i >> 2) % 2) != 0).B)
+
+    c.io.fifo_ready.expect((i > 1).B)
+    c.io.pe0_valid.expect((i == 3 || i == 7).B)
+    c.io.pe1_valid.expect((i == 5).B)
+
+    if (i == 3 || i ==7) {
+      c.io.pe0_data.expect((data).U)
+    } else if (i == 5) {
+      c.io.pe1_data.expect((data).U)
+    }
+  }
+}
+println("SUCCESS!!")
+

数据线(如io.pe0_dataio.pe1_data)通常会持续地带有它们可能需要使用的数据信号(本例中为io.fifo_data)。但是,这些数据是否被“接收”或“采用”通常由valid信号来控制。

测试代码设计用来验证Arbiter模块的行为。测试通过随机生成一个数据,然后使用不同的组合的fifo_validpe0_readype1_ready信号来模拟不同的工作情况。

  • c.io.fifo_data.poke(data.U)模拟从 FIFO 发送的数据。
  • 循环for (i <- 0 until 8)遍历 8 种不同的信号组合状态。
  • c.io.fifo_valid.pokec.io.pe0_ready.pokec.io.pe1_ready.poke根据i的不同值模拟不同的信号状态,使用位操作来确定每个信号是否应该被激活。
  • c.io.fifo_ready.expectc.io.pe0_valid.expectc.io.pe1_valid.expect是对仲裁器预期行为的断言检查。
  • 如果i的值表示 PE0 或 PE1 应该接收数据(如i == 3 || i == 7是 PE0,i == 5是 PE1),则使用expect断言来检查io.pe0_dataio.pe1_data与 FIFO 的数据相同。

# Parameterized Adder

class ParameterizedAdder(saturate: Boolean) extends Module {
+  val io = IO(new Bundle {
+    val in_a = Input(UInt(4.W))
+    val in_b = Input(UInt(4.W))
+    val out  = Output(UInt(4.W))
+  })
+  val sum = io.in_a +& io.in_b
+  if(saturate){
+    io.out := Mux(sum>15.U,15.U,sum)
+  }else{
+    io.out := sum
+  }
+}
+
+for (saturate <- Seq(true, false)) {
+  test(new ParameterizedAdder(saturate)) { c =>
+    // 100 random tests
+    val cycles = 100
+    import scala.util.Random
+    import scala.math.min
+    for (i <- 0 until cycles) {
+      val in_a = Random.nextInt(16)
+      val in_b = Random.nextInt(16)
+      c.io.in_a.poke(in_a.U)
+      c.io.in_b.poke(in_b.U)
+      if (saturate) {
+        c.io.out.expect(min(in_a + in_b, 15).U)
+      } else {
+        c.io.out.expect(((in_a + in_b) % 16).U)
+      }
+    }
+
+    // ensure we test saturation vs. truncation
+    c.io.in_a.poke(15.U)
+    c.io.in_b.poke(15.U)
+    if (saturate) {
+      c.io.out.expect(15.U)
+    } else {
+      c.io.out.expect(14.U)
+    }
+  }
+}
+println("SUCCESS!!")
+

在 Chisel 中,+&是一个用于加法的运算符,它会考虑输入的进位,得到一个比最大输入位宽更宽的结果。如果输入是 4 位UInt,标准加法结果io.in_a + io.in_b会是 4 位,可能会截断超出的位。而+&加法会产生一个 5 位的结果,这可以用于在必要时实现饱和加法逻辑。连接一个 4 位的UInt线到一个 5 位的UInt线(一个 4.W 的量等于 5.W 的量),默认会截断最高位(MSB)。这样,你可以用这个方法来轻松实现非饱和加法器,只保留 5 位和的低 4 位。

+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3 Control Flow.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3 Control Flow.html new file mode 100644 index 0000000..487e28a --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3 Control Flow.html @@ -0,0 +1,285 @@ + + + + + + 2024.02.25-2.3 Control Flow | Personal Blog --from OutisLi + + + + + + + + +

# 2024.02.25-2.3 Control Flow

# Last Connect Semantics

class LastConnect extends Module {
+  val io = IO(new Bundle {
+    val in = Input(UInt(4.W))
+    val out = Output(UInt(4.W))
+  })
+  io.out := 1.U
+  io.out := 2.U
+  io.out := 3.U
+  io.out := 4.U
+}
+
+//  Test LastConnect
+test(new LastConnect) { c => c.io.out.expect(4.U) }
+

当有多个值被赋值给一个量时,最后的那个生效

# when, elsewhen, and otherwise

when(someBooleanCondition) {
+  // things to do when true
+}.elsewhen(someOtherBooleanCondition) {
+  // things to do on this condition
+}.otherwise {
+  // things to do if none of th boolean conditions are true
+}
+

when是一种特殊的构造,它用于硬件生成。它类似于软件编程中的if语句,但是在硬件描述中,when会生成实际的硬件逻辑,如多路复用器。而标准的if语句通常用于生成时(编译时)的控制流,并不直接生成硬件。if语句在 Scala(因此在 Chisel 的生成时)可以有返回值,可以用于赋值或者作为表达式的一部分。相比之下,when是一种专门为硬件设计提供的控制结构,用于生成条件硬件逻辑,如多路复用器或条件赋值,但它不返回值。因此,当你需要根据输入信号在运行时动态地选择硬件行为时,你会使用when。而当你在编译时根据某些条件生成不同的硬件模块时,你会使用if

在 Scala 中,==用于基本类型和对象的相等性比较,而在 Chisel 中(一个建立在 Scala 之上的硬件构建语言),===用于硬件信号之间的相等性比较。这是因为 Chisel 需要区分硬件操作和 Scala 的软件操作,===在 Chisel 中被定义为生成硬件电路中的等于比较逻辑。而在 Scala 的if语句中,==仍然用于比较两个值是否相等。这种区分确保了代码的清晰性,以及硬件设计中逻辑正确性的维护。因此,在when中使用===来生成判断相等的硬件电路

# The Wire Construct

Wire是一种基本的硬件构造类型,用于创建一个可以在模块内部读取和写入的信号。它主要用于表示组合逻辑或暂存数据,允许在硬件描述中定义中间变量或内部连接。使用Wire时,需要指定信号的数据类型,如UIntSInt等。Wire类型的变量在定义时不持有初始值,需要在逻辑中显式赋值。在使用过程中,可以根据需要多次对其赋值,但在每个时钟周期结束时,Wire仅保留最后一次赋值的结果。val myWire = Wire(UInt(32.W))

List(1, 2, 3, 4).permutations.foreach { case i0 :: i1 :: i2 :: i3 :: Nil =>
+    println(s"Sorting $i0 $i1 $i2 $i3")}
+List(1, 2, 3, 4).permutations.foreach { case i0 :: i1 :: i2 :: _ :: Nil =>
+  println(s"Sorting $i0 $i1 $i2")}
+

使用 Scala 的集合和模式匹配功能来遍历List(1, 2, 3, 4)的所有排列组合。List(1, 2, 3, 4).permutations生成一个包含所有可能排列的列表的迭代器。foreach循环遍历这些排列。

foreach的代码块中,case i0 :: i1 :: i2 :: i3 :: Nil =>是一个模式匹配表达式,用于解构每个排列列表。这个表达式匹配一个包含四个元素的列表,将这四个元素分别绑定到变量i0i1i2i3Nil在这里表示列表的末尾,确保列表只有这四个元素。这种方式允许直接访问每个排列中的元素,然后可以将它们打印出来或用于其他逻辑操作。

# Exercise: Polynomial

class Polynomial extends Module {
+  val io = IO(new Bundle {
+    val select = Input(UInt(2.W))
+    val x = Input(SInt(32.W))
+    val fOfX = Output(SInt(32.W))
+  })
+
+  val result = Wire(SInt(32.W))
+  val square = Wire(SInt(32.W))
+
+  square := io.x * io.x
+  when(io.select === 0.U){
+    result := square - 2.S * io.x + 1.S
+  }.elsewhen(io.select === 1.U) {
+    result := 2.S * square + 6.S * io.x + 3.S
+  }.otherwise {
+    result := 4.S * square - 10.S * io.x - 5.S
+  }
+
+  io.fOfX := result
+}
+
+// Test Polynomial
+test(new Polynomial) { c =>
+  for(x <- 0 to 20) {
+    for(select <- 0 to 2) {
+      c.io.select.poke(select.U)
+      c.io.x.poke(x.S)
+      c.io.fOfX.expect(poly(select, x).S)
+    }
+  }
+}
+

# Exercise: Finite State Machine

Grad students pass through four states in their career: Idle, Coding, Writing, and Graduating. These states transition based off three inputs: Coffee, Ideas they come up with, and Pressure from their advisor to make progress. Once they Graduate, they return to the Idle state. The FSM diagram below shows these states and transitions. Any unlabelled transition (i.e. when there are no inputs) returns a grad student to the Idle state instead of staying in the current state. The input precedence is coffee > idea > pressure, so when in the Idle state and receiving both coffee and pressure, a graduate student will move to the Coding state.

Untitled

检查逻辑:

// state map
+def states = Map("idle" -> 0, "coding" -> 1, "writing" -> 2, "grad" -> 3)
+
+// life is full of question marks
+def gradLife (state: Int, coffee: Boolean, idea: Boolean, pressure: Boolean): Int = {
+  var nextState = states("idle")
+  if(state == states("idle")){
+    if(coffee) nextState = states("coding")
+    else if(idea) nextState = states("idle")
+    else if(pressure) nextState = states("writing")
+    else nextState = states("idle")
+  }else if(state == states("coding")){
+    if(coffee) nextState = states("coding")
+    else if(idea) nextState = states("writing")
+    else if(pressure) nextState = states("writing")
+    else nextState = states("idle")
+  }else if(state == states("writing")){
+    if(coffee) nextState = states("writing")
+    else if(idea) nextState = states("writing")
+    else if(pressure) nextState = states("grad")
+    else nextState = states("idle")
+  }
+  nextState
+}
+
+// some sanity checks
+(0 until states.size).foreach{ state => assert(gradLife(state, false, false, false) == states("idle")) }
+assert(gradLife(states("writing"), true, false, true) == states("writing"))
+assert(gradLife(states("idle"), true, true, true) == states("coding"))
+assert(gradLife(states("idle"), false, true, true) == states("idle"))
+assert(gradLife(states("grad"), false, false, false) == states("idle"))
+

Chisel:

class GradLife extends Module {
+  val io = IO(new Bundle {
+    val state = Input(UInt(2.W))
+    val coffee = Input(Bool())
+    val idea = Input(Bool())
+    val pressure = Input(Bool())
+    val nextState = Output(UInt(2.W))
+  })
+
+  val idle :: coding :: writing :: grad :: Nil = Enum(4)
+
+  when(io.state === idle){
+    when(io.coffee) {io.nextState := coding}
+    .elsewhen(io.idea) {io.nextState := idle}
+    .elsewhen(io.pressure) {io.nextState := writing}
+    .otherwise {io.nextState := idle}
+  } .elsewhen (io.state === coding) {
+    when      (io.coffee) { io.nextState := coding }
+    .elsewhen (io.idea || io.pressure) { io.nextState := writing }
+    .otherwise {io.nextState := idle}
+  } .elsewhen (io.state === writing) {
+    when      (io.coffee || io.idea) { io.nextState := writing }
+    .elsewhen (io.pressure) { io.nextState := grad }
+    .otherwise {io.nextState := idle}
+  }.otherwise {io.nextState := idle}
+}
+
+// Test
+test(new GradLife) { c =>
+  // verify that the hardware matches the golden model
+  for (state <- 0 to 3) {
+    for (coffee <- List(true, false)) {
+      for (idea <- List(true, false)) {
+        for (pressure <- List(true, false)) {
+          c.io.state.poke(state.U)
+          c.io.coffee.poke(coffee.B)
+          c.io.idea.poke(idea.B)
+          c.io.pressure.poke(pressure.B)
+          c.io.nextState.expect(gradLife(state, coffee, idea, pressure).U)
+        }
+      }
+    }
+  }
+}
+
+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4 Sequential Logic.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4 Sequential Logic.html new file mode 100644 index 0000000..57e069f --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4 Sequential Logic.html @@ -0,0 +1,297 @@ + + + + + + 2024.02.26-2.4 Sequential Logic | Personal Blog --from OutisLi + + + + + + + + +

# 2024.02.26-2.4 Sequential Logic

# Registers

A Reg holds its output value until the rising edge of its clock, at which time it takes on the value of its input.

class RegisterModule extends Module {
+  val io = IO(new Bundle {
+    val in  = Input(UInt(12.W))
+    val out = Output(UInt(12.W))
+  })
+
+	// val register : UInt = Reg(UInt(12.W))
+  val register = Reg(UInt(12.W))
+  register := io.in + 1.U
+  io.out := register
+}
+
+test(new RegisterModule) { c =>
+  for (i <- 0 until 100) {
+    c.io.in.poke(i.U)
+    c.clock.step(1)
+    c.io.out.expect((i + 1).U)
+  }
+}
+println("SUCCESS!!")
+

Notice: One important note is that Chisel distinguishes between types (like UInt) and hardware nodes (like the literal 2.U, or the output of myReg).

// legal because a Reg needs a data type as a model
+val myReg = Reg(UInt(2.W))
+// error because `2.U` is already a hardware node and can't be used as a model
+val myReg = Reg(2.U)
+

# RegInit

The register in RegisterModule was initialized to random data for simulation. Unless otherwised specified, registers do not have a reset value (or a reset). The way to create a register that resets to a given value is with RegInit.

// The first argument is a type node that specified the datatype and its width.
+// The second argument is a hardware node that specified the reset value, in this case 0.
+val myReg = RegInit(UInt(12.W), 0.U)
+
+// It is a hardware node that specifies the reset value, but normally `0.U`.
+val myReg = RegInit(0.U(12.W))
+

RegInit 不仅初始化,也创建了这个 reg,因此不需要先创建再 init

class RegInitModule extends Module {
+  val io = IO(new Bundle {
+    val in  = Input(UInt(12.W))
+    val out = Output(UInt(12.W))
+  })
+
+  val register = RegInit(0.U(12.W))
+  register := io.in + 1.U
+  io.out := register
+}
+

# RegNext

RegNext 在 Chisel 中是一个用于创建寄存器并在下一个时钟周期将输入信号的值传递给该寄存器的便捷方法。它简化了寄存器的声明和初始化,使得您可以轻松地创建一个将当前输入信号的值保存到下一个时钟周期的寄存器。使用RegNext时,可以指定一个初始值,如果不指定,则寄存器在复位时的值是未定义的

在 Chisel 中使用 RegNext 的基本语法如下:

val myReg = RegNext(inputSignal, initValue)
+
  • inputSignal 是你希望在下一个时钟周期传递给寄存器的信号。
  • initValue 是可选参数,用于指定寄存器在复位时的初始值。如果不提供初始值,寄存器在复位时的值是未定义的。

# Shift Register

Untitled

class MyShiftRegister(val init: Int = 1) extends Module {
+  val io = IO(new Bundle {
+    val in  = Input(Bool())
+    val out = Output(UInt(4.W))
+  })
+
+  val state = RegInit(UInt(4.W), init.U)
+  val stateTemp = (state << 1.U) + io.in.asUInt
+  state := stateTemp
+  io.out := state
+}
+
+test(new MyShiftRegister()) { c =>
+  var state = c.init
+  for (i <- 0 until 10) {
+    // poke in LSB of i (i % 2)
+    c.io.in.poke(((i % 2) != 0).B)
+    // update expected state
+    state = ((state * 2) + (i % 2)) & 0xf
+    c.clock.step(1)
+    c.io.out.expect(state.U)
+  }
+}
+println("SUCCESS!!")
+

# Parameterized Shift Register

// n is the output width (number of delays - 1)
+// init state to init
+class MyOptionalShiftRegister(val n: Int, val init: BigInt = 1) extends Module {
+  val io = IO(new Bundle {
+    val en  = Input(Bool())
+    val in  = Input(Bool())
+    val out = Output(UInt(n.W))
+  })
+
+  val state = RegInit(init.U(n.W))
+
+  when(io.en){
+    state := state << 1 | io.in
+  }
+  io.out := state
+}
+
+// test different depths
+for (i <- Seq(3, 4, 8, 24, 65)) {
+  println(s"Testing n=$i")
+  test(new MyOptionalShiftRegister(n = i)) { c =>
+    val inSeq = Seq(0, 1, 1, 1, 0, 1, 1, 0, 0, 1)
+    var state = c.init
+    var i = 0
+    c.io.en.poke(true.B)
+    while (i < 10 * c.n) {
+      // poke in repeated inSeq
+      val toPoke = inSeq(i % inSeq.length)
+      c.io.in.poke((toPoke != 0).B)
+      // update expected state
+      state = ((state * 2) + toPoke) & BigInt("1"*c.n, 2)
+      c.clock.step(1)
+      c.io.out.expect(state.U)
+
+      i += 1
+    }
+  }
+}
+println("SUCCESS!!")
+

Notice: Chisel 中变量被声明为常量val,因此一个变量只能被赋值一次,因为这表示硬件电路连接,但是会根据输入等的不同而具有不同的值。因此不能多次给一个变量赋值,如果需要,可以把中间值重新命名为一个val来调用

# Appendix: Explicit clock and reset

Chisel 模块默认使用隐式的时钟和复位信号,每个内部创建的寄存器都会使用这些默认信号。在某些情况下,你可能需要覆盖这种默认行为,比如使用生成时钟或复位信号的黑盒,或者设计多时钟系统。Chisel 提供了withClock() {}withReset() {}withClockAndReset() {}等构造来处理这些情况,允许分别或同时覆盖时钟和复位。需要注意的是,至本教程编写时,复位信号总是同步的并且是Bool类型。时钟在 Chisel 中有其自身的类型(Clock),并且应该相应声明。Bool类型可以通过调用asClock()转换为Clock类型,但需要确保这样做是合理的。同时,chisel-testers目前对多时钟设计的支持并不完全。

# Example: Multi-Clock Module

// we need to import multi-clock features
+import chisel3.experimental.{withClock, withReset, withClockAndReset}
+
+class ClockExamples extends Module {
+  val io = IO(new Bundle {
+    val in = Input(UInt(10.W))
+    val alternateReset    = Input(Bool())
+    val alternateClock    = Input(Clock())
+    val outImplicit       = Output(UInt())
+    val outAlternateReset = Output(UInt())
+    val outAlternateClock = Output(UInt())
+    val outAlternateBoth  = Output(UInt())
+  })
+
+  val imp = RegInit(0.U(10.W))
+  imp := io.in
+  io.outImplicit := imp
+
+  withReset(io.alternateReset) {
+    // everything in this scope with have alternateReset as the reset
+    val altRst = RegInit(0.U(10.W))
+    altRst := io.in
+    io.outAlternateReset := altRst
+  }
+
+  withClock(io.alternateClock) {
+    val altClk = RegInit(0.U(10.W))
+    altClk := io.in
+    io.outAlternateClock := altClk
+  }
+
+  withClockAndReset(io.alternateClock, io.alternateReset) {
+    val alt = RegInit(0.U(10.W))
+    alt := io.in
+    io.outAlternateBoth := alt
+  }
+}
+
+println(getVerilog(new ClockExamples))
+

通过import chisel3.experimental.{withClock, withReset, withClockAndReset}引入了多时钟特性。ClockExamples模块定义了一个 10 位宽的输入io.in,以及替代的复位和时钟信号io.alternateResetio.alternateClock。模块输出了四种不同情况下的寄存器值:使用默认时钟和复位、只替换复位、只替换时钟、同时替换时钟和复位。

  1. withReset(io.alternateReset) {...}块定义了一个新的作用域,其中所有寄存器的复位信号被替换为io.alternateReset。在这个作用域内,altRst寄存器在被替代复位信号复位时初始化为 0,并在每个时钟周期将io.in的值赋给它。
  2. withClock(io.alternateClock) {...}块定义了另一个作用域,其中所有寄存器的时钟信号被替换为io.alternateClock。在这个作用域内,altClk寄存器在被替代时钟信号驱动时初始化为 0,并在每个时钟周期将io.in的值赋给它。
  3. withClockAndReset(io.alternateClock, io.alternateReset) {...}块同时替换了寄存器的时钟和复位信号为io.alternateClockio.alternateReset。在这个作用域内,alt寄存器同时被替代的时钟和复位信号控制,初始化为 0,并在每个时钟周期将io.in的值赋给它。
+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5 FIR Filter.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5 FIR Filter.html new file mode 100644 index 0000000..d87f7fd --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5 FIR Filter.html @@ -0,0 +1,191 @@ + + + + + + 2024.02.28-2.5 FIR Filter | Personal Blog --from OutisLi + + + + + + + + +

# 2024.02.28-2.5 FIR Filter

Untitled

class My4ElementFir(b0: Int, b1: Int, b2: Int, b3: Int) extends Module {
+  val io = IO(new Bundle {
+    val in = Input(UInt(8.W))
+    val out = Output(UInt(8.W))
+  })
+
+  val reg_1 = RegInit(0.U(8.W))
+  val reg_2 = RegInit(0.U(8.W))
+  val reg_3 = RegInit(0.U(8.W))
+
+  reg_1 := io.in
+  reg_2 := reg_1
+  reg_3 := reg_2
+
+	// 或者使用RegNext来一并定义初始化及赋值
+	val reg_1 = RegNext(io.in, 0.U)
+	val reg_2 = RegNext(reg_1, 0.U)
+	val reg_3 = RegNext(reg_2, 0.U)
+
+  io.out := b0.U(8.W) * io.in + b1.U(8.W) * reg_1 + b2.U(8.W) * reg_2 + b3.U(8.W) * reg_3
+}
+

# FIR Filter Generator

一个有限脉冲响应(FIR)滤波器生成器。生成器的length参数决定了滤波器的抽头数目,即滤波器的长度。这个生成器有三个输入:in(滤波器的输入信号)、valid(一个布尔值,表示输入是否有效)和consts(一个向量,包含所有抽头的系数)。还有一个输出out,即滤波器的输出。

  • taps是一个序列,包含输入和一系列寄存器,用于实现滤波器的延迟线。
  • valid信号为真时,序列中的每个元素(除了第一个)被更新为前一个元素的值。
  • 输出out是抽头值和对应系数乘积之和。

这个结构允许滤波器动态处理不同长度的输入,通过改变consts向量的内容来改变滤波器的特性。

class MyManyDynamicElementVecFir(length: Int) extends Module {
+  val io = IO(new Bundle {
+    val in = Input(UInt(8.W))
+    val valid = Input(Bool())
+    val out = Output(UInt(8.W))
+    val consts = Input(Vec(length, UInt(8.W)))
+  })
+
+  // Such concision! You'll learn what all this means later.
+  val taps = Seq(io.in) ++ Seq.fill(io.consts.length - 1)(RegInit(0.U(8.W)))
+  taps.zip(taps.tail).foreach { case (a, b) => when (io.valid) { b := a } }
+
+  io.out := taps.zip(io.consts).map { case (a, b) => a * b }.reduce(_ + _)
+}
+
+visualize(() => new MyManyDynamicElementVecFir(4))
+
  1. val io = IO(new Bundle {...})定义了模块的接口,包括 8 位宽的输入in,一个有效信号valid,8 位宽输出out,和长度为length的系数向量consts

  2. val taps = Seq(io.in) ++ Seq.fill(io.consts.length - 1)(RegInit(0.U(8.W)))这行代码在 FIR 滤波器实现中创建了一个名为taps的序列,用于存储当前和之前的输入值,从而实现数据的时间序列延迟。首先,它将输入信号io.in作为序列的第一个元素。随后,使用++操作符将io.in与一个新的序列连接起来,后者通过Seq.fill(io.consts.length - 1)(RegInit(0.U(8.W)))创建,其中包含length - 1个初始化为 0 的 8 位寄存器。这样,taps序列就包含了一个输入信号和length - 1个延迟寄存器,总共length个元素,每个元素对应滤波器的一个抽头。在 Chisel 中,虽然io.in不是寄存器,但taps序列可以包含不同类型的元素,因为在 Chisel 里,所有这些都被视为Data类型的子类,可以被综合为硬件。在这个上下文中,io.in是直接的输入信号,而后续元素是寄存器类型,但它们共同构成了一个序列,用于表示滤波器的不同时间点上的信号值。这种混合类型的序列是可行的,并可以在 Chisel 生成的硬件中正确表达相应的逻辑。

  3. taps.zip(taps.tail).foreach { case (a, b) => when (io.valid) { b := a } }在输入valid为真时,将taps序列中每个元素的值传递到下一个元素,实现数据在寄存器间的移动。

    zip是一个方法,它将两个集合中对应位置的元素组成一对,生成一个新的集合。在这里,taps.zip(taps.tail)的作用是将taps列表中的每个元素与其后面的元素配对。tail是一个方法,返回除第一个元素外的列表所有元素。例如,如果taps[in, reg1, reg2, reg3],那么taps.tail就是[reg1, reg2, reg3]taps.zip(taps.tail)的结果将是[(in, reg1), (reg1, reg2), (reg2, reg3)]。这样,foreach就可以遍历这些配对,根据valid信号更新寄存器的值,实现数据的逐级传递。

    case (a, b) =>是模式匹配的语法,用于解构元组,将zip操作生成的元素对分别赋值给a(当前元素)和b(下一个元素)。

  4. io.out := taps.zip(io.consts).map { case (a, b) => a * b }.reduce(_ + _)计算输出out,即将每个延迟元素与其对应的系数相乘,并将所有乘积求和得到最终结果。

    在这段代码中,mapreduce是 Scala 中的集合操作方法:

    • map:对集合中的每个元素应用一个函数。这里map { case (a, b) => a * b }对每对(a, b)应用乘法操作,a来自tapsb来自io.consts,分别代表寄存器中的数据和滤波器的系数。
    • reduce:对集合中的元素应用一个二元操作,逐步将集合减少为单一结果。这里的reduce(_ + _)将所有乘法结果相加,得到最终的滤波输出。

    不使用foreach是因为foreach仅用于执行操作而不返回结果,而这里的目的是计算经过滤波器后的输出值,需要通过mapreduce聚合计算结果。

+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6 More on ChiselTest.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6 More on ChiselTest.html new file mode 100644 index 0000000..e6df0bd --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6 More on ChiselTest.html @@ -0,0 +1,188 @@ + + + + + + 2024.02.29-2.6 More on ChiselTest | Personal Blog --from OutisLi + + + + + + + + +

# 2024.02.29-2.6 More on ChiselTest

iotesters ChiselTest
poke poke(c.io.in1, 6) c.io.in1.poke(6.U)
peek peek(c.io.out1) c.io.out1.peek()
expect expect(c.io.out1, 6) c.io.out1.expect(6.U)
step step(1) c.clock.step(1)
initiate Driver.execute(...) { c => test(...) { c =>

# Modules with Decoupled Interfaces

class QueueModule[T <: Data](ioType: T, entries: Int) extends MultiIOModule {
+  val in = IO(Flipped(Decoupled(ioType)))
+  val out = IO(Decoupled(ioType))
+  out <> Queue(in, entries)
+}
+
  1. class QueueModule[T <: Data](ioType: T, entries: Int) extends MultiIOModule 定义了一个泛型队列模块,其中T <: Data表示TData类型或其子类型。ioType是队列中数据的类型,entries是队列的大小。
  2. Decoupled(ioType)是一个 Chisel 提供的高级接口,自动包含了validbitsready信号。validbits组合用于传输有效数据,而ready信号用于流量控制。当你声明一个Decoupled接口时,这些信号都会被自动创建。
  3. IO(Flipped(Decoupled(ioType))) 创建了一个输入端口,Flipped意味着通常的输入输出方向被反转(即原本是输出的validbits成为输入,原本是输入的ready成为输出),Decoupled表示它是一个可以被反压的接口。
  4. out <> Queue(in, entries) 将输出端口out连接到一个新建的Queue实例,Queue(in, entries)创建了一个队列,其中in是输入端口,entries是队列大小。<>是连接操作符,表示双向连接。确保了数据可以从in流向队列,经过处理后,再从队列流向out

# EnqueueNow and expectDequeueNow

EnqueueNowexpectDequeueNow是用于测试队列行为的方法。EnqueueNow用于立即将数据入队,而不需要等待队列准备好。expectDequeueNow用于立即从队列中出队数据,并验证其值是否符合预期。这两个方法都是在基于队列的测试中非常有用,使得测试代码可以直接控制和验证队列中数据的流动。这样,测试者可以确保队列正确地处理了入队和出队操作,并且数据的传输符合设计的预期。

test(new QueueModule(UInt(9.W), entries = 200)) { c =>
+    // Example testsequence showing the use and behavior of Queue
+    c.in.initSource()
+    c.in.setSourceClock(c.clock)
+    c.out.initSink()
+    c.out.setSinkClock(c.clock)
+
+    val testVector = Seq.tabulate(200){ i => i.U }
+
+    testVector.zip(testVector).foreach { case (in, out) =>
+      c.in.enqueueNow(in)
+      c.out.expectDequeueNow(out)
+    }
+}
+

There is some required boiler plate initSource, setSourceClock, etc that is necessary to ensure that the ready and valid fields are all initialized correctly at the beginning of the test.

# EnqueueSeq and DequeueSeq

EnqueueSeq 允许你一次性将一个序列的元素批量入队,这对于测试需要连续多个数据处理的场景特别有用。DequeueSeq, 相应地,用于一次性从队列中出队多个元素,并验证这些元素是否符合预期的序列。enqueueSeq must finish before the expectDequeueSeq can begin. This example would fail if the testVector's size is made larger than the queue depth, because the queue would fill up and not be able to complete the enqueueSeq.

# Fork and Join

forkjoin用于创建并发测试,允许同时执行多个操作或测试场景。使用fork可以启动一个并发的测试过程,这个过程可以与主测试流程同时运行。可以在fork后使用多个测试命令定义并发执行的操作。随后,join用于等待所有并发启动的测试过程完成。这样,你可以在一个测试中执行多个并行操作,例如同时对多个模块输入不同的信号,或者同时观察多个输出。这在需要模拟复杂交互或并行处理时特别有用。

test(new QueueModule(UInt(9.W), entries = 200)) { c =>
+    // Example testsequence showing the use and behavior of Queue
+    c.in.initSource()
+    c.in.setSourceClock(c.clock)
+    c.out.initSink()
+    c.out.setSinkClock(c.clock)
+
+    val testVector = Seq.tabulate(300){ i => i.U }
+
+    fork {
+        c.in.enqueueSeq(testVector)
+    }.fork {
+        c.out.expectDequeueSeq(testVector)
+    }.join()
+}
+

虽然fork启动了两个并发过程,似乎表明c.in.enqueueSeq(testVector)c.out.expectDequeueSeq(testVector)应该同时执行,但实际上,它们在逻辑上是有先后顺序的。enqueueSeq首先向队列中填充数据,而expectDequeueSeq则等待这些数据从队列中出现并验证它们。在 ChiselTest 中,fork创建的并发线程会同时开始执行,但是expectDequeueSeq自然会在等待有数据可以出队之后才开始验证,确保了数据的正确流向和测试的逻辑顺序。

+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1 Generators Parameters.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1 Generators Parameters.html new file mode 100644 index 0000000..6d0a016 --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1 Generators Parameters.html @@ -0,0 +1,409 @@ + + + + + + 2024.03.01-3.1 Generators: Parameters | Personal Blog --from OutisLi + + + + + + + + +

# 2024.03.01-3.1 Generators: Parameters

# Parameter Passing

# Example: Parameterized Scala Object

class ParameterizedScalaObject(param1: Int, param2: String) {
+  println(s"I have parameters: param1 = $param1 and param2 = $param2")
+}
+val obj1 = new ParameterizedScalaObject(4,     "Hello")
+val obj2 = new ParameterizedScalaObject(4 + 2, "World")
+

# Example: Parameterized Chisel Object

class ParameterizedWidthAdder(in0Width: Int, in1Width: Int, sumWidth: Int) extends Module {
+  require(in0Width >= 0)
+  require(in1Width >= 0)
+  require(sumWidth >= 0)
+  val io = IO(new Bundle {
+    val in0 = Input(UInt(in0Width.W))
+    val in1 = Input(UInt(in1Width.W))
+    val sum = Output(UInt(sumWidth.W))
+  })
+  // a +& b includes the carry, a + b does not
+  io.sum := io.in0 +& io.in1
+}
+
+println(getVerilog(new ParameterizedWidthAdder(1, 4, 6)))
+

The above code block has some require(...) statements. These are pre-elaboration assertions, which are useful when your generator only works with certain parameterizations or when some parameterizations are mutually exclusive or nonsensical. The above code block checks that widths are non-negative.

# Example: Parameterized 4-input Sort

Untitled

/ Sort4 sorts its 4 inputs to its 4 outputs */
+class Sort4(ascending: Boolean) extends Module {
+  val io = IO(new Bundle {
+    val in0 = Input(UInt(16.W))
+    val in1 = Input(UInt(16.W))
+    val in2 = Input(UInt(16.W))
+    val in3 = Input(UInt(16.W))
+    val out0 = Output(UInt(16.W))
+    val out1 = Output(UInt(16.W))
+    val out2 = Output(UInt(16.W))
+    val out3 = Output(UInt(16.W))
+  })
+
+  // this comparison funtion decides < or > based on the module's parameterization
+  def comp(l: UInt, r: UInt): Bool = {
+      if (ascending) {
+        l < r
+      } else {
+        l > r
+    }
+  }
+
+  val row10 = Wire(UInt(16.W))
+  val row11 = Wire(UInt(16.W))
+  val row12 = Wire(UInt(16.W))
+  val row13 = Wire(UInt(16.W))
+
+  when(comp(io.in0, io.in1)) {
+    row10 := io.in0            // preserve first two elements
+    row11 := io.in1
+  }.otherwise {
+    row10 := io.in1            // swap first two elements
+    row11 := io.in0
+  }
+
+  when(comp(io.in2, io.in3)) {
+    row12 := io.in2            // preserve last two elements
+    row13 := io.in3
+  }.otherwise {
+    row12 := io.in3            // swap last two elements
+    row13 := io.in2
+  }
+
+  val row21 = Wire(UInt(16.W))
+  val row22 = Wire(UInt(16.W))
+
+  when(comp(row11, row12)) {
+    row21 := row11            // preserve middle 2 elements
+    row22 := row12
+  }.otherwise {
+    row21 := row12            // swap middle two elements
+    row22 := row11
+  }
+
+  val row20 = Wire(UInt(16.W))
+  val row23 = Wire(UInt(16.W))
+  when(comp(row10, row13)) {
+    row20 := row10            // preserve the first and the forth elements
+    row23 := row13
+  }.otherwise {
+    row20 := row13            // swap the first and the forth elements
+    row23 := row10
+  }
+
+  when(comp(row20, row21)) {
+    io.out0 := row20            // preserve first two elements
+    io.out1 := row21
+  }.otherwise {
+    io.out0 := row21            // swap first two elements
+    io.out1 := row20
+  }
+
+  when(comp(row22, row23)) {
+    io.out2 := row22            // preserve first two elements
+    io.out3 := row23
+  }.otherwise {
+    io.out2 := row23            // swap first two elements
+    io.out3 := row22
+  }
+}
+

# Option and Defualt Arguments

val map = Map("a" -> 1)
+val a = map.get("a")
+println(a)
+val b = map.get("b")
+println(b)
+

在 Scala 中,Map.get(key)方法返回一个Option类型:如果键存在,则返回Some(value);如果键不存在,则返回None。在您的例子中,map.get("a")返回Some(1),因为"a"是映射中的一个键,值为 1。然而,map.get("b")返回None,因为"b"不是映射中的键。SomeNone用于 Scala 中以安全且表达性的方式处理值的存在或缺失,避免空指针异常。

val some = Some(1)
+val none = None
+println(some.get)          // Returns 1
+// println(none.get)       // Errors!
+println(some.getOrElse(2)) // Returns 1
+println(none.getOrElse(2)) // Returns 2
+

getOrElse是一个常用于Option类型的方法,它允许你为Option可能不包含值(即为None)的情况提供一个默认值。getOrElse接受一个参数,这个参数是当OptionNone时将返回的值。如果OptionSome,则getOrElse会返回包裹在Some中的值。

# Options for Parameters with Defaults

class DelayBy1(resetValue: Option[UInt] = None) extends Module {
+    val io = IO(new Bundle {
+        val in  = Input( UInt(16.W))
+        val out = Output(UInt(16.W))
+    })
+    val reg = if (resetValue.isDefined) { // resetValue = Some(number)
+        RegInit(resetValue.get)
+    } else { //resetValue = None
+        Reg(UInt())
+    }
+    reg := io.in
+    io.out := reg
+}
+
+println(getVerilog(new DelayBy1))
+println(getVerilog(new DelayBy1(Some(3.U))))
+

resetValue 默认初始化为 Option[UInt] = NoneReg(UInt()) 可以从上下文中自动推断,不过最好还是指定位宽

// 还可以用match来实现ifelse
+class DelayBy1(resetValue: Option[UInt] = None) extends Module {
+  val io = IO(new Bundle {
+    val in  = Input( UInt(16.W))
+    val out = Output(UInt(16.W))
+  })
+  val reg = resetValue match {
+    case Some(r) => RegInit(r)
+    case None    => Reg(UInt())
+  }
+  reg := io.in
+  io.out := reg
+}
+

# Match/Case Statements

Scala 中的匹配概念在 Chisel 中被广泛使用,是每个 Chisel 程序员必须理解的基础知识。Scala 提供的 match 操作符支持以下功能:

  • 用于检测多种情况的简单测试,类似于 C 语言中的 switch 语句。
  • 对值的复杂组合进行测试。
  • 根据变量的类型采取行动,当变量类型未知或未完全指定时,例如: +
    • 从异构列表中取变量,如val mixedList = List(1, "string", false)
    • 变量已知属于一个超类,但不确定是哪个具体的子类。
  • 使用正则表达式提取字符串的子串。

# Example: Value Matching

// y is an integer variable defined somewhere else in the code
+val y = 7
+/// ...
+val x = y match {
+  case 0 => "zero" // One common syntax, preferred if fits in one line
+  case 1 =>        // Another common syntax, preferred if does not fit in one line.
+      "one"        // Note the code block continues until the next case
+  case 2 => {      // Another syntax, but curly braces are not required
+      "two"
+  }
+  case _ => "many" // _ is a wildcard that matches all values
+}
+println("y is " + x) // out: y is many
+

y 为 7,不匹配,因此采用默认值

  • 每个跟在=>操作符后面的代码块都会继续执行,直到它到达match的结束大括号或下一个case语句。
  • match会按照case语句的顺序进行搜索,一旦匹配到一个case语句,就不会再对其他case语句进行检查。
  • 使用下划线_作为通配符,来处理任何未找到匹配的值。

# Example: Multiple Value Matching

def animalType(biggerThanBreadBox: Boolean, meanAsCanBe: Boolean): String = {
+  (biggerThanBreadBox, meanAsCanBe) match {
+    case (true, true) => "wolverine"
+    case (true, false) => "elephant"
+    case (false, true) => "shrew"
+    case (false, false) => "puppy"
+  }
+}
+println(animalType(true, true)) // wolverine
+

# Example: Type Matching

val sequence = Seq("a", 1, 0.0)
+sequence.foreach { x =>
+  x match {
+    case s: String => println(s"$x is a String")
+    case s: Int    => println(s"$x is an Int")
+    case s: Double => println(s"$x is a Double")
+    case _ => println(s"$x is an unknown type!")
+  }
+}
+

Seq是 Scala 集合中的一个接口,它代表序列,而ListSeq的一个具体实现。在这个例子中,可以直接用List("a", 1, 0.0)来代替Seq("a", 1, 0.0),而不会影响foreachmatch语句的行为。

# Example: Multiple Type Matching

If you want to match on whether a value has one of many types, use the following syntax. Note that you must use an _ when matching.

val sequence = Seq("a", 1, 0.0)
+sequence.foreach { x =>
+  x match {
+    case _: Int | _: Double => println(s"$x is a number!")
+    case _ => println(s"$x is an unknown type!")
+  }
+}
+

# Example: Type Matching and Erasure

类型匹配在 Scala 中有一些限制。由于 Scala 运行在 JVM 上,而 JVM 不保持多态类型信息,因此你不能在运行时基于它们进行匹配(因为这些类型信息已被擦除)。注意下面的例子始终匹配第一个 case 语句,因为[String][Int][Double]这些多态类型在运行时被擦除了,case 语句实际上只是在匹配Seq

val sequence = Seq(Seq("a"), Seq(1), Seq(0.0))
+sequence.foreach { x =>
+  x match {
+    case s: Seq[String] => println(s"$x is a String")
+    case s: Seq[Int]    => println(s"$x is an Int")
+    case s: Seq[Double] => println(s"$x is a Double")
+  }
+}
+

在 Scala 中,类型擦除指的是 JVM 在运行时不保留泛型的具体类型信息。因此,当你对Seq[String]Seq[Int]Seq[Double]进行模式匹配时,JVM 实际上无法区分这些Seq的元素类型,因为泛型信息[String][Int][Double]已经被擦除,只留下了基础的Seq类型。所以,这些 case 语句在运行时都被视为对Seq类型的匹配,而无法区分具体是哪种Seq。因此,匹配总是成功于第一个 case,无论其实际参数是什么类型的Seq。这就是为什么在运行时你看到的行为似乎是它总是匹配Seq的原因。

# IOs with Optional Fields

有时我们希望 IO 端口能够根据需要选择性地包含或排除。例如,在调试时可能需要查看一些内部状态,但在生成器用于系统时希望将其隐藏。或者,你的生成器可能有一些输入在某些情况下不需要连接,因为存在合理的默认值。

# Example: Optional IO with Option

示例中展示了一个可选地接收进位信号的一位加法器。如果包含进位,io.carryIn将是Some[UInt]类型并包含在 IO 束中;如果不包含进位,io.carryIn将是None类型并从 IO 束中排除。

class HalfFullAdder(val hasCarry: Boolean) extends Module {
+  val io = IO(new Bundle {
+    val a = Input(UInt(1.W))
+    val b = Input(UInt(1.W))
+    val carryIn = if (hasCarry) Some(Input(UInt(1.W))) else None
+    val s = Output(UInt(1.W))
+    val carryOut = Output(UInt(1.W))
+  })
+  val sum = io.a +& io.b +& io.carryIn.getOrElse(0.U)
+  io.s := sum(0)
+  io.carryOut := sum(1)
+}
+

# Example: Optional IO with Zero-Width Wires

class HalfFullAdder(val hasCarry: Boolean) extends Module {
+  val io = IO(new Bundle {
+    val a = Input(UInt(1.W))
+    val b = Input(UInt(1.W))
+    val carryIn = Input(if (hasCarry) UInt(1.W) else UInt(0.W))
+    val s = Output(UInt(1.W))
+    val carryOut = Output(UInt(1.W))
+  })
+  val sum = io.a +& io.b +& io.carryIn
+  io.s := sum(0)
+  io.carryOut := sum(1)
+}
+

也可以用一个 0 宽度的 wire 来代替 None。An IO with width zero is pruned from the emitted Verilog, and anything that tries to use the value of a zero-width wire gets a constant zero.

# Implicits

为了减少大量重复的模板代码,Scala 引入了*隐式(implicits)*的概念,允许编译器为你自动进行一些语法简化。由于很多操作是在背后进行,隐式使用可能显得很神奇。

# Implicit Arguments

隐式参数的一个常见用途是当你的代码在深层的函数调用中需要访问某个顶层变量时,可以使用隐式参数自动传递这个变量,而不是手动在每个函数调用中传递它。

# Example: Implicit Cats

object CatDog {
+  implicit val numberOfCats: Int = 3
+  //implicit val numberOfDogs: Int = 5
+
+  def tooManyCats(nDogs: Int)(implicit nCats: Int): Boolean = nCats > nDogs
+
+  val imp = tooManyCats(2)    // Argument passed implicitly!
+  val exp = tooManyCats(2)(1) // Argument passed explicitly!
+}
+CatDog.imp
+CatDog.exp
+

首先,我们定义了一个隐式值numberOfCats。在给定的作用域中,同一类型的隐式值只能有一个。然后,我们定义了一个函数,它接受两个参数列表;第一个是任何显式参数,第二个是任何隐式参数。当我们调用tooManyCats时,我们可以省略第二个隐式参数列表(让编译器为我们找到它),或者显式提供一个参数(这个参数可以与隐式值不同)。

隐式参数可能失败的情况包括:

  • 在一个作用域中定义了给定类型的两个或多个隐式值
  • 如果编译器找不到调用函数所需的隐式值

object定义了一个单例对象,它是一个类的单一实例。与class不同,当你定义一个object时,Scala 会自动为你创建这个类的一个实例。你不需要使用new关键字来创建它的实例。在这个例子中,CatDog是一个单例对象,可以直接访问其成员,无需创建实例。这在定义工具方法或当你需要一个全局唯一的实体时非常有用,比如这里的numberOfCats隐式值和tooManyCats方法。

# Example: Implicit Logging

sealed trait Verbosity
+implicit case object Silent extends Verbosity
+case object Verbose extends Verbosity
+
+class ParameterizedWidthAdder(in0Width: Int, in1Width: Int, sumWidth: Int)(implicit verbosity: Verbosity)
+extends Module {
+  def log(msg: => String): Unit = verbosity match {
+    case Silent =>
+    case Verbose => println(msg)
+  }
+  require(in0Width >= 0)
+  log(s"in0Width of $in0Width OK")
+  require(in1Width >= 0)
+  log(s"in1Width of $in1Width OK")
+  require(sumWidth >= 0)
+  log(s"sumWidth of $sumWidth OK")
+  val io = IO(new Bundle {
+    val in0 = Input(UInt(in0Width.W))
+    val in1 = Input(UInt(in1Width.W))
+    val sum = Output(UInt(sumWidth.W))
+  })
+  log("Made IO")
+	// 对于结果位宽自然容纳进位的情况,直接使用+也是可行的。
+  io.sum := io.in0 + io.in1
+  log("Assigned output")
+}
+
+println(getVerilog(new ParameterizedWidthAdder(1, 4, 5)))
+println(getVerilog(new ParameterizedWidthAdder(1, 4, 5)(Verbose)))
+
  1. 定义了一个名为Verbosity的密封特质(sealed trait)和两个实现这个特质的对象。sealed trait Verbosity表示Verbosity是一个可以被继承的类型,但所有继承它的类必须定义在同一个文件中,这有助于实现模式匹配的完整性检查。implicit case object Silent extends Verbosity定义了一个隐式的单例对象Silent,它是Verbosity的一个实现,可以在需要Verbosity类型的隐式参数时自动使用。case object Verbose extends Verbosity定义了另一个名为Verbose的单例对象,也是Verbosity的实现。case object通常用于代表不可变、无状态的值或单例定义.
  2. msg: => String这样的参数定义使用了名为“call-by-name”的参数传递机制。这种机制意味着,只有在函数内部实际使用到msg时,传入的字符串表达式才会被计算。这对于条件日志记录来说非常有用,因为它允许延迟计算日志消息直到确实需要打印消息时。例如,如果verbositySilent,则msg根本不会被计算,这样就避免了不必要的性能开销。

# Implicit Conversions

隐式函数(也称为隐式转换)用于减少模板代码。更具体地说,它们用于自动将一个 Scala 对象转换为另一个对象。

# Example: Implicit Conversion

在下面的例子中,我们有两个类,AnimalHumanAnimal有一个species字段,但Human没有。然而,通过实现一个隐式转换,我们可以在Human上调用species方法。这意味着即使Human类原本不包含species字段,通过隐式转换,我们也可以像访问自己的属性一样访问species,就好像这个属性是Human类的一部分一样。

class Animal(val name: String, val species: String)
+class Human(val name: String)
+implicit def human2animal(h: Human): Animal = new Animal(h.name, "Homo sapiens")
+val me = new Human("Adam")
+println(me.species)
+
+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2 Generators Collections.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2 Generators Collections.html new file mode 100644 index 0000000..0f3f2ff --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2 Generators Collections.html @@ -0,0 +1,293 @@ + + + + + + 2024.03.03-3.2 Generators: Collections | Personal Blog --from OutisLi + + + + + + + + +

# 2024.03.03-3.2 Generators: Collections

# Generators and Collections

# FIR Golden Model

/
+  * A naive implementation of an FIR filter with an arbitrary number of taps.
+  */
+class ScalaFirFilter(taps: Seq[Int]) {
+  var pseudoRegisters = List.fill(taps.length)(0)
+
+  def poke(value: Int): Int = {
+    pseudoRegisters = value :: pseudoRegisters.take(taps.length - 1)
+    var accumulator = 0
+    for(i <- taps.indices) {
+      accumulator += taps(i) * pseudoRegisters(i)
+    }
+    accumulator
+  }
+}
+

# Seq

taps变为Seq[Int]时,意味着类的用户可以在构造类时传递任意长度的Int序列。

# 寄存器

使用var pseudoRegisters = List.fill(taps.length)(0)创建了一个List,用于存储前几个周期的值。选择List是因为其添加元素到头部和移除最后一个元素的语法非常简单。理论上可以使用 Scala 集合家族中的任何成员。这个列表被初始化为全零。

# Poke

我们的类添加了一个 poke 函数/方法,模拟将新输入放入过滤器并循环时钟。

# 更新寄存器

pseudoRegisters = value :: pseudoRegisters.take(taps.length - 1)首先使用列表的take方法保留除最后一个元素外的所有元素,然后使用::列表连接操作符将value添加到缩减版列表的头部。

# 计算输出

一个简单的 for 循环和累加器用于求和列表中每个元素与其对应抽头系数的乘积。仅含accumulator的行将该值作为函数结果返回。

# Test circuit using the golden model

为了避免使用繁杂的手动验证,这里使用 Golden Model 来生成期望的值,并与 Chisel 的结果对比

val goldenModel = new ScalaFirFilter(Seq(1, 1, 1, 1))
+
+test(new My4ElementFir(1, 1, 1, 1)) { c =>
+    for(i <- 0 until 100) {
+        val input = scala.util.Random.nextInt(8)
+
+        val goldenModelResult = goldenModel.poke(input)
+
+        c.io.in.poke(input.U)
+
+        c.io.out.expect(goldenModelResult.U, s"i $i, input $input, gm $goldenModelResult, ${c.io.out.peek().litValue}")
+
+        c.clock.step(1)
+    }
+
+}
+

注意:这里软件上的 Golden Model 没有考虑位宽,而硬件则与位宽有很大关系。这里只考虑了 8 以内,即 3bit 的数,因此不存在这个问题

# Example: Parameterized FIR Generator

class MyManyElementFir(consts: Seq[Int], bitWidth: Int) extends Module {
+  val io = IO(new Bundle {
+    val in = Input(UInt(bitWidth.W))
+    val out = Output(UInt(bitWidth.W))
+  })
+
+  val regs = mutable.ArrayBuffer[UInt]()
+  for(i <- 0 until consts.length) {
+      if(i == 0) regs += io.in
+      else       regs += RegNext(regs(i - 1), 0.U)
+  }
+
+  val muls = mutable.ArrayBuffer[UInt]()
+  for(i <- 0 until consts.length) {
+      muls += regs(i) * consts(i).U
+  }
+
+  val scan = mutable.ArrayBuffer[UInt]()
+  for(i <- 0 until consts.length) {
+      if(i == 0) scan += muls(i)
+      else scan += muls(i) + scan(i - 1)
+  }
+
+  io.out := scan.last
+}
+
  1. val regs = mutable.ArrayBuffer[UInt]()声明了一个名为regs的不可变变量,它被初始化为一个可变的ArrayBuffer,其中包含UInt类型的元素。ArrayBuffer是一个可变的序列,允许在序列两端高效地添加或删除元素,适用于需要动态修改元素的场景。在这里,regs可以被用来存储和更新UInt类型的数据,但由于使用了valregs本身的引用是不可变的,尽管它指向的ArrayBuffer内容是可变的。
  2. regs += io.in这行代码的意思是将io.in这个UInt信号添加到regs这个ArrayBuffer中。这里没有直接的数值相加操作,而是将io.in这个元素添加(追加)到regs这个列表的末尾。regs是一个容器,可以逐个添加元素,即使一开始regs是空的。这行代码的作用是初始化regs列表的第一个元素,后续元素则在循环中通过RegNext添加。
  3. regs作为一个ArrayBuffer,可以包含不同类型的UInt元素。在这种情况下,io.in是一个Input(UInt)类型,而RegNext(regs(i - 1), 0.U)生成的是一个Reg(UInt)类型。尽管io.in和通过RegNext创建的寄存器在硬件层面扮演不同的角色(一个是输入信号,另一个是寄存器),但它们都是UInt类型,可以存储在同一个ArrayBuffer中。在 Chisel 生成的硬件逻辑中,这将创建一个信号和寄存器链,其中信号和寄存器可以互相连接。
  4. 使用scan数组缓存逐步累加的结果而不是直接对muls求和,是为了展示在每一步如何逐渐累积计算的中间值。这种方法在某些复杂的 FIR 滤波器设计中可以提供更多的灵活性,比如在需要逐个访问累加过程中的中间结果时。尽管在这个特定例子中,只需要最终的累加结果,直接对muls求和看似更直接,但展开累加过程可以帮助理解和调试滤波器的行为,尤其是在更复杂或参数化的设计中。然而,如果目标只是获取最终的累加和,直接使用muls.reduce(_ + _)确实会更简洁高效。

# Test a bunch of different sized FIR filters

def r(): Int = {
+  scala.util.Random.nextInt(1024)
+}
+
+/
+  * run a test comparing software and hardware filters
+  * run for at least twice as many samples as taps
+  */
+def runOneTest(taps: Seq[Int]) {
+    val goldenModel = new ScalaFirFilter(taps)
+
+    test(new MyManyElementFir(taps, 32)) { c =>
+        for(i <- 0 until 2 * taps.length) {
+            val input = r()
+
+            val goldenModelResult = goldenModel.poke(input)
+
+            c.io.in.poke(input.U)
+
+            c.io.out.expect(goldenModelResult.U, s"i $i, input $input, gm $goldenModelResult, ${c.io.out.peek().litValue}")
+
+            c.clock.step(1)
+        }
+    }
+}
+
+for(tapSize <- 2 until 100 by 10) {
+    val taps = Seq.fill(tapSize)(r())  // create a sequence of random coefficients
+
+    runOneTest(taps)
+}
+
  1. 在 Chisel 测试中,c.clock.step(1)通常放在对输出进行期望检查(expect)之后,因为我们希望在提供输入后推进仿真一个时钟周期,然后在下一个时钟边沿检查输出。这样可以确保寄存器已经更新到了因输入变化而触发的新状态。
  2. 字符串s"i $i, input $input, gm $goldenModelResult, ${c.io.out.peek().litValue}"是 Scala 的字符串插值,用于构造包含变量值的字符串。这里它构建了一个描述当前测试状态的字符串,包括迭代次数i,当前输入input,金标准模型goldenModel的结果goldenModelResult,以及从待测试模块的输出c.io.out中提取的值。这对于调试和理解测试失败的上下文非常有用。

# Hardware Collections

# Example: Add run-time configurable taps to our FIR

在 FIR 生成器的 IO 中添加了一个额外的consts向量,允许在电路生成后从外部改变系数。这是通过 Chisel 集合类型Vec实现的。Vec支持许多 Scala 集合方法,但只能包含 Chisel 硬件元素。仅在普通 Scala 集合无法满足需求的情况下使用Vec,主要是以下两种情况:1. 在 Bundle 中需要元素集合,通常是作为 IO 使用的 Bundle。2. 需要通过硬件部分的索引访问集合(如寄存器文件)。

原因在于Vec能够创建一组硬件元素的集合,而这些硬件元素可以在生成的硬件电路中被索引和操作。相反,普通的 Scala 集合,如ListSeq,仅仅在 Scala 软件环境中存在,它们不能直接映射到硬件电路中。因此,当定义硬件模块的 IO 接口或需要在硬件级别按索引访问元素时,应该使用Vec

class MyManyDynamicElementVecFir(length: Int) extends Module {
+  val io = IO(new Bundle {
+    val in = Input(UInt(8.W))
+    val out = Output(UInt(8.W))
+    val consts = Input(Vec(length, UInt(8.W)))
+  })
+
+  // Reference solution
+  val regs = RegInit(VecInit(Seq.fill(length)(0.U(8.W))))
+  for(i <- 0 until length) {
+      if(i == 0) regs(i) := io.in
+      else       regs(i) := regs(i - 1)
+  }
+
+  val muls = Wire(Vec(length, UInt(8.W)))
+  for(i <- 0 until length) {
+      if(i == 0) muls(i) := io.in * io.consts(i)
+      else       muls(i) := regs(i - 1) * io.consts(i)
+  }
+
+  val scan = Wire(Vec(length, UInt(8.W)))
+  for(i <- 0 until length) {
+      if(i == 0) scan(i) := muls(i)
+      else scan(i) := muls(i) + scan(i - 1)
+  }
+
+  io.out := scan(length - 1)
+}
+
  1. VecInit用于创建一个Vec,这是 Chisel 中的一种集合类型,专门用于存储硬件元素。Seq.fill(length - 1)(0.U(8.W))生成一个长度为length - 1,每个元素初始化为 8 位宽的 0 的序列。VecInit将这个序列转换成一个Vec,以便在硬件设计中使用。RegInit则将这个Vec初始化为寄存器,使得其值在复位时为指定的初始值。这种方式常用于定义具有多个初始相同值的寄存器数组。

  2. Wire(Vec(length, UInt(8.W))) 用于创建一个具有 length 元素的向量,每个元素是 8 位无符号整数。这是在硬件描述语言中创建信号数组的标准方法,允许这些信号在生成的硬件电路中被实例化。

    相比之下,mutable.ArrayBuffer[UInt]() 是 Scala 的一个集合类型,主要用于软件程序中的数据存储和处理。在 Chisel 的上下文中,你不能直接将 ArrayBuffer 用作硬件信号的容器,因为 ArrayBuffer 是一个可变的、仅在 Scala 软件执行环境中存在的数据结构,它不会被合成到硬件中。

    简单来说:

    • Wire(Vec(length, UInt(8.W))) 在 Chisel 中创建一个硬件向量,这个向量可以在生成的硬件电路中存在并携带信号。
    • mutable.ArrayBuffer[UInt]() 创建一个仅在 Scala 软件执行时存在的内存数组,它不能直接用于硬件设计。

    所以,在你的代码中使用 Wire(Vec(length, UInt(8.W))) 是为了定义一个可以在硬件层面操作和传递信号的向量,这对于硬件设计至关重要。

    # Example: 32-bit RISC-V Processor

    Register file: An array of registers that can be read from or written to via a number of read or write ports. Each port consists of an address and data field.

    class RegisterFile(readPorts: Int) extends Module {
    +    require(readPorts >= 0)
    +    val io = IO(new Bundle {
    +        val wen   = Input(Bool())
    +        val waddr = Input(UInt(5.W))
    +        val wdata = Input(UInt(32.W))
    +        val raddr = Input(Vec(readPorts, UInt(5.W)))
    +        val rdata = Output(Vec(readPorts, UInt(32.W)))
    +    })
    +
    +    // A Register of a vector of UInts
    +    val reg = RegInit(VecInit(Seq.fill(32)(0.U(32.W))))
    +
    +    when(io.wen){
    +        reg(io.waddr) := io.wdata
    +    }
    +    for(i <- 0 until readPorts){
    +        when(io.raddr(i) === 0.U){
    +            io.rdata(i) := 0.U
    +        }.otherwise{
    +            io.rdata(i) := reg(io.raddr(i))
    +        }
    +    }
    +}
    +

    readPorts 表示寄存器文件的读端口数量。这个数量决定了在任何给定的时钟周期内,可以同时读取多少个独立寄存器的数据。每个读端口由其自己的读取地址(raddr)和读取数据(rdata)组成。在这种设置中,你可以在一个时钟周期内并行读取多个寄存器的值,而不是一次只能读取一个,这对于增加处理器的数据吞吐量非常有用。

    具体到代码:

    • readPorts:定义了有多少个并行的读端口可用于同时读取寄存器文件中的数据。
    • io.raddr:一个向量,包含了每个读端口对应的读取地址。每个读端口都可以独立地从寄存器文件中选择一个寄存器进行读取。
    • io.rdata:一个向量,用于输出每个读端口读取到的寄存器值。每个端口根据对应的raddr读取寄存器文件中的数据,并将其放置在rdata的相应位置。
+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3 Interlude Chisel Standard Library.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3 Interlude Chisel Standard Library.html new file mode 100644 index 0000000..8c69a04 --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3 Interlude Chisel Standard Library.html @@ -0,0 +1,498 @@ + + + + + + 2024.03.04-3.3 Interlude: Chisel Standard Library | Personal Blog --from OutisLi + + + + + + + + +

# 2024.03.04-3.3 Interlude: Chisel Standard Library

# Decoupled: A Standard Ready-Valid Interface

在 Chisel 中,DecoupledIO 是一种标准的准备就绪(ready-valid)接口,广泛用于不同模块间的数据传输,提供了一种带有流控制的通信机制。使用 DecoupledIO 可以有效地处理数据传输的同步问题,特别是在生产者(source)和消费者(sink)速率不匹配时,确保数据的正确传输与接收。

# 组件

DecoupledIO 接口由以下三个主要部分组成:

  1. valid(有效) - 这是一个输出信号(从数据源角度看),用于表明当前的数据是有效的,可以被读取。当数据源有数据准备好发送时,它会将 valid 信号置为高电平。
  2. ready(准备就绪) - 这是一个输入信号(从数据源角度看),用于表明目标模块(接收端)准备好接收数据。当接收端可以接收新的数据时,它会将 ready 信号置为高电平。
  3. bits(数据位) - 这个信号承载了要传输的实际数据。数据的宽度和类型可以是任意的,从简单的 UIntBool 到复杂的用户定义 Bundle

# 数据传输

DecoupledIO 接口中,数据传输在以下条件下发生:

  • 数据源设置 valid 为高电平,表示其有数据要发送。
  • 接收端设置 ready 为高电平,表示其准备好接收数据。

当且仅当同一时钟周期内 validready 同时为高电平时,数据才会被传输。这允许在接收端或发送端任一端控制数据流,实现背压(backpressure)机制:

  • 如果接收端未准备好接收(ready 为低),即使发送端有数据发送(valid 为高),数据也不会被传输。
  • 如果发送端没有数据要发送(valid 为低),即使接收端准备好了(ready 为高),也不会有数据传输。

# 使用场景

DecoupledIO 非常适用于生产者和消费者速率不一致的情况,如:

  • 在 FIFO 队列的实现中,确保数据不会在缓冲区满时被写入,或在缓冲区空时被读出。
  • 在处理器设计中,用于不同执行单元间的数据传输,确保在数据未准备好或处理单元未准备好时不发生数据传输。

# 代码示例

以下是如何在 Chisel 中创建一个 DecoupledIO 接口的简单示例:

val data = UInt(8.W) // 定义数据宽度
+val decoupledData = Decoupled(data) // 创建 DecoupledIO 接口
+

这里,decoupledData 将是一个拥有 validreadybits 字段的 DecoupledIO Bundle,可用于模块间的数据传输。

# Queue

test(new Module {
+    // Example circuit using a Queue
+    val io = IO(new Bundle {
+      val in = Flipped(Decoupled(UInt(8.W)))
+      val out = Decoupled(UInt(8.W))
+    })
+    val queue = Queue(io.in, 2)  // 2-element queue
+    io.out <> queue
+  }) { c =>
+    c.io.out.ready.poke(false.B)
+    c.io.in.valid.poke(true.B)  // Enqueue an element
+    c.io.in.bits.poke(42.U)
+    println(s"Starting:")
+    println(s"\tio.in: ready=${c.io.in.ready.peek().litValue}")
+    println(s"\tio.out: valid=${c.io.out.valid.peek().litValue}, bits=${c.io.out.bits.peek().litValue}")
+    c.clock.step(1)
+
+    c.io.in.valid.poke(true.B)  // Enqueue another element
+    c.io.in.bits.poke(43.U)
+    // What do you think io.out.valid and io.out.bits will be?
+    println(s"After first enqueue:")
+    println(s"\tio.in: ready=${c.io.in.ready.peek().litValue}")
+    println(s"\tio.out: valid=${c.io.out.valid.peek().litValue}, bits=${c.io.out.bits.peek().litValue}")
+    c.clock.step(1)
+
+    c.io.in.valid.poke(true.B)  // Read a element, attempt to enqueue
+    c.io.in.bits.poke(44.U)
+    c.io.out.ready.poke(true.B)
+    // What do you think io.in.ready will be, and will this enqueue succeed, and what will be read?
+    println(s"On first read:")
+    println(s"\tio.in: ready=${c.io.in.ready.peek().litValue}")
+    println(s"\tio.out: valid=${c.io.out.valid.peek().litValue}, bits=${c.io.out.bits.peek().litValue}")
+    c.clock.step(1)
+
+    c.io.in.valid.poke(false.B)  // Read elements out
+    c.io.out.ready.poke(true.B)
+    // What do you think will be read here?
+    println(s"On second read:")
+    println(s"\tio.in: ready=${c.io.in.ready.peek().litValue}")
+    println(s"\tio.out: valid=${c.io.out.valid.peek().litValue}, bits=${c.io.out.bits.peek().litValue}")
+    c.clock.step(1)
+
+    // Will a third read produce anything?
+    println(s"On third read:")
+    println(s"\tio.in: ready=${c.io.in.ready.peek().litValue}")
+    println(s"\tio.out: valid=${c.io.out.valid.peek().litValue}, bits=${c.io.out.bits.peek().litValue}")
+    c.clock.step(1)
+}
+
Starting:
+	io.in: ready=1
+	io.out: valid=0, bits=0
+After first enqueue:
+	io.in: ready=1
+	io.out: valid=1, bits=42
+On first read:
+	io.in: ready=0
+	io.out: valid=1, bits=42
+On second read:
+	io.in: ready=1
+	io.out: valid=1, bits=43
+On third read:
+	io.in: ready=1
+	io.out: valid=0, bits=42
+
  1. val in = Flipped(Decoupled(UInt(8.W))) 这里的Flipped表示是Input,因为Decoupled默认是Output

  2. val queue = Queue(io.in, 2) 连接 io.in 到队列的输入端: 这意味着 io.in 上发生的任何事情(比如信号变化)都会直接影响到队列。具体来说,当您在测试代码中设置 io.in.validio.in.bits,您实际上是在向队列的入队端提供数据。

  3. io.out <> queue 时,你实际上是在将模块的输出接口 io.out 和队列 queue 的出队接口双向连接。

    具体来说,对于 DecoupledIO 接口:

    • io.out.valid 会连接到 queue.io.deq.valid
    • io.out.bits 会连接到 queue.io.deq.bits
    • queue.io.deq.ready 会连接到 io.out.ready

    这种连接方式确保了数据可以从 queue 的出队端传输到模块的输出 io.out,同时允许 io.out 控制背压(通过 ready 信号)以及 queue 报告其状态(通过 valid 信号)。

  • 开始时: +
    • 首先,输出端 io.out.ready 被设为 false,表示消费者还没准备好接收数据。
    • 输入端 io.in.valid 被设为 true,并通过 io.in.bits 提供了值 42,尝试将其入队。
    • 打印的输出显示,初始时,io.in.ready 应该为 true(队列未满,可以接收数据),而 io.out.valid 应该为 false(数据尚未出队到输出端)。
  • 首次入队后: +
    • 程序尝试将另一个值 43 入队,并再次检查状态。
    • 由于队列不满,第二个值应该成功入队。io.in.ready 仍然为 true,表明还可以接收更多数据。
    • io.out.valid 被设置为 true 并且 io.out.bits 被更新为 42,因为队列内部确实有一个元素(42)准备好了并且尝试发送。即使 io.out.readyfalseio.out.validio.out.bits 仍然会反映队列出口处的数据状态。
    • 尽管 io.out.validtrue 并且 io.out.bits 显示了数据(42),但由于 io.out.readyfalse,这次数据传输并不会真正完成。换句话说,42 在逻辑上是"准备发送"的,但由于缺乏接收准备就绪的确认(即 io.out.readyfalse),它实际上并没有"被接收"。
  • 首次读取尝试: +
    • 程序尝试同时进行读取(将 io.out.ready 设为 true)和入队(值 44)。
    • 由于此时输出准备好接收数据,第一个入队的值(42)应该会被传递到 io.outio.out.valid 应变为 trueio.out.bits 应显示 42。
    • io.in.ready0。这是因为队列(queue)此时已经满了。
  • 第二次读取: +
    • 这时不再有新数据入队,但 io.out 准备好读取数据。
    • 应该能读取到之前入队的第二个值 43,io.out.valid 应为 trueio.out.bits 应显示 43。
  • 第三次读取尝试: +
    • 在这一步,尽管 io.out 依然准备好接收数据,但队列应该已经空了。
    • 因此,io.out.valid 应该变回 false,表示没有更多数据可读。
    • 不过为什么是 42? +注:
    1. peek() 函数用于查看信号的当前值,而 .litValue 用于获取这个值作为一个 Scala 的字面量(literal)。因此,c.io.in.ready.peek().litValue 表示查看 c.io.in.ready 信号的当前值,并获取其字面量值。
    2. 必须要c.clock.step(1)以后才会有输出

# Arbiter

一个 Arbiter 是用于解决多个请求源争用单一资源的组件。它的基本功能是在多个输入信号中选择一个进行输出,基于某种特定的优先级或策略。在处理多个并发请求访问同一资源(例如,总线或共享内存)时,仲裁器确保每个时刻只有一个选定的请求被服务,同时遵循公平性或优先级规则,避免资源冲突或死锁。

  1. Arbiter:这是一个静态优先级仲裁器,它总是优先选择索引较低的生产者。如果有多个请求同时到达,Arbiter 会根据请求信号的索引顺序来决定优先权,索引较小的请求者会获得优先服务。这意味着如果较低索引的请求者持续有请求,它将持续获得资源,而更高索引的请求者则需要等待。

    示例代码如下:

    test(new Module {
    +    // Example circuit using a priority arbiter
    +    val io = IO(new Bundle {
    +      val in = Flipped(Vec(2, Decoupled(UInt(8.W))))
    +      val out = Decoupled(UInt(8.W))
    +    })
    +    // Arbiter doesn't have a convenience constructor, so it's built like any Module
    +    val arbiter = Module(new Arbiter(UInt(8.W), 2))  // 2 to 1 Priority Arbiter
    +    arbiter.io.in <> io.in
    +    io.out <> arbiter.io.out
    +  }) { c =>
    +    c.io.in(0).valid.poke(false.B)
    +    c.io.in(1).valid.poke(false.B)
    +    c.io.out.ready.poke(false.B)
    +    println(s"Start:")
    +    println(s"\tin(0).ready=${c.io.in(0).ready.peek().litValue}, in(1).ready=${c.io.in(1).ready.peek().litValue}")
    +    println(s"\tout.valid=${c.io.out.valid.peek().litValue}, out.bits=${c.io.out.bits.peek().litValue}")
    +    c.io.in(1).valid.poke(true.B)  // Valid input 1
    +    c.io.in(1).bits.poke(42.U)
    +    c.io.out.ready.poke(true.B)
    +    // What do you think the output will be?
    +    println(s"valid input 1:")
    +    println(s"\tin(0).ready=${c.io.in(0).ready.peek().litValue}, in(1).ready=${c.io.in(1).ready.peek().litValue}")
    +    println(s"\tout.valid=${c.io.out.valid.peek().litValue}, out.bits=${c.io.out.bits.peek().litValue}")
    +    c.io.in(0).valid.poke(true.B)  // Valid inputs 0 and 1
    +    c.io.in(0).bits.poke(43.U)
    +    // What do you think the output will be? Which inputs will be ready?
    +    println(s"valid inputs 0 and 1:")
    +    println(s"\tin(0).ready=${c.io.in(0).ready.peek().litValue}, in(1).ready=${c.io.in(1).ready.peek().litValue}")
    +    println(s"\tout.valid=${c.io.out.valid.peek().litValue}, out.bits=${c.io.out.bits.peek().litValue}")
    +    c.io.in(1).valid.poke(false.B)  // Valid input 0
    +    // What do you think the output will be?
    +    println(s"valid input 0:")
    +    println(s"\tin(0).ready=${c.io.in(0).ready.peek().litValue}, in(1).ready=${c.io.in(1).ready.peek().litValue}")
    +    println(s"\tout.valid=${c.io.out.valid.peek().litValue}, out.bits=${c.io.out.bits.peek().litValue}")
    +}
    +
    Start:
    +  in(0).ready=0, in(1).ready=0
    +  out.valid=0, out.bits=0
    +valid input 1:
    +  in(0).ready=1, in(1).ready=1
    +  out.valid=1, out.bits=42
    +valid inputs 0 and 1:
    +  in(0).ready=1, in(1).ready=0
    +  out.valid=1, out.bits=43
    +valid input 0:
    +  in(0).ready=1, in(1).ready=0
    +  out.valid=1, out.bits=43
    +
    1. 初始状态检查:

      • 首先,测试确认在没有任何有效输入 (io.in(0).validio.in(1).valid 都为 false) 时,输出 (io.out.valid) 也应为 false,表示没有数据通过仲裁器。
    2. 激活第二个输入:

      • 然后,测试激活 io.in(1)(即索引为 1 的输入),同时保持 io.out.readytrue,这模拟了接收端准备好接收数据的情况。预期 io.in(1) 的数据应该通过到 io.out
      • 两个输入的 ready 信号都是 1。这是因为 Arbiter 的行为是基于它可以传递数据的能力。让我们分解这个情况: +当只有 io.in(1) 有效时: +
        • in(0).ready=1:这意味着 Arbiter 仲裁器准备好从 io.in(0) 接收数据,尽管此时 io.in(0) 没有数据(不是有效的)。ready 信号为 1 表示如果 io.in(0) 有数据,Arbiter 准备好接收它。
        • in(1).ready=1:同时,Arbiter 也表示准备好接收 io.in(1) 的数据,因为它是有效的。在这种情况下,由于 io.out.ready 被设置为 trueArbiter 知道输出端已经准备好接收数据,所以它将 io.in(1)ready 也置为 1

      这里的关键是 ready 信号表示的是接收能力而非当前的数据有效性。即使 io.in(0) 当前没有标记为有效,Arbiter 也表明它准备好从该输入接收数据,这就是为什么在 io.in(1) 有效时,io.in(0).ready 也会是 1

    3. 同时激活两个输入:

      • 接下来,测试同时激活两个输入,即 io.in(0)io.in(1) 都设置为有效。由于 Arbiter 的静态优先级策略,预期 io.in(0) 的数据(即优先级更高的输入)会被传递到 io.out
      • 当两个输入 io.in(0)io.in(1) 都被设置为有效时,Arbiter 会根据其内部逻辑来选择一个输入。对于普通的 Arbiter,它将优先选择索引较低的输入,即 io.in(0)
      • 由于 io.in(0) 被选中,io.in(1)ready 信号将会被置为 false,而 io.in(0).ready 会是 true,表示 Arbiter 准备接受 io.in(0) 的数据。
      • 在此情况下,即使您设置了 io.in(1).bits,这个数据也不会被 Arbiter 选择,因为 io.in(0) 有更高的优先级。
    4. 只激活第一个输入:

      • 最后,测试只激活 io.in(0)。即使之前 io.in(1) 被激活过,在这一步中只有 io.in(0) 有效,所以只有它的数据应该被传递到 io.out
  2. RRArbiter:这是一个循环(round-robin)仲裁器,它按照循环的顺序为请求者提供服务,确保了长期的公平性。当一个请求被服务后,RRArbiter 会记住最后被服务的请求,并在下一个服务周期中优先考虑下一个请求者。这样可以确保即使在高负载下,所有请求者也能获得均等的服务机会。

    示例代码如下:

    val rrArbiter = Module(new RRArbiter(UInt(8.W), 2))
    +rrArbiter.io.in(0) <> producer0
    +rrArbiter.io.in(1) <> producer1
    +consumer <> rrArbiter.io.out
    +

注:Ariter 是组合电路,不需要 step(1)

# Misc Function Blocks

# Bitwise Utilities

# PopCount

PopCount returns the number of high (1) bits in the input as a UInt.

test(new Module {
+    // Example circuit using PopCount
+    val io = IO(new Bundle {
+      val in = Input(UInt(8.W))
+      val out = Output(UInt(8.W))
+    })
+    io.out := PopCount(io.in)
+  }) { c =>
+    // Integer.parseInt is used create an Integer from a binary specification
+    c.io.in.poke(Integer.parseInt("00000000", 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+
+    c.io.in.poke(Integer.parseInt("00001111", 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+
+    c.io.in.poke(Integer.parseInt("11001010", 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+
+    c.io.in.poke(Integer.parseInt("11111111", 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+
+}
+
in=0b0, out=0
+in=0b1111, out=4
+in=0b11001010, out=4
+in=0b11111111, out=8
+

# Reverse

Reverse returns the bit-reversed input

test(new Module {
+    // Example circuit using Reverse
+    val io = IO(new Bundle {
+      val in = Input(UInt(8.W))
+      val out = Output(UInt(8.W))
+    })
+    io.out := Reverse(io.in)
+  }) { c =>
+    // Integer.parseInt is used create an Integer from a binary specification
+    c.io.in.poke(Integer.parseInt("01010101", 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=0b${c.io.out.peek().litValue.toInt.toBinaryString}")
+
+    c.io.in.poke(Integer.parseInt("00001111", 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=0b${c.io.out.peek().litValue.toInt.toBinaryString}")
+
+    c.io.in.poke(Integer.parseInt("11110000", 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=0b${c.io.out.peek().litValue.toInt.toBinaryString}")
+
+    c.io.in.poke(Integer.parseInt("11001010", 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=0b${c.io.out.peek().litValue.toInt.toBinaryString}")
+}
+
in=0b1010101, out=0b10101010
+in=0b1111, out=0b11110000
+in=0b11110000, out=0b1111
+in=0b11001010, out=0b1010011
+

# OneHot encoding utilities

# UIntToOH

UInt to OneHot

test(new Module {
+    // Example circuit using UIntToOH
+    val io = IO(new Bundle {
+      val in = Input(UInt(4.W))
+      val out = Output(UInt(16.W))
+    })
+    io.out := UIntToOH(io.in)
+  }) { c =>
+    c.io.in.poke(0.U)
+    println(s"in=${c.io.in.peek().litValue}, out=0b${c.io.out.peek().litValue.toInt.toBinaryString}")
+
+    c.io.in.poke(1.U)
+    println(s"in=${c.io.in.peek().litValue}, out=0b${c.io.out.peek().litValue.toInt.toBinaryString}")
+
+    c.io.in.poke(8.U)
+    println(s"in=${c.io.in.peek().litValue}, out=0b${c.io.out.peek().litValue.toInt.toBinaryString}")
+
+    c.io.in.poke(15.U)
+    println(s"in=${c.io.in.peek().litValue}, out=0b${c.io.out.peek().litValue.toInt.toBinaryString}")
+}
+
+in=0, out=0b1
+in=1, out=0b10
+in=8, out=0b100000000
+in=15, out=0b1000000000000000
+

# OHToUInt

OneHot to UInt

test(new Module {
+    // Example circuit using OHToUInt
+    val io = IO(new Bundle {
+      val in = Input(UInt(16.W))
+      val out = Output(UInt(4.W))
+    })
+    io.out := OHToUInt(io.in)
+}) { c =>
+    c.io.in.poke(Integer.parseInt("0000 0000 0000 0001".replace(" ", ""), 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+
+    c.io.in.poke(Integer.parseInt("0000 0000 1000 0000".replace(" ", ""), 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+
+    c.io.in.poke(Integer.parseInt("1000 0000 0000 0001".replace(" ", ""), 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+
+    // Some invalid inputs:
+    // None high
+    c.io.in.poke(Integer.parseInt("0000 0000 0000 0000".replace(" ", ""), 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+
+    // Multiple high
+    c.io.in.poke(Integer.parseInt("0001 0100 0010 0000".replace(" ", ""), 2).U)
+    println(s"in=0b${c.io.in.peek().litValue.toInt.toBinaryString}, out=${c.io.out.peek().litValue}")
+}
+
+in=0b1, out=0
+in=0b10000000, out=7
+in=0b1000000000000001, out=15
+in=0b0, out=0
+in=0b1010000100000, out=15
+

# MUX

# PriorityMux

Outputs the value associated with the lowest-index asserted select signal.

test(new Module {
+    // Example circuit using PriorityMux
+    val io = IO(new Bundle {
+      val in_sels = Input(Vec(2, Bool()))
+      val in_bits = Input(Vec(2, UInt(8.W)))
+      val out = Output(UInt(8.W))
+    })
+    io.out := PriorityMux(io.in_sels, io.in_bits)
+  }) { c =>
+    c.io.in_bits(0).poke(10.U)
+    c.io.in_bits(1).poke(20.U)
+
+    // Select higher index only
+    c.io.in_sels(0).poke(false.B)
+    c.io.in_sels(1).poke(true.B)
+    println(s"in_sels=${c.io.in_sels(0).peek().litValue}, out=${c.io.out.peek().litValue}")
+
+    // Select both - arbitration needed
+    c.io.in_sels(0).poke(true.B)
+    c.io.in_sels(1).poke(true.B)
+    println(s"in_sels=${c.io.in_sels(0).peek().litValue}, out=${c.io.out.peek().litValue}")
+
+    // Select lower index only
+    c.io.in_sels(0).poke(true.B)
+    c.io.in_sels(1).poke(false.B)
+    println(s"in_sels=${c.io.in_sels(0).peek().litValue}, out=${c.io.out.peek().litValue}")
+}
+
+in_sels=0, out=20
+in_sels=1, out=10
+in_sels=1, out=10
+

PriorityMux 会根据 in_sels 中的布尔值,从左到右(即从索引 0 开始)检查哪个输入是选中的,并输出第一个选中输入对应的 in_bits 值。因此,同时使 in_sels(0)in_sels(1)true 时,由于 in_sels(0) 的优先级更高,io.out 应该输出 in_bits(0) 的值,即 10.U

# OneHot Mux: Mux1H

An Mux1H provides an efficient implementation when it is guaranteed that exactly one of the select signals will be high. Behavior is undefined if the assumption is not true.

test(new Module {
+    // Example circuit using Mux1H
+    val io = IO(new Bundle {
+      val in_sels = Input(Vec(2, Bool()))
+      val in_bits = Input(Vec(2, UInt(8.W)))
+      val out = Output(UInt(8.W))
+    })
+    io.out := Mux1H(io.in_sels, io.in_bits)
+  }) { c =>
+    c.io.in_bits(0).poke(10.U)
+    c.io.in_bits(1).poke(20.U)
+
+    // Select index 1
+    c.io.in_sels(0).poke(false.B)
+    c.io.in_sels(1).poke(true.B)
+    println(s"in_sels=${c.io.in_sels(0).peek().litValue}, out=${c.io.out.peek().litValue}")
+
+    // Select index 0
+    c.io.in_sels(0).poke(true.B)
+    c.io.in_sels(1).poke(false.B)
+    println(s"in_sels=${c.io.in_sels(0).peek().litValue}, out=${c.io.out.peek().litValue}")
+
+    // Select none (invalid)
+    c.io.in_sels(0).poke(false.B)
+    c.io.in_sels(1).poke(false.B)
+    println(s"in_sels=${c.io.in_sels(0).peek().litValue}, out=${c.io.out.peek().litValue}")
+
+    // Select both (invalid)
+    c.io.in_sels(0).poke(true.B)
+    c.io.in_sels(1).poke(true.B)
+    println(s"in_sels=${c.io.in_sels(0).peek().litValue}, out=${c.io.out.peek().litValue}")
+}
+
+in_sels=0, out=20
+in_sels=1, out=10
+in_sels=0, out=0
+in_sels=1, out=30
+

# Counter

A counter that can be incremented once every cycle, up to some specified limit, at which point it overflows. Note that it is not a Module, and its value is accessible.

test(new Module {
+  // Example circuit with two counters
+  val io = IO(new Bundle {
+    val count = Input(Bool())
+    val out = Output(UInt(2.W))
+    val totalCycles = Output(UInt(32.W))  // Assuming 32-bit is enough for cycle count
+  })
+
+  // Counter for controlled increments
+  val controlledCounter = Counter(3)  // 3-count Counter (outputs range [0...2])
+  when(io.count) {
+    controlledCounter.inc()
+  }
+  io.out := controlledCounter.value
+
+  // Counter for total cycles, counting up to (2^32)-1
+  val totalCycleCounter = Counter(math.pow(2, 32).toInt)
+  totalCycleCounter.inc()  // Increment every cycle
+  io.totalCycles := totalCycleCounter.value
+}) { c =>
+  c.io.count.poke(true.B)
+  println(s"start: controlled counter value=${c.io.out.peek().litValue}, total cycles=${c.io.totalCycles.peek().litValue}")
+
+  c.clock.step(1)
+  println(s"step 1: controlled counter value=${c.io.out.peek().litValue}, total cycles=${c.io.totalCycles.peek().litValue}")
+
+  c.clock.step(1)
+  println(s"step 2: controlled counter value=${c.io.out.peek().litValue}, total cycles=${c.io.totalCycles.peek().litValue}")
+
+  c.io.count.poke(false.B)
+  c.clock.step(1)
+  println(s"step without increment: controlled counter value=${c.io.out.peek().litValue}, total cycles=${c.io.totalCycles.peek().litValue}")
+
+  c.io.count.poke(true.B)
+  c.clock.step(1)
+  println(s"step again: controlled counter value=${c.io.out.peek().litValue}, total cycles=${c.io.totalCycles.peek().litValue}")
+}
+
+start: controlled counter value=0, total cycles=0
+step 1: controlled counter value=1, total cycles=1
+step 2: controlled counter value=2, total cycles=2
+step without increment: controlled counter value=2, total cycles=3
+step again: controlled counter value=0, total cycles=4
+

在 Chisel 中创建一个计数器时,如果您传递的参数是 n,那么计数器能够表示的计数范围是从 0 到 n-1。所以,当您使用 Counter(n) 时,计数器的实际最大计数值是 n-1。

+ + + diff --git a/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4 Higher-Order Functions.html b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4 Higher-Order Functions.html new file mode 100644 index 0000000..f5443fe --- /dev/null +++ b/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4 Higher-Order Functions.html @@ -0,0 +1,217 @@ + + + + + + 2024.03.05-3.4 Higher-Order Functions | Personal Blog --from OutisLi + + + + + + + + +

# 2024.03.05-3.4 Higher-Order Functions

# A Tale of Two FIRs

From the last module, we had the convolution part of the FIR filter written like this:

val muls = Wire(Vec(length, UInt(8.W)))
+for(i <- 0 until length) {
+  if(i == 0) muls(i) := io.in * io.consts(i)
+  else       muls(i) := regs(i - 1) * io.consts(i)
+}
+
+val scan = Wire(Vec(length, UInt(8.W)))
+for(i <- 0 until length) {
+  if(i == 0) scan(i) := muls(i)
+  else scan(i) := muls(i) + scan(i - 1)
+}
+
+io.out := scan(length - 1)
+

As a recap, the idea is to multiply each element of io.in with the corresponding element of io.consts, and store it in muls. Then, the elements in muls are accumulated into scan, with scan(0) = muls(0), scan(1) = scan(0) + muls(1) = muls(0) + muls(1), and in general scan(n) = scan(n-1) + muls(n) = muls(0) + ... + muls(n-1) + muls(n). The last element in scan (equal to the sum of all muls) is assigned to io.out.

However, it's very verbose for what might be considered quite a simple operation. In fact, all that could be written in one line:

io.out := (taps zip io.consts).map { case (a, b) => a * b }.reduce(_ + _)
+
  • 假设 taps 是所有样本的列表,其中 taps(0) = io.intaps(1) = regs(0) 等等。
  • (taps zip io.consts) 将两个列表 tapsio.consts 合并成一个列表,其中每个元素是一个元组,这个元组包含了在相应位置的输入元素。具体来说,它的值将是 [(taps(0), io.consts(0)), (taps(1), io.consts(1)), ..., (taps(n), io.consts(n))]。记住,在 Scala 中点号是可选的,所以这等同于 (taps.zip(io.consts))
  • .map { case (a, b) => a * b } 对列表中的元素应用一个匿名函数(接收两个元素的元组并返回它们的乘积),并返回结果。在这个情况下,结果等价于在冗长示例中的 muls,其值为 [taps(0) * io.consts(0), taps(1) * io.consts(1), ..., taps(n) * io.consts(n)]
  • 最后,.reduce(_ + _) 同样应用一个函数(元素的加法)到列表的元素上。然而,它接收两个参数:第一个是当前的累加值,第二个是列表元素(在第一次迭代中,它只是将前两个元素相加)。这些由括号中的两个下划线表示。那么结果,假设是从左到右的遍历,将会是 (((muls(0) + muls(1)) + muls(2)) + ...) + muls(n),更深层次括号内的结果先被计算。这就是卷积的输出结果。

# Functions as Arguments

Formally, functions like map and reduce are called higher-order functions : they are functions that take functions as arguments. As it turns out (and hopefully, as you can see from the above example), these are very powerful constructs that encapsulate a general computational pattern, allowing you to concentrate on the application logic instead of flow control, and resulting in very concise code.

  • 对于每个参数只引用一次的函数,您可以使用下划线(_)来引用每个参数。在上面的例子中,reduce 函数接受两个参数,可以被指定为 _ + _。虽然这很方便,但它受制于一组额外的复杂规则,所以如果不起作用,您可以尝试:
  • 明确指定输入参数列表。reduce 可以被明确写成 (a, b) => a + b,通用形式是把参数列表放在括号里,后面跟着 =>,然后是引用这些参数的函数体。
  • 当需要解包元组时,使用 case 语句,如 case (a, b) => a * b。这接收一个参数,一个两个元素的元组,并将其解包到变量 ab 中,然后可以在函数体中使用它们。

# Practice in Scala

Scala 集合 API 中的主要类,如List。这些高阶函数是这些 API 的一部分。实际上,上面的示例使用了List上的mapreduce API。在这一节中,我们将通过示例和练习熟悉这些方法。在这些示例中,我们将对 Scala 数字(Int)操作,以简化和明确表示,但因为 Chisel 运算符的行为类似,所以这些概念应该是通用的。

# Example: map

List[A].map 有类型签名 map[B](f: (A) ⇒ B): List[B]。现在,将类型 A 和 B 视为 IntUInt,意味着它们可以是软件或硬件类型。它接受一个类型为 (f: (A) ⇒ B) 的参数,或者一个接受类型为 A(与输入列表的元素类型相同)的一个参数并返回类型为 B 的值的函数。map 然后返回一个新的类型为 B(参数函数的返回类型)的列表。

println(List(1, 2, 3, 4).map(x => x + 1))  // explicit argument list in function
+println(List(1, 2, 3, 4).map(_ + 1))  // equivalent to the above, but implicit arguments
+println(List(1, 2, 3, 4).map(_.toString + "a"))  // the output element type can be different from the input element type
+
+println(List((1, 5), (2, 6), (3, 7), (4, 8)).map { case (x, y) => x*y })  // this unpacks a tuple, note use of curly braces
+
+// Related: Scala has a syntax for constructing lists of sequential numbers
+println(0 to 10)  // to is inclusive , the end point is part of the result
+println(0 until 10)  // until is exclusive at the end, the end point is not part of the result
+
+// Those largely behave like lists, and can be useful for generating indices:
+val myList = List("a", "b", "c", "d")
+println((0 until 4).map(myList(_)))
+
+// output:
+List(2, 3, 4, 5)
+List(2, 3, 4, 5)
+List(1a, 2a, 3a, 4a)
+List(5, 12, 21, 32)
+Range 0 to 10
+Range 0 until 10
+Vector(a, b, c, d)
+

# Example: zipWithIndex

List.zipWithIndex has type signature zipWithIndex: List[(A, Int)]. It takes no arguments, but returns a list where each element is a tuple of the original elements, and the index (with the first one being zero). So List("a", "b", "c", "d").zipWithIndex would return List(("a", 0), ("b", 1), ("c", 2), ("d", 3))

println(List(1, 2, 3, 4).zipWithIndex)  // note indices start at zero
+println(List("a", "b", "c", "d").zipWithIndex)
+println(List(("a", "b"), ("c", "d"), ("e", "f"), ("g", "h")).zipWithIndex)  // tuples nest
+
+// output:
+List((1,0), (2,1), (3,2), (4,3))
+List((a,0), (b,1), (c,2), (d,3))
+List(((a,b),0), ((c,d),1), ((e,f),2), ((g,h),3))
+

# Example: reduce

List[A].map has type signature similar to reduce(op: (A, A) ⇒ A): A. (it's actually more lenient, A only has to be a supertype of the List type, but we're not going to deal with that syntax here)

println(List(1, 2, 3, 4).reduce((a, b) => a + b))  // returns the sum of all the elements
+println(List(1, 2, 3, 4).reduce(_ * _))  // returns the product of all the elements
+println(List(1, 2, 3, 4).map(_ + 1).reduce(_ + _))  // you can chain reduce onto the result of a map
+println(List(1, 2, 3, 4).map(_*2).reduce(_*_))  // returns the product of the double of the elements of the input list.
+
+// output:
+10
+24
+14
+384
+
+// Important note: reduce will fail with an empty list
+println(List[Int]().reduce(_ * _))
+

# Example: fold

List[A].fold is very similar to reduce, except that you can specify the initial accumulation value. It has type signature similar to fold(z: A)(op: (A, A) ⇒ A): A. (like reduce, the type of A is also more lenient). Notably, it takes two argument lists, the first (z) is the initial value, and the second is the accumulation function. Unlike reduce, it will not fail with an empty list, instead returning the initial value directly.

println(List(1, 2, 3, 4).fold(0)(_ + _))  // equivalent to the sum using reduce
+println(List(1, 2, 3, 4).fold(1)(_ + _))  // like above, but accumulation starts at 1
+println(List().fold(1)(_ + _))  // unlike reduce, does not fail on an empty input
+println(List(1, 2, 3, 4).fold(2)(_*_))  // returns the double the product of the elements of the input list
+
+// output:
+10
+11
+1
+48
+
+ + + diff --git "a/Chip/Chip/3. 2023.11.07-Verilog\350\257\255\346\263\225.html" "b/Chip/Chip/3. 2023.11.07-Verilog\350\257\255\346\263\225.html" new file mode 100644 index 0000000..9e3a104 --- /dev/null +++ "b/Chip/Chip/3. 2023.11.07-Verilog\350\257\255\346\263\225.html" @@ -0,0 +1,150 @@ + + + + + + 3. 2023.11.07-Verilog语法 | Personal Blog --from OutisLi + + + + + + + + +
+ + + diff --git "a/Chip/Chip/\344\270\200\347\224\237\344\270\200\350\212\257\350\256\241\345\210\222/\351\242\204\345\255\246\344\271\240\351\230\266\346\256\265.html" "b/Chip/Chip/\344\270\200\347\224\237\344\270\200\350\212\257\350\256\241\345\210\222/\351\242\204\345\255\246\344\271\240\351\230\266\346\256\265.html" new file mode 100644 index 0000000..9e35d8b --- /dev/null +++ "b/Chip/Chip/\344\270\200\347\224\237\344\270\200\350\212\257\350\256\241\345\210\222/\351\242\204\345\255\246\344\271\240\351\230\266\346\256\265.html" @@ -0,0 +1,146 @@ + + + + + + 预学习阶段 | Personal Blog --from OutisLi + + + + + + + + +

# 预学习阶段

+ + + diff --git a/Chip/index.html b/Chip/index.html new file mode 100644 index 0000000..c4aef65 --- /dev/null +++ b/Chip/index.html @@ -0,0 +1,146 @@ + + + + + + SoC Design | Personal Blog --from OutisLi + + + + + + + + +
+ + + diff --git a/LeetCode/LeetCode/2024.02.22-BFS.html b/LeetCode/LeetCode/2024.02.22-BFS.html new file mode 100644 index 0000000..615286b --- /dev/null +++ b/LeetCode/LeetCode/2024.02.22-BFS.html @@ -0,0 +1,150 @@ + + + + + + 2024.02.22-BFS | Personal Blog --from OutisLi + + + + + + + + +
+ + + diff --git "a/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752 \346\211\223\345\274\200\350\275\254\347\233\230\351\224\201\357\274\210BFS\357\274\211.html" "b/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752 \346\211\223\345\274\200\350\275\254\347\233\230\351\224\201\357\274\210BFS\357\274\211.html" new file mode 100644 index 0000000..087c42b --- /dev/null +++ "b/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752 \346\211\223\345\274\200\350\275\254\347\233\230\351\224\201\357\274\210BFS\357\274\211.html" @@ -0,0 +1,322 @@ + + + + + + 2024.02.22-752.打开转盘锁(BFS) | Personal Blog --from OutisLi + + + + + + + + +

# 2024.02.22-752.打开转盘锁(BFS)

/*
+ * @lc app=leetcode.cn id=752 lang=cpp
+ *
+ * [752] 打开转盘锁
+ *
+ * https://leetcode.cn/problems/open-the-lock/description/
+ *
+ * algorithms
+ * Medium (52.77%)
+ * Likes:    653
+ * Dislikes: 0
+ * Total Accepted:    128.3K
+ * Total Submissions: 243.1K
+ * Testcase Example:  '["0201","0101","0102","1212","2002"]\n"0202"'
+ *
+ * 你有一个带有四个圆形拨轮的转盘锁。每个拨轮都有10个数字: '0', '1', '2', '3', '4', '5', '6', '7', '8',
+ * '9' 。每个拨轮可以自由旋转:例如把 '9' 变为 '0','0' 变为 '9' 。每次旋转都只能旋转一个拨轮的一位数字。
+ *
+ * 锁的初始数字为 '0000' ,一个代表四个拨轮的数字的字符串。
+ *
+ * 列表 deadends 包含了一组死亡数字,一旦拨轮的数字和列表里的任何一个元素相同,这个锁将会被永久锁定,无法再被旋转。
+ *
+ * 字符串 target 代表可以解锁的数字,你需要给出解锁需要的最小旋转次数,如果无论如何不能解锁,返回 -1 。
+ *
+ *
+ *
+ * 示例 1:
+ *
+ *
+ * 输入:deadends = ["0201","0101","0102","1212","2002"], target = "0202"
+ * 输出:6
+ * 解释:
+ * 可能的移动序列为 "0000" -> "1000" -> "1100" -> "1200" -> "1201" -> "1202" -> "0202"。
+ * 注意 "0000" -> "0001" -> "0002" -> "0102" -> "0202" 这样的序列是不能解锁的,
+ * 因为当拨动到 "0102" 时这个锁就会被锁定。
+ *
+ *
+ * 示例 2:
+ *
+ *
+ * 输入: deadends = ["8888"], target = "0009"
+ * 输出:1
+ * 解释:把最后一位反向旋转一次即可 "0000" -> "0009"。
+ *
+ *
+ * 示例 3:
+ *
+ *
+ * 输入: deadends = ["8887","8889","8878","8898","8788","8988","7888","9888"],
+ * target = "8888"
+ * 输出:-1
+ * 解释:无法旋转到目标数字且不被锁定。
+ *
+ *
+ *
+ *
+ * 提示:
+ *
+ *
+ * 1 <= deadends.length <= 500
+ * deadends[i].length == 4
+ * target.length == 4
+ * target 不在 deadends 之中
+ * target 和 deadends[i] 仅由若干位数字组成
+ *
+ *
+ */
+
class Solution
+{
+public:
+    int openLock(vector<string> &deadends, string target)
+    {
+        int num = 0;
+        queue<string> q;
+        set<string> visited(deadends.begin(), deadends.end());
+        if (visited.find("0000") != visited.end())
+            return -1;
+        q.push("0000");
+        visited.insert("0000");
+        while (!q.empty())
+        {
+            int ssize = q.size();
+            for (int i = 0; i < ssize; i++)
+            {
+                string str = q.front();
+                q.pop();
+                // if (visited.find(str) != visited.end())
+                //     continue;
+                if (str == target)
+                    return num;
+                for (int j = 0; j < 4; j++)
+                {
+                    string up = turnUp(str, j);
+                    string down = turnDown(str, j);
+                    if (visited.find(up) == visited.end())
+                    {
+                        q.push(up);
+                        visited.insert(up);
+                    }
+                    if (visited.find(down) == visited.end())
+                    {
+                        q.push(down);
+                        visited.insert(down);
+                    }
+                }
+            }
+            num++;
+        }
+        return -1;
+    }
+    string turnUp(string str, int index)
+    {
+        char old = str[index];
+        char nnew = (old != '9') ? (old + 1) : '0';
+        string newString = str;
+        newString[index] = nnew;
+        return newString;
+    }
+    string turnDown(string str, int index)
+    {
+        char old = str[index];
+        char nnew = (old != '0') ? (old - 1) : '9';
+        string newString = str;
+        newString[index] = nnew;
+        return newString;
+    }
+};
+

# Hint:

  1. 修改string的某一个字符直接使用[]索引修改即可
  2. 字符’0‘到’1‘直接加一
  3. deadends中的字符串以及已经访问过的字符串应该在尝试加入队列之前就被过滤掉,以防止它们被进一步处理。而不是从队列中拿出来的时候检查是不是在visited
  4. 起始的“0000”也要检查
  5. 使用双向 BFS 可以加快速度,但是 queue 修改为 set,如下:
int openLock(vector<string> &deadends, string target)
+    {
+        unordered_set<string> dead(deadends.begin(), deadends.end());
+        unordered_set<string> begin, end, *set1, *set2;
+
+        if (dead.find("0000") != dead.end() || dead.find(target) != dead.end())
+            return -1;
+
+        int step = 0;
+        begin.insert("0000");
+        end.insert(target);
+
+        while (!begin.empty() && !end.empty())
+        {
+            // 优化搜索,总是从较小的集合开始扩展
+            if (begin.size() > end.size())
+            {
+                set1 = &end;
+                set2 = &begin;
+            }
+            else
+            {
+                set1 = &begin;
+                set2 = &end;
+            }
+            unordered_set<string> temp;
+            for (auto it = set1->begin(); it != set1->end(); ++it)
+            {
+                string str = *it;
+                if (set2->find(str) != set2->end())
+                    return step;
+                if (dead.find(str) != dead.end())
+                    continue;
+                dead.insert(str); // 标记为已访问
+                for (int j = 0; j < 4; ++j)
+                {
+                    string up = turnUp(str, j);
+                    string down = turnDown(str, j);
+                    if (dead.find(up) == dead.end())
+                        temp.insert(up);
+                    if (dead.find(down) == dead.end())
+                        temp.insert(down);
+                }
+            }
+            step++;
+            *set1 = temp; // 更新当前正在扩展的集合
+        }
+        return -1; // 如果没有找到有效路径
+    }
+
  1. 创建一个临时集合(temp)的原因是在每一轮搜索中,我们需要更新当前层次的节点。由于在遍历当前层次的节点时不能直接修改正在遍历的集合(这会影响迭代器的有效性),因此我们先将新发现的节点存储在一个临时集合中。在当前层次的所有节点都遍历完毕后,我们再用这个临时集合来更新主集合,为下一轮搜索做准备。
+ + + diff --git "a/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221.html" "b/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221.html" new file mode 100644 index 0000000..34df983 --- /dev/null +++ "b/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221.html" @@ -0,0 +1,154 @@ + + + + + + 2024.03.05-二叉树 | Personal Blog --from OutisLi + + + + + + + + +
+ + + diff --git "a/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221/2024 03 05-104 \344\272\214\345\217\211\346\240\221\347\232\204\346\234\200\345\244\247\346\267\261\345\272\246 c6649929175d46038db921b552f2a235.html" "b/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221/2024 03 05-104 \344\272\214\345\217\211\346\240\221\347\232\204\346\234\200\345\244\247\346\267\261\345\272\246 c6649929175d46038db921b552f2a235.html" new file mode 100644 index 0000000..f8d494a --- /dev/null +++ "b/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221/2024 03 05-104 \344\272\214\345\217\211\346\240\221\347\232\204\346\234\200\345\244\247\346\267\261\345\272\246 c6649929175d46038db921b552f2a235.html" @@ -0,0 +1,245 @@ + + + + + + 2024.03.05-104.二叉树的最大深度 | Personal Blog --from OutisLi + + + + + + + + +

# 2024.03.05-104.二叉树的最大深度

/*
+ * @lc app=leetcode.cn id=104 lang=cpp
+ *
+ * [104] 二叉树的最大深度
+ *
+ * https://leetcode.cn/problems/maximum-depth-of-binary-tree/description/
+ *
+ * algorithms
+ * Easy (77.10%)
+ * Likes:    1786
+ * Dislikes: 0
+ * Total Accepted:    1.2M
+ * Total Submissions: 1.6M
+ * Testcase Example:  '[3,9,20,null,null,15,7]'
+ *
+ * 给定一个二叉树 root ,返回其最大深度。
+ *
+ * 二叉树的 最大深度 是指从根节点到最远叶子节点的最长路径上的节点数。
+ *
+ *
+ *
+ * 示例 1:
+ *
+ *
+ *
+ *
+ *
+ *
+ * 输入:root = [3,9,20,null,null,15,7]
+ * 输出:3
+ *
+ *
+ * 示例 2:
+ *
+ *
+ * 输入:root = [1,null,2]
+ * 输出:2
+ *
+ *
+ *
+ *
+ * 提示:
+ *
+ *
+ * 树中节点的数量在 [0, 10^4] 区间内。
+ * -100 <= Node.val <= 100
+ *
+ *
+ */
+
+// @lc code=start
+/
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ *     int val;
+ *     TreeNode *left;
+ *     TreeNode *right;
+ *     TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+// @lc code=end
+
  1. 递归:分解成左右子树
class Solution
+{
+public:
+    int res;
+    int maxDepth(TreeNode *root)
+    {
+        if (root == nullptr)
+            return 0;
+        int tempLeft = maxDepth(root->left);
+        int tempRight = maxDepth(root->right);
+        return res = max(tempLeft, tempRight) + 1;
+    }
+};
+
  1. 遍历:进入节点(前序)加深度,离开节点(后序)减深度,叶子结点处更新结果
class Solution {
+public:
+    int res, temp;
+    int maxDepth(TreeNode* root) {
+        traverse(root);
+        return res;
+    }
+private:
+    void traverse(TreeNode* node){
+        if(node == nullptr){
+            res = max(res,temp);
+            return;
+        }
+        temp++;
+        traverse(node->left);
+        traverse(node->right);
+        temp--;
+    }
+};
+
+ + + diff --git "a/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221/2024 03 05-543 \344\272\214\345\217\211\346\240\221\347\232\204\347\233\264\345\276\204 9db6d046b0954b45b96ca749922a2ece.html" "b/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221/2024 03 05-543 \344\272\214\345\217\211\346\240\221\347\232\204\347\233\264\345\276\204 9db6d046b0954b45b96ca749922a2ece.html" new file mode 100644 index 0000000..94e86dc --- /dev/null +++ "b/LeetCode/LeetCode/2024.03.05-\344\272\214\345\217\211\346\240\221/2024 03 05-543 \344\272\214\345\217\211\346\240\221\347\232\204\347\233\264\345\276\204 9db6d046b0954b45b96ca749922a2ece.html" @@ -0,0 +1,231 @@ + + + + + + 2024.03.05-543.二叉树的直径 | Personal Blog --from OutisLi + + + + + + + + +

# 2024.03.05-543.二叉树的直径

/*
+ * @lc app=leetcode.cn id=543 lang=cpp
+ *
+ * [543] 二叉树的直径
+ *
+ * https://leetcode.cn/problems/diameter-of-binary-tree/description/
+ *
+ * algorithms
+ * Easy (59.72%)
+ * Likes:    1495
+ * Dislikes: 0
+ * Total Accepted:    387.9K
+ * Total Submissions: 649.5K
+ * Testcase Example:  '[1,2,3,4,5]'
+ *
+ * 给你一棵二叉树的根节点,返回该树的 直径 。
+ *
+ * 二叉树的 直径 是指树中任意两个节点之间最长路径的 长度 。这条路径可能经过也可能不经过根节点 root 。
+ *
+ * 两节点之间路径的 长度 由它们之间边数表示。
+ *
+ *
+ *
+ * 示例 1:
+ *
+ *
+ * 输入:root = [1,2,3,4,5]
+ * 输出:3
+ * 解释:3 ,取路径 [4,2,1,3] 或 [5,2,1,3] 的长度。
+ *
+ *
+ * 示例 2:
+ *
+ *
+ * 输入:root = [1,2]
+ * 输出:1
+ *
+ *
+ *
+ *
+ * 提示:
+ *
+ *
+ * 树中节点数目在范围 [1, 10^4] 内
+ * -100 <= Node.val <= 100
+ *
+ *
+ */
+
+// @lc code=start
+/
+ * Definition for a binary tree node.
+ * struct TreeNode {
+ *     int val;
+ *     TreeNode *left;
+ *     TreeNode *right;
+ *     TreeNode() : val(0), left(nullptr), right(nullptr) {}
+ *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
+ *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
+ * };
+ */
+class Solution {
+public:
+    int res = 0;
+    int diameterOfBinaryTree(TreeNode* root) {
+        traverse(root,res);
+        return res;
+    }
+    // cal the maxDepth
+    int traverse(TreeNode* node,int& res){
+        if(node == nullptr){
+            return 0;
+        }
+        int leftMax = traverse(node->left,res);
+        int rightMax = traverse(node->right,res);
+        int nodeMax = max(leftMax,rightMax)+1;
+        res = max(res,leftMax+rightMax);
+        return nodeMax;
+    }
+};
+// @lc code=end
+
+ + + diff --git "a/LeetCode/LeetCode/2024.03.10-\346\273\221\345\212\250\347\252\227\345\217\243.html" "b/LeetCode/LeetCode/2024.03.10-\346\273\221\345\212\250\347\252\227\345\217\243.html" new file mode 100644 index 0000000..477b7fe --- /dev/null +++ "b/LeetCode/LeetCode/2024.03.10-\346\273\221\345\212\250\347\252\227\345\217\243.html" @@ -0,0 +1,150 @@ + + + + + + 2024.03.10-滑动窗口 | Personal Blog --from OutisLi + + + + + + + + +

# 2024.03.10-滑动窗口

+ + + diff --git a/LeetCode/index.html b/LeetCode/index.html new file mode 100644 index 0000000..21b743a --- /dev/null +++ b/LeetCode/index.html @@ -0,0 +1,146 @@ + + + + + + LeetCode | Personal Blog --from OutisLi + + + + + + + + +
+ + + diff --git a/Research/Research/2023-Geant4.html b/Research/Research/2023-Geant4.html new file mode 100644 index 0000000..8642784 --- /dev/null +++ b/Research/Research/2023-Geant4.html @@ -0,0 +1,146 @@ + + + + + + 2023-Geant4 | Personal Blog --from OutisLi + + + + + + + + +
+ + + diff --git "a/Research/Research/2023-Geant4/2023.02.13-\345\234\250\350\266\205\347\256\227\344\270\212\346\220\255\345\273\272Singularity\347\216\257\345\242\203\345\271\266\351\205\215\347\275\256Geant4.html" "b/Research/Research/2023-Geant4/2023.02.13-\345\234\250\350\266\205\347\256\227\344\270\212\346\220\255\345\273\272Singularity\347\216\257\345\242\203\345\271\266\351\205\215\347\275\256Geant4.html" new file mode 100644 index 0000000..00a0068 --- /dev/null +++ "b/Research/Research/2023-Geant4/2023.02.13-\345\234\250\350\266\205\347\256\227\344\270\212\346\220\255\345\273\272Singularity\347\216\257\345\242\203\345\271\266\351\205\215\347\275\256Geant4.html" @@ -0,0 +1,223 @@ + + + + + + 2023.02.13-在超算上搭建Singularity环境并配置Geant4 | Personal Blog --from OutisLi + + + + + + + + +

# 2023.02.13-在超算上搭建Singularity环境并配置Geant4

# I. 制作singularity包

# 1. 进入fakeroot节点

ssh <user_id>@162.105.133.209
+

# 2. 制作并进入sandbox镜像

  1. 搭建ubuntu

    singularity build --fakeroot --sandbox Geant4 docker://ubuntu:22.04
    +
  2. 进入Geant4环境(sandbox)

    singularity shell --fakeroot -w Geant4
    +

# 3. 配置geant4环境

  1. 安装基本环境

    apt-get install build-essential
    +apt-get install wget
    +
  2. 下载geant4

    mkdir geant4
    +wget https://geant4-data.web.cern.ch/releases/geant4-v11.1.0.tar.gz
    +tar -xzvf geant4-v11.1.0.tar.gz
    +
  3. 安装依赖包(若报错,则分别单独安装)

    sudo apt-get install -y cmake libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev libhdf5-serial-dev hdf5-tools
    +sudo apt-get install -y libexpat1-dev
    +sudo apt install -y qt5*
    +
  4. 编译安装

    mkdir build
    +cd build
    +cmake -DCMAKE_INSTALL_PREFIX=/root/Geant4/home/geant4 /root/Geant4/home/geant4-v11.1.0
    +cmake -DGEANT4_INSTALL_DATA=ON .
    +make -jN  # N表示处理器数量,需修改为实际值
    +make install
    +
  5. 配置环境变量

    cd /root/Geant4/etc/skel/
    +vim .bashrc
    +

    将下列内容添加到 .bashrc

    source /root/Geant4/home/geant4/bin/geant4.sh
    +source /root/Geant4/home/geant4/share/Geant4/geant4make/geant4make.sh
    +

    配置

    cp /root/Geant4/etc/skel/.bashrc /root/Geant4/home
    +cd /root/Geant4/home
    +source .bashrc
    +
  6. 检验geant4是否配置成功

    cd /root/Geant4/home/geant4/share/Geant4/examples/basic/B1
    +mkdir build && cd build
    +cmake ..
    +make
    +./exampleB1 run1.mac
    +

    若无报错则配置成功

  7. 退出

    exit
    +

# 4. 打包

singularity build --fakeroot s-Geant4.sif Geant4/
+

# II. 配置go&singularity

# 1. 配置go环境

# 超算Data节点
+export VERSION=1.17.2 OS=linux ARCH=amd64
+wget https://dl.google.com/go/go$VERSION.$OS-$ARCH.tar.gz
+tar -xzvf go1.17.2.linux-amd64.tar.gz
+rm -f go1.17.2.linux-amd64.tar.gz
+export PATH=/lustre/home/<user_id>/go/bin:$PATH
+

# 2. 安装singularity

module load singularity/3.11.3
+

# 3. 环境变量

cd $HOME
+vim .bashrc
+# 将下列语句添加到.bashrc中
+# export PATH=/lustre/home/<user_id>/go/bin:$PATH
+source .bashrc
+

# III. 启用singularity

# 1. 将SIF镜像下载到常规节点

scp -r <user_id>@162.105.133.209:/home/<user_id>/s-Geant4.sif /gpfs/share/home/<user_id>/
+

# 2. 转换成sandbox镜像并启用

singularity build --sandbox Geant4 s-Geant4.sif
+singularity shell -w Geant4
+

# 3. 配置环境变量

cd Geant4/home
+vim .bashrc
+
+# 将下列语句添加到文件末尾
+# source /lustre/home/2201210084/singularity/Geant4/home/geant4/bin/geant4.sh
+# source /lustre/home/2201210084/singularity/Geant4/home/geant4/share/Geant4/geant4make/geant4make.sh
+
+source .bashrc
+

看见如下字样表示成功

Untitled

# IV. 附录

# 1. SIF容器与sandbox相互转换

# 1. 将SIF格式的容器转换成sandbox;
+singularity build --sandbox XXX XXX.sif
+
+# 2. 将sandbox容器镜像转化成SIF格式;
+singularity build XXX.sif XXX
+

# 2. 在fakeroot节点上删除sandbox镜像

# 假设要删除的为文件夹名为molspin的sandbox镜像
+
+# 首先,以可读的模式进入要删除的镜像
+singularity shell --fakeroot -w molspin
+
+# 删除掉容器中,基于fakeroot创建的所有文件
+rm -rf /* 1>/dev/null 2>&1
+
+# 退出镜像
+exit
+
+# 将创建好的软件镜像上传到高性能计算集群,加载singularity软件环境
+# 删除掉剩下的
+rm -rf molspin
+
+ + + diff --git "a/Research/Research/2023-Geant4/2023.02.27-\345\244\204\347\220\206Geant4\350\216\267\345\217\226\347\232\204\346\225\260\346\215\256.html" "b/Research/Research/2023-Geant4/2023.02.27-\345\244\204\347\220\206Geant4\350\216\267\345\217\226\347\232\204\346\225\260\346\215\256.html" new file mode 100644 index 0000000..679ac55 --- /dev/null +++ "b/Research/Research/2023-Geant4/2023.02.27-\345\244\204\347\220\206Geant4\350\216\267\345\217\226\347\232\204\346\225\260\346\215\256.html" @@ -0,0 +1,457 @@ + + + + + + 2023.02.27-处理Geant4获取的数据 | Personal Blog --from OutisLi + + + + + + + + +

# 2023.02.27-处理Geant4获取的数据

# 直方图 Histogram

import copy
+import os
+import sys
+import pandas as pd
+import numpy as np
+import matplotlib.pyplot as plt
+
+# Path of the file to read
+path = "../output_below.csv"
+# open the csv file
+df = pd.read_csv(path)
+
+# columns of the csv file
+particleName = df.iloc[:, 0].values.tolist()
+eventID = df.iloc[:, 1].values.tolist()
+trackID = df.iloc[:, 2].values.tolist()
+preVolumeName = df.iloc[:, 3].values.tolist()
+preX = df.iloc[:, 4].values.tolist()
+preY = df.iloc[:, 5].values.tolist()
+preZ = df.iloc[:, 6].values.tolist()
+preKE = df.iloc[:, 7].values.tolist()
+preProcessName = df.iloc[:, 8].values.tolist()
+postProcessName = df.iloc[:, 9].values.tolist()
+postVolumeName = df.iloc[:, 10].values.tolist()
+postX = df.iloc[:, 11].values.tolist()
+postY = df.iloc[:, 12].values.tolist()
+postZ = df.iloc[:, 13].values.tolist()
+postKE = df.iloc[:, 14].values.tolist()
+depositEnergy = df.iloc[:, 15].values.tolist()
+stepLength = df.iloc[:, 16].values.tolist()
+trackLength = df.iloc[:, 17].values.tolist()
+
+# get the energy density
+unit = 'MeV*cm^2/g'
+densitySiC = 3.217 * 1e-3import os
+import sys
+import pandas as pd
+import numpy as np
+import matplotlib.pyplot as plt
+
+# Path of the file to read
+path = "../output_below.csv"
+
+# open the csv file
+df = pd.read_csv(path)
+
+# columns of the csv file
+particleName = df.iloc[:, 0].values.tolist()
+eventID = df.iloc[:, 1].values.tolist()
+trackID = df.iloc[:, 2].values.tolist()
+preVolumeName = df.iloc[:, 3].values.tolist()
+preX = df.iloc[:, 4].values.tolist()
+preY = df.iloc[:, 5].values.tolist()
+preZ = df.iloc[:, 6].values.tolist()
+preKE = df.iloc[:, 7].values.tolist()
+preProcessName = df.iloc[:, 8].values.tolist()
+postProcessName = df.iloc[:, 9].values.tolist()
+postVolumeName = df.iloc[:, 10].values.tolist()
+postX = df.iloc[:, 11].values.tolist()
+postY = df.iloc[:, 12].values.tolist()
+postZ = df.iloc[:, 13].values.tolist()
+postKE = df.iloc[:, 14].values.tolist()
+depositEnergy = df.iloc[:, 15].values.tolist()
+stepLength = df.iloc[:, 16].values.tolist()
+trackLength = df.iloc[:, 17].values.tolist()
+
+# get the energy density
+unit = 'MeV*cm^2/g'
+densitySiC = 3.217 * 1e-3
+densityAl = 2.6989 * 1e-3
+densitySi = 2.3296 * 1e-3
+densitySiO2 = 2.2 * 1e-3
+depositEnergy = np.array(depositEnergy)
+stepLength = np.array(stepLength)
+depositEnergyDensity = depositEnergy / stepLength
+for i in range(len(preVolumeName)):
+    if preVolumeName[i].strip() == 'V1':
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySi
+        continue
+    if preVolumeName[i].strip() == 'V2':
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySiO2
+        continue
+    if (preVolumeName[i].strip() == 'Vs1') or (preVolumeName[i].strip() == 'Vs2') or (preVolumeName[i].strip() == 'VD'):
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densityAl
+        continue
+    else:
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySiC
+depositEnergyDensity = depositEnergyDensity.tolist()
+depositEnergyDensity250000 = []
+preX_250000=[]
+preZ_250000=[]
+for i in range(len(depositEnergyDensity)):
+    if depositEnergyDensity[i] < 250000:
+        depositEnergyDensity250000.append(depositEnergyDensity[i])
+        preX_250000.append(preX[i])
+        preZ_250000.append(preZ[i])
+
+# draw the heatmap according to the coordinates and the energy deposit
+# the energy deposit is the color of the heatmap
+# the coordinates are the x and y axis of the heatmap
+# the z axis is the energy deposit
+# the colorbar is the energy deposit
+# draw the heatmap
+plt.scatter(preX, preZ, c=depositEnergy, s=0.1, cmap='jet',marker='.')
+plt.xlabel("preX")
+plt.ylabel("preZ")
+plt.title("heatmap_total")
+plt.colorbar()
+plt.savefig("heatmap_total.png", dpi=500)
+plt.show()
+
+plt.scatter(preX, preZ, c=depositEnergyDensity, s=0.1, cmap='jet',marker='.')
+plt.xlabel("preX")
+plt.ylabel("preZ")
+plt.title("heatmap_total")
+plt.colorbar()
+plt.savefig("heatmap_density_total.png", dpi=500)
+plt.show()
+
+plt.scatter(preX_250000, preZ_250000, c=depositEnergyDensity250000, s=1, cmap='jet',marker='.')
+plt.xlabel("preX")
+plt.ylabel("preZ")
+plt.title("heatmap_<250000")
+plt.colorbar()
+plt.savefig("heatmap_density_2500000.png", dpi=500)
+plt.show(
+densityAl = 2.6989 * 1e-3
+densitySi = 2.3296 * 1e-3
+densitySiO2 = 2.2 * 1e-3
+depositEnergy = np.array(depositEnergy)
+stepLength = np.array(stepLength)
+depositEnergyDensity = depositEnergy / stepLength
+for i in range(len(preVolumeName)):
+    if preVolumeName[i].strip() == 'V1':
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySi
+        continue
+    if preVolumeName[i].strip() == 'V2':
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySiO2
+        continue
+    if (preVolumeName[i].strip() == 'Vs1') or (preVolumeName[i].strip() == 'Vs2') or (preVolumeName[i].strip() == 'VD'):
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densityAl
+        continue
+    else:
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySiC
+depositEnergyDensity = depositEnergyDensity.tolist()
+depositEnergyDensity250000 = []
+for i in range(len(depositEnergyDensity)):
+    if depositEnergyDensity[i] < 250000:
+        depositEnergyDensity250000.append(depositEnergyDensity[i])
+        
+# draw the histogram of the energy deposit
+plt.hist(depositEnergy, bins=50, facecolor="blue",
+         edgecolor="black", alpha=0.7)
+# plt.yscale('log')
+plt.xlabel("depositEnergy(MeV)")
+plt.ylabel("Number")
+plt.title("depositEnergy_total")
+plt.savefig("depositEnergy_total.png", dpi=500)
+plt.show()
+
+# draw the histogram of the energy deposit density
+plt.hist(depositEnergyDensity, bins=50, facecolor="blue",
+         edgecolor="black", alpha=0.7)
+plt.yscale('log')
+plt.xlabel("depositEnergyDensity(MeV*cm^2/g)")
+plt.ylabel("Number")
+plt.title("depositEnergyDensity_total")
+plt.savefig("depositEnergyDensity_total.png", dpi=500)
+plt.show()
+
+# make a dictionary of the columns
+names = [('V1', []), ('V2', []), ('V31', []), ('V32', []), ('V51', []), ('V52', []), ('V66', []), ('VD', []),
+         ('Vs1', []), ('Vs2', []), ('V7', [])]
+dict_dp = dict(names)
+dict_dpd = copy.deepcopy(dict_dp)
+# extract the keys of the dictionary to a list
+volumeNames = list(dict_dp.keys())
+
+# for every column, determine the preVolumeName and fill the dictionary
+for i in range(len(preVolumeName)):
+    for j in volumeNames:
+        if preVolumeName[i].strip() == j:
+            dict_dp[j].append(depositEnergy[i])
+            dict_dpd[j].append(depositEnergyDensity[i])
+            break
+
+# draw the histogram of the energy deposit for each volume and merge in one page
+plt.figure(figsize=(16, 16))
+for i in range(len(volumeNames)):
+    plt.subplot(3, 4, i + 1)
+    plt.hist(dict_dp[volumeNames[i]], bins=50,
+             facecolor="blue", edgecolor="black", alpha=0.7)
+    # plt.yscale('log')
+    plt.xlabel("depositEnergy(MeV)")
+    plt.ylabel("Number")
+    plt.title(volumeNames[i])
+plt.savefig("depositEnergy_each.png", dpi=500)
+plt.show()
+
+# draw the histogram of the energy deposit density for each volume and merge in one page
+plt.figure(figsize=(16, 16))
+for i in range(len(volumeNames)):
+    plt.subplot(3, 4, i + 1)
+    plt.hist(dict_dpd[volumeNames[i]], bins=50,
+             facecolor="blue", edgecolor="black", alpha=0.7)
+    # plt.yscale('log')
+    plt.xlabel("depositEnergyDensity(MeV*cm^2/g)")
+    plt.ylabel("Number")
+    plt.title(volumeNames[i])
+plt.savefig("depositEnergyDensity_each.png", dpi=500)
+plt.show()
+

# 热力图 Heatmap

import os
+import sys
+import pandas as pd
+import numpy as np
+import matplotlib.pyplot as plt
+
+# Path of the file to read
+path = "../output_below.csv"
+
+# open the csv file
+df = pd.read_csv(path)
+
+# columns of the csv file
+particleName = df.iloc[:, 0].values.tolist()
+eventID = df.iloc[:, 1].values.tolist()
+trackID = df.iloc[:, 2].values.tolist()
+preVolumeName = df.iloc[:, 3].values.tolist()
+preX = df.iloc[:, 4].values.tolist()
+preY = df.iloc[:, 5].values.tolist()
+preZ = df.iloc[:, 6].values.tolist()
+preKE = df.iloc[:, 7].values.tolist()
+preProcessName = df.iloc[:, 8].values.tolist()
+postProcessName = df.iloc[:, 9].values.tolist()
+postVolumeName = df.iloc[:, 10].values.tolist()
+postX = df.iloc[:, 11].values.tolist()
+postY = df.iloc[:, 12].values.tolist()
+postZ = df.iloc[:, 13].values.tolist()
+postKE = df.iloc[:, 14].values.tolist()
+depositEnergy = df.iloc[:, 15].values.tolist()
+stepLength = df.iloc[:, 16].values.tolist()
+trackLength = df.iloc[:, 17].values.tolist()
+
+# get the energy density
+unit = 'MeV*cm^2/g'
+densitySiC = 3.217 * 1e-3
+densityAl = 2.6989 * 1e-3
+densitySi = 2.3296 * 1e-3
+densitySiO2 = 2.2 * 1e-3
+depositEnergy = np.array(depositEnergy)
+stepLength = np.array(stepLength)
+depositEnergyDensity = depositEnergy / stepLength
+for i in range(len(preVolumeName)):
+    if preVolumeName[i].strip() == 'V1':
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySi
+        continue
+    if preVolumeName[i].strip() == 'V2':
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySiO2
+        continue
+    if (preVolumeName[i].strip() == 'Vs1') or (preVolumeName[i].strip() == 'Vs2') or (preVolumeName[i].strip() == 'VD'):
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densityAl
+        continue
+    else:
+        depositEnergyDensity[i] = depositEnergyDensity[i] / densitySiC
+depositEnergyDensity = depositEnergyDensity.tolist()
+depositEnergyDensity250000 = []
+preX_250000=[]
+preZ_250000=[]
+for i in range(len(depositEnergyDensity)):
+    if depositEnergyDensity[i] < 250000:
+        depositEnergyDensity250000.append(depositEnergyDensity[i])
+        preX_250000.append(preX[i])
+        preZ_250000.append(preZ[i])
+
+# draw the heatmap according to the coordinates and the energy deposit
+# the energy deposit is the color of the heatmap
+# the coordinates are the x and y axis of the heatmap
+# the z axis is the energy deposit
+# the colorbar is the energy deposit
+# draw the heatmap
+plt.scatter(preX, preZ, c=depositEnergy, s=0.1, cmap='jet',marker='.')
+plt.xlabel("preX")
+plt.ylabel("preZ")
+plt.title("heatmap_total")
+plt.colorbar()
+plt.savefig("heatmap_total.png", dpi=500)
+plt.show()
+
+plt.scatter(preX, preZ, c=depositEnergyDensity, s=0.1, cmap='jet',marker='.')
+plt.xlabel("preX")
+plt.ylabel("preZ")
+plt.title("heatmap_total")
+plt.colorbar()
+plt.savefig("heatmap_density_total.png", dpi=500)
+plt.show()
+
+plt.scatter(preX_250000, preZ_250000, c=depositEnergyDensity250000, s=1, cmap='jet',marker='.')
+plt.xlabel("preX")
+plt.ylabel("preZ")
+plt.title("heatmap_<250000")
+plt.colorbar()
+plt.savefig("heatmap_density_2500000.png", dpi=500)
+plt.show()
+
+ + + diff --git "a/Research/Research/2023-Geant4/2023.03.12-PKA\346\225\260\346\215\256\345\244\204\347\220\206.html" "b/Research/Research/2023-Geant4/2023.03.12-PKA\346\225\260\346\215\256\345\244\204\347\220\206.html" new file mode 100644 index 0000000..c75e697 --- /dev/null +++ "b/Research/Research/2023-Geant4/2023.03.12-PKA\346\225\260\346\215\256\345\244\204\347\220\206.html" @@ -0,0 +1,154 @@ + + + + + + 2023.03.12-PKA数据处理 | Personal Blog --from OutisLi + + + + + + + + +

# 2023.03.12-PKA数据处理

23-03-12_Geant4_PKA_Data.pdf

+ + + diff --git "a/Research/Research/2023-Geant4/2023.05.23-Geant4\345\244\232\347\262\222\345\255\220\346\272\220\350\256\276\347\275\256.html" "b/Research/Research/2023-Geant4/2023.05.23-Geant4\345\244\232\347\262\222\345\255\220\346\272\220\350\256\276\347\275\256.html" new file mode 100644 index 0000000..3769f70 --- /dev/null +++ "b/Research/Research/2023-Geant4/2023.05.23-Geant4\345\244\232\347\262\222\345\255\220\346\272\220\350\256\276\347\275\256.html" @@ -0,0 +1,183 @@ + + + + + + 2023.05.23-Geant4多粒子源设置 | Personal Blog --from OutisLi + + + + + + + + +

# 2023.05.23-Geant4多粒子源设置

源代码:

// Create particle source
+G4GeneralParticleSource* particleSource = new G4GeneralParticleSource();
+
+// First particle source
+particleSource->SetCurrentSourceto(particleSource->GetNumberofSource() - 1);
+particleSource->GetCurrentSource()->GetPosDist()->SetCentreCoords(G4ThreeVector(-5.0*cm, 0.0, 0.0));
+particleSource->GetCurrentSource()->GetAngDist()->SetAngDistType("iso");
+particleSource->GetCurrentSource()->GetEneDist()->SetEnergyDisType("Mono");
+particleSource->GetCurrentSource()->GetEneDist()->SetMonoEnergy(10*MeV);
+particleSource->GetCurrentSource()->SetParticleDefinition(G4Neutron::NeutronDefinition());
+
+// Point source
+particleSource->GetCurrentSource()->GetPosDist()->SetPosDisType("Point");
+
+// Second particle source
+particleSource->AddaSource(1.0);
+particleSource->SetCurrentSourceto(particleSource->GetNumberofSource() - 1);
+particleSource->GetCurrentSource()->GetPosDist()->SetCentreCoords(G4ThreeVector(5.0*cm, 0.0, 0.0));
+particleSource->GetCurrentSource()->GetAngDist()->SetAngDistType("iso");
+particleSource->GetCurrentSource()->GetEneDist()->SetEnergyDisType("Mono");
+particleSource->GetCurrentSource()->GetEneDist()->SetMonoEnergy(20*MeV);
+particleSource->GetCurrentSource()->SetParticleDefinition(G4Proton::ProtonDefinition());
+
+// Plane source
+particleSource->GetCurrentSource()->GetPosDist()->SetPosDisType("Plane");
+particleSource->GetCurrentSource()->GetPosDist()->SetPosDisShape("Circle");
+particleSource->GetCurrentSource()->GetPosDist()->SetRadius(2*cm);
+

mac文件内:

/gps/source/0/intensity 500
+/gps/source/1/intensity 1000
+
+ + + diff --git "a/Research/Research/2023-Geant4/2023.06.14-Geant4\345\220\204\347\211\210\346\234\254\347\232\204\345\256\211\350\243\205.html" "b/Research/Research/2023-Geant4/2023.06.14-Geant4\345\220\204\347\211\210\346\234\254\347\232\204\345\256\211\350\243\205.html" new file mode 100644 index 0000000..024045b --- /dev/null +++ "b/Research/Research/2023-Geant4/2023.06.14-Geant4\345\220\204\347\211\210\346\234\254\347\232\204\345\256\211\350\243\205.html" @@ -0,0 +1,174 @@ + + + + + + 2023.06.14-Geant4各版本的安装 | Personal Blog --from OutisLi + + + + + + + + +

# 2023.06.14-Geant4各版本的安装

# 安装依赖

sudo apt-get install -y build-essential
+sudo apt-get install -y wget
+// sudo apt-get install -y aptitude
+sudo apt-get install -y cmake libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev libhdf5-serial-dev hdf5-tools
+sudo apt-get install -y libexpat1-dev libxerces-c-dev libxt-dev libmotif-dev
+sudo apt install qt5* qt6* libqt5opengl5-dev
+

# 下载安装Geant4

mkdir Geant4_11.1.1
+wget https://geant4-data.web.cern.ch/releases/geant4-v11.1.1.tar.gz
+// https://gitlab.cern.ch/geant4/geant4/-/archive/v10.5.1/geant4-v10.5.1.tar.gz
+tar -xzvf geant4-v11.1.1.tar.gz
+
+mkdir build
+cd build
+cmake -DCMAKE_INSTALL_PREFIX=/home/tiancheng/Geant4_11.1.1 /home/tiancheng/geant4-v11.1.1
+cmake -DGEANT4_INSTALL_DATA=ON -DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_USE_GDML=ON -DGEANT4_USE_QT=ON -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON -DGEANT4_USE_NETWORKDAWN=ON -DGEANT4_USE_XM=ON -DGEANT4_USE_NETWORKVRML=ON .
+
+make -jN
+make install
+source /root/Geant4/home/geant4/bin/geant4.sh
+source /root/Geant4/home/geant4/share/Geant4/geant4make/geant4make.sh
+
+ + + diff --git "a/Research/Research/2023-Geant4/2023.08.28-Geant4\350\207\252\345\256\232\344\271\211PhysicsList.html" "b/Research/Research/2023-Geant4/2023.08.28-Geant4\350\207\252\345\256\232\344\271\211PhysicsList.html" new file mode 100644 index 0000000..1345386 --- /dev/null +++ "b/Research/Research/2023-Geant4/2023.08.28-Geant4\350\207\252\345\256\232\344\271\211PhysicsList.html" @@ -0,0 +1,321 @@ + + + + + + 2023.08.28-Geant4 自定义 PhysicsList | Personal Blog --from OutisLi + + + + + + + + +

# 2023.08.28-Geant4 自定义 PhysicsList

# 一个最简单的例子

# main:

#include "G4RunManager.hh"
+
+int main()
+{
+    // 初始化 run manager
+    G4RunManager runManager;
+
+    // 设置物理列表
+    runManager.SetUserInitialization(new SimplePhysicsList());
+
+    // ... 其他初始化和设置
+
+    // 开始模拟
+    runManager.BeamOn();
+
+    return 0;
+}
+

# 自定义物理列表类:

#include "G4VModularPhysicsList.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4ProcessManager.hh"
+#include "G4Proton.hh"  // 或其他你关心的粒子
+
+class SimplePhysicsList : public G4VModularPhysicsList
+{
+public:
+    void ConstructParticle() override
+    {
+        // 创建或获取粒子类型
+        G4Proton::ProtonDefinition();
+        // ... 其他粒子
+    }
+
+    void ConstructProcess() override
+    {
+        // 获取粒子的过程管理器
+        G4ProcessManager* pManager = G4Proton::Proton()->GetProcessManager();
+
+        // 添加自定义的碰撞过程
+        pManager->AddDiscreteProcess(new SimpleCollisionProcess());
+    }
+};
+
+void YourCustomPhysicsList::ConstructProcess()
+{
+    // ... other processes
+
+    auto particleIterator = GetParticleIterator();
+    particleIterator->reset();
+
+    while ((*particleIterator)())
+    {
+        G4ParticleDefinition* particle = particleIterator->value();
+        G4ProcessManager* pmanager = particle->GetProcessManager();
+
+        if (YourCustomProcess::IsApplicable(*particle))
+        {
+            pmanager->AddDiscreteProcess(new YourCustomProcess());
+        }
+    }
+}
+

# 自定义碰撞过程类:

#include "G4VDiscreteProcess.hh"
+#include "G4Step.hh"
+#include "G4VParticleChange.hh"
+
+class SimpleCollisionProcess : public G4VDiscreteProcess
+{
+public:
+    G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& /*step*/) override
+    {
+        // 这里执行碰撞后的粒子状态更改
+        // 例如,改变动量、能量等
+
+        aParticleChange.Initialize(track);
+        // aParticleChange.SetXXX(...);  // 设置粒子状态
+        return &aParticleChange;
+    }
+
+    G4double GetMeanFreePath(const G4Track& /*track*/, G4double /*previousStepSize*/, G4ForceCondition* /*condition*/) override
+    {
+        // 返回这个过程的平均自由路径
+        // 这里只返回一个固定的值作为示例
+        return 1.0 * cm;
+    }
+};
+

# 1. 关于必须重新定义的函数:

  • PostStepDoIt: 这个函数用于描述在一步运动后粒子的状态如何改变。这通常是必须要重写的。
  • GetMeanFreePath: 这个函数返回给定粒子在特定条件下的平均自由路径。这通常也需要重写以适应你的模型。

这两个函数通常是最主要需要重写的。然而,根据你的具体需求,有时还可能需要重写其他函数,比如:

  • AlongStepDoIt: 如果你从 G4VContinuousProcess 继承,这个函数用于描述粒子在一步中如何连续地改变。
  • IsApplicable: 这个函数决定这个过程是否应用于某个粒子。
  • AtRestDoIt: 用于描述一个静止粒子如何起始一个新的过程(如果适用)。
  • StartTrackingEndTracking: 这些是在粒子轨迹开始和结束时被调用的。

# 2. 关于 aParticleChange

aParticleChange 是一个 G4VParticleChange 对象,它用于保存由这个过程产生的粒子状态改变。当 PostStepDoIt 被调用时,你需要用它来设置新的粒子状态(如位置、动量、能量等)。这个对象通常是 G4VDiscreteProcessG4VContinuousProcess 的成员变量,由基类初始化。

例如,你可以这样设置新的动量方向:

aParticleChange.ProposeMomentumDirection(newDirection);
+

或者,设置新的能量:

aParticleChange.ProposeEnergy(newEnergy)
+

这样,在 PostStepDoIt 函数返回后,Geant4 会用 aParticleChange 中的信息来更新粒子状态。

  • aParticleChange.Initialize(track)

这个函数初始化 aParticleChange 对象,使其包含给定轨迹(track)的当前状态。这通常是你开始修改粒子状态之前的第一步。

# 3. GetMeanFreePath 的作用

GetMeanFreePath 函数是用来告知 Geant4 在多长的距离后应该调用 PostStepDoIt 函数的。简单地说,这个函数决定了一个物理过程发生的"频率"或者概率。在每一步结束后,Geant4 会评估所有的离散过程来看哪一个将被下一个执行,这一决定是基于每个过程的平均自由路径和其他概率性因素来的。

比如说,如果 GetMeanFreePath 返回了一个很小的数值,这表示该过程非常可能在下一步就会发生。相反地,一个大的返回值意味着该过程相对较不可能发生。

# 4. 多物理过程情形

# 说明:

在 Geant4 中,一粒子的轨迹(track)被分解为多个连续的 "步"(steps)。在每一步结束时,Geant4 会评估所有应用于该粒子类型的离散物理过程(例如电离、散射等)。这个评估的目的是为了决定下一步应该执行哪个过程。

假设我们有三个不同的物理过程 A、B 和 C。每一个都有自己的 GetMeanFreePath 函数,这个函数返回一个距离值,该值表示粒子在该距离后大概会经历该过程。

  1. 计算平均自由路径: 在每一步的结束,Geant4 会调用所有过程的 GetMeanFreePath 函数,获得 A、B、C 的平均自由路径,分别记作λA,λB,λC
  2. 概率性决策: 基于这些平均自由路径和其他概率性因素,Geant4 会计算哪一个过程应该下一个被执行。一种简单的方式是,选择平均自由路径最小的那个过程,因为它更可能发生。但实际的算法可能更加复杂,并考虑其他因素。
  3. 执行过程: 选定了要执行的过程(比如说是过程 A)后,Geant4 就会调用 A 的 PostStepDoIt 函数来实际模拟该过程,更新粒子的状态。
  4. 进入下一步: 根据 PostStepDoIt 的结果,粒子的状态被更新,然后开始下一步的模拟。

这样,通过在每一步结束时动态评估哪一个过程应该被执行,Geant4 能够模拟一个粒子轨迹中多种物理过程的竞争和相互作用。这是为什么需要定义 GetMeanFreePath 的原因:它为这个概率性决策提供了必要的信息。

# 示例:

#include "G4VDiscreteProcess.hh"
+#include "G4Step.hh"
+#include "G4ParticleChange.hh"
+
+class SimpleElasticScattering : public G4VDiscreteProcess {
+public:
+    // ... Constructors, destructor, etc.
+
+    G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step) override {
+        aParticleChange.Initialize(track);
+        // ... Do some calculations for scattering, modify aParticleChange
+        return &aParticleChange;
+    }
+
+    G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*) override {
+        return 1.0;  // Just a constant mean free path for demonstration
+    }
+};
+
+class EnergyAbsorption : public G4VDiscreteProcess {
+public:
+    // ... Constructors, destructor, etc.
+
+    G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step& step) override {
+        aParticleChange.Initialize(track);
+        // ... Do some calculations for energy absorption, modify aParticleChange
+        return &aParticleChange;
+    }
+
+    G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition*) override {
+        return 2.0;  // Another constant mean free path for demonstration
+    }
+};
+

在物理列表中添加:

#include "MyPhysicsList.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4ProcessManager.hh"
+
+void MyPhysicsList::ConstructProcess() {
+    // ... Other setup code
+
+    // Get the process manager for ions (or whatever particle you're interested in)
+    G4ParticleDefinition* ion = G4Ion::IonDefinition();
+    G4ProcessManager* pmanager = ion->GetProcessManager();
+
+    // Add the custom processes
+    SimpleElasticScattering* elasticScattering = new SimpleElasticScattering();
+    EnergyAbsorption* energyAbsorption = new EnergyAbsorption();
+
+    pmanager->AddDiscreteProcess(elasticScattering);
+    pmanager->AddDiscreteProcess(energyAbsorption);
+
+    // ... Other code for adding standard processes
+}
+

# 蒙特卡洛程序嵌入

G4VParticleChange* YourProcess::PostStepDoIt(const G4Track& track, const G4Step& step)
+{
+    aParticleChange.Initialize(track);
+
+    // Execute your methods
+    FreeLength();
+    ChoseCollisionAtom();
+    EleEnergyLoss();
+    EmissionAngle();
+    IonNewCondition();
+
+    // Update particle state in aParticleChange (not shown)
+    // ...
+
+    // Check whether the ion is still under processing
+    int IonFlag = 1;
+    OutOrNot(IonFlag);
+
+    // If IonFlag is changed by OutOrNot() to indicate the ion's journey is done,
+    // you might need additional logic here to finalize the ion's record.
+    // ...
+
+    return &aParticleChange;
+}
+

在 Geant4 中,如果一个粒子已经不再需要进一步处理,你通常需要更新这个粒子的状态,以便 Geant4 知道不再需要追踪这个粒子。这通常是通过设置 G4Track 的状态来完成的,具体来说,是通过 aParticleChange 对象(这通常是 G4VParticleChange 类型或其子类)。

一个简单的例子:

if (some_condition) { // Replace this with your actual stopping condition
+    aParticleChange.ProposeTrackStatus(fStopAndKill);
+}
+
+

在这里,fStopAndKill 是一个枚举值,表示该粒子应停止并被“杀死”,即不再被追踪。其他可用的状态还包括 fStopButAlive(停止但仍然“存活”,可能在以后的时间步重新开始)和 fAlive(继续运动)。

如果在 PostStepDoIt 函数中确定粒子需要被停止,你可以通过上面的代码片段来告诉 Geant4。这样,Geant4 在执行完该步骤后就会知道不再需要对这个粒子进行后续计算。

+ + + diff --git "a/Research/Research/2023-Geant4/2023.09.05-C++ Trim\347\250\213\345\272\217.html" "b/Research/Research/2023-Geant4/2023.09.05-C++ Trim\347\250\213\345\272\217.html" new file mode 100644 index 0000000..ea15920 --- /dev/null +++ "b/Research/Research/2023-Geant4/2023.09.05-C++ Trim\347\250\213\345\272\217.html" @@ -0,0 +1,424 @@ + + + + + + 2023.09.05-C++ Trim 程序 | Personal Blog --from OutisLi + + + + + + + + +

# 2023.09.05-C++ Trim 程序

# 每个粒子端到端的计算

void PKU_MC::DoOneIon()
+{
+	int IonFlag;
+	// init the orginal paramters for current ions
+	InitialIon();
+	IonFlag = 1;
+
+	while (IonFlag == 1) // the current ion are under processing
+	{
+		FreeLength();
+		ChoseCollisionAtom();
+		EleEnergyLoss();
+		EmissionAngle();
+		IonNewCondition();
+		ProcessRecorder();
+		OutOrNot(IonFlag);
+	} // end of one ions
+
+	CollisionRecording(); // add the results of this ion to the recording arraies
+}
+

# InitialIon()

void PKU_MC::InitialIon()
+{
+
+	E = IonEnergyEV;	// Energy
+	COSIN = cos(ALPHA); // direction to the normal
+	SINY = COSIN;
+
+	SINE = sin(ALPHA);
+	COSY = SINE;
+
+	CurrentLayer = 1;
+	IonWayLength = 0;
+	IonCollisionNo = 0;
+	X = 0;
+	Y = 0;
+}
+

# 具体计算

# 1. FreeLength()

double PKU_MC::FreeLength()
+{
+	float tempvalue;
+
+	// when the ion energy is high
+	IonCollisionNo++;
+	ReducedCollEnergy = E * F[CurrentLayer];
+	EEG = sqrt(ReducedCollEnergy * EPSDG[CurrentLayer]);
+	PMAX[CurrentLayer] = A[CurrentLayer] / (EEG + sqrt(EEG) + 0.125 * pow(EEG, 0.1));
+	IonFreeLength = 1.0 / (PI * PMAX[CurrentLayer] * PMAX[CurrentLayer] * ARHO[CurrentLayer]);
+
+	// when the ion enrgy is low
+
+	tempvalue = PKURandom();
+
+	if (IonCollisionNo == 1)
+		IonFreeLength = tempvalue * AMIN1(IonFreeLength, channelwidth);
+
+	return IonFreeLength;
+}
+
  • ReducedCollEnergy: 同样表示与被选中的原子碰撞后的"减少的"能量。
  • E: 未定义在这个函数中,但似乎是离子或粒子的能量。
  • F[CurrentLayer]: 当前层对应的一个因子,用于计算ReducedCollEnergy
  • EEG: 一个与ReducedCollEnergyEPSDG[CurrentLayer]有关的参数。
  • EPSDG[CurrentLayer]: 与当前层有关的一个常数或参数。
  • PMAX[CurrentLayer]: 当前层中的最大动量或概率。
  • A[CurrentLayer]: 当前层对应的一个参数或常数。
  • IonFreeLength: 离子的自由路径长度。
  • ARHO[CurrentLayer]: 当前层的密度或者与密度相关的一个参数。
  • channelwidth: 一个与离子自由路径长度有关的参数或者常数。

# 使用到的变量:

E, F, EPSDG, A, ARHO

# 输出(改变)的变量:

IonCollisionNo, ReducedCollEnergy, IonFreeLength, PMAX

# 2. ChoseCollisionAtom()

double PKU_MC::ChoseCollisionAtom()
+{
+
+	int MaxElement;
+	float tempRandValue;
+
+	tempRandValue = PKURandom();
+	while (tempRandValue == 0)
+	{
+		tempRandValue = PKURandom();
+	}
+	P = PMAX[CurrentLayer] * sqrt(tempRandValue);
+	MaxElement = LayerElementNo[CurrentLayer];
+
+	// decided which kinds of atoms to be knocked!
+
+	tempRandValue = PKURandom();
+
+	for (CurrentElement = 1; CurrentElement <= MaxElement; CurrentElement++)
+	{
+		tempRandValue = tempRandValue - TargetAtomConc[CurrentLayer][CurrentElement];
+		if (tempRandValue < 0)
+			break;
+	}
+	if (tempRandValue >= 0)
+		CurrentElement = LayerElementNo[CurrentLayer];
+
+	ReducedCollEnergy = FItemp[CurrentLayer][CurrentElement] * E;
+	B = P / ScreenLen[CurrentLayer][CurrentElement];
+
+	return TargetAtomNumber[CurrentLayer][CurrentElement];
+}
+
  • P: 未定义在这个函数中,但在函数内部进行了计算。可能是与粒子动量或概率有关的一个参数。
  • PMAX[CurrentLayer]: 当前层中的最大动量或概率。
  • CurrentLayer: 当前所在的层编号。
  • LayerElementNo[CurrentLayer]: 当前层包含的元素(原子)种类数量。
  • CurrentElement: 当前正在考虑的元素(原子)的编号。
  • TargetAtomConc[CurrentLayer][CurrentElement]: 当前层和元素对应的原子浓度或概率。
  • ReducedCollEnergy: 表示与被选中的原子碰撞后的"减少的"能量。
  • FItemp[CurrentLayer][CurrentElement]: 与当前层和元素有关的一个因子,用于计算ReducedCollEnergy
  • E: 未定义在这个函数中,但用于计算ReducedCollEnergy,可能是粒子的能量。
  • B: 另一个与碰撞有关的参数。
  • ScreenLen[CurrentLayer][CurrentElement]: 与当前层和元素有关的一个参数,用于计算B
  • TargetAtomNumber[CurrentLayer][CurrentElement]: 返回的是当前层和元素对应的目标原子的编号。

# 使用到的变量:

PMAX, FItemp, E, ScreenLen

# 改变的变量:

P, ReducedCollEnergy, B

# 3. EleEnergyLoss()

double PKU_MC::EleEnergyLoss()
+{
+	double Ion_Se;
+
+	IE = int(E / IonEnergyKeV + .5);
+	if (IE != 0)
+		SEE = SE[CurrentLayer][IE];
+	if (E < IonEnergyKeV)
+		SEE = SE[CurrentLayer][1] * sqrt(E / IonEnergyKeV);
+	DEE = IonFreeLength * SEE;
+	Ion_Se = DEE;
+	return Ion_Se;
+}
+
  • double Ion_Se: 存储电子或离子的能量损失。
  • IE: 一个与离子或粒子能量E有关的整数变量。
  • E: 离子或粒子的能量,未在此函数内定义。
  • IonEnergyKeV: 离子能量的一个特定单位(千电子伏特,KeV)。
  • SEE: 与离子或粒子能量损失有关的一个参数。
  • SE[CurrentLayer][IE]: 当前层和能量级对应的能量损失率。
  • DEE: 实际能量损失,是IonFreeLength(离子的自由路径长度)和SEE(能量损失率)的乘积。

# 使用的变量:

E, IonEnergyKeV, SE, IonFreeLength

# 改变的变量:

DEE,

# 4. EmissionAngle()

double PKU_MC::EmissionAngle()
+{
+	double AngleValue, R, Q;
+	// using the magic method
+
+	if (ReducedCollEnergy <= 10)
+	{
+		R = B;
+		RR = -2.7 * log(ReducedCollEnergy * B);
+		if (RR >= B)
+		{
+			RR = -2.7 * log(ReducedCollEnergy * RR);
+			if (RR >= B)
+				R = RR;
+		}
+		do
+		{
+			EX1 = 0.18175 * exp(-3.1998 * R);
+			EX2 = 0.50986 * exp(-0.94229 * R);
+			EX3 = 0.28022 * exp(-0.4029 * R);
+			EX4 = 0.028171 * exp(-0.20162 * R);
+			V = (EX1 + EX2 + EX3 + EX4) / R;
+			V1 = -(V + 3.1998 * EX1 + 0.94229 * EX2 + 0.4092 * EX3 + 0.20162 * EX4) / R;
+
+			FR = B * B / R + V * R / ReducedCollEnergy - R;
+			FR1 = -B * B / (R * R) + (V + V1 * R) / ReducedCollEnergy - 1;
+			Q = FR / FR1;
+			R = R - Q;
+		} while (fabs(Q / R) > 0.001);
+
+		ROC = -2.0 * (ReducedCollEnergy - V) / V1;
+		SQE = sqrt(ReducedCollEnergy);
+		CC = (0.011615 + SQE) / (0.0071222 + SQE);
+		AA = 2.0 * ReducedCollEnergy * (1.0 + (0.99229 / SQE)) * pow(B, CC);
+		FF = (sqrt(AA * AA + 1.0) - AA) * ((9.3066 + ReducedCollEnergy) / (14.813 + ReducedCollEnergy));
+		DELTA = (R - B) * AA * FF / (FF + 1.0);
+		CO = (B + DELTA + ROC) / (R + ROC);
+		C2 = CO * CO;
+		S2 = 1.0 - C2;
+		if (S2 < -1)
+			printf("\n%d  %lf\n", ElapsedIonNo, B);
+		CT = 2.0 * C2 - 1.0;
+		ST = sqrt(1.0 - CT * CT);
+	}
+	// using the RusefScattering methods
+	else{
+		S2 = 1.0 / (1.0 + (1.0 + B * (1.0 + B)) * (2.0 * ReducedCollEnergy * B) * (2.0 * ReducedCollEnergy * B));
+		if (S2 < -1)
+			printf("\n%d  %lf\n", ElapsedIonNo, B);
+		C2 = 1.0 - S2;
+		CT = 2.0 * C2 - 1.0;
+		ST = sqrt(1.0 - CT * CT);
+	}
+	AngleValue = acos(CT);
+	return AngleValue;
+}
+

# 使用的变量:

ReducedCollEnergy, B,

# 改变的变量:

RR, ST, S2, CT,

# 5. IonNewCondition()

double PKU_MC::IonNewCondition()
+{
+	double MAX(0), X1; // MAX is not OK!!!!!!!!!!!!!!!!!!!!!!!!!
+	float tempvalue;
+
+	DEN = recoilfactor[CurrentLayer][CurrentElement] * S2 * E;
+	E = E - DEN - DEE;
+	if (DEE > MAX)
+		MAX = DEE;
+	IonWayLength = IonWayLength + IonFreeLength - DistanceNuclear;
+
+	X = X + (IonFreeLength - DistanceNuclear) * COSIN;
+	Y = Y + (IonFreeLength - DistanceNuclear) * COSY;
+
+	I = AMIN1(fabs(X / channelwidth) + 1.0, 100.0);
+	J = AMIN1(fabs(Y / channelwidth) + 1.0, 50.0);
+
+	if ((ALPHA != 0) && (Y <= 0))
+		J = 1;
+
+	tempvalue = PKURandom();
+	PHI = 2.0 * PI * tempvalue;
+
+	PSI = atan(ST / (CT + M1_to_M2[CurrentLayer][CurrentElement]));
+	if (PSI < 0)
+		PSI = PSI + PI;
+	X1 = -COSIN * COSY / (SINE * SINY + pow(10, -8));
+	if (fabs(X1) > 1.0)
+		X1 = X1 / fabs(X1);
+	DELTA = PHI - acos(X1);
+
+	COSIN = COSIN * cos(PSI) + SINE * sin(PSI) * cos(PHI);
+	COSY = COSY * cos(PSI) + SINY * sin(PSI) * cos(DELTA);
+
+	SINY = sqrt(1.0 - COSY * COSY);
+	SINE = sqrt(1.0 - COSIN * COSIN);
+	return 1;
+}
+

# 使用的变量:

recoilfactor, DistanceNuclear, IonFreeLength, channelwidth, ALPHA, M1_to_M2,

if (channelwidth == 0)
+		channelwidth = 0.01 * LayertoSurface[3]; // for recording, the total sample are dividied into 100 segment
+

# 改变的变量:

DEN, E, IonWayLength, COSIN, COSY, X, Y, I, J, PHI, PSI, SINE, SINY, DELTA,

# 6. ProcessRecorder()

void PKU_MC::ProcessRecorder()
+{
+
+	double EPSD, EN;
+
+	// total energy
+	MTOT[I - 1][J] = MTOT[I - 1][J] + DEN + DEE;
+
+	// the nuclear energy loss treamting process
+	if (DEN < DisEnergy)
+		PhoneEDis[I] = PhoneEDis[I] + DEN;
+	else
+	{
+		EPSD = DamageEFract[CurrentLayer] * DEN;
+
+		// Modified Kinchin-Pease  model
+		EN = DEN / (1.0 + ElectronEFract[CurrentLayer] * (EPSD + 0.4 * pow(EPSD, 0.75) + 3.4 * pow(EPSD, (1.0 / 6.0))));
+
+		if (EN < DisEnergy)
+			PhoneEDis[I] = PhoneEDis[I] + DEN;
+		else
+		{
+
+			MVAC[I - 1][J] = MVAC[I - 1][J] + 1;
+			IVAC[I] = IVAC[I] + 1;
+			if (EN > 0) //!!!!
+				RPHON[I] = RPHON[I] + EN - DisEnergy;
+
+			// Multi-defect production!
+			if (EN >= 2.5 * DisEnergy)
+			{
+				MVAC[I - 1][J] = MVAC[I - 1][J] - 1.0 + 0.4 * EN / DisEnergy;
+				RPHON[I] = RPHON[I] + DisEnergy - 0.4 * EN;
+				RVAC[I] = RVAC[I] - 1.0 + 0.4 * EN / DisEnergy;
+			}
+
+			MION[I - 1][J] = MION[I - 1][J] + DEN - EN;
+			RION[I] = RION[I] + DEN - EN;
+		}
+	}
+
+	// eletric energy loss treating process
+	IonizatinEDis[I] = IonizatinEDis[I] + DEE;
+
+	MION[I - 1][J] = MION[I - 1][J] + DEE;
+}
+

# 使用的变量:

I, J, DEN, DEE, DisEnergy, DamageEFract, ElectronEFract,

# 改变的变量:

MTOT, PhoneEDis, MVAC, IVAC, RPHON, RVAC, MION, RION, IonizatinEDis,

# 7. OutOrNot(int &Ionflag)

int PKU_MC::OutOrNot(int &Ionflag)
+{
+	if (X < 0)
+	{
+		Ionflag = 0;
+		return 1;
+	}
+	else
+	{
+		if (X <= LayertoSurface[1])
+			CurrentLayer = 1;
+		else if (X <= LayertoSurface[2])
+			CurrentLayer = 2;
+		else
+			CurrentLayer = 3;
+		if (X >= LayertoSurface[CurrentLayer])
+		{
+			Ionflag = 0;
+			return 1;
+		}
+	}
+	if (E <= StoppingEnergy)
+	{
+		Ionflag = 0;
+		return 1;
+	}
+}
+

# 使用的变量:

X, LayertoSurface, StoppingEnergy, E,

# 改变的变量:

Ionflag,

# 一些注意点

  1. while 大循环内部其实就是一个 step,那这些 step 里使用到的变量应该是继承在 event 里一直用的,但是在 event 结束后这些变量在哪里初始化的
+ + + diff --git "a/Research/Research/2023-Geant4/2023.12.18-Geant4\350\207\252\345\212\250\345\214\226.html" "b/Research/Research/2023-Geant4/2023.12.18-Geant4\350\207\252\345\212\250\345\214\226.html" new file mode 100644 index 0000000..514784b --- /dev/null +++ "b/Research/Research/2023-Geant4/2023.12.18-Geant4\350\207\252\345\212\250\345\214\226.html" @@ -0,0 +1,337 @@ + + + + + + 2023.12.18-Geant4自动化 | Personal Blog --from OutisLi + + + + + + + + +

# 2023.12.18-Geant4自动化

# 1. CMakeLists.txtrun.mac的自动创建

# Python script to generate CMakeLists.txt and run.mac files with customizable parameters.
+
+def create_cmake_lists(project_name, executable_name, files_to_copy):
+    """
+    Creates a CMakeLists.txt with customizable project and executable names.
+    Args:
+    - project_name: Name of the project
+    - executable_name: Name of the executable
+    - files_to_copy: List of files to copy
+    Returns:
+    - A string containing the contents of the CMakeLists.txt file
+    """
+    cmake_template = f"""cmake_minimum_required(VERSION 3.16)
+project({project_name})
+
+# default build type: Debug
+if(NOT CMAKE_BUILD_TYPE)
+  set(CMAKE_BUILD_TYPE Debug)
+endif()
+
+#----------------------------------------------------------------------------
+# Find Geant4 package, activating all available UI and Vis drivers by default
+# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
+# to build a batch mode only executable
+#
+option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
+if(WITH_GEANT4_UIVIS)
+  find_package(Geant4 REQUIRED ui_all vis_all)
+else()
+  find_package(Geant4 REQUIRED)
+endif()
+
+#----------------------------------------------------------------------------
+# Setup Geant4 include directories and compile definitions
+# Setup include directory for this project
+#
+include_directories(${{PROJECT_SOURCE_DIR}}/include)
+include(${{Geant4_USE_FILE}})
+
+#----------------------------------------------------------------------------
+# Locate sources and headers for this project
+# NB: headers are included so they will show up in IDEs
+#
+file(GLOB sources ${{PROJECT_SOURCE_DIR}}/src/*.cc)
+file(GLOB headers ${{PROJECT_SOURCE_DIR}}/include/*.hh)
+
+#----------------------------------------------------------------------------
+# Add the executable, and link it to the Geant4 libraries
+#
+add_executable({executable_name} main.cc ${{sources}} ${{headers}})
+# target_compile_definitions({executable_name} PUBLIC G4GEOM_USE_USOLIDS)
+target_link_libraries({executable_name} ${{Geant4_LIBRARIES}})
+
+#----------------------------------------------------------------------------
+# Copy all scripts to the build directory, i.e. the directory in which we
+# build PKU_Trim_Geant4. This is so that we can run the executable directly
+# because it relies on these scripts being in the current working directory.
+#
+set(FILES_TO_COPY{files_to_copy})
+foreach(_script ${{FILES_TO_COPY}})
+  configure_file(
+    ${{PROJECT_SOURCE_DIR}}/${{_script}}
+    ${{PROJECT_BINARY_DIR}}/${{_script}}
+    COPYONLY
+    )
+endforeach()
+"""
+    return cmake_template
+
+def create_run_mac(
+    numberOfThreads, outputFileName, iondefinition, ionenergy, numberOfIons
+):
+    """
+    Creates a run.mac file with customizable parameters.
+    Args:
+    - numberOfThreads: Number of threads
+    - outputFileName: Name of the output file
+    - iondefinition: Ion definition (Z A Q E)
+    - ionenergy: Ion energy
+    - numberOfIons: Number of ions
+    Returns:
+    - A string containing the contents of the run.mac file
+    """
+    run_mac_content = f"""# Macro file for the runtime control of the example
+
+# Minimal run.mac file for testing the application
+
+# Set number of threads
+# /run/numberOfThreads {numberOfThreads}
+# /tracking/verbose 2
+
+# Initialize kernel
+/run/initialize
+/myApp/setOutputFileName {outputFileName}
+
+# Start simulation
+/gun/particle ion
+/gun/ion {iondefinition}
+/gun/energy {ionenergy}
+/run/beamOn {numberOfIons}
+"""
+    return run_mac_content
+
+if __name__ == "__main__":
+    # Default values
+    project_name = "PKU_Trim_Geant4"
+    executable_name = "PKU_Trim_Geant4"
+    files_to_copy = """
+    init_vis.mac
+    vis.mac
+    run.mac
+    scoef.data
+    scoefh.data
+    thresholds.txt
+  """
+
+    # Generate CMakeLists.txt
+    cmake_content = create_cmake_lists(project_name, executable_name, files_to_copy)
+
+    outputFileName = "FinFET_p_2MeV.txt"
+    iondefinition = "1 1 0 0"  # Z A Q E
+    ionenergy = "2 MeV"
+    numberOfIons = 10000
+
+    # Generate run.mac
+    run_mac_content = create_run_mac(
+        4, outputFileName, iondefinition, ionenergy, numberOfIons
+    )
+
+    # Define the paths for the output files
+    cmake_lists_path = "./CMakeLists.txt"
+    run_mac_path = "./run.mac"
+
+    # Write the contents to the respective files
+    with open(cmake_lists_path, "w") as cmake_file:
+        cmake_file.write(cmake_content)
+
+    with open(run_mac_path, "w") as run_mac_file:
+        run_mac_file.write(run_mac_content)
+

# CMakeLists.txt中:

executable_name:生成的可执行文件名

files_to_copy:需要复制到build文件夹中的内容

# run.mac

numberOfThreads:Geant4运行时使用的核心数(若使用Docker可不填)

outputFileName:Geant4产生的数据文件名

iondefinition:入射离子类型 # Z A Q E

ionenergy:入射离子能量

numberOfIons:入射离子数

# 2. Docker自动化

# Dockerfile

# 原单Geant4镜像
+FROM outispku/geant4:v1
+
+# 指定启动脚本
+COPY start.sh /
+RUN chmod +x /start.sh
+RUN mkdir program
+ENTRYPOINT ["/start.sh"]
+

# start.sh

#!/bin/bash
+
+# Source Geant4 environment scripts
+source /geant4/bin/geant4.sh
+source /geant4/share/Geant4/geant4make/geant4make.sh
+
+# 获取系统的线程数
+NUM_THREADS=$(expr $(nproc) - 1)
+
+cd /program
+
+# 构建命令
+CMD_TO_ADD="/run/numberOfThreads $NUM_THREADS"
+
+# 将命令添加到 run.mac 的第一行
+# 注意不要重复添加
+sed -i "1i $CMD_TO_ADD" ./run.mac
+
+# 定义目录路径
+BUILD_DIR="/program/build"
+
+# 检查目录是否存在
+if [ -d "$BUILD_DIR" ]; then
+    # 如果目录存在,删除它
+    rm -rf "$BUILD_DIR"
+fi
+
+# 创建新的目录
+mkdir -p "$BUILD_DIR"
+cd build
+cmake ..
+make -j $NUM_THREADS
+# PKU_Trim_Geant4 为程序名称(可执行文件),由CMakeLists.txt中的add_executable(PKU_Trim_Geant4 PKU_Trim_Geant4.cc)决定
+# 使用前请修改
+./PKU_Trim_Geant4 run.mac > /dev/null 2>>error.txt
+
  1. 默认采用处理器最大核心数减1作为使用的核心数量

  2. 默认程序名为PKU_Trim_Geant4,若在CMakeLists中修改,请重新使用Dockerfile创建镜像

    docker build -t outispku/geant4:v2 . 
    +# -t 后为新镜像名
    +
  3. 创建共享文件路径并运行容器

    docker run -v D:\FinFET:/program --name geant4_program outispku/geant4:v2
    +# -v 后为映射本地路径到容器内(共享项目文件)(program为容器内路径,请不要修改)
    +# --name 为容器名
    +
+ + + diff --git a/Research/index.html b/Research/index.html new file mode 100644 index 0000000..7c1b9a0 --- /dev/null +++ b/Research/index.html @@ -0,0 +1,146 @@ + + + + + + Research | Personal Blog --from OutisLi + + + + + + + + +
+ + + diff --git a/about/index.html b/about/index.html new file mode 100644 index 0000000..25c8e76 --- /dev/null +++ b/about/index.html @@ -0,0 +1,146 @@ + + + + + + Helloworld | Personal Blog --from OutisLi + + + + + + + + +

# Helloworld

+ + + diff --git a/assets/css/0.styles.9501ef99.css b/assets/css/0.styles.9501ef99.css new file mode 100644 index 0000000..db4460f --- /dev/null +++ b/assets/css/0.styles.9501ef99.css @@ -0,0 +1 @@ +code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}.theme-default-content code{color:#476582;padding:.25rem .5rem;margin:0;font-size:.85em;background-color:rgba(27,31,35,.05);border-radius:3px}.theme-default-content code .token.deleted{color:#ec5975}.theme-default-content code .token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.4;padding:1.25rem 1.5rem;margin:.85rem 0;background-color:#282c34;border-radius:6px;overflow:auto}.theme-default-content pre[class*=language-] code,.theme-default-content pre code{color:#fff;padding:0;background-color:transparent;border-radius:0}div[class*=language-]{position:relative;background-color:#282c34;border-radius:6px}div[class*=language-] .highlight-lines{-webkit-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.4}div[class*=language-] .highlight-lines .highlighted{background-color:rgba(0,0,0,.66)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent;position:relative;z-index:1}div[class*=language-]:before{position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:hsla(0,0%,100%,.4)}div[class*=language-]:not(.line-numbers-mode) .line-numbers-wrapper{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlighted{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{content:" ";position:absolute;z-index:3;left:0;top:0;display:block;width:3.5rem;height:100%;background-color:rgba(0,0,0,.66)}div[class*=language-].line-numbers-mode pre{padding-left:4.5rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers-wrapper{position:absolute;top:0;width:3.5rem;text-align:center;color:hsla(0,0%,100%,.3);padding:1.25rem 0;line-height:1.4}div[class*=language-].line-numbers-mode .line-numbers-wrapper br{-webkit-user-select:none;user-select:none}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number{position:relative;z-index:4;-webkit-user-select:none;user-select:none;font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;z-index:2;top:0;left:0;width:3.5rem;height:100%;border-radius:6px 0 0 6px;border-right:1px solid rgba(0,0,0,.66);background-color:#282c34}div[class~=language-js]:before{content:"js"}div[class~=language-ts]:before{content:"ts"}div[class~=language-html]:before{content:"html"}div[class~=language-md]:before{content:"md"}div[class~=language-vue]:before{content:"vue"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"stylus"}div[class~=language-go]:before{content:"go"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-sh]:before{content:"sh"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-py]:before{content:"py"}div[class~=language-docker]:before{content:"docker"}div[class~=language-dockerfile]:before{content:"dockerfile"}div[class~=language-makefile]:before{content:"makefile"}div[class~=language-javascript]:before{content:"js"}div[class~=language-typescript]:before{content:"ts"}div[class~=language-markup]:before{content:"html"}div[class~=language-markdown]:before{content:"md"}div[class~=language-json]:before{content:"json"}div[class~=language-ruby]:before{content:"rb"}div[class~=language-python]:before{content:"py"}div[class~=language-bash]:before{content:"sh"}div[class~=language-php]:before{content:"php"}.custom-block .custom-block-title{font-weight:600;margin-bottom:-.4rem}.custom-block.danger,.custom-block.tip,.custom-block.warning{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-block.tip{background-color:#f3f5f7;border-color:#42b983}.custom-block.warning{background-color:rgba(255,229,100,.3);border-color:#e7c000;color:#6b5900}.custom-block.warning .custom-block-title{color:#b29400}.custom-block.warning a{color:#2c3e50}.custom-block.danger{background-color:#ffe6e6;border-color:#c00;color:#4d0000}.custom-block.danger .custom-block-title{color:#900}.custom-block.danger a{color:#2c3e50}.custom-block.details{display:block;position:relative;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:#eee}.custom-block.details h4{margin-top:0}.custom-block.details figure:last-child,.custom-block.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-block.details summary{outline:none;cursor:pointer}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-bottom:6px solid #ccc}.arrow.down,.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent}.arrow.down{border-top:6px solid #ccc}.arrow.right{border-left:6px solid #ccc}.arrow.left,.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent}.arrow.left{border-right:6px solid #ccc}.theme-default-content:not(.custom){max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.theme-default-content:not(.custom){padding:2rem}}@media (max-width:419px){.theme-default-content:not(.custom){padding:1.5rem}}.table-of-contents .badge{vertical-align:middle}body,html{padding:0;margin:0;background-color:#fff}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:16px;color:#2c3e50}.page{padding-left:20rem}.navbar{z-index:20;right:0;height:3.6rem;background-color:#fff;box-sizing:border-box;border-bottom:1px solid #eaecef}.navbar,.sidebar-mask{position:fixed;top:0;left:0}.sidebar-mask{z-index:9;width:100vw;height:100vh;display:none}.sidebar{font-size:16px;background-color:#fff;width:20rem;position:fixed;z-index:10;margin:0;top:3.6rem;left:0;bottom:0;box-sizing:border-box;border-right:1px solid #eaecef;overflow-y:auto}.theme-default-content:not(.custom)>:first-child{margin-top:3.6rem}.theme-default-content:not(.custom) a:hover{text-decoration:underline}.theme-default-content:not(.custom) p.demo{padding:1rem 1.5rem;border:1px solid #ddd;border-radius:4px}.theme-default-content:not(.custom) img{max-width:100%}.theme-default-content.custom{padding:0;margin:0}.theme-default-content.custom img{max-width:100%}a{font-weight:500;text-decoration:none}a,p a code{color:#3eaf7c}p a code{font-weight:400}kbd{background:#eee;border:.15rem solid #ddd;border-bottom:.25rem solid #ddd;border-radius:.15rem;padding:0 .15em}blockquote{font-size:1rem;color:#999;border-left:.2rem solid #dfe2e5;margin:1rem 0;padding:.25rem 0 .25rem 1rem}blockquote>p{margin:0}ol,ul{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25}.theme-default-content:not(.custom)>h1,.theme-default-content:not(.custom)>h2,.theme-default-content:not(.custom)>h3,.theme-default-content:not(.custom)>h4,.theme-default-content:not(.custom)>h5,.theme-default-content:not(.custom)>h6{margin-top:-3.1rem;padding-top:4.6rem;margin-bottom:0}.theme-default-content:not(.custom)>h1:first-child,.theme-default-content:not(.custom)>h2:first-child,.theme-default-content:not(.custom)>h3:first-child,.theme-default-content:not(.custom)>h4:first-child,.theme-default-content:not(.custom)>h5:first-child,.theme-default-content:not(.custom)>h6:first-child{margin-top:-1.5rem;margin-bottom:1rem}.theme-default-content:not(.custom)>h1:first-child+.custom-block,.theme-default-content:not(.custom)>h1:first-child+p,.theme-default-content:not(.custom)>h1:first-child+pre,.theme-default-content:not(.custom)>h2:first-child+.custom-block,.theme-default-content:not(.custom)>h2:first-child+p,.theme-default-content:not(.custom)>h2:first-child+pre,.theme-default-content:not(.custom)>h3:first-child+.custom-block,.theme-default-content:not(.custom)>h3:first-child+p,.theme-default-content:not(.custom)>h3:first-child+pre,.theme-default-content:not(.custom)>h4:first-child+.custom-block,.theme-default-content:not(.custom)>h4:first-child+p,.theme-default-content:not(.custom)>h4:first-child+pre,.theme-default-content:not(.custom)>h5:first-child+.custom-block,.theme-default-content:not(.custom)>h5:first-child+p,.theme-default-content:not(.custom)>h5:first-child+pre,.theme-default-content:not(.custom)>h6:first-child+.custom-block,.theme-default-content:not(.custom)>h6:first-child+p,.theme-default-content:not(.custom)>h6:first-child+pre{margin-top:2rem}h1:focus .header-anchor,h1:hover .header-anchor,h2:focus .header-anchor,h2:hover .header-anchor,h3:focus .header-anchor,h3:hover .header-anchor,h4:focus .header-anchor,h4:hover .header-anchor,h5:focus .header-anchor,h5:hover .header-anchor,h6:focus .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid #eaecef}h3{font-size:1.35rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;-webkit-user-select:none;user-select:none;opacity:0}a.header-anchor:focus,a.header-anchor:hover{text-decoration:none}.line-number,code,kbd{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}ol,p,ul{line-height:1.7}hr{border:0;border-top:1px solid #eaecef}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto}tr{border-top:1px solid #dfe2e5}tr:nth-child(2n){background-color:#f6f8fa}td,th{border:1px solid #dfe2e5;padding:.6em 1em}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.no-navbar .theme-default-content:not(.custom)>h1,.theme-container.no-navbar h2,.theme-container.no-navbar h3,.theme-container.no-navbar h4,.theme-container.no-navbar h5,.theme-container.no-navbar h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .sidebar{top:0}@media (min-width:720px){.theme-container.no-sidebar .sidebar{display:none}.theme-container.no-sidebar .page{padding-left:0}}@media (max-width:959px){.sidebar{font-size:15px;width:16.4rem}.page{padding-left:16.4rem}}@media (max-width:719px){.sidebar{top:0;padding-top:3.6rem;transform:translateX(-100%);transition:transform .2s ease}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translateX(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width:419px){h1{font-size:1.9rem}.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}#nprogress{pointer-events:none}#nprogress .bar{background:#3eaf7c;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #3eaf7c,0 0 5px #3eaf7c;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border-color:#3eaf7c transparent transparent #3eaf7c;border-style:solid;border-width:2px;border-radius:50%;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}mjx-math{display:inline-block;text-align:left;line-height:0;text-indent:0;font-style:normal;font-weight:400;font-size:100%;font-size-adjust:none;letter-spacing:normal;word-wrap:normal;word-spacing:normal;white-space:nowrap;direction:ltr;padding:1px 0}mjx-container[jax=CHTML][display=true]{display:block;text-align:center;margin:1em 0}mjx-container[jax=CHTML][display=true] mjx-math{padding:0}mjx-container[jax=CHTML][justify=left]{text-align:left}mjx-container[jax=CHTML][justify=right]{text-align:right}mjx-mrow{display:inline-block;text-align:left}mjx-container [space="1"]{margin-left:.111em}mjx-container [space="2"]{margin-left:.167em}mjx-container [space="3"]{margin-left:.222em}mjx-container [space="4"]{margin-left:.278em}mjx-container [space="5"]{margin-left:.333em}mjx-container [rspace="1"]{margin-right:.111em}mjx-container [rspace="2"]{margin-right:.167em}mjx-container [rspace="3"]{margin-right:.222em}mjx-container [rspace="4"]{margin-right:.278em}mjx-container [rspace="5"]{margin-right:.333em}mjx-container [size=s]{font-size:70.7%}mjx-container [size=ss]{font-size:50%}mjx-container [size=Tn]{font-size:60%}mjx-container [size=sm]{font-size:85%}mjx-container [size=lg]{font-size:120%}mjx-container [size=Lg]{font-size:144%}mjx-container [size=LG]{font-size:173%}mjx-container [size=hg]{font-size:207%}mjx-container [size=HG]{font-size:249%}mjx-container [width=full]{width:100%}mjx-box{display:inline-block}mjx-block{display:block}mjx-itable{display:inline-table}mjx-row{display:table-row}mjx-row>*{display:table-cell}mjx-merror,mjx-mstyle,mjx-mtext{display:inline-block}mjx-merror{color:red;background-color:#ff0}mjx-mphantom{visibility:hidden}mjx-inferredMrow,mjx-mi,mjx-mo{display:inline-block;text-align:left}mjx-stretchy-h{display:inline-table;width:100%}mjx-stretchy-h>mjx-beg,mjx-stretchy-h>mjx-end{display:table-cell;width:0}mjx-stretchy-h>mjx-ext{display:table-cell;overflow:hidden;width:100%}mjx-stretchy-h>mjx-ext>mjx-c{transform:scalex(500);margin-right:-2em}mjx-stretchy-h>mjx-ext>mjx-c:before{padding:.001em 0}mjx-stretchy-h>mjx-beg>mjx-c{margin-right:-.1em}mjx-stretchy-h>mjx-end>mjx-c{margin-left:-.1em}mjx-stretchy-v{display:inline-block}mjx-stretchy-v>*{display:block}mjx-stretchy-v>mjx-beg{height:0}mjx-stretchy-v>mjx-end>mjx-c{display:block}mjx-stretchy-v>*>mjx-c{transform:scale(1);transform-origin:left center;overflow:hidden}mjx-stretchy-v>mjx-ext{display:block;height:100%;box-sizing:border-box;border:0 solid transparent;overflow:hidden}mjx-stretchy-v>mjx-ext>mjx-c{transform:scaleY(500) translateY(.1em);overflow:visible}mjx-mark{display:inline-block;height:0}mjx-mn,mjx-mpadded,mjx-ms,mjx-mspace{display:inline-block;text-align:left}mjx-menclose,mjx-rbox{display:inline-block;position:relative}mjx-menclose{text-align:left}mjx-menclose>mjx-dstrike{top:0;transform-origin:top left}mjx-menclose>mjx-dstrike,mjx-menclose>mjx-ustrike{display:inline-block;left:0;position:absolute;border-top:.067em solid}mjx-menclose>mjx-ustrike{bottom:0;transform-origin:bottom left}mjx-menclose>mjx-hstrike{border-top:.067em solid;position:absolute;left:0;right:0;bottom:50%;transform:translateY(.034em)}mjx-menclose>mjx-vstrike{border-left:.067em solid;position:absolute;top:0;bottom:0;right:50%;transform:translateX(.034em)}mjx-menclose>mjx-rbox{border:.067em solid;border-radius:.267em}mjx-menclose>mjx-cbox,mjx-menclose>mjx-rbox{position:absolute;top:0;bottom:0;right:0;left:0}mjx-menclose>mjx-cbox{border:.067em solid;border-radius:50%}mjx-menclose>mjx-arrow{position:absolute;left:0;bottom:50%;height:0;width:0}mjx-menclose>mjx-arrow>*{display:block;position:absolute;transform-origin:bottom;border-left:.268em solid;border-right:0;box-sizing:border-box}mjx-menclose>mjx-arrow>mjx-aline{left:0;top:-.034em;right:.201em;height:0;border-top:.067em solid;border-left:0}mjx-menclose>mjx-arrow[double]>mjx-aline{left:.201em;height:0}mjx-menclose>mjx-arrow>mjx-rthead{transform:skewX(.464rad);right:0;bottom:-1px;border-bottom:1px solid transparent;border-top:.134em solid transparent}mjx-menclose>mjx-arrow>mjx-rbhead{transform:skewX(-.464rad);transform-origin:top;right:0;top:-1px;border-top:1px solid transparent;border-bottom:.134em solid transparent}mjx-menclose>mjx-arrow>mjx-lthead{transform:skewX(-.464rad);left:0;bottom:-1px;border-left:0;border-right:.268em solid;border-bottom:1px solid transparent;border-top:.134em solid transparent}mjx-menclose>mjx-arrow>mjx-lbhead{transform:skewX(.464rad);transform-origin:top;left:0;top:-1px;border-left:0;border-right:.268em solid;border-top:1px solid transparent;border-bottom:.134em solid transparent}mjx-menclose>dbox{position:absolute;top:0;bottom:0;left:-.3em;width:.6em;border:.067em solid;border-radius:50%;-webkit-clip-path:inset(0 0 0 .3em);clip-path:inset(0 0 0 .3em);box-sizing:border-box}mjx-mfrac{text-align:left}mjx-frac,mjx-mfrac{display:inline-block}mjx-frac{vertical-align:.17em;padding:0 .22em}mjx-frac[type=d]{vertical-align:.04em}mjx-frac[delims]{padding:0 .1em}mjx-frac[atop]{padding:0 .12em}mjx-frac[atop][delims]{padding:0}mjx-dtable{display:inline-table;width:100%}mjx-dtable>*{font-size:2000%}mjx-dbox{display:block;font-size:5%}mjx-den,mjx-num{display:block;text-align:center}mjx-mfrac[bevelled]>mjx-den,mjx-mfrac[bevelled]>mjx-num{display:inline-block}mjx-den[align=right],mjx-num[align=right]{text-align:right}mjx-den[align=left],mjx-num[align=left]{text-align:left}mjx-nstrut{display:inline-block;height:.054em;width:0;vertical-align:-.054em}mjx-nstrut[type=d]{height:.217em;vertical-align:-.217em}mjx-dstrut{display:inline-block;height:.505em;width:0}mjx-dstrut[type=d]{height:.726em}mjx-line{display:block;box-sizing:border-box;min-height:1px;height:.06em;border-top:.06em solid;margin:.06em -.1em;overflow:hidden}mjx-line[type=d]{margin:.18em -.1em}mjx-msqrt{text-align:left}mjx-msqrt,mjx-root{display:inline-block}mjx-root{white-space:nowrap}mjx-surd{vertical-align:top}mjx-sqrt,mjx-surd{display:inline-block}mjx-sqrt{padding-top:.07em}mjx-sqrt>mjx-box{border-top:.07em solid}mjx-sqrt.mjx-tall>mjx-box{padding-left:.3em;margin-left:-.3em}mjx-mroot,mjx-msub,mjx-msubsup,mjx-msup{display:inline-block;text-align:left}mjx-script{display:inline-block;padding-right:.05em}mjx-script>*{display:block}mjx-munder{display:inline-block}mjx-munder,mjx-over{text-align:left}mjx-munder:not([limits=false]){display:inline-table}mjx-munder>mjx-row{text-align:left}mjx-under{padding-bottom:.1em}mjx-mover{display:inline-block;text-align:left}mjx-mover:not([limits=false]){padding-top:.1em}mjx-mover:not([limits=false])>*{display:block;text-align:left}mjx-munderover{display:inline-block;text-align:left}mjx-munderover:not([limits=false]){padding-top:.1em}mjx-munderover:not([limits=false])>*{display:block}mjx-mmultiscripts{display:inline-block;text-align:left}mjx-prescripts{display:inline-table;padding-left:.05em}mjx-scripts{display:inline-table;padding-right:.05em}mjx-prescripts>mjx-row>mjx-cell{text-align:right}mjx-mfenced{display:inline-block;text-align:left}mjx-mtable{display:inline-block;text-align:center;vertical-align:.25em;position:relative;box-sizing:border-box}mjx-labels{position:absolute;left:0;top:0}mjx-table{display:inline-block}mjx-table>mjx-itable{vertical-align:middle;text-align:left;box-sizing:border-box}mjx-labels>mjx-itable{position:absolute;top:0}mjx-mtable[justify=left]{text-align:left}mjx-mtable[justify=right]{text-align:right}mjx-mtable[justify=left][side=left]{padding-right:0!important}mjx-mtable[justify=left][side=right]{padding-left:0!important}mjx-mtable[justify=right][side=left]{padding-right:0!important}mjx-mtable[justify=right][side=right]{padding-left:0!important}mjx-mtable[align]{vertical-align:baseline}mjx-mtable[align=top]>mjx-table{vertical-align:top}mjx-mtable[align=bottom]>mjx-table{vertical-align:bottom}mjx-mtable[align=baseline]>mjx-table,mjx-mtable[align=center]>mjx-table{vertical-align:middle}mjx-mtr{display:table-row;text-align:left}mjx-mtr[rowalign=top]>mjx-mtd{vertical-align:top}mjx-mtr[rowalign=center]>mjx-mtd{vertical-align:middle}mjx-mtr[rowalign=bottom]>mjx-mtd{vertical-align:bottom}mjx-mtr[rowalign=baseline]>mjx-mtd{vertical-align:baseline}mjx-mtr[rowalign=axis]>mjx-mtd{vertical-align:.25em}mjx-mlabeledtr{display:table-row;text-align:left}mjx-mlabeledtr[rowalign=top]>mjx-mtd{vertical-align:top}mjx-mlabeledtr[rowalign=center]>mjx-mtd{vertical-align:middle}mjx-mlabeledtr[rowalign=bottom]>mjx-mtd{vertical-align:bottom}mjx-mlabeledtr[rowalign=baseline]>mjx-mtd{vertical-align:baseline}mjx-mlabeledtr[rowalign=axis]>mjx-mtd{vertical-align:.25em}mjx-mtd{display:table-cell;text-align:center;padding:.215em .4em}mjx-mtd:first-child{padding-left:0}mjx-mtd:last-child{padding-right:0}mjx-mtable>*>mjx-itable>:first-child>mjx-mtd{padding-top:0}mjx-mtable>*>mjx-itable>:last-child>mjx-mtd{padding-bottom:0}mjx-tstrut{display:inline-block;height:1em;vertical-align:-.25em}mjx-labels[align=left]>mjx-mtr>mjx-mtd{text-align:left}mjx-labels[align=right]>mjx-mtr>mjx-mtd{text-align:right}mjx-mlabeledtr mjx-mtd[rowalign=top],mjx-mtr mjx-mtd[rowalign=top]{vertical-align:top}mjx-mlabeledtr mjx-mtd[rowalign=center],mjx-mtr mjx-mtd[rowalign=center]{vertical-align:middle}mjx-mlabeledtr mjx-mtd[rowalign=bottom],mjx-mtr mjx-mtd[rowalign=bottom]{vertical-align:bottom}mjx-mlabeledtr mjx-mtd[rowalign=baseline],mjx-mtr mjx-mtd[rowalign=baseline]{vertical-align:baseline}mjx-mlabeledtr mjx-mtd[rowalign=axis],mjx-mtr mjx-mtd[rowalign=axis]{vertical-align:.25em}mjx-maction{display:inline-block;text-align:left;position:relative}mjx-maction>mjx-tool{display:none;position:absolute;bottom:0;right:0;Width:0;height:0}mjx-tool>mjx-tip{display:inline-block;padding:.2em;border:1px solid #888;font-size:70%;background-color:#f8f8f8;color:#000;box-shadow:2px 2px 5px #aaa}mjx-maction[toggle]{cursor:pointer}mjx-status{display:block;position:fixed;left:1em;bottom:1em;min-width:25%;padding:.2em .4em;border:1px solid #888;font-size:90%;background-color:#f8f8f8;color:#000}mjx-mglyph{display:inline-block;text-align:left}mjx-mglyph>img{display:inline-block;border:0;padding:0}mjx-annotation,mjx-annotation-xml,mjx-semantics,mjx-TeXAtom{display:inline-block;text-align:left}mjx-c,mjx-c:before,mjx-utext{display:inline-block}mjx-utext{padding:.75em 0 .25em}mjx-measure-text{position:absolute;font-family:MJXZERO;white-space:nowrap;height:1px;width:1px;overflow:hidden}.MJX-TEX .mjx-n mjx-c{font-family:MJXZERO,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-i mjx-c{font-family:MJXZERO,MJXTEX-I,MJXTEX,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-b mjx-c{font-family:MJXZERO,MJXTEX-B,MJXTEX-BI,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-b.mjx-i mjx-c{font-family:MJXZERO,MJXTEX-BI,MJXTEX-B,MJXTEX-I,MJXTEX,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-cal mjx-c{font-family:MJXZERO,MJXTEX-C,MJXTEX-I,MJXTEX,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-cal.mjx-b mjx-c{font-family:MJXZERO,MJXTEX-C-B,MJXTEX-C,MJXTEX-B,MJXTEX-BI,MJXTEX,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-ds mjx-c{font-family:MJXZERO,MJXTEX-A,MJXTEX-B,MJXTEX-BI,MJXTEX,MJXTEX-I,MJXTEX-S1}.MJX-TEX .mjx-fr mjx-c{font-family:MJXZERO,MJXTEX-FR,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-fr.mjx-b mjx-c{font-family:MJXZERO,MJXTEX-FR-B,MJXTEX-FR,MJXTEX-B,MJXTEX-BI,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-sc mjx-c{font-family:MJXZERO,MJXTEX-SC,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-sc.mjx-b mjx-c{font-family:MJXZERO,MJXTEX-SC-B,MJXTEX-SC,MJXTEX-B,MJXTEX-BI,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-ss mjx-c{font-family:MJXZERO,MJXTEX-SS,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-ss.mjx-b mjx-c{font-family:MJXZERO,MJXTEX-SS-B,MJXTEX-SS,MJXTEX-B,MJXTEX-BI,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-ss.mjx-i mjx-c{font-family:MJXZERO,MJXTEX-SS-I,MJXTEX-I,MJXTEX,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-ss.mjx-b.mjx-i mjx-c{font-family:MJXZERO,MJXTEX-SS-B,MJXTEX-SS-I,MJXTEX-BI,MJXTEX-B,MJXTEX-I,MJXTEX,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-ty mjx-c{font-family:MJXZERO,MJXTEX-T,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-var mjx-c{font-family:MJXZERO,MJXTEX-A,MJXTEX,MJXTEX-I,MJXTEX-S1}.MJX-TEX .mjx-os mjx-c{font-family:MJXZERO,MJXTEX-C,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-os.mjx-b mjx-c{font-family:MJXZERO,MJXTEX-C-B,MJXTEX-C,MJXTEX-B,MJXTEX-BI,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-mit mjx-c{font-family:MJXZERO,MJXTEX-MI,MJXTEX-I,MJXTEX,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-lop mjx-c{font-family:MJXZERO,MJXTEX-S2,MJXTEX-S1,MJXTEX,MJXTEX-I,MJXTEX-A}.MJX-TEX .mjx-sop mjx-c{font-family:MJXZERO,MJXTEX-S1,MJXTEX,MJXTEX-I,MJXTEX-A}.MJX-TEX .mjx-s3 mjx-c{font-family:MJXZERO,MJXTEX-S3,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX .mjx-s4 mjx-c{font-family:MJXZERO,MJXTEX-S4,MJXTEX,MJXTEX-I,MJXTEX-S1,MJXTEX-A}.MJX-TEX{font-family:MJXZERO}.MJX-TEX mjx-stretchy-h mjx-c,.MJX-TEX mjx-stretchy-v mjx-c{font-family:MJXZERO,MJXTEX-S1,MJXTEX-S4,MJXTEX,MJXTEX-A!important}@font-face{font-family:MJXZERO;src:url(data:font/otf;base64,T1RUTwALAIAAAwAwQ0ZGIA9zN9cAAAhgAAAArUZGVE12+H9qAAAJEAAAABxHREVGACoAHgAACSwAAAAgT1MvMkDE54cAAAEgAAAAYGNtYXAADfKiAAAG/AAAAUJoZWFkCdzO7wAAALwAAAA2aGhlYQBmAJgAAAD0AAAAJGhtdHgA+gAAAAAJTAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZeMFXGAAAAGAAAAFenBvc3T/hgAzAAAIQAAAACAAAQAAAAMAAO7o+YVfDzz1AAsD6AAAAADVXaFMAAAAANVe7L4AAAAAAAAAAAAAAAgAAgAAAAAAAAABAAAAZP+cAAAA+gAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQA+gGQAAUAAAKKArwAAACMAooCvAAAAeAAMQECAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAFBmRWQAwO/87/wAZP+cAAAAZABkIAAAAAAAAAAAAAAAACAAIAABAAAAFgEOAAEAAAAAAAAAKgAAAAEAAAAAAAEADAAqAAEAAAAAAAIABwA2AAEAAAAAAAMAIwA9AAEAAAAAAAQADAAqAAEAAAAAAAUACwBgAAEAAAAAAAYADAAqAAEAAAAAAA0A9QBrAAEAAAAAAA4AGgFgAAEAAAAAABAADAAqAAEAAAAAABEABwA2AAMAAQQJAAAAUgF6AAMAAQQJAAEAGAHMAAMAAQQJAAIADgHkAAMAAQQJAAMARgHyAAMAAQQJAAQAGAHMAAMAAQQJAAUAFgI4AAMAAQQJAAYAGAHMAAMAAQQJAA0B6gJOAAMAAQQJAA4ANAQ4AAMAAQQJABAAGAHMAAMAAQQJABEADgHkQ29weXJpZ2h0IChjKSAyMDE3IFRoZSBNYXRoSmF4IENvbnNvcnRpdW0uTWF0aEpheF9aZXJvUmVndWxhckZvbnRGb3JnZSA6IE1hdGhKYXhfWmVybyA6IDctNi0yMDE3VmVyc2lvbiAxLjFDb3B5cmlnaHQgKGMpIDIwMTcsIFRoZSBNYXRoSmF4IENvbnNvcnRpdW0uICg8d3d3Lm1hdGhqYXgub3JnPiksCndpdGggUmVzZXJ2ZWQgRm9udCBOYW1lIE1hdGhKYXhfWmVyby4KClRoaXMgRm9udCBTb2Z0d2FyZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgU0lMIE9wZW4gRm9udCBMaWNlbnNlLCBWZXJzaW9uIDEuMS4KVGhpcyBsaWNlbnNlIGF2YWlsYWJsZSB3aXRoIGEgRkFRIGF0OgpodHRwOi8vc2NyaXB0cy5zaWwub3JnL09GTGh0dHA6Ly9zY3JpcHRzLnNpbC5vcmcvT0ZMAEMAbwBwAHkAcgBpAGcAaAB0ACAAKABjACkAIAAyADAAMQA3ACAAVABoAGUAIABNAGEAdABoAEoAQQB4ACAAQwBvAG4AcwBvAHIAdABpAHUAbQBNAGEAdABoAEoAYQB4AF8AWgBlAHIAbwBSAGUAZwB1AGwAYQByAEYAbwBuAHQARgBvAHIAZwBlACAAOgAgAE0AYQB0AGgASgBhAHgAXwBaAGUAcgBvACAAOgAgADcALQA2AC0AMgAwADEANwBWAGUAcgBzAGkAbwBuACAAMQAuADEAQwBvAHAAeQByAGkAZwBoAHQAIAAoAGMAKQAgADIAMAAxADcALAAgAFQAaABlACAATQBhAHQAaABKAGEAeAAgAEMAbwBuAHMAbwByAHQAaQB1AG0ALgAgACgAPAB3AHcAdwAuAG0AYQB0AGgAagBhAHgALgBvAHIAZwA+ACkALAAKAHcAaQB0AGgAIABSAGUAcwBlAHIAdgBlAGQAIABGAG8AbgB0ACAATgBhAG0AZQAgAE0AYQB0AGgASgBhAHgAXwBaAGUAcgBvAC4ACgAKAFQAaABpAHMAIABGAG8AbgB0ACAAUwBvAGYAdAB3AGEAcgBlACAAaQBzACAAbABpAGMAZQBuAHMAZQBkACAAdQBuAGQAZQByACAAdABoAGUAIABTAEkATAAgAE8AcABlAG4AIABGAG8AbgB0ACAATABpAGMAZQBuAHMAZQAsACAAVgBlAHIAcwBpAG8AbgAgADEALgAxAC4ACgBUAGgAaQBzACAAbABpAGMAZQBuAHMAZQAgAGEAdgBhAGkAbABhAGIAbABlACAAdwBpAHQAaAAgAGEAIABGAEEAUQAgAGEAdAA6AAoAaAB0AHQAcAA6AC8ALwBzAGMAcgBpAHAAdABzAC4AcwBpAGwALgBvAHIAZwAvAE8ARgBMAGgAdAB0AHAAOgAvAC8AcwBjAHIAaQBwAHQAcwAuAHMAaQBsAC4AbwByAGcALwBPAEYATAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAA7/z//wAA7/z//xAFAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQBAAEBAQ1NYXRoSmF4X1plcm8AAQEBHfgcAPgdAfgeAvgeA/gYBIwMAfcTD673HhL3FhEABAEBCAs0QHVuaUVGRkMzLjBDb3B5cmlnaHQgKGMpIDIwMTcgVGhlIE1hdGhKYXggQ29uc29ydGl1bU1hdGhKYXhfWmVybwAAAAGHAAIBAQIDDg51ofhDnPdtjJmkBvtijQceoDlj/wwJiwwKvQq9Cx0AAATiFAAAAAAAAAEAAAAAzD2izwAAAADVXW5NAAAAANVdbk0AAQAAAAwAAAAUABwAAQABAAEAAQAEAAAAAQAAAAIAAAD6AAAAAAAA) format("opentype")}@font-face{font-family:MJXTEX;src:url(/Blog/assets/fonts/MathJax_Main-Regular.9995de47.woff) format("woff")}@font-face{font-family:MJXTEX-B;src:url(/Blog/assets/fonts/MathJax_Main-Bold.c9423d5d.woff) format("woff")}@font-face{font-family:MJXTEX-MI;src:url(/Blog/assets/fonts/MathJax_Main-Italic.7e83626b.woff) format("woff")}@font-face{font-family:MJXTEX-I;src:url(/Blog/assets/fonts/MathJax_Math-Italic.5589d1a8.woff) format("woff")}@font-face{font-family:MJXTEX-BI;src:url(/Blog/assets/fonts/MathJax_Math-BoldItalic.77dbcee3.woff) format("woff")}@font-face{font-family:MJXTEX-S1;src:url(data:font/woff;base64,d09GRk9UVE8AABagAAsAAAAAIDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAEF0AABULkl+DEUZGVE0AABFoAAAAHAAAABxdKvsAR0RFRgAAEYQAAAAdAAAAIABeAARPUy8yAAARpAAAAE0AAABgPshXF2NtYXAAABH0AAAA6QAAAhoVJZqOaGVhZAAAEuAAAAAzAAAANgy+mDloaGVhAAATFAAAACAAAAAkAwUEGGhtdHgAABM0AAAAjQAAAMR0yQmkbWF4cAAAE8QAAAAGAAAABgAxUABuYW1lAAATzAAAAr0AAAZv+wCdtHBvc3QAABaMAAAAEwAAACD/hgAyeJylNwl0VFWW/1P85JFgUGKhrRlAQBYPaAgjyowiIIER0UTAFggCIYmQmJ1slaT2ql9V//5afu2VykYIIGGREDaBgLIFNS6AIratoPZg2840Kj39fniF3a+qgMaZtmfOmXq//v3vvnvvu+++d5fHMoMHMyzLjngut2rdgty6VYsL6wumTllUsLa6OLeSYQcxLDNFvpORZ7Hy7EHyHIX89ODIafJjGnfvwGUubdCdw9IY5s60QRV3pTEj04bPHs5MirIgZhhzLzOKGc88wsxgMpmFzGJmBZPHFDEVjIrRMRbGwfiYZmYj08V0MweYo8wp5j3mI+Yz5ivmW+Z7BjM/sRw7lE1ln2KXsLns2urSwvT02elRMC09o6qwOL8gr6xkDe1npE+dnltZWVZbXR4D+WW1pfGPNcU3UWuKo9jyyrL86ryqKE/G1PT11SUluVWFZaWVufmFebnFMXTGtDh4tLC0qmBt5U3s03EwNw4yY+Dp9DiYGgcZcRDjn5b+eBzMiIPZcTAnBubG+B7LfDwOYiSz09PjYGocZMTBP8fBdAoy582bGweZcTDv6bJyVWXh2nVVoyfmTRqdkZ4+Ywo1RfrouQXrC9eWjl6cV1hQmlcwefQzpXkP/93N/Rny+bLKktxihv5YZgiTxNzJPME8ycykm7aStTAaRstaWRsrsMCKrJ11sE7WxUqsm/WwXtbH+tkAG2RDbBMbZpvZFraVbWPb2Q1sB7uR7WQ3sZvZLexr7Fa2i93GTI2ejzHMg0wd8zYTYdPYLLZ80HzFBMVDihmKXEW5IqTYr/jL4HmDz3DLuHcS/jWBJBYkrk98K/HjxD+hkUN8Q64nlSTfkTwq+bHk7OR1ybpkKfmLoQ8NPXhHVsqUlEPDJg2bMyxnWFGkHHrlzF62l/4UvSPwQ/JW8lBCb6RWSbGRzMSUSHkKaceTLyrwZOxUAmn/muTiiSQVbUmw251OcIBDsBt8JBnfvwhnA3YBlo7jbDwU3+/1ifbouMVps6OyBEK5ppHVVASKiqygIk9GReK2aTiXTMSpSJPQwINulGhzmSQTTib3HSNZQFxAnEtIFqF9s4k3CTakdwrNI4MJeBJO/QqvBryBCpwoVw/8RslrI4+nEZNgAbXf4Ac3eJxOjysgP542uFF0Qkjn1YEeeLPFTFneJj/0XLvaw+KVPQq8kvygxEt6yORrV/HkHrIkISqylfxGKTgjUW4+YHEbXUbQgEEj6kWLHJ3HpXUaPRY3+MHvhdDtIuf0KDYMHFHiyT9dJZPz8JK0wa/HZI69SeD4QiFXkO+UoUQIC3aT/aXQwm0NPXwIeMAz4Ec4KkjWFkO7LlzVlbspqx01SgEndzjcs6Gzs60t2OncJEpwlNJRYt4VCve8s+1oyG2nBg8jCJklNXAmMAoCCGCwGqyza5dXVBTp1KYGvhYJZDonkEwxYG7QlpSVranW8VqzytRgBoB6aAAIm1tMAbOfR3uqt5QFSqQGISCSTCSSRzlXjdQQUG8sPlDZX7dD7xBCgILRZf0J1z12MVWHBw38u9JiFazUTo2iTbI5BLfVYztd21MWLEKps1xqoNs5A8bBS6LZofLW+Bs6ig+U9dWigKXRzGXV5FZUFesaDDVWlWCGlygduRNKBLOl3qRpbKytLa5fo0E1ZkGwWVGqTrCBBQxQJwqtEASnuN3X33qgc2NXICSFXe1IxI9yIs4UtFI4vPfEnhPNbkfUPtBE7e1Y1LxoT8Nec1jUCjgTCXg6x7eZw9rQ+q6VnQtaC31WUQPICDydA8WcYKZ8CL/I4m0DU5Wjk6Ldb9+1vjs8VXdsYJrygaTUWWOSUnVjKdSG9AYuVTeOfj6YlHK9KMZGtsbZaPcGW8T2D/mOttew2LcPz9unwL4R++Q/rk7AFZE/KmNfKdnR0X469Fv5a+WKObMWZJQg3gar6BF5r/NUd+8hFAxARNwHIItBLdebc6rgvUpqYtjP27lHu2adWv4JMvm5v8np/06pCXDLDmV3P9OJtE5Y5bJxXxafzz78FHLrXF7u4Efn+3+3FbnssF9r4Z6pzC5YloM0Wip+NXC3KyvfJX+mXDp2evq47Hp9QV29GWl4WM15nFt8Ld5DHQe79mxHPg9EmKhukwIBrqOzs6v1NZfHJQF0FG1+ZXMpCmghMomO4wUiXuAzcj1FB4sPVbUYtug9FgT7NC6uXiporfeNOzX98tKrFi91QPqzmCwGlHJ0w212wzql3sOt2b6iK6dD5S3zGZ0IVgd5rtncXdes/zH7UvqRsU6D0xRld7qd3iNXL13+8VSzr7u1WUJBF+zjjJYyvcqQU7WiOK8I6Y0CXkC1Wg1UP62Wq6qsLK4r5Y08dZyq7eW7yl9D2gBdVdQkuJQ4eq5Npo6egQfLEzCnGNhMHlEOHE30vd7Z9KYDhXquf5wXSjhs3aT2lyCHCa4ftRo5XUmFerkVqfPw2R51wq8dFU2GXUiQ54KcKU8AuP5fv0Tzf5mQnP35hH+OUJFypihncr9I8zOlBj6+fcIviOPtayN62NMDurjLq5Gow88RD/cDGX2RJIKAyLOkhBtPhj42UbDZrNSVbGB18A7BYXsD5BRA8hPil9iTB5y50VBj1LzyQvbqOTUva5abZ1sbBTIYCAuIMGNAHIWfwUXcFZz0+X+KosMpuCySYCefyNkWJ4h98AngYYAfE5qEM/wbpj1q9HnFmaytT6A2oQ04S7Bhb+WHaA0eFHkCuEgG6MBqo/pvvlbUrcBhbFeSySR5UwUnQlOgJYR2bKJfhwnXR0YhzBIpIHBNYBclyW7Hw3Ezfhh/hPA2+TOQOMFt8uvACCbeYhYsBBEzGU0OIOKJbOZsdrJKLotFj3/CD9LjOF6WleOjkYP28PxbCFw5AmwCmQyxR6Rvm93gNfvAC17J7qURC0++9Qh2ZPUaJANNYkaTzUgzzqld1zbsYo+dlJ89qbhKxisnJKX8/hYS7z35TfR1YwRfGUGH5YX/bXzU/ySKU96i27n70reY270jTlNWU1syChqddR5187rXyw9DK7Q6W7zbwpu2tO3d+YH796Hvkejj/I5Wh9/1ZvvuPc1vudvFAHTCRiFgam88+Gr36g28XeUBEQG43nfs9GDOvS+0PdDV0r4DQhCy+I0SXSdNXoLaYrOhBqOxHupRRVvVa1va27aOhHdy9j3vNNAEx0M1TRwq7YriwnkN6TZtI+Gs1UjQczprnVXH/7omf039i6YaQQvroVLUumuaVmwr2FfttLUa6fkEEFS2Ki3J4Fep842VGlWjwWDWWbWgBrVT5zE7DN6ojmLIabeHPZ5maEabajtKR+Kl8g6l4Sndw/x8QU2bBZkTV3bkHYB+OHf4reNNTtEuiiBS8QAIzydjlPDM6qU5KoNFa6UoUfTbQ95PPedc74hBMSTSsCR5LNye2teXQRZK+fOxC3L/BcV/ELuyBbxuj9/h3HoJK/A5hEfL4/EDkfEcHkTObZ3usHh0XlMLbISWFugA6ha02cnZaxN5j9GvcasB1YNGb9bZLOTcT+OsOuqk0VYdrt0Et+Y5NrBUCbxoEXm75Rwp+Jo48eyIWbvDb/SYJZsfYjr4XB5M5Yp2JLpEFzihQ9WyHlRgMBl1VkvJdEIVQoSqRqiKHKHKllyyOo1+naeeWr6+DqrofAMPf8Eeuygf/UKBR5ESWvmdF/En9iDX9PXxDz/e1dO2zX8CvoF3XzmU053fscL7IrJr7Nd/xUkqn7oTNkAw6ArbJTo37ge8CvAQwWP6bdHZxSdfPpi9Y2EzKvJUOQrBKJrBTKsoCwh0ufRLII/XkzHkjgbyb4IRyBAgqxCQfrDYza6GoGYDPZfeJk8z1Y/YY/r1XlKcGahTTkxKGThyW3XYkzbYgvN6CCTE8aobJV5eGlH1ROs7OkCru9vKSegheZQp7waeMmAVeVtJ8vIwUIa82xJ5fzzHp2C5WyEPGbisNICFt5jMdUSKHKferscUSnVOo2Txgg88HtEHkuAgw3E3InfjPZj+ORqeukUHxXuNXi3d4AvdigsDHynBLFrxcNKN8N1kD6F/jtBe1Dii3mOMBhqJVslSK5bk41S2j1BobrV4eIdRRFowGgSaWGUlcVzC39BbwDeX2OMX8WUaBy9fVNwdkdHAKuWkJPkPkQIlvCqo+fJSMpPOkkKm5L9qLLUWwKugFstdGU2PHsx+//n3132qu4wEHzTHm+jrxEvxWDwaZ24N29sdnfS80Q0R8PIqPItMA9KIIroRK7cVHziwrevAwcLXVuQVFa0eSfXB+Rdl9CUr+y4qbuiAHyB6JXk+ghJFFxfCSad//O7MkV0fdJ2PFcYiIBEKyMRRmMULlKcN75YfWfuHzNPjQiQJiXyEBgMZuQTODj7BY0OEvd6v5EWODApOODbvy5y+ko8NnyLBJSPg5BxeWU2eo4cqg6ysQrxAOaP4mJEuDpyLGmjg7N/UqluqPG/4sLxvJQrpyT3kXtroG99D7sH3hnzcmz1vb+r33754RHSRfcoomSHIvdxX/oHh09st5v108wdv9CFvEFMKKuZeTk6jN6kDWVsyvTNFPS3iY03QG54sn/9yFjJobs6GKTl37qO+U9HkvDiyTBnlVuu5rJXzy2ca9EK9EOOkF5yZ3vmbsw4gtQ9H2SgjF/MP+cGL1EWw9iLW3PQSPCWSr4QGnyZg9pmd0Afo2KIEKIT1otVZ16JuoZ4bDjub6cHcCDvQiWOJfdSFfVJA8gVpMd6sb1K7kdlJ7gA4wcFpEHmfKahz19u1YBJ4nreajFae19NQ+jxaRIYmNhgatVB9w1tPfC4fuRjTw2zhjTajLer5kVXRh6fu3eg3NPFo4MGEFrfk9YSRXJAI8hzYaZMsYXWoGqpBo+Eb4kzzUWRh5Ii8kFLMB5dNMjdrgtVAj7/FTC+LkZlwhYUrV64oYPCVKxMS8IoJyij85YHrCbGBG+gUufjugSLlyCSF/6mhQ2BoUm9Sb/LIpIS/DB2exoxMZZKit/1/YRYyrzA6ponZyvyO7Rg0bZCXBrsAQXbBLoh2ugBvC+nBU8kDT3JP5j67Nnq7iz60YrBIWuRVcW47ljDyAUqGF/PNo0CI3qRRQO3zcsn7d+xt6aHXL9qEzdYWvre6S01vejxKDlqDtiDsgT3N+3cAvLUbJLoLbrMbJa8qzFXlxYIpL5Y5VK5lG9a01khVTpTMiyYaXNEyWKfKLaLT/Z0SJhqo/vcSJvkflhPN2/27Pfud7a14rLsPhXCidMaH7wviedLB8O7/d71gqVaR0cbn1CTRPFdP7kNa8qR5xS9XAvFCAN1eCSTfOneWaE4hq2iCEU3uGdvnHn/hUE7fuvcbuowdtp2AdkKHfZvnvXDfzkOHjp/cftb9ueimKSyWyPrBaZP4cPS8ofWgV5vqke36r2wazrCkakVBfk7OwlcejioiGkRyV8sjX9XiZGQLCvg84E+sLs7cpA7U3jypyWTE0vHjlxJl1Qu65TATZvqXdSw6QpTfj8cjlh6v6tVegAtwOHCyA2Hlke+/P4KVHSf8vRTXBq2C3/hOw/GKt+biMeT+KyR9c6mkEl+l12DRQPc6CxY3Lq1FyX8FL9FaYwAAAAAAAAEAAAAAzD2izwAAAADG+TJPAAAAAMn0JeF4nGNgZGBg4ANiCQYQYGJgBEIDIGYB8xgABloAYwAAAHicY2BhamGcwMDKwMDUxbSHgYGhB0IzPmAwZGRiQAINDAzvBRjevIXxA9JcUxgOMCi8/88g9/8RUECOQU6BgaE/jhmqQAEIGQEjQxBnAAAAeJxjYGBgZoBgGQZGIMnAKALkMYL5LAw/gLQVgwKQJQUkNRn0GWIZqhlqGRYwHWO6w8ysIKY4UXGy4kXFy0qCSlJKykqqSnpKh5W5lS+ov9Ri0mLRYnv///9/oBkKDBpAvdFIepmQ9PJD9WorHVDmAOp9ocUA1vsXqPnh/1v/r/5f9b/3f8//rL+ufw3+ct//ea/+Xt09x3sO91jv/r379e6Xu+/vxt2VuhN2w/6a5jWNa+oChhC/kAsY2RgIGgCTZ2IGUywkGM/Kxo5XnoOBkwTTUIGYCDCqoEAcQnGRoJ2bB8YCAHUmSSwAAAB4nGNgZGBgAOLLEuvZ4vltvjJwM78AijBcjV21AUb/PfNvEasEcxCQy8HABBIFAGdaDTUAeJxjYGRgYJD7/4iBgaXv75n/ZawSDCARZGAIAJW9BiB4nGP4xWDE8IuBgfEUwwwgVmZyYjBnXMhwCkibAWkxJneGTBAGqWHS+f+DSYeBkYHh7xkgvsrMxcjINJuhAISZuRgswXgDgzkIsygwWDC/YMhn9GWYCNQzkfEGUNwYKN4HNB/EdkTFQLFTQCwGo5lmM1oA6UQg9mUJZ7CAYbh6HaCbgZghhYEBAAF/KMQAAAAAAFAAADEAAHicrVTLTttAFD2GBNRUiWBBF2w6m0pQOc5D3RAQEgJFCkpBEITabpBxhniQ40S2kwBS1/2CfkDVL+gndNlFu+sX9Ae67LLHk6GQilSibSx7zty5c+65984EwCOrAAvjn41XBlvI473BM5jHR4Nn8cRaMjiDJatjcBYPrbcGz9H+2eA8fsx+NbiA5WzG4AXks+sGL2I++5LMVuYBZy90lBRbWMYbg2e4+4PBs9jFJ4MzeGqtG5xlLq8NnqP9ncF567v1zeACnmW+GLxAPY8NXkQh28A2eujjEhEUOvCRQGAFHlY5VlHms4aiRhW+AjuQiLVvyFmLnoqWkKNkLQUaGjvAdq9/GamOn4gVb1VUy+W1YrVcKYsdGatOKFqekqEnbdEIPXo/h8vQPtN0cYETEitckbLCJTfxd92Lk5a6kpwe0trBAAE9I05lZxC4BHUmEpIjHSN6SJ2Ao0XX+E6PUPyds94Lk3ov6khRdcqiJiYUFH9FvAfjFIZjekW6nD1dzgr1MsVjGcWqF4qKU/kfUe7XYvseTU55NjDSj4OuUXqulTqmD5uMYyNHD6VXhVYd68yH/LZpue6dwB73dnXvpuftkC2HI64p8tze3SI6IxrpeqQsY4+Ao6cziE3EAXFbaxA6itS7G2hy3Ge1pM78hrk5wZDW4O7eORPKJuMKqhryVbpfp/ymtpu6uDriFg40Tnhqc7pbCfXUUOITky3tYp+2mLFizXVd6RKV16l02tWz77x7YmVjNBo5XZ6dc/fC4bHfXLVzI5X44lDGMhrKtkgvhNhzu3LyKji53JGv4vFyq3eWjNxIChoC5ckw5sZB2JaRSHwpWo2m2O/LcOzcHDvY4tZRd8ZkZq9wh64K3NNACq3FFfWtA+EmtZyfJP1aqRR7keonsROrIBVd2q8z878q158I//l/6ScbPUGCAAAAeJxjYGYAg//NDEYMWAAAKEQBuAA=) format("woff")}@font-face{font-family:MJXTEX-S2;src:url(data:font/woff;base64,d09GRk9UVE8AABVYAAsAAAAAHbQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAD1cAABLoUO+TM0ZGVE0AABBgAAAAHAAAABxdKvsAR0RFRgAAEHwAAAAdAAAAIABWAARPUy8yAAAQnAAAAE0AAABgPshX0mNtYXAAABDsAAAAwwAAAdqEtw5laGVhZAAAEbAAAAAzAAAANg2pmDdoaGVhAAAR5AAAACAAAAAkA/AEwGhtdHgAABIEAAAAdQAAAKR8fAIEbWF4cAAAEnwAAAAGAAAABgApUABuYW1lAAAShAAAAr0AAAZv/gOhtnBvc3QAABVEAAAAEwAAACD/hgAyeJyNVwlYU9e2PsdwwgYqVdv02jbiPD6riHVAW+tEi9WOovVzRkShChEIAgGSABnPOhkgAwkJM4rUMijaOiAOaG/Vtl/vs77a6fW2771qWymt7e0+YYfetwP1u7Zf77svCfk5e62119pr773+FZYJC2NYln3ouWRl2rPJ+dvWpqtS4x57OXV37t7kbIYdxrDMLHEEIy5kxfhh4iKJuDjsl5KBO/LwLjn3Iidnz94vZ5gR8mEjRsqZGPmI50Yx40M2iLmfGc2MZaYws5n5zBImgVnDrGU2MslMGqNg9jPFjI4BpoLxMnVMM9PGHGe6mB7mCvMXZoAdxY5lJ+dmpsfGLosNwdzYOGX63p2pKYqMHfuyFTtzU5R0OC5uTmxObkZGsjJdkZmdvDM9JXlveqYydXd28t5BcdyKIVg5BAmDsCJ2COYMQdwQzA3B3NiFQxA/BMuGYHkIFiQsHIJB2bLY2CGYMwRxQ/D4EMynkPD00yuHIGEInl6h2FeQnb47TTluWsr0cXGxsfGPxcXOiR23MjUnfXfmuLUp6amZKakzx63KTJn1h3vxm8HnFdkZyXsZ+mKZCCaSGcE8wTxJ07yZ2coaGTWjYU2smeVZYAXWwlpZG2tny9kK1sE6WRfrZitZD+tlq1gf62er2Rq2lq1j69kGtpGZHtq9Ccxkxs+OYJezKVSpaxhINku2STIkxRJeUhU2KkzgNnFHuavcHemUcD8KR1kRD0VMjVgasTEiJ0KI+CxyQeRXUR33lQ+fOfzg8LPDbwy/Sa7AGTHhDHuGviRnHsIzxBYyQ3ommCejo8GE8GhyJboDJ96UiJcGHpSBjRc0HjITL5yDs7LwSd17/En4DD4VTla8V4+t7+PNOBzPrm/2+g80o0qPIIANrEab2YIUUjKGRE4iS5LI5jTygIrcD2Q+kHl+MqKNjLpANt0hS/EYEoGapRaLjVoh6vbGTUmbPCxbJvDlunLdwUxPYb0Ch5PZ75PN9cRakShsgUUQz2/RJWaRk3NIFplJFiK9Tq/jeaS18tUxHikegyPv4CUX8OY2/IAf3w94HuD5KjwiDY9Kwpsm4aVkDI5AammhATRjo7Hto4ExMge4bJZyqzUwXi69BlVQVepQC2VQYjTrTaaB8fLALCiEImeZh0fRcwfGdMul9d0sVnZLsJJa48JukkiHcGI3KZTSKQObj0sChgFOBj5qLP13k9VYobPqoAi0GqFY0AXGyQMzbHqL3mWsAA+4nFB177wbuiW+/s9lOFEe2EYSN+BCeXh4aOKfcSfdljcH/iTzhoMfQGvLc2T48r2bWhWdJaeQ2c1jHcdjt1BkqFX+z+KL8a8jTbnLylXaX/N5Ky62Xeiq/ou9li8SsBsJWG9xca5TzZ2nW2u8Lb5ah9sGAH4EXn15MXBaMPJGfotqnzpT9cKunVuKN+iVQh1P/IgnerOWMxWZNHp1btKGjav2qI28KZQfweQxvrune2N9UrnaqrEWI4tWIAZOIH6+rlxZu/T6Gox2VBqBLhl56HIGxpySS1tOsfjILSy5JMFR/b/IIMdh95VdVVxN8q6gO1AkkP0C8YXs7fnunEpV92IcsR14tEe9Y39WflJKxq7Cp03ZlmCSKbt4xeqk1YrCsjI75EC+wNcAqgQBPPaj3qM1LbXn2lvf8HTZ66EEsBXwbPhIqKh46/Vzl95Afk+j1++otIcSAD4Ajf3Vql0Hsg6kdeQdM5zgK+Ajqo9CZiWGenVX+hvr2zNqd9bs9KrtPGggH3iAPBS6OeIa8fIRtl8r9snGRYae8Ft1l1h8MVAiGx8ZHbwYktqGhPRhUDiwZkgY2BFcf17O3XeexfvwE6IZPynpf4NclfXjcN/lnvpPAbnOy0nOOpe0HVr1DaXtRZV5nnQEv2BTKZe/dl3ek4BK1om68yXSRfBSffEVxIt9IH4vmgHkZNU/U/p/+Q3qfu9WThKDZvH7cEH8nvs/1H4XnTzMco/nfhRcf0se9u1p9s/9iTKDCUxQgIQiXBNkOTyFbMbDSbxgtpiCh4M/AvBmesp4MFkNVt5qfgfEVkBir3AJz+bavql/u9yLUqTabE1OgXLtqiXbZuS8VLxWP8Og4omdJy8DIhGPgTAW+/E5Dk/C8TgKywVBsILAW3jrZDye/CKWoTI3PgEc7uCr4YwJjy/9NufjTYdU9aqG3Mbs6myvAlUUdwKnd+eeT/sUvYQfDX4HXPBzeq9NZkR3u39Ph6S/WB6mlumgzGAyoKBDHjhKdgZ2cQA5WYp0NIUMP5j1zkeYDUZzl8nek2SBTYMqpV6wW+x2hFv7ozgMgYbDP9DC69Q5tYCijQN3jshRSgd7AYcFHsNhErx4oEA2gZ6uunsk4uM4jJa+QbyrITY9RNX6/X+ghqfSvzn0edzv1EV7yCbkM/DmMXHrscCJQbsrx8RtnZfv6r6e3ZCxKy97d4x1zcn1b8MpOPpaw+HWE4evtfQ1ffEW1r+BX0bON13AfeW4cbrz6qHj/uPwLnh5L+8o+ibp2tIOnU1vBUC1OJxrxotdF2q/bcH/VvNh47t1lxra68otggWs4AKv0akvN3rVPKCMMqUadqNXm5QtR2qaOmKMV5LPJoCRvk38Tl1mdm5m2ta9CRlTsxe9QGA7SUKl20qAiy17atOONZnbVDtgFazyJx9Kbt7WmXFSmUUWbCeabBK+iyzfMzstDWlLDCatoIKicrXXaDXT4FocDR5oR9jfv0FWtq1gtiGDL+P1NJJcD7fx8O4u9UVDDe+BBmgQPPYa37snei63NFa2ueoA2aVGzaskXvUkwmcPyEDNa/gy1YxnVszdrzEVmPSAjFJb5es43v+xs9v3lbPj/Z2XVsMkFH3hZuDiTUl/Z3CyjC7fRk+5M7hBzo022cq8KpcK8qBQqys26YPr5f29phKerh2MKKteeTCmGvwuh99ivYVrsARfR3ir+AneGvyEwxJy/RapsZicKn9JNTRDbRM03nV1oX+0LDSHYLKWiKFJrQZnYUitGnzuCo/VJobcW5z0moQIujGvSRFTAKqS0kKzcRapIXRuRKgXQr1xhPqdhWvMtjJfgasAMiE/C3Joebl1m73QGzjRKxH9/atkRFI6LWV+wuMrVk9UkRheA6l8cB6QL4EMF4w2ZZ2KJhRq/fZ6JNgAjwR8DfBZwNMElxtP/w7L8NTzJ/1dztOAlYDjyRIPeVEoATINyFkE5BqQkYLRnls7OE2d39YQmmU44C950Sgk647m48hEPGzadbSsZ17rDLdGyIBceseC62iQ3wXe7JX09E+UTYyM3tP/+T0ET3n5A6ztJp3SXwX2XxlaKw/M7A6xc0hC+fuenqCzm2ip2Ya7AmqC7cFvZES7AXdSEyroxmHn8NtnJPQqmmR4YGCAq1A7dG7wgruS9yKoIM+IK7npuHQRfgUsIHyKX+nFpQg/IyZABSd4SitVUAxGnU6NyMBAkIvu/vIkfuccnY8G4ASH3eawWD7Dm/qwHuFV4rPgJavEVdxUrI/Hm8wWo6PUXkJrV0mRoLGpMB74GsxgXkRemU5KEXkmuBJ0nLnYq6FsHd2/mqZIdNJZKnrZnl7RgRNFR6/kQXkgtn+lbFIkHv+Y7GbpXxUfb8ZzZuJHyPNANPBU0ZLM5S+TifScSMkjzyXufVa1VFfK5/H5gPIpQ5cKZF8tWYjvj8Vxr9za9yPcgSuuq7VvH8PSnv/84voXH+BhXTi8Crktr1kOQh20gJtHZFLwtgzKhDJB79r92p5TcBaOdMA5OL+jdYt1PaTsgnWhcPGWXvH0d2xPn3iqVzzVJ3lw4a+RHhl4WEaapUSxltIBWK0HLZXHcSV+Aa/BRWcPlLfZ6yzIIsWjTLIf1L0pnz+HR0/9gsyoJotDHmnjwa8FooghzeJpaTnP2cDJO2lQo+RkrUwvcETqnnw07j3ycN88PKMAL+YdfDkISOgBrIjBzdKAnKc3zrTPrNFtV29UJf8jO6szVqtW6BCtMOJp3ExJSNED/NihxMvDOkNZl4cd7ZXck/CftX27vnjep23Ko3EFRwcfDo4WH+ZAaKr1ub+88vORvzkcgpNWElQjvZu8ETR5IU2Oh8IarU/jL64tqaa5/wF+hA+rbhz6wHO4/nj1IV9jc7sFUH+cRlabU6Ooyjo76+BkmDi0o+o9uckFmYU5it1mQCGXYsgt7fwNdh1aPHCDLnBL+n71gvVxmVNLh7Y7H/Lobk91xh1aeC7Xs6WVFhNB/JM4WogJXT3xv3vp7cM/9eK/3b2A4iskIKN8nwbL0YQJ4cvpPyY+z5ifT1s7Wl38ZW69m6+ndapR6AD003gpEAT2co2jqEpbGypfLqevvBIMgBH620/hHdBIKb0e3IK73O9whQpcY35Nns0kUAeAJvwkhQ+gjbcaGvb7lJANqnxD3lBV6LkdOHF7MCgaAPkMBj8C/TbZCzzqWh0St/Ic/i/AI8AuVNt8VbYasAr4Mxj88PTbaqjP8ytBCXkqQy6iRZushOBGNBAxcCIQEQ7iRsAredtvPRMP9LHQ19cngbC+vqlSvHmqLIT/XBDcPij4dTi6/9sHxYuymEiJ+6n7IuC+yDORZ6JiIqV/v2+UnIl5gOFCPy2XMd1sKvv3YQqDEDThJygfE9t8jozdQrhU2tCaXGm0OwI8rAU/2o4f6cCSFgEQNidy+NHdeFiGEKLoNrqTUduNO8u2FG0tSit6IQPtLnAUcvZSaxlQY7u1wnrYd6L6sPtC7RHnO1BD35Xm44YDZR9koTcLK41N+tbSA8Z2wFL46tjXp1B7dZmPMzhNDtrvgcGkM+0p3FqwR5uUl1r6LITOkcaSbM9yrDiAEht2VC0AFPWHvcihIwd7mj70dVWdb/jqpij9M267Js5uxFMq3675Gv2LVuOPO40cyNUWqB9fs5Uk7iBzZwUjXyAtK4OPZ5In8icqx//LNiKKN1CGozwnBI388Yqd3rnHFlx++sYCzL6EwwtfM7igFW7CO9Xvv45un/7wetfXB7p9Zx1XhEo4Ioj0B+yXlMV4u7F+/29P0shByjtL+Y8v0ZLp04iMTFm3RbWxdCMQJZB4vESNX+RdlD8pi6JBMh35j7OWn2/KQ1Hk4UIyMmnSvBmLl5JhO0hU9jL1ElgChGka1zX9NknCL5NYDK+2GbxwHNBxyk7tdvyQH4+88MNfv/3kP/CwYziq6brnBtwAzGT/vLF3JZ5AwnEYmfgeWta2pHaeU0tvWQ5kgMJcYEJR/wtA42GBAAAAAAEAAAAAzD2izwAAAADG+TJPAAAAAMn0JeF4nGNgZGBg4ANiCQYQYGJgBEINIGYB8xgABgIAWwAAAHicY2BhtmecwMDKwMDUxbSHgYGhB0IzPmAwZGRiQAINDAzvBRjevIXxA9JcUxgOMCi8/88g9/8RUECOQU6BgaE/jhmqQAEIGQEKkBAjAAAAeJxjYGBgZoBgGQZGBhC4AuQxgvksDDuAtBaDApDFBSQ1GfQZYhmqGWoZFjAdY7rDzKwkqCSlpKd0WJlb/aUWkxaLFtv7////A/UoMGgA1UYjqWVS4geq1VY6oMyh/kKLAaz2L1Dxw/+3/l/9v+p/7/+e/1l/Xf8a/OW+x3D3x90Xd8PvCt8wv6Z4TeGavIAm1G1EAkY2BoIaYPJMzGCKhQTjWdnY8cpzMHCSYBoqEORnEIaxhSAUFwnauXlgLACmbzOJAHicY2BkYGAA4ti7W+/G89t8ZeBmfgEUYbgau2oDjP4j/GcR+x7WACCXg4EJJAoAleMOSwB4nGNgZGBgkPv/iIGBzeKP8L8a9j0MIBFkoAkAiYgFtXicY/jFYMTwi4GBKZRhCxArM2szWDDeYHgApM2AtADTbIZyEAapYX7x/zfzCwYg+CMMxBIs/xgsQJh1CYM5UDyfSYfBnMWGwZzNgsEczA5HxUwCDA+AWABOJzMUAHEo63OgGVAMU8uow8AAwgwpDAwAR5Eh3gAAAAAAUAAAKQAAeJytVMtO20AUPYYEVFeJYEEXbDqbSlAlzkNsCAgJgSIFpSAIqtpukHGGeJDjRLaTAFLX/YJ+QNUv6Cd02UW76xf0B7rssseToZCKVKJtLHvO3Llz7rn3zgTAIysPC+NfAa8MtpDDe4NnMI+PBs/iibVkcAZLVsfgLB5abw2eo/2zwTn8mP1qcB7L2YzBC8hlNwxexHz2JZmtzAPOXugoKbawjDcGz3D3B4NnsYdPBmfw1NowOMtcXhs8R/s7g3PWd+ubwXmsZb4YvEA9jw1eRD7bwA566OMSERQ68JFAYAUeVjlWUeazjqJGFb4Cu5CItW/IWYueipaQo2QtBRoaO8BOr38ZqY6fiBVvVVTL5fVitVwpi10Zq04oWp6SoScLohF69H4Gl6F9puniAickVrgiZZVLbuLvuRcnLXUlOT2itYMBAnpGnMrOIHAJ6kwkJEc6RvSQOgFHi67xnR6h+DtnvRcm9V7UkaLqlEVNTCgo/op4D8YpDM/pFely9nQ5K9RboVlGseqFouJU/keU+7W4cI8mpzybGOnHQdcoPddKHdOHLcYpwKaH0qtCq4515kN+27Rc905gn3u7unfT83bIZuOYa4o8t3e3iM6IRroeKcvYI+Do6QxiE3FA3NYahI4i9e4GmhwPWC2pM79hbk4wpDW4u3fOhLLJuIKqhnyV7tcpv6ntpi6ujriNQ40TnlpbdyuhnhpKfGKypV3s0xYzVqy5ritdovI6lU67eoU7755Y2RyNRk6XZ+fcvXB47LdWC/ZIJb44krGMhrIt0gsh9t2unLwKjm0f+yoeL7d6Z8nIjaSgIVCeDGNuHIRtGYnEl6LVaIqDvgzHzs2xQ0HcOurOmMzsFe7QVYF7Gkihtbiivn0o3KRm+0nSr5VKsRepfhI7sQpS0aWDOjP/q3L9ifCf/5d+AkCAQY4AAAB4nGNgZgCD/80MRgxYAAAoRAG4AA==) format("woff")}@font-face{font-family:MJXTEX-S3;src:url(data:font/woff;base64,d09GRk9UVE8AAAysAAsAAAAAEmgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAABu8AAAgJfCKV3kZGVE0AAAf4AAAAHAAAABxdKvsBR0RFRgAACBQAAAAdAAAAIABGAARPUy8yAAAINAAAAE4AAABgPshXPmNtYXAAAAiEAAAAngAAAar6/I+1aGVhZAAACSQAAAAzAAAANgnZmDloaGVhAAAJWAAAACAAAAAkACAFjGhtdHgAAAl4AAAAVwAAAGQ7uPuabWF4cAAACdAAAAAGAAAABgAZUABuYW1lAAAJ2AAAAr0AAAZvAQaluHBvc3QAAAyYAAAAEwAAACD/hgAyeJx1VXtQVNcZP9fdixfU9VHX2s4NruNYjQ2GaBwx1UaTYEI6aGpKTdWAm5XCIiwqEHnuyrIP9n737oNdFnZhQbQ+oDYY08xgLTFWZ2Q7dlIndSjTDjqxHdO0lhmNfBfOZtuzYqeTmfbcP373+33ne5xzf99cjmi1hOO4JfnG6tLXjbVFb5rri9dn7SouqSk3HiHcLMKRZ9UFRF3NqU/PUtdo1O9qxem3kq+L/BmRH+BFLmu+SMgCkStcKJJMcXbWIrIwFSSQ+WQpWUa+Q7LI8+R75CWSR94gu0khkUgvOUcu1FjM2dnbslOwPntdtbn8QLGpsuKdI8YDZpOxnNHr1mfnzMCmGdg2Ay+lYGNuzgykfLnbt78yA7kzsP3lykN1R8wlpdWG1aanDeuyszdlrct+LtvwSnGVucRieNNkLraYip8x5FlMa//nyb9G7qg8UmEsJ2xxJJ1kkAVkM9lCvk/2kULOTazExrVyHk7igJM5hfNyPs7PBbg2Lki+lbqK5WQFOc7N5X7M1XKfcA9nxTWKxqfp07yv+VhzU5ul3a41auu0Ae0Dfi9fxQMfuQbDau4wN8yWZngJrlH76Zq04cRRPWMTubN113TqB1j8D83UD5Nb9eCT5OYwXYvPr8Dd+SgZcXMN/gDwCKg/w4WqDjuwrz0sy+ADr9vnUYRycLv5uqbCwqrDtIhW0fn0RnlinjNXKoQc2CgXBrYPJHTIWGTek4eHCmNNgs89ALyi+FgOgRVXt97XqFvRp4fEnmfoI1pA28v2l71jMgnHvFJPZhR8Pj4WGRo6eQqLsArn440BVRf4vTwEt2FcGnLeLFfnUcZS5q06VThUFxHcvkbg611gW4bdtBuXJJ6CxGlBN3XvN5c0f07m6UMQ8vsCijKJg7hDdQlqvqjt4D/DphHcJHvliDXaAM1gd3hcHneSEyfvuK2SB1KPNdwYBUGHd5N5cVG4G+cQ4hoElhP74tTEKDTFaV8aq3X1V1NjlzTTh5Jr9RBwh+hKdamQeFyIspoGHPQo7kCLzyE3gK0ZGsDhtePKxNJUM9TM446Ea5IOKh6fM+QKQQQ6OiHytcKWuCYs8uV6NIn4FDXlY5+YXpQqrV5J5g2J6fwQh2PsapPJl/XR2dAB7HuB7PK6lLrQoa76zp0XjdetI84zskXChxJ+KVscZ4V3//7iZzTtqlAfCnl5nzfsD/m/vHpzvPde21nJIuMjGR9IlsCZzpEPr1+/2N15uisWEvyK3wuyojBRdAgQdQYqoMHB08U/2rSxarXDIvdLFCX6EVRLx+y7avaUvF1RYjIba6wOSYZaAWplpdPxl323nusyyMegWqYfyWx/f1vlyVW3N+DiAiHi7AeenQpHJzT4TZFv14MdnLIke3ytYdfdvZ+81mPwlnkS97xlx+nCz3Mmdgu9zUftfFl9ZV1lTYP1YLmtsbTo3bftBa1lSuJea1ktJa/mrd/b4JAUaBTACQ7eKkvHMyMQDfC46Mr4nZP3gwNSmYzTgoy3lAjf/ttTH18cPnX2g/5fdLf7QYYYdIPc7K8LHo7Vd77x6z03rH8VPBEJ/8BLOC2XtQxU3c+5QxddERoDTeACvkGSji5jsyZq76ojF764xYl8rzqiN2Q8ZiYvv3eZC6uT+uUZOlows8E142bmY684XTLjn7qkbh7UqJuTr+k9AB2s6TbZG/T71cti+kZol0LNwRZwQIur1eVxJvwiRsEt0OLpfTSLujutfFtLwAXsBJGTsTN9g+1R8HhbsTzZ5m0VdExOTFgSU7TEFB0X05djV5yOpT1xnP6P4rrEydvxlNqYi+nxvyE4FqddLCz/Cc8i8HRyjp525eMYC8hPqVP92zUNLkKXHm2J2zzq6egjGpM9bY5QSxiEaDTcuwxCtFEdZRrCT1dghHUrP8QIMkvARvWPEORj1s76TBs0t7gckmc5jVGWRaC2xHhKKF+w/AtZN1FoC/hDsvwIY6jHUQFt6m3opjZ1nKfMXo4xSXG12YNN0Aj2ZpeNzTiwGT/WtwtLEn24mH76kEZAEkBaQSOUmQJtTIyCna8L23oydZMwwcHExIQGtBMTq9Jw3yp9Cv8vv/Yx/4TVqX9ajAX6zAxN+MW56TA3YzhjeE5mRtq/5i5iv75vkFkct+EiyMHzIEvwlRm3SCB8VUq38CAFfwpscnBDP751Hn9ynr0oEIKpnfTbIRDmyBBUon584QrqT2EavAfnPOdcHzov2H9X+6Dil/a4s0PqgxMgnIA+6JD/Gfy8B+e93+6d/Dn4wdt8AtokaPE0uugLBVR/mKaBYAazctC/P3AglNezst8Y2hmwyaVQBfuhrPWga1tzTu2zFuFYq+Eg03lrezU4hDn/Bn5x3UoAAAAAAQAAAADMPaLPAAAAAMb5Mk8AAAAAyfQl4nicY2BkYGDgA2IJBhBgYmAEQgkgZgHzGAAFUgBLAAAAeJxjYGFazTiBgZWBgamLaQ8DA0MPhGZ8wGDIyMSABBoYGN4LMLx5C+MHpLmmMBxgUHj/n0Hu/yOggByDnAIDQ38cM1SBAhAyAgAxbhCOAAB4nGNgYGBmgGAZBkYGEFgC5DGC+SwMHUBajkEAKMLHoMCgyaDPEMtQzVDLsIDpGNMdZmYlKWVu9Zfv////D1SnwKABlI9GkmcCynOov3j/F6jg4f9b/6/+X/W/93/P/6y/rn8N/nLf/XqX44aOgCTUXjyAkY2BoCKYPBMzmGIhZCYSYGVjxyvPwcBJgmm4AT+E4iJBCzcPjAUAwEAoHgAAeJxjYGRgYADipW/uh8Tz23xl4GZ+ARRhuBq7agOM/hXxx4t1OesqIJeDgQkkCgCXpQ5xAHicY2BkYGCQ+/+IgYF1ya+I/29YlzOARJCBJAChfAateJxj+MVgxPCLgYHpAcNFIFZiEWEwZxJg+A6kLYA0N9M7hiYgbgapYV3y/w/rEgZGBoZfEUAcy/yCIZ/JneEbEHPD6XcMdUAcx6jDwADCDCkMDAAipRhzAAAAUAAAGQAAeJytVM1OE1EU/gZaiDVtYIELNt6NCZjp9Ec3FEJCIE1KKgRKjLohw/TSuWQ6bWamLZC49gl8AOMT+AguXejOJ/AFXLr0m9uLUENNUDuZud8999zvfOecewvggVWAhfHPxiuDLeTx3uAZzOOjwbN4ZC0ZnMGS1TE4i/vWW4PnaP9scB4/Zr8aXMByNmPwAvLZdYMXMZ99SWYrc4+zFzpKii0s443BM9z9weBZ7OKTwRk8ttYNzjKX1wbP0f7O4Lz13fpmcAFPM18MXqCehwYvopBtYBs99HGBCAod+EggsAIPqxyrKPNZQ1GjCl+BHUjE2jfkrEVPRUvIUbKWAg2NHWC717+IVMdPxIq3Kqrl8lqxWq6UxY6MVScULU/J0JO2aIQevZ/BZWifabo4xzGJFS5J+YRLbuLvuufHLXUpOT2ktYMBAnpGnMrOIHAJ6kwkJEc6RvSQOgFHi67xnR6h+DtnvRcm9V7UkaLqlEVNTCgo/op4B8YpDM/pFely9nQ5K9RboVlGseqFouJU/keUu7XYvkOTU54NjPTjoGuUnmmljunDJuPYyNFD6VWhVcc68yG/bVqueiewx71d3bvpeTtky+GIa4o8N3e3iE6JRroeKcvYI+Do6QxiE3FA3NYahI4i9e4Gmhz3WS2pM79mbk4wpDW4vXfOhLLJuIKqhnyV7tcJv6ntui6ujriFA40Tntqc7lZCPTWU+MRkS7vYpy1mrFhzXVW6ROV1Kp129exb755Y2RiNRk6XZ+fMPXd47DdX7dxIJb44lLGMhrIt0gsh9tyunLwKTi535Kt4vNzqnSYjN5KChkB5Moy5cRC2ZSQSX4pWoyn2+zIcOzfHDra4cdSdMZnZK9yhqwL3JJBCa3FFfetAuEkt5ydJv1YqxV6k+knsxCpIRZf268z8r8r1J8J//l/6CWXDQZoAAAB4nGNgZgCD/80MRgxYAAAoRAG4AA==) format("woff")}@font-face{font-family:MJXTEX-S4;src:url(data:font/woff;base64,d09GRk9UVE8AABQcAAsAAAAAHMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAADg4AABHZr+S44UZGVE0AAA8YAAAAHAAAABxdKvsBR0RFRgAADzQAAAAdAAAAIABhAARPUy8yAAAPVAAAAE0AAABgPshXmGNtYXAAAA+kAAAAtQAAAcr935afaGVhZAAAEFwAAAAzAAAANgnZmDloaGVhAAAQkAAAACAAAAAkACAHYGhtdHgAABCwAAAAjwAAANCVFRBcbWF4cAAAEUAAAAAGAAAABgA0UABuYW1lAAARSAAAAr0AAAZvBAmpunBvc3QAABQIAAAAEwAAACD/hgAyeJx1Vwl8FOXZn2GPjLmkwiLqGCI1ylEkBDDkRwEDJBULVIkVq6gNENhASCAkhGyy2ew1uzPPzN6bZLMJIRzKGRKRD/jC8ZX78OBID8XPRcWf/moVtbTvJO8G+04m2GLbmf3Ns+/xPP/neZ9jnqEprZaiaXrEgsIK4zOFG18rKDYVTZmwqGhlZUlhOUUPoWgqUx5KyXNoee4QOU8j52tZ2c/iNDahlNX/QccOeeRelqKGskPcP2GpNHbohvuonylcDHUvNZIaRT1GTaCmUNOp2dQ86llqMfUqVUSVUOspE2Wl3JSXaqBaqW3UbupN6jD1f9RZ6l3q99SH1KfUn6lvKZn6ntbTKfRw+iH6F/QSupguqywtzszMzVTI5MysiuKS5UXLytYsLS9cXryssIRMZ03OnKaSHJXkqmT2AMkZJHNUMlcleSrJHyADwgmZpJIslUxWyRSVTFXJkyrJVokKm6vC5qqwuSperoqXq+LNHmDIzpumEoUhLzMzUyUKbN6kqZkqGRxlqWSyShQl8vLz56okTyX5c8rWVpcXrzRWpI9ZNjY9KzMzZ0JW5qTM9LlF64tXlqYXLCsuKl1W9LP0eaXLnviP3r5rcmFZ+ZrCEopcNHUPlUgNpX5OzaBmUkuoV2kXVUdZaDfN0wINtEhLtIf20j7aTwfoIB2iw3QD3Ug30RG6mY7SLXQrvYluozfT7fQWeiu9jd5Ov06/Qe+gd9K76N30Hnov3UFNUWJmNJVBvU6PJn6W6Ku0POQLzXuaK5qY5lstpR2mtWij2kPaHu03uhd0y3Rv63P0+fpO/Xn9B/q/JiQnPJzwZEKImclsYf58zwuJVOLyxK4kJuk3SXzSueT05LXJb6dMSslNeSllfYot3gxH5byj9FFyaY6OQOPknXic/mi8ykBm43kJqfHm1K3IijSaXoHFYwzg4T2WKB6KJk5E+c+gFTNQYAU6BnIiyPd0omPvo8DbaMXnKB+RHY1RyQMeBjwuLy8xJn0duIAXeH5taW017saf4vR4JfSnkB9Kj1ehbvxJS9X2MkkQhSCEgYnqJcnrJQJSt8q/IgrsYfXvGMDt4SImNAQ/fAPnnMcLP8NtB/BFiP8U4o8W4ouTcNsCvDAL52Cyw2xyc8AztoAQTvPrgxAUJZDE7W+0tKFu9ClKlyuhNxV6k3G6XIW70SemtnVv8KIgOsEBjF1vcQj2Ualy4OSJvv0nNKzWw+ovGNzc7RvsLY63KZYAD7URc5QoG/b5Ah5f3w02ySSFCAgBYqK1TaY0K9idnJNJxQtYPKqHTcrooVF7jwa1k6EBnevBFjKHLD34nP4HqJOs/pABBJHIl2x9CpyH8znCXBiiEIlAM0gCkc+Hbitwbh/DBeu9VjCBpRZq70Zy9Gh8rF4yIAt76xq2zEbn2KSDClQX+kZx6VgWZxigBRp1EBLA5q33r4+aG01NpTvqWl773aoeR0wIARoBKDzwu18IMY6Y8cNnL1ua1uysa6hp3NhcE2Ze3qE7t7P7rUPdZy53fBiIiYTlfkDk2UB4xZC3u/FQ24Hdl05ffGcfE/KKACEGGqHF6V8FlfW61aYKc/nGvMUv/rJsdn2ZYy1nFJzC44BPMkI8gzfp+A2uKs5UnjE/a0qBxSp4YANUiZ5G6ycFF7K2ZfhM3ippAyPViPEMHeBT4uOiM/TL1pc6Xjj8i7cLPlrKtNr2gI7Y+xWxFz3K6o8boBqEEPf1sx9hKozTRBvgNMASYA8oI3/Onpmn8ptqdq2Jmpmd5bsrujYaTasqVq+rMZesqatZlL9qpjNHUJk8A3xpgo1xTC6esXBexbrlJWU1dk4QoJqpANia1gxtYd2x7W/t6Oo8c6rrYssVb5OnWWoV/eI3gE6K8gKhKPDmJsRcuvXlWaYxDE5ohy3gtITHn82/tRExjjfFIkFeCOiE8I3g51vdza4mpvKzgmvZF8o3lUdXR5mqcA3Ug84C/IZRSrL2/U0+fZGu69UZ0hOVwTWkjSItLf+197zhkcTU/pCyzMoBdQMZDm5g+26rO1Ct/PN9clunpm81q79o4LlleDlexWKBwQG276hOkJagbQXo+iIUI38EkZmJx8/CE7avu4iGIU3/A7pzGB3DB0Eg0UsyIwIB0RP0+eTjbFIAAkLIFrSBHRycW8kKA4nOf80IErel6GBPnNL/sHbkTgwfZG8FyPrBwUUS5P/CKFM9+CBhnv3PNcKIjrDYaMAHZ8sUYSRrf0cH0X2a3vdZrc1QrSfJCQK5HA6HDUfwZTwxPvnX8Z1mPNqOR/N4JuSD6HdLwj7YBcwWaCOJ7ZdAhANwUPpCPL6pdwxKlG1oh/xwIOzxgQe8Lg+pdIMo8iSbYXTiHchY/72keLpJHmMT+gAPlyctlffXI9aJZgIaQ0SKTokXq6ACSmAFKS4M5yZI+R68sgHPacezLpAKOT4+DLnxkYAt4CBliqQmqZItSpUkyARVfoUA7WK1VQaRl1werqVi7+LGKvQCfgfR8WGdcXsDfthPrMJjoBBINElCGwk2ZhfsUwzzEI9dcqOV9WhOJXpqvrwBj5eHYTc64gg5AgRNdChlsV5f7xSsowbB5D+qJg4MTvaPNIQgCCK5AoFACEXQZTRRnvw7eWcEjQ6i0RIx9RIITg8vroUyYMrIgxeInQIsJUo58ax6/NCKuAMTbTHR2lJVvNhU4XLwbnAzdp/Qlpb6WN+JGI2uxjToav8Dhhir34+iMXxTn/rY5g2D8yNi8tfZZKJ/5A87RxrQzRiOkt3KwoCIaEzTd0KLomzvghibkPCDCDKPoneJGJiJnzLgaDa6SbaSBXk4StL0Lum732CEOofu1fLlZcWrp03Px0Ns+BFSGyYCzgAchFbljFthL5wkrpT8DHktnAM0T0TNQq2/azN68DJivrsS8Pp8ypkB8SfTkqBIT9bID7Bal8Hl0glu+A3gPEVilmCx4hlz8WiclOXgOE6JXVCSyQ42UWBA8HEBDumy/4gfasDzRAtkDejhUfXYDuotiQwJ4mpAXkDp8AUphX+ourzy3Vev5/0++zhjDkVCujOdx//3wIkLH3V+FfiOVPMvlI1ke7USoRuhEkrBqERoqmxAKZrepbd/YmhJILEYUqKEvKm8008siK3+ytLh6OD+R4jAFgGtBfQ0nBMkhvcLUADLwAJugVHM4wFPADwSxsJU0eqdH31ux3NHH7uW8+3zTIOzg1RuK+qhB08EnTeoHEbAiYCnQ/huu4hZVkDTlZ/VSaB+rGuSBs3pG2FwuYmIarLVriQROTPXtefPZ+8e22gMGH2/Fc1QIeIyBvA8WEjyyCkS7+2FVlU+ObYgoAz4nBzbB2v+tOos8+JHcy5NOsLU+01KEeZUrLs9SEwcB3gEjIcnRavvqba8fU8fevJybmwxE7GZbbpnVyxeUvj8/GkrxjoeJcHzBOB0wN7/4jSPgn5DbAyjGVfQaJR0I+Dz+UCNHtLhKD5gQHGCD+tis9BD9Wie0Ag3FC7C++8eVDUNGQTSlwlKS7MQ8NMCbhYjzqIq/OBczDw61+HiOKVMKnHGlANsS4tCg1/32ZGrl47F9p7e8YHvfRIlnw9gBP8dA73Vu2i/ptfUr1T07xNcQWfASk6fs7s4RujnoJ+Lz2N14/AT+GJTnS5g93NA0mXTm1sOMweuyxVs36JG0G0SRV8wyKR29d77rgalI86AhP71OsTGxyAtvi7yAWvQ0QLM5khk8ygxFDezun1yLavrgJAO2muaqkUXcMQ8q9vh5OwCjwkTJswMFvrLSX/wHZGaxuJ0QwsEA4GwKCEtuo5YeQyDhN710IqF3nIdJmNM5gXJEbYGa4CpMtduGAU2AtS3KE4ez4FNtyFi3px2x+gVZkMD+PzeICP//UeW4zOAz+i8dp+zAZRDks/vp3/Mcx5dTQh6Az5ogAaHz+5l8JfAuXUOt+Air8/4xwl32PEVQMl0NS42tOjbyOn5gr5Qc3uo4U9/QcNPoomhkNgIfmgCjyj5SBUiIcUoD0HifW4S8Q6oFxwwzTmtbOGK7JfnznlpKmM3g1E3IDeRtp41wDpYR7KB8whNJBu6uS77/9dcLjn1yp7yjuWbjD67SN6OTAv4/dBhj+he+nju1ezup9+avGscCRpy7iTXBUvNqEE916NrBjAGzbojU6/Mib3cWr/P1Go/Xfme+STpC/+poqoho6hYB8Xwsq8omBPN27XocE3jmp2WqC1c286FuKAAVUC+LgZly0b0sUH51iCpyJMO2s27OVttpc1qqVmzpsYyY36GEac4rIKF9FpMHalCvBIW69RbtbCRZPx7kdPtrcF9La0NTKz7ytUjHzPBCHToUuNaBcQ6Qp6GkuPT9KlxI9yk4ebNmxrQ3rz5uB4tedyg0P++0J85sDA4ndqXMrw3ZEhL1DTMSr4HkhOPJh5NSkvUf598H0ulDaM0yrfgr6g4PZ1oKZAPKE60S3W+Sq8tABKglQdQwzFGLv5SXjleh8IvImOhRBztC3m3Sg1SgPwN8B4X1HtvP4WKeVJ1b+fiEreLSZrmwFR1emlmJc56pdJSY68yg5PnAi9K9ZJyBrwXAC62MWjBSTShAxma2qXd0k4gN9/KX7IfMv+l6Lqxq/6EbY+z070fGNLNpm5CGZ032lHW4fbG5mBbBPykKEmkKWrmOvkQL7l9pDVyEbHPVOH5BfgJI76vbj1fwpeQhqdU2ijlB1+LjO+a2lHUUBBiSvyveX6rdPpCtcAkeUFCD45CXycgFoBLc8NGcf2dNkl9Rc4DXM/g3ATAY8VmH+8RXofXYQdsE33AJP0DWbiWLwAAAAAAAQAAAADMPaLPAAAAAMb5Mk8AAAAAyfQl4nicY2BkYGDgA2IJBhBgYmAEQmMgZgHzGAAGewBmAAAAeJxjYGFmZZzAwMrAwNTFtIeBgaEHQjM+YDBkZGJAAg0MDO8FGN68hfED0lxTGA4wKLz/zyD3/xFQQI5BToGBoT+OGapAAQgZAfVvD+kAAAB4nGNgYGBmgGAZBkYGEDgC5DGC+SwMK4C0GoMCkMUGJDUZ9BliGaoZahkWMB1jusPMrCSlzK28Vnm7+ssHjA9D3v///x+oXoFBA6guGkkdE1Adh/JsoLoXDxgeBrz/C1T48P+t/1f/r/rf+7/nf9Zf178Gf7nvfr3LcafyTsENBwUtuTsCJlD3EAEY2RgIKobJMzGDKRZizQYCVjZ2vPIcDJwkmIYb8EMoLhK0cPPAWAAKajPsAAAAeJxjYGRgYADi+gqdffH8Nl8ZuJlfAEUYrsau2gCjf0z8Lceex3YNyOVgYAKJAgBvnw2OAHicY2BkYGCQ+/+IgYE98cfE/y/Y8xhAIsjABACbyAaDeJxj+MVgxPCLgYFZguEtECuy/GOwYHJn5IXQDKzMagwTQBikhj3x/yf2RAZGBoYfE4F4IfMLhnymekZepnoGVhjNnM2ojMAM8kD6JIhmms1oj8AMDECaHUQzVzI2MFcyrILQyGyGVSwKDPlAu3uAOJ1FgWkfCDMe+v8CiL/B6QlArMPAAMIMKQwMACkWM+QAAABQAAA0AAB4nK1Uy07bQBQ9hgTUVIlgQRdsOptKUCXOQ2wICAmBIgWlIAiq2m6QcYZ4kONEthMDUtf9gn5A1S/oJ3TZRbvrF/QHuuyyx5OhkIpUom0se87cuXPuuffOBMAjqwAL418Rrwy2kMd7g2cwj48Gz+KJtWRwBktW1+AsHlpvDZ6j/bPBefyY/WpwAcvZjMELyGc3DF7EfPYlma3MA85e6CgptrCMNwbPcPcHg2exh08GZ/DU2jA4y1xeGzxH+zuD89Z365vBBaxlvhi8QD2PDV5EIdvEDvoY4BIhFLrwEENgBS5WOdZQ4bOOkkZVvgK7kIi0b8BZm56KloCjZC0FmhrbwE5/cBmqrheLFXdV1CqV9VKtUq2IXRmpbiDarpKBK4uiGbj0fgaHoT2m6eACJyRWuCLlGpec2NtzLk7a6kpyekRrF0P49Aw5ld2h7xA0mEhAjnQM6SF1ArYWXec7PULpd85GP4gb/bArRc2uiLqYUFD6FfEejFMYntMr1OXs63JWqbdKswwj1Q9E1a7+jyj3a3HxHk1OeTaR6MdGzyg910pt04ctxikiRw+lV4VWHenMR/x2aLnuncA+9/Z076bnbZMth2OuKfLc3t0mOiNKdD1SlrGHz9HVGUQm4pC4ozUIHUXq3U20OB6wWlJnfsPcmmBIa3B37+wJZZNxBVWN+Crdr1N+U9tNXRwdcRuHGsc8tTndrZh66ijziciWdnFAW8RYkea6rnSZyhtUOu3qFe+8e2JlM0kSu8ezc+5c2Dz2W6vFXKJiTxzJSIYj2RHphRD7Tk9OXgU7lzv2VDRebvfP4sQJpaDBV64MIm4cBh0ZitiTot1siYOBDMbOrbFDUdw66vaYzOwVzshRvnPqS6G1OKKxfSicuJ7z4nhQL5cjN1SDOLIj5aeiywcNZv5X5foT4T//L/0EiwZBpgAAAHicY2BmAIP/zQxGDFgAAChEAbgA) format("woff")}@font-face{font-family:MJXTEX-A;src:url(/Blog/assets/fonts/MathJax_AMS-Regular.07173fb7.woff) format("woff")}@font-face{font-family:MJXTEX-C;src:url(data:font/woff;base64,d09GRk9UVE8AACWEAAsAAAAALvgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAH50AACQyJmMC1UZGVE0AACCoAAAAHAAAABxdKvrmR0RFRgAAIMQAAAAdAAAAIABXAARPUy8yAAAg5AAAAFAAAABgQXJW9GNtYXAAACE0AAAAfwAAAWLiwp1NaGVhZAAAIbQAAAAzAAAANg4tmIBoaGVhAAAh6AAAACAAAAAkBHQDnmhtdHgAACIIAAAAlAAAAKhijgTFbWF4cAAAIpwAAAAGAAAABgAqUABuYW1lAAAipAAAAskAAAbbFaN4pXBvc3QAACVwAAAAEwAAACD/hgAyeJx9mgl0FGX67juGDp+o0UkbHWecBFEHRFRUFFFHREERFJVNdghk39OdXtJ7V3dXd9VbS+/7ls6ekB1Cwq6CIIwSVJTrKIrOjDODY3CtZspz7/9rnHvPuefe+afOSeeku9Lf8r7P83u+To5k2jRJTk7O7S+VNFeuKNFsf7aktqpCXtJYWbXrvtVlFcraErkk5xpJjmRe5iZJpjgnM/OazB25mVnT6sTa26c1XemR3i75+423SyQ33Z7z5K9ul8y6/a6bCiQoeweS3Ci5RfI7yQuSUolaYlDWV82fv2Q+flj23HNLf3lY9svDc882NLbIqyoqm2fO2XXPzIfmz19030PzH5w/c2mZoqqifuaaXVVl9bvK5s18oX7X/f/NSP8/T61qkNeV1ErwV47kV5ICiUxys6QQD+tWya8lt0l+I5kluVNyl+Ruye8lsyVzJPdI5krulcyT3Ce5X/KAZL7kQclDkoclCySPSB6VLJQ8JlkkeVzyRI4jx5lD5dCSudlZzsI3czmynHeuOZ1bPu0V6R+kn+R9MP0IOjHjkRn/uO7Q9ZEbWvNHb8q96btfnSm4JDtfePct82+97tZLt13/m8d+u/b23N/Jfnei6LPir2Z+MOuxWU/MWjurbpb+511wKLPsUM4h/JV76BZhbqZHnJt36Gd1If7tz8um5/+8K185nLlrMGfka0FzKVcgMxsKxVmr5ol3iXNOLRDmCHPe/gJ/f2DlZ+L9xUK+WF4IKjBJxenUH8RpRc1gZnTuV9rJg/AROjAdBmGI8XO9XMITDnYMtO4BHly0B9D37uV3FOfDhPDeRI5Q+3nuxczsQqjx2DpAOswMsykfEudPB/EWaKQpykE6HJTFWUWVA6oBaFaDM1K8D0bZM3AG9lD7AEWAS6YBaorLoYq1cA7GwVM8zdAHQbgLCeumOziKswEJNG0l5fpacwWpcujoehop8vLhgnB+ouCNvwpbL5eMyS6/IXxR2JjUdHQk4h1FECNiBg/JArBsItET6IfP4a0yWAHVLfWVddsqxK3izZQNURTYwJq9WIqzG0DYBEh4IY9leRY4JPsby3YKNwPr8DKMFloAgFTamymbzYyIPJLeAK/QC0ALwAD740kv7+Li3qj3VPeRdOQ4kl1m3eCHAPjAR7s1ny0cFiWAHnqg4rHifLF2TDg8KLhGCiaFacLvv3tUyJX98L2tsLS5uawYmr1NYdXglmO1n0EYwoyX+Sp65kTsAuvFfyx7+Skv0r/z2sQzbXbWztAM8ruk+1P9vak9SJYJtLrboQ1GlcO7Osrby/wvgxGstJl63rBpp2kthX8EK6rsUPf0tbX1FsFgc6jB25EeTE3ASeiqhJWwvPG1XWrSaXM6wEG/ZLMDIinagf+KgWFdJBrO68FDcFM9ZIcqWodkP/hV7hoog+d0O8sVOouOVEEV1HnlQaNbEcNFAzzDAGrzJNugC/UquqqK8sX1E8Kcicyj6hzhwKe5wjrx/kKoctsDII2x70Iv7IcjdDeNAuDxQJ+Td3AtIFWCgiVYK+NkKQ/NQjvsRX/8YrrHDf029wKAzHy7WwPSFqDBSVHUlpXzxQIkPio2g0YKBiCzu0uAUIx3t0D8TZ7TISUtGqaKRvV5l4T1hWIjCI3CMWl2Y84LOcLCYeHarwoOCTkvTAiVX8v+JTy8vXCgubW2Ut1cWuRaeGz1+6qwM0pF4DOYPND/RnJ3sBcOwkntvtrh2tHNvSsANYHc3mxGsp/0Nq3RTKCL0z8EP1MUtHdTrfA3mBweP4pC00O0y1rkBCdtczZb5LYmh4I0QwO8CiWBnTEnQ0H2ooGiEUlry4uhgdkFr4F4HxhYB0tydBgiwDBub9ueoY7jeOWC1rgWdTT4KuBJWGBc92q9ztbiaIHVsLOneRiRPg9IO9l0HPpQvnIsc92wsHakYO9l4aXvF0/JMsKdQqYwOZ37yDueHE2O9vcMBcN8mAtDHGKOkM3j8NvwaPBgnIBslMlut1ssDgMYUUNK0duXbBsosp/b3L8IdkK5vkb54CvrxGtA/D3clXhk9MWukrH6/YSfCtJBQNmiDnJD3u5YT2//QHLAi+v2Bz7K+CCO4tPhsD2lH2gZrB2sTzbG5N5SQKugqrphGxJ+N1I4TLTXerezOm4zbId7bHUNDS1aFVEHW6FswDxiS5GH4RCCv+z++JQf+fP8EAI3jfKFS1/24Wp76vvcDwW6MAAsVgWeA4ZPuvt9vTzu9iFGQMx3kMBCA+Rjc9fNR2vn1s12zgYNkAzpbk7oOnFXJSLuNpYHL3TBIHOAbUOefyYmB45xroH9w4fRe3+H3Ta3mA9S8SbYyTSxTZzZhSXA5eCcHDLlWYGkKUAOh5RyVouvAclbaToGKF+1N/PtaMHYqfLjgvN4xSnZpJCf+bmwsqZlO56k3C0PNntbAsaIPmD2kK0GFLEQpLS6pU6hkiPZn5vqDDWwGcxgZq3xhedf+hEECZz/Y/ICH2Y8EETB6TBkj5rb5fu14Q27UVNM2p/a3RHvQLLz0XZvHIZ/EaiWc88dvQ/QBtiqbGhAgsxfeBImykMbWSs4QQ8a2mLTm+vlDdUqZLGtGZS+uIfkCL8uZk1BEk6+s/tNQMzP3xbK/vz0c8f/RzEE2SAX8g93Dg12+DzxAIOlU7j18YQmqQwooR69uGrNoqKrMrhiKHPNKC7CxacF5WXZ18J1mwrrm1VVz5wq/aj4AOyO7E59fuyIkAvCTOildjs6DcL0dd/PDDuAYK7qNpYm1AhNhNJUrindqS7DpaSrtjfCNnglsnWgpG/XgHKv1UMH6QC8DsPtnWPI7QObFBYZlsvL5OU1DesAyb4uqY66sE6xxTyEvS6X38+HIYQ6Ve21RcKLmdWFISKs8+j8Gu8mbCEvaNfX1WnUamsjVIA83NJlSpAJaj9+Z1zdCbwcnzJjA0OxaMrfC50QdEZNKP/zjT/9OPn8iQyjLug5ltFdlh3sGStcO162r2gEJva8/VkomuyOtaNQQir7RLiVFm4FcEoZiiEYC1/lqfRVeBpZG2/3GhPmFNbfCBvkw3yATwdRbyzo9Yc5N8MyPPhJ3gwm0NlVFmS2S828jSWDlNva74gSe8l+xylCyHF8Dz8i4Y7pTIB0maEaShssatqBu5pEBABRZAVtlXSJOO8hcc7d4p3rn64qbzI7KAc24SaoTDq7qQDlJQDpGkp2FWcOCzsLWa24DiwOqeygncJeAYgGlh99W3r08zen9n6OAilYJeVms4+7HkT5a5STmX2HrGcKhDVfLPhe0F1eeVnWLhwX/lEYhFYuACMwSnRre1tSDYEa3sTYwIRM02Gjvl7eVN+0Vb0ON3plTN5uCjpZO9TB5rqsHTNUyIj6akZbXsd6mGBCrHBLTLjxYt8lT4pP4/34eP2by9LI6Aq5pYe79vT0j8bSvqS7HclGGBfjBQ/4aT/l0R8u6VyJFy/rl4tMT+1Y9YLNivkAY8ApLhD+Bne9x+6ygAPLNYmrjqSctMV5/xar3UBoDaBHVo8jUNTFtSfckC13rNs0ZaR0LeKv5GJBjXizdpl6bfUKu9GBdQBZ3Q5fURKG4rGkP9B2OL43PBzoCx7o+LbjXP87wXZPKJIaONrbNehHsnSIj7NBGHF26cMNLgtrAzOyTYcao0qrb9FWaDZqbJTSqrGVGm1Ok5WwK1vAgOw86cMNtko+mfnzmZzglHBuKjejFBYX1kBlk05RtWFH02bAAr3hSxCmw+noud73+j/af/xge0ewxzcIqD9uqSkGC2V2WqzN2jKjgmihnNhy7BzlwwvmZb1sfyASju1G6b2J/Xw7phQ3uGG8Lr6VxVKEXSJLVnb6AWLe5mXPopdWbn+s6ffmHfYSKIVHOp8/WNGlHNbvh3+AID3+7l/CCTd2e+Sx80RR/nGYzOydzLly3+XcoUxDYSfXn4ikGI5zs67Eidej511u3KjOep34xE5xyYviw8iqNjukWlJnMZlsdgLzDThYp8vJY7M6Dx/jDe5zCbkRQTL+5Tvoq8njF1J/dXdy7ZCGP5e9uWr4mbEVHvEGKIcK2grinYR425P1DyDahiveAdk9BXQFPV+onw462uLQaO5Z+cS9G1fUvKybT6FyCPdLjwq3DQm/Tgu/cQ/7TmExZRkIwlk4YRhXn6retxkeQPniS8pJYf+koJrM6ZkKXxbqL+cKCuF/Fhqs0md3vLqqYaVJTjThcl58fsNf4Du8IyfP/DUQcfnwinpsPG62BiiVG1WVG7Y0rodFsGYMw1qMj/nbWl/fN34okfQl+Q4G9bOpYCLh9129L0AwetjFlgXkUUVUk8Yyn2IDgSRK7t3TcRK32T4SdoGJdtiMpI2y46na3A4/XpPhZCSBArFQGtsdBk3SZ+jd7t8MFrDQNphL3P3qpmda5NhxyhFs7qk8KEf57ppJgfnTc5NCzXfPTRbIuoXWzL8Kz+YN9wFdDJRpg72hVrxph3jjGvEm1ZbaVXaLww6QXVwzS3DNnpaYuRXZQ8DqoZlq0LdorFanHfCIGFxtibLBpjevUrSbQfv9B/t6RkffGheu6TqLOLewHKSyo5yVc/qhA0Zaw62cyxWnccN20+7s7Ui8MU+81o5lHUNSzJNKnowcDr/FR/kIsIjh/wnS72gGYqSPYiiaQDKXxUUGut/sHi6i4vpAgwvJnASjBHEtI86Au2k7LCdfblCWOG0UCQ788uySFXVBOpqK4z2eIV53tuyDTyczjjMF+6YEYUp2ULhLeK/QN90tXPeWcM3Zib7WkeBR6IfdjoTebcNKbYEs/DmdhuZdGgWy41yBi9fO45rrgrZINJJKvXEestGLp3lbX3NkvQ/ZGAUOIuVQRzbZxEd2ideKN5eJDxCVDizO8Hzq1cHKroYB3REMunkXz0Ex0OYam1a5pnmnoslosDnUgKx522CrvzSJZHqzy4rRmmoyaloIC9YlOxA8HbIj2cEx1ShxhOqEKNPqPpc4dWj83O43Oia7fwiMRk5mo6DdbQVUBduq7SpSR2pJs2pj1fZyhVKvsDYBmrP9T5eL84Vfbz4juN96ZVJoO1sgHJ0S8r+RHcy2dJptDyXiXh/DuoORrmgqEYyHdnv78aTjFpDDa0pRaliHHDoFjd2wAXuT1tpoVKmwMuONYig8PJedxsDdjxstK7NOs8PY/FTz0oZndNsdWV6xeh1eHDpgMBFr5V2uQGwi9WbH+ejrSPaJpw37lHANCLmMlGfCPMsiW61Utcj4tH0ZskyH2pC20+ymGGzkf4VPR3rfcPncUTxjv5Uz0kqn3KTVIovFaXMYDVSL0wwKMAZxq3jZENvmfT/8btflzn8OCrmD/0DuKOfBN/oIFk+KqlQb1GbdGvHh+tnIphCvB+ndWmCKY4fjF70n+G7XPqwcXmfA4SValcEaEG+Gu1eufcLYYsDBHFl9uNDyxSd/UUbhwmThbPD6pN296bHksdCAfyh1oe1ScCQ6FuwKdwcj6FTe25hmPGy7tzvpjbI8wwEHbpLLtsS9eY/BUzQBK52biF26FfItO/RbnDaazKqd2xmCJNsZjMeQz8e5+KA75vJ6uIinxzXEeZgBGGDQacDpSdEk36RZbSy1VGueapxpLGkpMdQY1TodEqWUVEGqjXoDQTgIXFBkVoo5OgXCEhCqGD3d6Xk3enJfZByxLsaFh+WzcWZQUo3GFq1a6SYcAPYm9hEM7ZXidZNX5k3m7L+ce+W9K4sLxWvzFkA1baHFa81i/tNr7jMoLU2OFqfFbQ9i32/3JSKRgMfHhxHj4rysK31sfPREJO0GOMegM2AhpPPu3yQu3iausDXZmii7dl3lxtImtUFja4An4NX98Ek2XbNefDuTtXAvwZtpNaW0aHRqrUODY22jR+nVtG86WvlBNsSEMGh8HPz80PGzPQPpPaFR1u3tdHd2fBc9mniz7x9D7/X3ooAfLx50w1h7oI3N7gELLpJz8Cj/oPJ45o1D3PGcvkvCzR8KH3+YKySvrCn8f7HiFwsKMgEeg4LLy+MwzVDkOrKGWG58qXFe472191bcb9c5LJjP7G67DxMnfrdWxLkie0L9A1/3fNNxKXk+cNI7yXVx4xAGv53/3xCDMveL1xb2cekkDMCIPFnOVoPO1mSZvUucO2v1suYGQo2Zz8HgUSHP4j+KC48ubisd3Dli4mhsTIC76K8n29/HheECF/hItzGbe5tbrErTjh2KtVkpYwh+U9szwk07hNsMY8QYpCDm9Xd0oNOnhV9//laEu1qYKBo0a4v10ymTxx7BcahZeS7z4Yc5GV7Izc1AJlpo5alAFpai6XQ8hlGoPxtqQrSbDBr7m2PbMGjYMJC9YF9WsW59XW1zdfPW6hXNy6vEW5Fivvbl9esNBjOmLtqJmcSZLXJf1i7SiQTy+yK0tJvqIUfNF5UBqtMRdyZwIovgvfWzn8T/9E7qFOvNjhF5bJy1SA8KolmvMmDIarFr7QRBIENeGdvoWpJYnJTz2/D0GbdP6glE+jyRUJ+3I3Sk9WLkYPxgx9m+N3s6A/4gl8BGHKuHnQh0DiOG2/yMfuNPV27H4VT4Z0Y/lfuvJZcKQc0oGT1XyVn9Fr8lRMYhu74uJslHXL3RdJBl/V4UCnivHi3ZOSvoQG62kXanA6+CDRy804evg9CL4IOEsLhDmOc95D/I+vkgE8S3BKkAgdeBxL7jpA1anQaJvxYfFOeKSx5/pKlh6bLsmYN22JawtFvT5pFK4foG4bpmocC2B8DGI6y/+OYmUJkMOouFdpANWvG6OnHGDnFG84pN4m01KhuZDWdIzqv8phCJ24/El4OykwaDrh5qcVGQjMOrHlNgzMTOBhy2mLbWtsHOvZ3HRr7bK+S0f9KBAx/sFyuGRElsQ+vmrq3I38JR/qsv5lif66Nz4weEa4WbhCeErTjGwzbRBeIdKP8nvJZ5Py5UF8hSwqUr6woboU5l0TrttNNRqxXvqRTnrhMfUCzV1+ot2VFaGAWv8hnCiHTRuMjtmFptdq3WWAnNUH1APgpxiHhj0f6+rjcGvkUjgrRHmNYqTONiXIRhgWcojzL1/OCdncuOiHfEyk7NjioYCAHqgy4crJnswRfF0JA9HnQNCw9E3+4T8keE4rbz3vZgP+fCAhgJhD1IdrQt2OsZYGOYHL3eWDzQhzEsRnk0eEAWrMuv2rcoq6tRXY38+VViY9P92hflc5D6SdIn3XxBc6D0xxIhd4dwc7WAnEFHgGaQi2DtRfkXlGczn0/mHJ/KRDH5ZxfDBGYsnsvNy3ZteKW6vGG7aqNVQ2NP4B087Yck0xmORbOyz3vjqUPtI11dqVTA2wM/wd4FIObCdutGY0ntnGcffLIUVWobiC2wHirCtel1e2omMcdHMSr4osKdnwrSH99OBoMBdwD923j+T2xygNFpJJWG+WufXbr50erVLa9alyFsRTp8iTceXvhpWa++B9fZOEx4J2LC3DcEmXDLhPD7yITvGEwgoWDtJfHGonytUDIp/A0nhBum/kNC4Bg2u+5O+2uUpllcsUV87mlxFc4JpA7XNum2eaAXhlpDrW5f52Ti6JvCQ3uEZ2LCfYgNdIP0S3hPPVLRpgw24GJV2FVGefmTj28Vc63NtJ3S2RqMGkwi6BcU4e0cBoUfsFKNXTgbCnR0+oMDY6lx9z7Gw3hwooEQFSaD9iQR1sVKh19s+wMGrh3MDsDXf0wb+d+Lt052nTlzNlOKvT5vKlPyTe6VhZkFhbDSsKFxbfnSVS89V1WvbyCqbLuIGudyGpVjx5Bq7DqL0WghyKzrYmDwYWxOUjFqhBw2n1ZerO2wDllRJ9ntbL+qbwH2/dAXr6cnWQ/DX6UUzkw3OxsNGG9w7HU4zESjxVQDr8KuwMrWFveaJM3QzEdt7x0Qrjn3jXBDQpiHGH921+HbyndX7alMVwU34LZpcpooUdIi5i1dcu/apTWPwjMIHhtafaKhzZRy9MJp+KlzZK/Xy7vx8gRsrBHXpI3SEKhK32ivwctSG2jsqOvRj2O6S7Epd2vkrd3Hx8cPHTrceSZ7dvvHe8WbMFj+VpnNUkL7mRzh2kuZR/5TUEQuBqxSrfjaJnHDE+J6u4HEBEnZPDb/v12Sc0eGfOnTwqK9wsKksAjx3VI8qVDRJ3DRPKhoNQTV2PU3NJfWNdTLd7Zss5M0ZnZajYest6Emk1pDGcDiwpsWpgL2oCmujjSkV3ct96uCqmR1WtVhRzztwmEsCq1snD8efnto73goHItjlfBasQ3jhnSaSKSxGC0mvUahUZaCCnR+bbsuRSSrP24ZM3YaE04XxQOgqdHv/5QUclg/g1UfhvTddYl1g0v42YAW5q0COb3VKOY0PvxC8zP/dzHNxDrw2WRBfOqDb4SVl2umZJmM4craQmyZTFaXnTQNc6yPbtzyikZhktubKCsQVy8La0ee2mRjnyKl85F/rD1XMVwR3M5iewEDDmoms0qx8dWaRwA9A1vaqvYaY/YQncge7LpCiAu4OGnUE496/BzH/huCjVBDVbQ0NcnlmkrYBgqPKtyCRjacqP0Ug9fFjsn9reFQIB775UCY9V2d5R7NUFkvamqtj61v35HUBNUJRdrYgXOCn/Vz/ujEQOdpmIDX9XEdkv3gs7gMWEgImnBaHHqGcpM8xngvrqOuUDx+lWejiAthfvCj9xe1Ls0CdebHc/3qnCvaLF6a8sQSnMHN1BLi0Y07X9UqLI24oM1u8moMZ71cp3egzR/PcivGOEiH+1OeEO+BbwF9A0at1Kq54+elNrlhk3qdcgNJOAkcTa7Chgd8jJfr9vckQx0ovb/9TOQo5+/4vluY0SNc2/Z19tzRg8PGdwxA2jXk3dfe2oF8AU8ke+Jkw+GhHhQalR7lL8Bb+fbZHO3UqSnh2anc9sz5wjAkPYlQ2Bfko5DEhA9KLLFau9pSY6goX7hJzNVsMmxEtkaHHE9lVef2Awas9fTVj5EYLzPi2Rsf7zo7/uEHH36NXG7eBbR2VZ14DTwH9XFtN35VmA3x3cHTXa7uX44WkRn0JG5XCyk1Y8+EJDfh2Zc1tpuPCIu73vW3+TpcSRbDN5Z9r5WzYCKiKtQGlYM017ZsIOR2vbpsofik+FtxybyVzXqjTQUbQL0XjiJIcWlPOjiRODD+bfc7gU5/Z3y/rx8nq4GWWCVshSpzmQqVKOVKjMSEF68qyp+dOffji6cKhO1fCm8flzW2X7mhkPA4fEVe3I5+Z48tpU3VDq9OzgbxNnjcJM40raZttA2ro5Ez+wGx2Y8BmJD7rf1jQyeOnj07cfS9z8//mBDyWDxrCCLZEJwpO/ySy4z30UGpTdqd0Ah6lojCXudALewEK21zWlHjo3eLMnGWWKDRNiqz535BzMV/B+HJOiHvlTeQrLGxvT6yFVB5WZ0aS1fXFcmpHOGFL6+8djw3O2Krh/QK07rFO8XiIlhpf8b8B9tGy2qH0WGiTLgNTZw5AF6G5xNpYY7wrHCbsHFKWIt4N+fOckVom6d+SCxOi/Nd4lxuKdAMyRNe2ucOed/74tC7CBvoU+eEu6M/4d0OYdV5UzNUHbHyZpbIMhkmYrVJVw1VSMcQgaFUfXkRbh+L06JdtXH+07OUtVtXaTUIY2VcahEW1AsLtgmzrZ3aIxSHjQ9LQSOUY3/EiAKslc3GBBrb4s7Fip0vz1o5d8k9qjpDS/YoFL+3P/CB6z14Gz4gJrVHENFmbDNEFb3lyR2ASksbm4vz4Zdoe2Qqc2QqVzif+VehL4+nPTRPDxi49a61KCD+Tgqk2CRe//DDtbUWDe6KyoS8H3bDQDqc4rHmUy7E21wOtTXcWoRLl2V5d2Rs9+TEcPtXx7MY4nqcq/M8xC4/KA+QXioG6BCMBAY6UqFoypNmgySvByXdZNRorNYss9aCsdXaj8wjhLDC6Ufgao9IL799enzfYCycTvtCkQQfglY00NJetXNLuRrLrbco7vRYspqBXcahrxZfEqfjOAtmYQExZOu0xPVBQ9DCy7Oa+WSVbjXtvPr5HpFN3W1MXyKeQvnbMhe+zul9XeC/FCxHcy9kLhTGIeWPRTCY+WlpuzNtjRlObB26Myg+wFUzu6AMyp2LnBr8hk6DZePOTfVyEmGyxwC+ma9rt4xTYafXgltGUQU1sGZ065g+6IhQoV/Im2de9/7w0eXvhDuFu6eER4eEuzxdWHfb4Yi+pz5tCKh8SkBkNinQequuAS+5gcedk4I2c8ASMviwEYDJabTKUd39y0XJQ7N1LfJGDF4J9jBuXOGRZmHuixcbRrb2vAybYaeyrhYZDHYC50KL14kbMD/IfPDaOUF1fs0x4eUP158rkD19+JYIRF1BT9wT4trhAMSpzwkkM39FJOgJzGwcFv5jweNDIwdTHfGBwAAXBN7JO1masQKyYmuyUzVEWTPRSFTo5C0KpMorZZvYZZ77fQoGt6DslUrGxUsvnvvTuQ/fR23pGC3tosJUlk3ddp5CspkszWOxTzF9SczgHI0vIqZx1zJIdrPdCkwxMIFAJPr+ubfeOfF+NMlyrBt7AZM9LLCyZtDRWkJuQjKkYqRNjJl9DcP9tBf9FLMJsvDtgMds967f9qJJZ6jNeqyLCmNoTnmTYZQK43AfCe1JhA5BK/Q7DtqQbMMb1gTVT6N2MOikeo3dLm9AYq44Q7wBrA6pkjDowAi44N1OtJ8+AAqFdM68x54W8+/U6gkTWJHN5fQVZf8r5OcHYSoHpqamcmHa1NTsPGHL7MLs43/zxJWrT/z71/kZ581Xthaqk1fuY6IDeUUzcgOLr78Wrp9xaMah64pm5P2v6wv+Cyb7dp8AAAAAAAABAAAAAMw9os8AAAAAxvkyTwAAAADJ9CXHeJxjYGRgYOADYgkGEGBiYARCTSBmAfMYAAYNAFwAAAB4nGNgYUpknMDAysDA1MW0h4GBoQdCMz5gMGRkYkACDQwM7wUY3ryF8QPSXFMYDjAovP/PIPf/EVBAjkFOgYGhP44ZJMu0ikEBCBkBG0IQ8HicY2BgYGaAYBkGRgYQiAHyGMF8FgYHIM3DwMHABGQrMFgyRDEseP///3+gqAKDAYMjkPcXyH34/9L/0//bBLSgJsABIxsDuhAGQJdnYmZhZWPn4OTihgrw8PLxCwgKCYuIiolLSEpJy8jKySsoKimrqBIwmdpAjSxdAD02FYAAeJxjYGRgYADiL8KHN8bz23xl4GZ+ARRhuBq7aj2M/v/ovwZLIbMokMvBwAQSBQCIvg3IAHicY2BkYGCQ+/+IgYFl4/9H/x6wFDKARJCBFgCqbgcVeJxj+MVgxPCLgYHxC4M6EIcBsQ4QawGxDBAbQdnmQKwNYjPLMcgxTWRQYOJn4GFmZhBmEgDyzzMIMQUz6DD7AmnF/4+YljHoM/0CqtnEoMCykUGG2eT/U2YZBiumHQzCzIYMRcwBQH1xILUMSkxF/98zpTJIMt9hkGQ6yWDCNIdBnukqgyrYTToQzJDCwAAArGwjmAAAUAAAKgAAeJy1VN1KG0EYPRuzSlNMFaEX9WauJMHN5qelYBBBlEAkKhqR0ovKmIzZkc1m2dlk9Qn6CL3uE/Si9AlKr3rZi170VUrpt5OxNiUVFcyyO2e//eacM983EwBPrTwsjH8OXhtsYQkfDM5gDt8MnsGq9dzgLJatdwbbeGx9NXgWy5knBs/jV7ZocB7P7DcGL2DJfm/wIubsL8RsZR/R2yutkmILK3hrcIZmfzZ4Bsf4YXAWL60Tg21ay0eDZyn+3eB562dm1eA8XtgFgxewYl8avIi8/QlbGCDEJSJI9OAhBkMBHRRprKFC1xpKGlXpZtiGgNK5Ab21KVNSJKBRUC0Zmhq7wNYgvIxkz4tZoVNktUplrVSrVCtsWyjZC1i7I0XQEQ5rBh3K3gUnaQ87NF7ghGxx+FomIhTSF0m02OWxt8MvTra4L3sRDz1JwUOS7mFI+ZyycSh6Q58TaNDSAmJNx4gyhF6Sq5dRp/t2mqV/+RuDIG4Mop5gNbfC6myKp9IfD/fUuJHzmHIj3YSBbkKV1lSlsIiUHASs6lYfRvduW8W5w2ZJedaR6MtF33g/195d070N0nGQowypvzLtXelajOjZpchVxxn2aG5fd/x2lXCJOYcj/aYmmNqEzgglukIp4zjD1/PS1SijPiTc1X6YVhR6dhMtGvdJSegqXDO3JhjSekzvrDvhbFKXkasR3VJ38JSeaey6RlwrbuJA45j2fU53LiY/dZTpUsSWdjSkmCItpbmuql4m5w1y+r/j7Ew9z6ywniSJ26fddM4vXDosG0Unl8jYY4dCiWgkuiw9RmyP98W0A+TmckeeVOOk9uAsTngkGAV82RGBounDoCsiFnuCtZstth+KYJzcGic47K/j4I7JzFzGR1z6/NQXTDvirLF5wHhcz3lxHNbLZdWJZBgrV0k/tV7eb9D671W0mwgf4B/vN8NCYPYAAAB4nGNgZgCD/80MRgxYAAAoRAG4AA==) format("woff")}@font-face{font-family:MJXTEX-C-B;src:url(data:font/woff;base64,d09GRk9UVE8AACa0AAsAAAAAMDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAIMsAACWhxti3MEZGVE0AACHUAAAAHAAAABxdKvrlR0RFRgAAIfAAAAAdAAAAIABXAARPUy8yAAAiEAAAAFQAAABgQqJfMWNtYXAAACJkAAAAfwAAAWLiwp1NaGVhZAAAIuQAAAAzAAAANg8JmLhoaGVhAAAjGAAAACAAAAAkBU8EQGhtdHgAACM4AAAAmgAAAKhxhgV4bWF4cAAAI9QAAAAGAAAABgAqUABuYW1lAAAj3AAAAsEAAAauadlq8nBvc3QAACagAAAAEwAAACD/hgAyeJydeml4FGXabgfs8I5o1LStjqMJO4gb7g6KG4sKIygMOwSyEbKnk05635danqre9yWdpNPZ9xAghLCJICiKuAwu44iD5/OMDmG+Qd/mlNd1zts48+O7ru+cHyf1o3N1dXXV+zz3cy9VnSW66SZRVlbWb98olO9dXajctbywqrysvrBub3nxw6/UVpWIsqaJskQPpW8XpfOz0rOmpWdPT8+5qU4ou0/8+vWvxPeJ/nrbfSLR7fdlPX3HfaI598035IpQ5ggkuk10l+h+0euiQpFcpG6sKV+y5OUl5GXlqlUrfn1Z+evLquW1dar68rK98lmLih+Y9fiSJb9/+PEljy2ZtaK0obysZtaG4vLSmuLSh2a9XlP8yP/tMv+b99fW1lcXVonIX5boDlGuSCK6UyQl13S36B7Rb0X3iuaI5ormieaLFogWihaJHhAtFj0oekj0sOgR0aOiJaLHRI+LnhA9KXpK9LToGdGzot+Lloqey6Ky6CwmixUtzixxDjn4YNaKaXnT757+P276VvxOtmGGDFX+Rn5z68yaW7bfWp1Tf5vu9k/uSOXaJe/e2SW9eNfluz+95/S94t/tvE9z/5N5K/P+OWvO7Io5e+f2zR2ce2but3P/8UshTKZXTmZNkr/pk3fhxeluYXH25C8KKXn3l5Uzcn4pzFEfTd98JGsc5+PdOH86HlVL8dLPPsJL8+GCcUI2Wn5oZ/Jlv5mrhSZAimwdyGkDLWQ3bn0JhDwkLP1sJV6a90V6gTSqder4N8HA1UENFLMFrJ5V0AraYq4s1eyEnVAaNfci2ksn2AQbYg/CKHRxHRDkTznD0Ugk0ubrhzFI2hIqlMOfxuNnsrAK3z39y/RdUmgANmRDQ9ktXCt4uTDX7XRwiAOFcFe+8OCbMzYABTRjolg7aJBthoIzJ/KOwiH+C/gCJpgjgBKcL5HvngFR1ml2UTwFGwCtw3/MBvwGeBkn7bE5jGADFgy2rbI1hqcANWTrLKwDZCgH8F249d3c937C2/CiN85KruLb8GHpQLK9Px+CdNDmY3iWBwBXP++HJHTRLbajus5aKIY6k1IuRwqF1S787tk1JZsrWJaiWQqU0MhRfsrB+ABvBrwJfODkkZMnfy4k+d7h6cYPgo91U067g+IZ0IIMGIZqtCspk82EjNk6VniSBeC4y2N+l5uPeSLuA9GIpzmEJFd7WiJxOAAHNCl5S2XP1uaVXgNXTr7gKVijqN9jNtg1oER7k/UDeTlC2SncewSrjudO4CeFO/ECPBM/INyFn5JcxivTt0o7Yj2hAXgHYjJYC1Wswaow7mmql5lMZBUVTCHNcWwDAhVHkytlOBiCfeSqQ1TUGjL7DEjynzG5WwbroZSR29SGPTL5VtgL1e66kNoL4HU6eLfD4UDNYX87JNHByv7tm2vLduaRNtg5W2TJP7ZiEXwLn3ePHeroiQ3AMRi2NquT9cM7uzeGkNYZdIoHo/3tzSkk+bG5PdQJw9BMxS2xmlMvD8yDhfDyFtUq2sgawYQKOmrGxzu6xvNgsClRG0A5wqYz+J4zufgDfL+Qi3Ml3+BqYZN0hBO3c4dhAs7BIDMGceC90AYtjNPspHkrVAIqxfcMZw+Ak7TL6+Sd0JLZa3FmALUXkOR8Kd5CIPVWBlJk4+08zdtAATrQsywwBKIsa6eFy7/kMXbEEMgSJCiAJp+y84yLHBEF/BvyPd/ge4V7tmXvIHi0MxY7y4AemWeQIWDCdnIWLMI+qTANhGkcrsN+8Y0+XjjyF3xn7kk8a/GHeDN+RPJjuiBdKGXByliZrapNpo2wCdYFCqNaF8XZaRvF+uFh9OgMEJ4FC0+TJTIJSBBEBSLJgQOtb0MXpDT+Jp/KUQGrELxO1xvkhvo6XY3VxhrABHtA5pdHzG6Tn+MAHBzPoWZ3NOZpRpJrpGw8ROBgfaLItQPqqmE3FMTLO2sG9040fAh4HuCb/wR4FoLvdry3pq8qXBQoJOxQbKhWkVZSNKkSIDzTMcPHJJlWCEOI83If+d7rPnw4EAyFeRfPgwe8KMIEDHk56nfwfxzBK44RCC/Cy/A9ws14oSSdfiD9nbRRr1JBJcF6zdi+9o6RPPhsx9DrESvXBGpA6uwnLC8V7VxdsFaxEhaBMKd3wVcb+xtHdcfhIIx5u8K90YGeRBdZTlt/YASOw6eKidLhwoM746/BOqhpqNuLGIaLiPnPPPuivS2jh/rfhQD4GT+D3BC0umm0XdBLmxW8iVsEz7EltibaZLeYTQajzqag7WBjbaSIDRFtEtk8tjDjo+P0BAzC+5GjXV3RqN/dB91MgIppUQ4+jWd3KrLwW/ie6fjpdIEUnIyb5inSSRXBjx0oI23bK6iB4mxOykUT5JHyoxg4OaeTEKXTmXD1eVMEsPx+bopDP2fzQNtrKndsVMiayt98pOpBejGoyNRZPbXt8j7ohVSbO4VIG91wgDvMJRy9nsut54Ym0aUr4rGJgTGOEBXhLB/E2ICBZ7it8Cws49aCkTNCE68FVM03kQlHOepT6TOEXKZe/Ss2/3XVVcnJdBt+SwoXdn+wahhJLmbmAzjkdYuP9XYcIDX+27LTQi5Bl4kUhwEza2VL7JX6WoXRrFRajUhRaaqAEtjrr05U+3UJgj8n5aQBdtZX1Cj3IMllY6NNRqjuyWNr/ybvsLVT/QRI+dc+wb/Nl1wUbsEfSaHSUCNrMJvttMWGVoyKS1rKEzSvCWgjhLm9vNfhDXaPRE9x6JPJ8tfyhRm/lEgll59aP/LnfDgY70+lQqFYyAEcO6DcJx+TDzY56RZ9oglqkHXG6vV1LxBK3fMOXnYUf3cig0dhJr4Hv0DweA1bhT3SIzDsH4z9dPzET4CfgH+qPi09VTda1Lk11OQycTKwgo2zASqCclODaYt82w7VRmstpYFSeCleNFY4VnhQ9QFhHB8XdaE2b6o52uJw8g4OkGYGNctYWllR31Br2A11oHRqvWSSEqFwAlJoWNZZXCyrLcl77KPS7/M+TgvSblNHjbPSoSCKXghlYGFN1p26iqYmo9FEaW1E4veA3qNpNgVpH9NLBoBQxTAhd7Jxfj7BR5w+3usLeD3BQIs3RUAfAhdLULpnG35EuPsf30yl9Yrc61I8V3IQz9kmbYWYtz26r3P/gfOXUSIlhnPsF3l4franIPFMUI4kSl9jh34Aklzc2e6Pez/sD3rbIq0t0AwBi8PiJGqnYA3UHqXCZGfoTJE8tNsa0h2xDCv+rsEBwM9CB3CMAzE87aA5oqrkQ3awEp0tsWyv1NXSVkK+RmSomWG3iJ8RFr8kiGcL9y5/tKi4yoIkBxmWJlirhOoWe4oOUn49OdRqt1jlcuV22IveOFY4mYdP4RPS3gOHLnQfQn/Bs0Er5sxEw1X8q14BuQqR/bEZL2XXAcNqrChnSD11XaTITX+I5wm34vmSb8h/m6VLN1W9kLcFqiJ7WsiSKpkSpUym01kzXGrw0knjSFOH7SQpZoD4m0u+v/SfP4FC/lTKFxzYHx1nD1Ofb554vQ2ZnQG3WHL+7MDFt50Xuf3KnuKELGTkKzgNGFkLu9T0XNmKdRYrbbczyNHh/QC8EDB59GAEI6O3Gyjh7tVac41K2QAaMARsQUDNEHP1REOegIvwOLDkY1pB3CRk1wnZquWKzeXrzVqaFB3pCBfltXGdgfZ4Iuz1h9sG3k2eSvxpGD/wEZaePxwLdXpbYBIG5bATgZIymq1y9bamx6obLFqbhSpV1tUSqjL6rUFCTSl3FNDfvy1anJ/zgGIqnZjKSuB5eD+ePz09iddJC+gqeV1tbXWVfAvsgD2xuraiwYaj8CcIcxHO77/Y9/nB42jfofHkp9AOYQvUkoZbGBul09doasxqYAl7GHliNBHRbcJhA3AklewOx3vOelLOEB+CIPQYWhqCWg9NpgVZwUrmzgY0gYnwola448mlwrSCNRVLTS8wxMESsRBmf7kYzwWUoTwP9577g+TZ0cG2oZ5UVzjm8oAfCBGpgIzA6zCVVl3NwmfwLHwQz5v+811fZh8geuLn8Cwvvn8/nnbh04mTJwfPpA41H4EzgJcKs04Jz/kNsJvbDWg3FLImWGpfrnqzukxd3lAnq6tV1ZqrWDsxtjToffYwIBe4ODc34D7QEe8gJ+cdfoffE3a5gsFz0aOkg2SejcgsLNorLH5LWIjMCooRFxp31+prGTuZCQrMbruPQtdz0r+Tgtxea5Vp1pdt21bx8o45tcIdgOzZwDn9rsA5/PAIfjCKH0bg8bJiF/hZYldnm/DMbSDci3Lmaq6kV+J1C6/kDuF5VXg+Xkewvg9X4bTUbDPZDOYXN255Tb2SNpAlGeHVE2WnNe22EDtIeuaDAIdwVvTKO+fOtbZ6AqQhIZNTDUpWYWvSay0mi05XVl6teAvQqy91vp9PDJeLc7o6o72Jtq6+0fhRRzvv4ULOvsBwKtTucHPEkCGCc0Me8TgRWSeS9OlDliCh9FSwPRgMB/tJtGiDHipA+yk3GTgwG5uIL5S8bwpSwTwXwYibP+afGAuOE9FzkJWGGK+VYNXo1bh17kpHKTFlfQZyHEu8GMEKu8S8aMe6P5QUNxVAEYJNvbL+JpTzn9X/mI8fIBtaOIX/gMUPXcmVvBkblIKdpzzW1oZedZ/Vw0bYMJlKL1nRee+XR/edjaUOXmo/gfxtJIqIJbMcJrctDCPwdm9Lv9PjSoAHSe5kfXaH2YmEbvC2ieOTLRf8Y5yTdwOPOOdfYT+IT+xjbfnAuOwuBkmQm/awYX6f59hgoJtzcA6ypGalX8MrnTwIHg5JrMJ9IGQTxG9gigwlcrmuUWlU28w2HVmcyW8JEQswFI/FEH4IKI24Xri1WLj5j8JMVXHR80Y1Ma6EX2VOlV8VR5I3jQE2A/6d9PICQpc5NYL4yiI849xUetXV3Eky1pfwPMnhdDJ9SkogTLM0bdLI1Eq9zm4CMxh91jA52YGWzu5ke/d+fytyhRyZAW2xxDUhRazEuwH0xD3TsJx6Xr66TLhrxTOCWCHcjRgDqyYkJtz++ZP4DjgLX6ZO9CG7Tty0uXarQmGnLKwMCvkSZ6kbSbQKJxEEqKSLFPUyg95GMgFYHZSHIp6bbaYnLMM0yYi9xFUGuEnvkdaDfRffmfya8FFoNPk9AUfI4NRCEb22QluE1OurthXWq00N1kZYAOu/gB+hxdHmboudHzp1sLunZTI4CWj0OBTn5+Cu7Vdx0dRj32HFVC7+ntQiK1OLsfQG6Si809cyNHg8FfmEqFdMSziMIqxlpXZat5oKKD1jAEDEaOvy6gnizMx23Y4SkkUlX4HJQ3vt6GR2TwrYfGB1BeZa5XrllsaNmiLC3zbe5CXwaYfeUGfC7w2G3F7EOz1RX1v76dBQy7soOPQDiH/iLGwzwdVhF+/M2HcoEubDQ6B2GDwmr85rjZkjFhd0wp8d7yeOj6BkS3+vow/CZreexJzNdfJqq5lkbxaZsmXacCofkp6T3gOJn47jl0/ifF8b7yIDGzS5dcRcvFmurlXWrBeWKt9EtFEs+UqYlr16F3D5JDSEnJHou/5J1zFnD9dGhi5ujRhCqqjGW0oIw0DUFAkPGAX0wqsLjGraBhaUkY+8nFWEZNVTWW+nKakfgnzItS/U1x3oGHNNuP4MaD+YDeLKXQ3r6hbUC9NqH96+Gm3I/gNReJVVbm3QajRanUWf6b/T5iVO2Q1YBhg4NdvtRhcjHx+NHeGIbSYTEzS71VDNlKrr6pHZPB/mcT6/ePztvos9+PaWv4TGwoOellDSE0Dn4SNOPOIbTcVSLq+DUAn4rE6rCwmvZi+CpwnlPsWsNW6SFyiLquXVRq3NYNey1A1CN/gzhJ7zoZB9Nf3DVNYxvHA63oEl0pDFo82rhiJlnaxJYc+UsYmzuNXh0r6aI8qUMUmPwPuwP/xOJ/ps6MNT+y5EUp5EaKIX3932cepM84HOE53tbreTa+YCnIdsqM8/3B5N/teLuyt7BckxDFtC19j3mlYpXivbWLC7vHSLagttZDIGyhCwE3tAtLOjrdvt5Z2uSHisvXsofqilm/sE0BEwmcRrXtuxuEB4mlDIXE25oqimpsJE5poM5jJYMQrnwecMgp/o4pOaS2kOS3PxJjy/Gmfjo/gmyfd/T49IM+6jP45SIdCJ6bXGVapXawRULMzcKUyzmxgbuQx9kIrCQcfx4XCXy5c8HexDI9eG8e3xb8PveT8hEtoGvNlld7CETLRgoPU2YnKkq41W9KvLQRmXk3d96y+3SS2ZWMHUm2tVlnqbmqYMdr1NZmskSDM4DT6zW9FiCqIdp7b/R80lkk30Q/Z2aEb+Ge5QIh6PvH3ou+OHoijoFMeZGEtrQeexB2wokD3gONIJ+yBhDikDmoCeryPYMmeynW1T01sVT2x75g+7tyNlo0FhV5P1mDPhhpgTS2TpCeH2d55treqsatYHLVEzcStuktuSQNjs2tn2L3g35yZjFDJ5SVjNuaj5aflPaYSLciW7z6qJp+70dcVRyBsF8RjTRf2gRZKW903d9DhhEy+JCN9GMHq/7at/QTlgchlI/F++xVKB9Jy4git17SDjv3t2rN6xjUPV4A6K44PBoeaPO/GMgW/GzgZj3kAoGAhwXAiQJ3swVl+RDxbaQOTB4KNCcATOTwR6SA6IkHh+vHxg/Y2bNnZiHm64qIct89avfGbrusLnKh8w11jqDDvUrxkrtHVmjd1mNKNGjdFo1dMZU0ORmSb9ybn+6PUNiqz/dZhYwOGEFMyc1WELyPc1DjFh8PNh94HWQ+fGfzp0beCH5HfI3epSi5PLDgi3tG1q2dGxs7cw2sQxGTbnCIUHORaO7kOXPxEfOYhvuoZn4OkolRQTY0SzlHmVXlgIL8JuR5Wn3NUQ1LWb3OSoOPF22RFypqgr5gq6hpsnkgFPLOYP+jzErgaNbg1kQki5CqktVooiLaQiTNg2yLYQpf6+FUPL5RvG0g8xqpn0iyIDTjM029BQUYmEy8In4i07l7xIAgonHze27Zp6E6+uxLfb46ynCbbDpiJTLfm4ntEhnTC9bt4uIatwjmyLUmex21kT1+BQ+LRhiyejutVQthK2kYlqImEr/TeFGz+YK2k5hPOltmwLkQ+LpaFBtZMQhtxjbNU2G5rNXZmgznn48dD46eEf0eDfRnBuG74JOaJOk3hMyPpYWNq/pnNT77bBgqCGp920k+bIOg7D8TFfj8PDUiRgAjgD3r5BPGcY/24/zm+9EDnoSzg8POf19naMRQ84AkB8tgO1BXqOkyNbqYiCGOsqq9y8RbFzT21hY7n8j3VPFwu3bxZeLRPmICLnLMtRroYhQ4uiX9NbfW4jvmU9nlOKxUhyzJLg/XIogMIqVb2VkADbZBBulQl3lAgzG1eqdpl0NqvFbgS0FxrimiipxWb11XR0KussnpfuIAC63ph+QGqfAcITgkjIFe6VNVFGthGEW+G5jxuu2FroJJkyD+cFj/tc66nRY6h7X3/nWKI72t0caHeS6aFcJGHyRlJuC0uzOkZjkxuQMHvlLOGWMiHXuMdeRmSwiW9yKtqE7EvL8G9UPjbBNsNluNBycQRhdOp/Xp682nE8chZOAc55668LWgwONacmBKVlDcw89dzlry9AGrmilNLfCJ808UGWKPTyQ/GOdr/f5fWEgql4d7QZ+YLRqNfl8/gdRChw1tHHhaz8nCu46FP8ztWs62+R1eIXXpMOw7G+lg5/ZOwfyQvI2x4EcT8cdO/z4fl9+PErQ1jqijniEIWJht7S5IuHXuKFPNgKW4kxR//vsPFr1kD/Xdh4n4QNDkjmNGmEkvXCzhXCM0hTQt6yZVIeoY303utZ0j5tc5OvlrdmxI6Iuo21WcpVlXJFccVq7Qv2csZol+uRjbbTLCB3i7j16/hl39d8kAiXAzlDM87Dh4ZRBWmxUlgwRU0dm1qIZ6Zvv5qLbyG93kPMVF76fVwvldQUmF837SFRLvsJ99pj8D3xcQHOG/ryxGcXBvuiA/5DgHPhL4+DkJu5gcBake2VmnWbNj79jHBbifC8VUa6YGZKjEU1BhltuxGS9CEqAaiTbad7rQPWbsuFxquVo+aTNiRxEKMCsRublxt0Dwf74uf6JyZDh2/4bAeSrM1IrMWJDNk76TdLjHtZirEzxJY3U1bCCATYG/yvNdd5t0dIsTicNfLzN6cnD5/qOtk2Hj4MpxHgu5+/JIhSCpeeqwILWEg4bQQVraeXG1+uWVnw9MaVyyqXIXWxZQ+B4dzzq7/TeNkQG808euCT/Nfeo4H9o7Gom3gjFDK6tHk5uJcMCDv1ayx14LnT8Tq1dJA71pvocvs7z8YPTeK7+/HvwvhOzk82UvnWGV/B27ZhQ58x0QQVoLDWGpUNu9dqV1BqAg5LplTVBhmiM09MbBkbE8ikQ9pt99rDOp8hrPBpBl7tWu/TxhpRsyyhbTe7GT/JPV/D1dHP34tHAiFngGhTpmABI3GVqA72amvlDUq5oSyTrziKa/I0dNYdodyGpLFVfsAcM8aQ1R9yi99NvT0yuL+rP9bnG+UDRCFj0Mr6rBFjQhuWhbakXuWfALQyewNs/P+P0oHAWGDS5SOx3UE+ZMrWC+t2Ca/8XlhjUdGWf3sSlKMlCTg2ldWO5/cTb/8Cyft4F94v1bBmRmXbpC4olReYmigNqKA00pBUjVSMq06Z/IQoCLJ+hA/jHw5cO/bBRfgz9JiTilRd3+aupZ17Qjq3KqD2a0PmIDKHiJdvgYQ74fd7/SP+PuLJh+zdlhjlYF02n9mpBx0CM2UmvkIXoGMw7jg+Eup0BhwxIltDqtaaYF14g3szoJdgq2Z9zUt7Nm1S/dGuIf5Ol3mgoAGat3hkUXlSmVJ0a4+oP5Ptk7dVhdRuJShBS+msWmSUm8x15hpjua2YcMbGcFmyLm4M2JqJcybNI6TC+90o5o+EfEGvn/eAjwlZHJmbIa+lL14bUGS9my6SEnTwIedoaKwn1M45Ms7GGSbZ1oOwKttqtRhpC8vUP1grILReaBTrdqh2Nu6waJnMJBpIa2HCOdHd1uVyOz3eWHIicTQyiXhf8m8dP6PDePMVkn5hnMQYjhgmF7ffdbh1sLu9JZbkYhAyu7T/onGkpBpMKiMy237pZrSMeJe5UFPcsLp411b9VnIme2bmvVSEXLhTPZWeUmSZ8Hwnaesa0tZI+rA0ARHXcMLrjJHB8oPbBjowMTq7lpSmuuy5ksf0FboipNttq4RKWNe6e5+i2eRi2gEvBLwY33sVizRrjVupYkbLasCIStrV+/J6uKj7eMexVMZqBILeG1bD5M7cBtFTFWrUYBDbvcQSxhxjroHgodZve651fxMd592eaHwkcoCEZH/m1h7aA+srFdUsUzzf1PSC8IAwV3hl7sp6rdpiAAVZk5HEdEsn9CNIOFrdbYF9kZH9V9pPEpB3Jg77BiAFw42xEshgiCSuNbZnKwqK9DprJiMbfLYMzlPXlzdlYRshj3e/mT6ZviRtZ5LWqPGDnWNCdkh4xbkLmmAt2Wqp3SCD2jgJGU4+4kOHOj87ceowGYy5V/H9ffi37qSjFRLo8x1nluVZsk2ZJ7ZmuVxZACXQ6NI3wxi1X+4sJf1iaJu5oamivgptXLX0xcWvIJWOnRSz55hR22EdvrP6+x3vlI+Vtq5zqknXLEyBaVsJ8RsGvzXTvnRB+tKPWbgU34e78RL8wzfT29P/lBJN8ue1QIclYjq3a0C4A4Q3YLVdmGnYlIndZFM5lNHMfSbeySO3s7m5dwDPxg/iO/DSf+JXvGF3gCN47/x9eOewcGe7cLdfmOXYy5t9dsSzPOu48UjQxXuc44c6uvB0fMslPHPySu/ZltOeI5yXCxIuhk+qTr3uIKogN6nlhj1WJWPKPAh26eLQT6ca+QrC9QxtsWttOpMC7X1t3bMvPIG0KjHjYT10vBE/sgs/vA7PMrca21gHw1ucNE++bBu1toC4QsajIT6Cke3WyNbMW75o2SNatc1itaLwDK6NayfSMMQMMh1GvKD0hzf21TYrfIWANqzdVp2f8xN35UaaJlC34bl4VYbF4umT0k5I+Jv9yOf2gTgGQdprCRp9ane9tyYg3AvAEZ+vNAnzlz75x40Fal1Dg0mPdAqrBtSosqNuKC9jp53g4Ts9XbFEIkzqR6YmUUWTGXNSXmIsnBzncqNE/NjA5wdHkgeSHADr3OvcFZjDayO1IVmzJmXxEPT3ExW+ccNwwjPe2tsTjfqiJJSEM4PdADKj2milgEAXbQPDgHWCdWjw84wDgas7Jr52+vzB8eFYOJn0h8PNnowDGtzbtockoTd3mWoICVK8DTnsbsrHxombJ3RIsazdVrpXmP0ccMj6npgeoPpZt3VU162MGf0Kv56nQcfpoBBkdI1pvXJrAVQik8caycuZEJ7F917frchKT8P348ovpn+SPkpyWsrXHkN+j3jI3mbskDUrIk2R6v1PEQC5hWWcJsPACOw2+4Y94mp1pVZz4+cBmR8I1HtUgaagIW5N0WGLz0LmqmIb7CBkz1t4U/itia2fQkafvHy/7+3uU/sun7381cdfX/7nmZ+7/xMFhhzN0EWE0c34jKcKJ1eQkcoEsxpd4w4oRxp3Y2T/IVlRHjlxk11X8cz659euUTVVVjJEzTNAhrj9DDVkuNp4ufoM0vYquxWJ+o6y1kqvwaHhNbAC1pcVl2o11oyjIxSRGbqfuWsLf8ZVl/ATeHqupO76tPQF6RiolcJsYdZqEG/I3HBh6uw1TaYm2sZkLsfksfkpdIg9BPWN4ideevTlxS9XNBAxMFuMRM+s5IvtUXBn7mBAi6OFGwUkGXoX8DL7RRL6OQjxk77jqfGR/X2jJyPHeQ+XuecUMJKci0rg+V26Elu9UWFQouLstQ5hHreGR5K6t7iuNvH54xj9sH8EuZxJEHeTxjuZX+d3Pwz1eJP/ciVeym12WVw2rpZDBjCRSIlaW8Xvnjz/0Ykzre0uLwFzwOQ2QOY5roXV0FpWBptBuN+1HlB99nLri5Vrt1XUVZbpC5kbMReMXrKcEOfjQ66R0MHO8Ahyd3j5XkBt2Udgij7CoMwvcYQymMqCKXxsajrcNDW1MDs9b6E085rzy6M39kz9ewfe8e8d+MaOf72dk/74zuvbpYrE9UVce3923s3TAy/e8hu45ebJmydn5t2c/b9vyf0/62YiOAAAAAABAAAAAMw9os8AAAAAxvkyTwAAAADJ9CXGeJxjYGRgYOADYgkGEGBiYARCTSBmAfMYAAYNAFwAAAB4nGNgYdrHtIeBlYGBqQtIMzD0QGjGBwyGjExAPgMHAwQ0MDC8F2B48xbKZQhIc01hWMCg8P4/g9z/R0ABOQY5BQaG/jhmkCzTOgYFIGQEAEr3EWZ4nGNgYGBmgGAZBkYGEIgB8hjBfBYGByDNw8DBwARkKzBYMkQxLHj///9/oKgCgwGDI5D3F8h9+P/S/9P/2wS0oCbAASMbA7oQBkCXZ2JmYWVj5+Dk4oYK8PDy8QsICgmLiIqJS0hKScvIyskrKCopq6gSMJnaQI0sXQA9NhWAAHicY2BkYGAA4mf/4lzj+W2+MnAzvwCKMFyNXbUeRv9/+l+X1ZPZA6iOg4EJJAoAjMcN6QB4nGNgZGBgkPv/iIGBNen/038XWT0ZQCLIQAsAnvcGlHicY/jFYMTwi4GByZ5BD4gDgNgYiA2AWAGILaFsByhtwDyTQZ3pDYMGUyqDCHMNgwhTPIMqsx6DINMqBiPm20B+0/+nzNwMpszpDBrMIgyarEkMaswr/79g7mKwZ9YC6lnNUMF8D6huB4MkUwuDGtPp/9+YHjJIskxkkGQ2ZLBg+s6gwmzEoAdyE+MXINZhYGBIYWAAAPNOIFYAAAAAUAAAKgAAeJytlE9LG0EYxp/VrLUpSkUopac5FIkQN3/oxSCCVQKRqNXYUnqRMRmzI5vdsLsmeig99txboR+i/QC99dxLP0g/QSl9djJiA7FoMcvO/Obdd573nXdmAuCRMw8Ho18Rbyw7WMRny1PI4bvlaRScp5ZzeOy8s+zigfPF8gztPy3P4XfOtTyPJ27N8kMsum8tLyDnfqKyk7vP0WsTJWMHS3hveQqz+GZ5Gi/ww3IOZWfHssu1fLQ8Q/tXy3POr6l7lufxzM1Zfogl96XlBcy6H7CJCH1cIIZGFz5SCBTQxjL7Ksp8VrFiqMJXYAsKifENOWrRU9MSslespUDDsAdsRv2LWHf9VBTay6JaLq+uVMuVsthSie6GotXWKmyromiEbXrvQDK0j2325zhiWhKBCROT+vyiKYsdmfrb8vxoUwa6G8u+r2l8ziUE6BCigG2dw5BiWR9TQJmVeCb7Gt+bhVq5kq1HYVqP4q4SVa8samJCEiuj0LeWvl7qFfOOTaUjU+kKV1ChWcWJjkJR8Sp3Gu52x6B4i4OQ6axhaB4PPZvyqUnZs1u0zjhF5OmhzVeBA6OelWDAtkPL5bYK7HJuz2zrzQrgUTmPQzNKxpRapBPSkN6xURx5BGZetprERj8jd0w+wkRUZnYDTfZ7jKRMFa6Um2MKWT0mb6g3ltl4XMGsBnw17RLHbDPbVY2kibiBfcMpD3fe7FzKfGoo8Umolu1on7aEsRKjdVn1EjOvM9Prrmpx4l0VhbXhcOj1eJRO5bnHe7G+XMwPdeqLA5WoeKA6IrsxYlf21KS74uXzh75ORk6t6CQdylgJGgLdVmHC6WdhR8Ui9ZVoNZpir6/CkXNz5FAUf90CbyRm5wo5kDqQx4ESJiMp6hv7Qqa1vJ+m/VqplLRj3U8TL9FBlnppr871/1fR/iV4d/9mfwDrbFK+AAAAeJxjYGYAg//NDEYMWAAAKEQBuAA=) format("woff")}@font-face{font-family:MJXTEX-FR;src:url(/Blog/assets/fonts/MathJax_Fraktur-Regular.b80e08d5.woff) format("woff")}@font-face{font-family:MJXTEX-FR-B;src:url(/Blog/assets/fonts/MathJax_Fraktur-Bold.bc421258.woff) format("woff")}@font-face{font-family:MJXTEX-SS;src:url(/Blog/assets/fonts/MathJax_SansSerif-Regular.bc3af04f.woff) format("woff")}@font-face{font-family:MJXTEX-SS-B;src:url(/Blog/assets/fonts/MathJax_SansSerif-Bold.07281897.woff) format("woff")}@font-face{font-family:MJXTEX-SS-I;src:url(/Blog/assets/fonts/MathJax_SansSerif-Italic.3d580bd5.woff) format("woff")}@font-face{font-family:MJXTEX-SC;src:url(/Blog/assets/fonts/MathJax_Script-Regular.4c74e33b.woff) format("woff")}@font-face{font-family:MJXTEX-T;src:url(/Blog/assets/fonts/MathJax_Typewriter-Regular.72815766.woff) format("woff")}@font-face{font-family:MJXTEX-V;src:url(data:font/woff;base64,d09GRk9UVE8AAARwAAsAAAAABoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAADKAAAAQkAAAElso6A7EZGVE0AAAQ0AAAAHAAAABx3J0njR0RFRgAABFAAAAAYAAAAHAAoAAJPUy8yAAABaAAAAEkAAABgd6mCHGNtYXAAAALcAAAANAAAAUIADSQ4aGVhZAAAAQgAAAA1AAAANgw5vZloaGVhAAABQAAAAB4AAAAkBKMBLmhtdHgAAARoAAAABgAAAAYCEQAAbWF4cAAAAWAAAAAGAAAABgACUABuYW1lAAABtAAAASYAAAIx/gQR3nBvc3QAAAMQAAAAFgAAACD/hgAzeNpjYGRgYADir0asH+L5bb4ycDO/AIowXJ28TRJCHzzLIMvEwnid6RSQy8HABBIFAFQsC7IAAAB42mNgZGBgOvXfgoGB8QsDEDBeZ2BkQAWMAGVAA9QAAAAAUAAAAgAAeNpjYGH8wviFgZWBgamLaQ8DA0MPhGZ8wGDIyAQUZWBjZoABRiBWgHEC0lxTGA4oTlKcxHTqvwVQ5SmGE1A1EKAAhIwAzIwNswAAAHjalZCxasMwEIZ/xU5KKXTM1EF0iqEJcZZAhkJxyRDIYoLX1BhhC2IryHJJxr5QX6YP0ico9OzckqRLDfJ9+u+/O0kA7vEJgdMX0DqxID1g7uEGc2YPj3hm9jHEG3Mfd3hnHnS6B+Hf0i7GB7PAA76Ye9T/m9nDK36YfTyJF+Y+hqJkHrR6ZPZHq/PCyVEWyNk0nMtNoeQ6dcUqPcjIVLWxTjclK9tEZc7YWOXNLrVLU7mlsbmSC3luGLPjbzVRttamkuEkRASDPY6w0MhRwEFihIyeSmKGKUJ6KIkNZRTFNVJyFFhRPNC+ra5Q09+SrtGgvPBskVBlRkrriYlzcu0oZ7Hsql0XLenthMXVlPMO44se//G2OUun1d1cSXebIPwFZj5mrgAAeNpjYGBgZoBgGQZGBhCwAfIYwXwWBgUgzQKEQL7ipP//IeS9fKhKBkY2BhhzxAIA+yMHZXjaY2BmAIP/zQxGQIqRAQ0AAChVAbkAAHjaY2RgYWJgZGQU900syfBKrIgPS00uyS/SDUpNL81JLAJJqf7gZ/ghw/hDlumHHPMPcZYeHsYVP2b8yP4Zx/rdln/295VC3x0EGVgYGblNvCISi4ryy4sy0zNKnPMLKsEMBY1kTQUjA0NzhZCMVAWoPQrO+XnF+UUlmaW52G1GFWVgYGBsZ2BiZGRK4fvB+9NLtLtuZu7Uao7fv9laW1vaupu6mya2TWrj+G7f9d2+m7WuITO3u7K7flrzlO7p3d39U6ctXL5w3qrZMyb193TP6J7cMaF5Akf5jJoFrYvap3f2t/d19LX3tnXXdzc3djdy8HXzcG3m2sq9mYdnKw/vjw4RAKc+clgAAAAAAAABAAAAAMw9os8AAAAA1VXxAgAAAADVk7YReNpjYGRgYOABYhEgZoRCFjCbAQADFgArAfQAAAAdAAA=) format("woff")}@font-face{font-family:MJXTEX-VB;src:url(data:font/woff;base64,d09GRk9UVE8AAARcAAsAAAAABjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAADGAAAAQcAAAEfGT6+mEZGVE0AAAQgAAAAHAAAABx3J0n8R0RFRgAABDwAAAAYAAAAHAAoAAJPUy8yAAABaAAAAEkAAABgd7yCRmNtYXAAAALMAAAANAAAAUIADSQ4aGVhZAAAAQgAAAA1AAAANgyFt9poaGVhAAABQAAAAB0AAAAkBPMBb2htdHgAAARUAAAABgAAAAYCYAAAbWF4cAAAAWAAAAAGAAAABgACUABuYW1lAAABtAAAARYAAAHs9k2y63Bvc3QAAAMAAAAAFgAAACD/hgAzeNpjYGRgYABiU6dQ9nh+m68M3MwvgCIMVydvM4bQu98xKDIxMskxXQaq42BgAokCABb+CfEAAAB42mNgZGBguvxfD0jaMwABkxwDIwMqYAQARfsCZwAAAAAAUAAAAgAAeNpjYGGyZ/zCwMrAwNTFtIeBgaEHQjM+YDBkZAKKMrAxM8AAIxArwDgBaa4pDAsUJylOYrr8Xw+o8jLDJagaCFAAQkYAiH0M8QAAAHjadY/NasJAFIW/mCgthW4K3XZWRReKcSNIKUXBheCmiFuRGJIUzchkBH2pPkGfpss+RW+SQaQ/AzPnuydn7p0At7zjUa+O7Jo97qSquUHAk2OfB14cBxeZJjesHLcq38cLrqV65c2xxyMfjhtc8enY55kvx8FFpsm913bcKv2J3p9MlqRWtaOOGvTDoVqksZqvbTpbH9VE54U2NjvsnLNaxpHVpjvW2025pzq3U22SWI3UH5FlbIpM5yrshUzQ7DlhyEhIsSjaRPJfigF9QoZCC/kSi85ZSyJlJnqUurydU8hpxM84sPuRWbGUm5E4ZabLWHTL5qzTqoOt1MgLyimjX5P+61K6RuZnVRclr+0RfgNnQFOYAAB42mNgYGBmgGAZBkYGELAB8hjBfBYGBSDNAoRAvuKk//8h5L18qEoGRjYGGHPEAgD7IwdleNpjYGYAg//NDEZAipEBDQAAKFUBuQAAeNpjZGBhYmBkZBTxTSzJ8EqsiA9LTS7JL9J1ys9JAYmr/uBn+CHD+EOW6Ycc8w9xlh4exjU/pv7Y9DOd9bs5/7zvC4S+WwkysDAycpu4hyYWFeWXF2WmZ5Q45xdUghkKGsmaCkYGhuYKIRmpClBLFJzz84rzi0oyS3OxWIsqxMDAwNjOwMTIyJTI9+2H1k8v0e666WWTGzj+sLHVtzS0dld210xtmtHG8d2h67tDd10ta21te1d3dXf1jNo53dO7+/rmzF6yZOmc1dPnTZ4yoXt+94zWybWTOfKnV89uWNI8p3VCeXdVd2NVdz0HXzcP12aurdybeXi28vD+6BD5kSEKAO9nb1wAAAAAAQAAAADMPaLPAAAAANVV8QIAAAAA1ZO2KnjaY2BkYGDgAWIRIGaEQhYwmwEAAxYAKwI/AAAAIQAA) format("woff")}.MJX-TEX mjx-stretchy-v[c="("] mjx-beg mjx-c:before{content:"\239B";width:.875em;padding:1.154em 0 .655em}.MJX-TEX mjx-stretchy-v[c="("] mjx-ext mjx-c:before{content:"\239C";width:.875em}.MJX-TEX mjx-stretchy-v[c="("] mjx-end mjx-c:before{content:"\239D";width:.875em;padding:1.165em 0 .644em}.MJX-TEX mjx-stretchy-v[c="("]>mjx-end{margin-top:-1.809em}.MJX-TEX mjx-stretchy-v[c="("]>mjx-ext{border-top-width:1.779em;border-bottom-width:1.779em}.MJX-TEX mjx-stretchy-v[c=")"] mjx-beg mjx-c:before{content:"\239E";width:.875em;padding:1.154em 0 .655em}.MJX-TEX mjx-stretchy-v[c=")"] mjx-ext mjx-c:before{content:"\239F";width:.875em}.MJX-TEX mjx-stretchy-v[c=")"] mjx-end mjx-c:before{content:"\23A0";width:.875em;padding:1.165em 0 .644em}.MJX-TEX mjx-stretchy-v[c=")"]>mjx-end{margin-top:-1.809em}.MJX-TEX mjx-stretchy-v[c=")"]>mjx-ext{border-top-width:1.779em;border-bottom-width:1.779em}.MJX-TEX .mjx-stretched mjx-c[c="-"]:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="-"] mjx-ext mjx-c:before{content:"\2212";padding:.583em 0 .082em}.MJX-TEX mjx-stretchy-h[c="="] mjx-ext mjx-c:before{content:"=";padding:.583em 0 .082em}.MJX-TEX mjx-stretchy-v[c="["] mjx-beg mjx-c:before{content:"\23A1";width:.771em;padding:1.154em 0 .645em .104em}.MJX-TEX mjx-stretchy-v[c="["] mjx-ext mjx-c:before{content:"\23A2";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="["] mjx-end mjx-c:before{content:"\23A3";width:.771em;padding:1.155em 0 .644em .104em}.MJX-TEX mjx-stretchy-v[c="["]>mjx-end{margin-top:-1.799em}.MJX-TEX mjx-stretchy-v[c="["]>mjx-ext{border-top-width:1.769em;border-bottom-width:1.769em}.MJX-TEX mjx-stretchy-v[c="]"] mjx-beg mjx-c:before{content:"\23A4";width:.771em;padding:1.154em 0 .645em .104em}.MJX-TEX mjx-stretchy-v[c="]"] mjx-ext mjx-c:before{content:"\23A5";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="]"] mjx-end mjx-c:before{content:"\23A6";width:.771em;padding:1.155em 0 .644em .104em}.MJX-TEX mjx-stretchy-v[c="]"]>mjx-end{margin-top:-1.799em}.MJX-TEX mjx-stretchy-v[c="]"]>mjx-ext{border-top-width:1.769em;border-bottom-width:1.769em}.MJX-TEX .mjx-stretched mjx-c[c="^"]:before{content:"\2C6"}.MJX-TEX .mjx-stretched mjx-c[c=_]:before{content:"\2013"}.MJX-TEX mjx-stretchy-h[c=_] mjx-ext mjx-c:before{content:"\2013";padding:.285em 0 0}.MJX-TEX mjx-stretchy-v[c="{"] mjx-beg mjx-c:before{content:"\23A7";width:.889em;padding:.899em 0 .01em}.MJX-TEX mjx-stretchy-v[c="{"] mjx-ext mjx-c:before{content:"\23AA";width:.889em}.MJX-TEX mjx-stretchy-v[c="{"] mjx-end mjx-c:before{content:"\23A9";width:.889em;padding:.01em 0 .899em}.MJX-TEX mjx-stretchy-v[c="{"] mjx-mid mjx-c:before{content:"\23A8";width:.889em;padding:1.16em 0 .66em}.MJX-TEX mjx-stretchy-v[c="{"]>mjx-mid{margin-top:-.91em;margin-bottom:-.91em}.MJX-TEX mjx-stretchy-v[c="{"]>mjx-end{margin-top:-.909em}.MJX-TEX mjx-stretchy-v[c="{"]>mjx-ext{height:50%;border-top-width:.879em;border-bottom-width:.879em}.MJX-TEX mjx-stretchy-v[c="|"] mjx-ext mjx-c:before{content:"\2223";width:.305em;padding-left:0}.MJX-TEX mjx-stretchy-v[c="}"] mjx-beg mjx-c:before{content:"\23AB";width:.889em;padding:.899em 0 .01em}.MJX-TEX mjx-stretchy-v[c="}"] mjx-ext mjx-c:before{content:"\23AA";width:.889em}.MJX-TEX mjx-stretchy-v[c="}"] mjx-end mjx-c:before{content:"\23AD";width:.889em;padding:.01em 0 .899em}.MJX-TEX mjx-stretchy-v[c="}"] mjx-mid mjx-c:before{content:"\23AC";width:.889em;padding:1.16em 0 .66em}.MJX-TEX mjx-stretchy-v[c="}"]>mjx-mid{margin-top:-.91em;margin-bottom:-.91em}.MJX-TEX mjx-stretchy-v[c="}"]>mjx-end{margin-top:-.909em}.MJX-TEX mjx-stretchy-v[c="}"]>mjx-ext{height:50%;border-top-width:.879em;border-bottom-width:.879em}.MJX-TEX .mjx-stretched mjx-c[c="~"]:before{content:"\2DC"}.MJX-TEX mjx-stretchy-h[c=AF] mjx-ext mjx-c:before{content:"\AF";padding:.59em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="2C9"]:before{content:"\AF"}.MJX-TEX mjx-stretchy-h[c="2C9"] mjx-ext mjx-c:before{content:"\AF";padding:.59em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="302"]:before{content:"\2C6"}.MJX-TEX .mjx-stretched mjx-c[c="303"]:before{content:"\2DC"}.MJX-TEX .mjx-stretched mjx-c[c="332"]:before{content:"\2013"}.MJX-TEX mjx-stretchy-h[c="332"] mjx-ext mjx-c:before,.MJX-TEX mjx-stretchy-h[c="2013"] mjx-ext mjx-c:before{content:"\2013";padding:.285em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="2014"]:before{content:"\2013"}.MJX-TEX mjx-stretchy-h[c="2014"] mjx-ext mjx-c:before{content:"\2013";padding:.285em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="2015"]:before{content:"\2013"}.MJX-TEX mjx-stretchy-h[c="2015"] mjx-ext mjx-c:before{content:"\2013";padding:.285em 0 0}.MJX-TEX mjx-stretchy-v[c="2016"] mjx-ext mjx-c:before{content:"\2225";width:.528em;padding-left:0}.MJX-TEX .mjx-stretched mjx-c[c="2017"]:before{content:"\2013"}.MJX-TEX mjx-stretchy-h[c="2017"] mjx-ext mjx-c:before{content:"\2013";padding:.285em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="203E"]:before{content:"\AF"}.MJX-TEX mjx-stretchy-h[c="203E"] mjx-ext mjx-c:before{content:"\AF";padding:.59em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="20D7"]:before{content:"\2192"}.MJX-TEX mjx-stretchy-h[c="20D7"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="20D7"] mjx-end mjx-c:before{content:"\2192";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-h[c="2190"] mjx-beg mjx-c:before{content:"\2190";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-h[c="2190"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-v[c="2191"] mjx-beg mjx-c:before{content:"\2191";width:.667em;padding:.6em 0 0}.MJX-TEX mjx-stretchy-v[c="2191"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="2191"]>mjx-ext{border-top-width:.57em}.MJX-TEX mjx-stretchy-h[c="2192"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="2192"] mjx-end mjx-c:before{content:"\2192";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-v[c="2193"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="2193"] mjx-end mjx-c:before{content:"\2193";width:.667em;padding:.6em 0 0}.MJX-TEX mjx-stretchy-v[c="2193"]>mjx-end{margin-top:-.6em}.MJX-TEX mjx-stretchy-v[c="2193"]>mjx-ext{border-bottom-width:.57em}.MJX-TEX mjx-stretchy-h[c="2194"] mjx-beg mjx-c:before{content:"\2190";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-h[c="2194"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="2194"] mjx-end mjx-c:before{content:"\2192";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-v[c="2195"] mjx-beg mjx-c:before{content:"\2191";width:.667em;padding:.6em 0 0}.MJX-TEX mjx-stretchy-v[c="2195"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="2195"] mjx-end mjx-c:before{content:"\2193";width:.667em;padding:.6em 0 0}.MJX-TEX mjx-stretchy-v[c="2195"]>mjx-end{margin-top:-.6em}.MJX-TEX mjx-stretchy-v[c="2195"]>mjx-ext{border-top-width:.57em;border-bottom-width:.57em}.MJX-TEX mjx-stretchy-h[c="219E"] mjx-beg mjx-c:before{content:"\219E";padding:.417em 0 0}.MJX-TEX mjx-stretchy-h[c="21A0"] mjx-ext mjx-c:before,.MJX-TEX mjx-stretchy-h[c="219E"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="21A0"] mjx-end mjx-c:before{content:"\21A0";padding:.417em 0 0}.MJX-TEX mjx-stretchy-h[c="21A4"] mjx-beg mjx-c:before{content:"\2190";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-h[c="21A4"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="21A4"] mjx-end mjx-c:before{content:"\2223";padding:.627em 0 .015em}.MJX-TEX mjx-stretchy-v[c="21A5"] mjx-beg mjx-c:before{content:"\2191";width:.771em;padding:.6em 0 0 .104em}.MJX-TEX mjx-stretchy-v[c="21A5"] mjx-ext mjx-c:before{content:"\23D0";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="21A5"] mjx-end mjx-c:before{content:"\22A5";width:.827em;padding:.668em 0 0 .048em}.MJX-TEX mjx-stretchy-v[c="21A5"]>mjx-end{margin-top:-.668em}.MJX-TEX mjx-stretchy-v[c="21A5"]>mjx-ext{border-top-width:.57em;border-bottom-width:.638em}.MJX-TEX mjx-stretchy-h[c="21A6"] mjx-beg mjx-c:before{content:"\2223";padding:.627em 0 .015em}.MJX-TEX mjx-stretchy-h[c="21A6"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="21A6"] mjx-end mjx-c:before{content:"\2192";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-v[c="21A7"] mjx-beg mjx-c:before{content:"\22A4";width:.827em;padding:.668em 0 0 .048em}.MJX-TEX mjx-stretchy-v[c="21A7"] mjx-ext mjx-c:before{content:"\23D0";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="21A7"] mjx-end mjx-c:before{content:"\2193";width:.771em;padding:.6em 0 0 .104em}.MJX-TEX mjx-stretchy-v[c="21A7"]>mjx-end{margin-top:-.6em}.MJX-TEX mjx-stretchy-v[c="21A7"]>mjx-ext{border-top-width:.638em;border-bottom-width:.57em}.MJX-TEX mjx-stretchy-v[c="21B0"] mjx-beg mjx-c:before{content:"\21B0";width:.584em;padding:.722em 0 0 .084em}.MJX-TEX mjx-stretchy-v[c="21B0"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="21B0"]>mjx-ext{border-top-width:.692em}.MJX-TEX mjx-stretchy-v[c="21B1"] mjx-beg mjx-c:before{content:"\21B1";width:.584em;padding:.722em 0 0 .084em}.MJX-TEX mjx-stretchy-v[c="21B1"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="21B1"]>mjx-ext{border-top-width:.692em}.MJX-TEX mjx-stretchy-h[c="21BC"] mjx-beg mjx-c:before{content:"\21BC";padding:.511em 0 0}.MJX-TEX mjx-stretchy-h[c="21BC"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="21BD"] mjx-beg mjx-c:before{content:"\21BD";padding:.27em 0 .011em}.MJX-TEX mjx-stretchy-h[c="21BD"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-v[c="21BE"] mjx-beg mjx-c:before{content:"\21BE";width:.542em;padding:.694em 0 .194em .125em}.MJX-TEX mjx-stretchy-v[c="21BE"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="21BE"]>mjx-ext{border-top-width:.858em}.MJX-TEX mjx-stretchy-v[c="21BF"] mjx-beg mjx-c:before{content:"\21BF";width:.542em;padding:.694em 0 .194em .125em}.MJX-TEX mjx-stretchy-v[c="21BF"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="21BF"]>mjx-ext{border-top-width:.858em}.MJX-TEX mjx-stretchy-h[c="21C0"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="21C0"] mjx-end mjx-c:before{content:"\21C0";padding:.511em 0 0}.MJX-TEX mjx-stretchy-h[c="21C1"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="21C1"] mjx-end mjx-c:before{content:"\21C1";padding:.27em 0 .011em}.MJX-TEX mjx-stretchy-v[c="21C2"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="21C2"] mjx-end mjx-c:before{content:"\21C2";width:.542em;padding:.694em 0 .194em .125em}.MJX-TEX mjx-stretchy-v[c="21C2"]>mjx-end{margin-top:-.888em}.MJX-TEX mjx-stretchy-v[c="21C2"]>mjx-ext{border-bottom-width:.858em}.MJX-TEX mjx-stretchy-v[c="21C3"] mjx-ext mjx-c:before{content:"\23D0";width:.667em}.MJX-TEX mjx-stretchy-v[c="21C3"] mjx-end mjx-c:before{content:"\21C3";width:.542em;padding:.694em 0 .194em .125em}.MJX-TEX mjx-stretchy-v[c="21C3"]>mjx-end{margin-top:-.888em}.MJX-TEX mjx-stretchy-v[c="21C3"]>mjx-ext{border-bottom-width:.858em}.MJX-TEX mjx-stretchy-h[c="21D0"] mjx-beg mjx-c:before{content:"\21D0";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-h[c="21D0"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-v[c="21D1"] mjx-beg mjx-c:before{content:"\21D1";width:.778em;padding:.599em 0 0}.MJX-TEX mjx-stretchy-v[c="21D1"] mjx-ext mjx-c:before{content:"\2016";width:.778em}.MJX-TEX mjx-stretchy-v[c="21D1"]>mjx-ext{border-top-width:.569em}.MJX-TEX mjx-stretchy-h[c="21D2"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-h[c="21D2"] mjx-end mjx-c:before{content:"\21D2";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-v[c="21D3"] mjx-ext mjx-c:before{content:"\2016";width:.778em}.MJX-TEX mjx-stretchy-v[c="21D3"] mjx-end mjx-c:before{content:"\21D3";width:.778em;padding:.6em 0 0}.MJX-TEX mjx-stretchy-v[c="21D3"]>mjx-end{margin-top:-.6em}.MJX-TEX mjx-stretchy-v[c="21D3"]>mjx-ext{border-bottom-width:.57em}.MJX-TEX mjx-stretchy-h[c="21D4"] mjx-beg mjx-c:before{content:"\21D0";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-h[c="21D4"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-h[c="21D4"] mjx-end mjx-c:before{content:"\21D2";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-v[c="21D5"] mjx-beg mjx-c:before{content:"\21D1";width:.778em;padding:.599em 0 0}.MJX-TEX mjx-stretchy-v[c="21D5"] mjx-ext mjx-c:before{content:"\2016";width:.778em}.MJX-TEX mjx-stretchy-v[c="21D5"] mjx-end mjx-c:before{content:"\21D3";width:.778em;padding:.6em 0 0}.MJX-TEX mjx-stretchy-v[c="21D5"]>mjx-end{margin-top:-.6em}.MJX-TEX mjx-stretchy-v[c="21D5"]>mjx-ext{border-top-width:.569em;border-bottom-width:.57em}.MJX-TEX mjx-stretchy-h[c="21DA"] mjx-beg mjx-c:before{content:"\21DA";padding:.611em 0 .111em}.MJX-TEX mjx-stretchy-h[c="21DA"] mjx-ext mjx-c:before,.MJX-TEX mjx-stretchy-h[c="21DB"] mjx-ext mjx-c:before{content:"\2261"}.MJX-TEX mjx-stretchy-h[c="21DB"] mjx-end mjx-c:before{content:"\21DB";padding:.611em 0 .111em}.MJX-TEX mjx-stretchy-h[c="2212"] mjx-ext mjx-c:before{content:"\2212";padding:.583em 0 .082em}.MJX-TEX .mjx-stretched mjx-c[c="2215"]:before{content:"/"}.MJX-TEX mjx-stretchy-v[c="221A"] mjx-beg mjx-c:before{content:"\E001";width:1.056em;padding:.605em 0 .014em}.MJX-TEX mjx-stretchy-v[c="221A"] mjx-ext mjx-c:before{content:"\E000";width:1.056em}.MJX-TEX mjx-stretchy-v[c="221A"] mjx-end mjx-c:before{content:"\23B7";width:1.056em;padding:.935em 0 .885em}.MJX-TEX mjx-stretchy-v[c="221A"]>mjx-end{margin-top:-1.82em}.MJX-TEX mjx-stretchy-v[c="221A"]>mjx-ext{border-top-width:.589em;border-bottom-width:1.79em}.MJX-TEX mjx-stretchy-v[c="2223"] mjx-ext mjx-c:before{content:"\2223";width:.305em;padding-left:0}.MJX-TEX mjx-stretchy-v[c="2225"] mjx-ext mjx-c:before{content:"\2225";width:.528em;padding-left:0}.MJX-TEX mjx-stretchy-v[c="2308"] mjx-beg mjx-c:before{content:"\23A1";width:.771em;padding:1.154em 0 .645em .104em}.MJX-TEX mjx-stretchy-v[c="2308"] mjx-ext mjx-c:before{content:"\23A2";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="2308"]>mjx-ext{border-top-width:1.769em}.MJX-TEX mjx-stretchy-v[c="2309"] mjx-beg mjx-c:before{content:"\23A4";width:.771em;padding:1.154em 0 .645em .104em}.MJX-TEX mjx-stretchy-v[c="2309"] mjx-ext mjx-c:before{content:"\23A5";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="2309"]>mjx-ext{border-top-width:1.769em}.MJX-TEX mjx-stretchy-v[c="230A"] mjx-ext mjx-c:before{content:"\23A2";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="230A"] mjx-end mjx-c:before{content:"\23A3";width:.771em;padding:1.155em 0 .644em .104em}.MJX-TEX mjx-stretchy-v[c="230A"]>mjx-end{margin-top:-1.799em}.MJX-TEX mjx-stretchy-v[c="230A"]>mjx-ext{border-bottom-width:1.769em}.MJX-TEX mjx-stretchy-v[c="230B"] mjx-ext mjx-c:before{content:"\23A5";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="230B"] mjx-end mjx-c:before{content:"\23A6";width:.771em;padding:1.155em 0 .644em .104em}.MJX-TEX mjx-stretchy-v[c="230B"]>mjx-end{margin-top:-1.799em}.MJX-TEX mjx-stretchy-v[c="230B"]>mjx-ext{border-bottom-width:1.769em}.MJX-TEX .mjx-stretched mjx-c[c="2312"]:before{content:"\23DC"}.MJX-TEX mjx-stretchy-h[c="2312"] mjx-beg mjx-c:before{content:"\E150";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c="2312"] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c="2312"] mjx-end mjx-c:before{content:"\E151";padding:.12em 0 .213em}.MJX-TEX .mjx-stretched mjx-c[c="2322"]:before{content:"\23DC"}.MJX-TEX mjx-stretchy-h[c="2322"] mjx-beg mjx-c:before{content:"\E150";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c="2322"] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c="2322"] mjx-end mjx-c:before{content:"\E151";padding:.12em 0 .213em}.MJX-TEX .mjx-stretched mjx-c[c="2323"]:before{content:"\23DD"}.MJX-TEX mjx-stretchy-h[c="2323"] mjx-beg mjx-c:before{content:"\E152";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c="2323"] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c="2323"] mjx-end mjx-c:before{content:"\E153";padding:.333em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="2329"]:before{content:"\27E8"}.MJX-TEX .mjx-stretched mjx-c[c="232A"]:before{content:"\27E9"}.MJX-TEX mjx-stretchy-v[c="23AA"] mjx-beg mjx-c:before{content:"\23AA";width:.889em;padding:.29em 0 .015em}.MJX-TEX mjx-stretchy-v[c="23AA"] mjx-ext mjx-c:before{content:"\23AA";width:.889em}.MJX-TEX mjx-stretchy-v[c="23AA"] mjx-end mjx-c:before{content:"\23AA";width:.889em;padding:.29em 0 .015em}.MJX-TEX mjx-stretchy-v[c="23AA"]>mjx-end{margin-top:-.305em}.MJX-TEX mjx-stretchy-v[c="23AA"]>mjx-ext{border-top-width:.275em;border-bottom-width:.275em}.MJX-TEX .mjx-stretched mjx-c[c="23AF"]:before{content:"\2013"}.MJX-TEX mjx-stretchy-h[c="23AF"] mjx-ext mjx-c:before{content:"\2013";padding:.285em 0 0}.MJX-TEX mjx-stretchy-v[c="23B0"] mjx-beg mjx-c:before{content:"\23A7";width:.889em;padding:.899em 0 .01em}.MJX-TEX mjx-stretchy-v[c="23B0"] mjx-ext mjx-c:before{content:"\23AA";width:.889em}.MJX-TEX mjx-stretchy-v[c="23B0"] mjx-end mjx-c:before{content:"\23AD";width:.889em;padding:.01em 0 .899em}.MJX-TEX mjx-stretchy-v[c="23B0"]>mjx-end{margin-top:-.909em}.MJX-TEX mjx-stretchy-v[c="23B0"]>mjx-ext{border-top-width:.879em;border-bottom-width:.879em}.MJX-TEX mjx-stretchy-v[c="23B1"] mjx-beg mjx-c:before{content:"\23AB";width:.889em;padding:.899em 0 .01em}.MJX-TEX mjx-stretchy-v[c="23B1"] mjx-ext mjx-c:before{content:"\23AA";width:.889em}.MJX-TEX mjx-stretchy-v[c="23B1"] mjx-end mjx-c:before{content:"\23A9";width:.889em;padding:.01em 0 .899em}.MJX-TEX mjx-stretchy-v[c="23B1"]>mjx-end{margin-top:-.909em}.MJX-TEX mjx-stretchy-v[c="23B1"]>mjx-ext{border-top-width:.879em;border-bottom-width:.879em}.MJX-TEX mjx-stretchy-h[c="23B4"] mjx-beg mjx-c:before{content:"\250C";padding:.694em 0 0}.MJX-TEX mjx-stretchy-h[c="23B4"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="23B4"] mjx-end mjx-c:before{content:"\2510";padding:.694em 0 0}.MJX-TEX mjx-stretchy-h[c="23B5"] mjx-beg mjx-c:before{content:"\2514";padding:.366em 0 .022em}.MJX-TEX mjx-stretchy-h[c="23B5"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="23B5"] mjx-end mjx-c:before{content:"\2518";padding:.366em 0 .022em}.MJX-TEX mjx-stretchy-v[c="23D0"] mjx-ext mjx-c:before{content:"\2223";width:.305em;padding-left:0}.MJX-TEX mjx-stretchy-h[c="23DC"] mjx-beg mjx-c:before{content:"\E150";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c="23DC"] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c="23DC"] mjx-end mjx-c:before{content:"\E151";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c="23DD"] mjx-beg mjx-c:before{content:"\E152";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c="23DD"] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c="23DD"] mjx-end mjx-c:before{content:"\E153";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c="23DE"] mjx-beg mjx-c:before{content:"\E150";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c="23DE"] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c="23DE"] mjx-end mjx-c:before{content:"\E151";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c="23DE"] mjx-mid mjx-c:before{content:"\E153\E152";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c="23DE"]>mjx-ext{width:50%}.MJX-TEX mjx-stretchy-h[c="23DF"] mjx-beg mjx-c:before{content:"\E152";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c="23DF"] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c="23DF"] mjx-end mjx-c:before{content:"\E153";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c="23DF"] mjx-mid mjx-c:before{content:"\E151\E150";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c="23DF"]>mjx-ext{width:50%}.MJX-TEX mjx-stretchy-h[c="23E0"] mjx-beg mjx-c:before{content:"\2CA";padding:.699em 0 0}.MJX-TEX mjx-stretchy-h[c="23E0"] mjx-ext mjx-c:before{content:"\2C9"}.MJX-TEX mjx-stretchy-h[c="23E0"] mjx-end mjx-c:before,.MJX-TEX mjx-stretchy-h[c="23E1"] mjx-beg mjx-c:before{content:"\2CB";padding:.699em 0 0}.MJX-TEX mjx-stretchy-h[c="23E1"] mjx-ext mjx-c:before{content:"\2C9"}.MJX-TEX mjx-stretchy-h[c="23E1"] mjx-end mjx-c:before{content:"\2CA";padding:.699em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="2500"]:before{content:"\2013"}.MJX-TEX mjx-stretchy-h[c="2500"] mjx-ext mjx-c:before{content:"\2013";padding:.285em 0 0}.MJX-TEX .mjx-stretched mjx-c[c="2758"]:before{content:"\2223"}.MJX-TEX mjx-stretchy-v[c="2758"] mjx-ext mjx-c:before{content:"\2223";width:.305em;padding-left:0}.MJX-TEX mjx-stretchy-v[c="27EE"] mjx-beg mjx-c:before{content:"\23A7";width:.889em;padding:.899em 0 .01em}.MJX-TEX mjx-stretchy-v[c="27EE"] mjx-ext mjx-c:before{content:"\23AA";width:.889em}.MJX-TEX mjx-stretchy-v[c="27EE"] mjx-end mjx-c:before{content:"\23A9";width:.889em;padding:.01em 0 .899em}.MJX-TEX mjx-stretchy-v[c="27EE"]>mjx-end{margin-top:-.909em}.MJX-TEX mjx-stretchy-v[c="27EE"]>mjx-ext{border-top-width:.879em;border-bottom-width:.879em}.MJX-TEX mjx-stretchy-v[c="27EF"] mjx-beg mjx-c:before{content:"\23AB";width:.889em;padding:.899em 0 .01em}.MJX-TEX mjx-stretchy-v[c="27EF"] mjx-ext mjx-c:before{content:"\23AA";width:.889em}.MJX-TEX mjx-stretchy-v[c="27EF"] mjx-end mjx-c:before{content:"\23AD";width:.889em;padding:.01em 0 .899em}.MJX-TEX mjx-stretchy-v[c="27EF"]>mjx-end{margin-top:-.909em}.MJX-TEX mjx-stretchy-v[c="27EF"]>mjx-ext{border-top-width:.879em;border-bottom-width:.879em}.MJX-TEX .mjx-stretched mjx-c[c="27F5"]:before{content:"\2190"}.MJX-TEX mjx-stretchy-h[c="27F5"] mjx-beg mjx-c:before{content:"\2190";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-h[c="27F5"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX .mjx-stretched mjx-c[c="27F6"]:before{content:"\2192"}.MJX-TEX mjx-stretchy-h[c="27F6"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="27F6"] mjx-end mjx-c:before{content:"\2192";padding:.511em 0 .011em}.MJX-TEX .mjx-stretched mjx-c[c="27F7"]:before{content:"\2194"}.MJX-TEX mjx-stretchy-h[c="27F7"] mjx-beg mjx-c:before{content:"\2190";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-h[c="27F7"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="27F7"] mjx-end mjx-c:before{content:"\2192";padding:.511em 0 .011em}.MJX-TEX .mjx-stretched mjx-c[c="27F8"]:before{content:"\21D0"}.MJX-TEX mjx-stretchy-h[c="27F8"] mjx-beg mjx-c:before{content:"\21D0";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-h[c="27F8"] mjx-ext mjx-c:before{content:"="}.MJX-TEX .mjx-stretched mjx-c[c="27F9"]:before{content:"\21D2"}.MJX-TEX mjx-stretchy-h[c="27F9"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-h[c="27F9"] mjx-end mjx-c:before{content:"\21D2";padding:.525em 0 .024em}.MJX-TEX .mjx-stretched mjx-c[c="27FA"]:before{content:"\21D4"}.MJX-TEX mjx-stretchy-h[c="27FA"] mjx-beg mjx-c:before{content:"\21D0";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-h[c="27FA"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-h[c="27FA"] mjx-end mjx-c:before{content:"\21D2";padding:.525em 0 .024em}.MJX-TEX .mjx-stretched mjx-c[c="27FB"]:before{content:"\21A4"}.MJX-TEX mjx-stretchy-h[c="27FB"] mjx-beg mjx-c:before{content:"\2190";padding:.511em 0 .011em}.MJX-TEX mjx-stretchy-h[c="27FB"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="27FB"] mjx-end mjx-c:before{content:"\2223";padding:.627em 0 .015em}.MJX-TEX .mjx-stretched mjx-c[c="27FC"]:before{content:"\21A6"}.MJX-TEX mjx-stretchy-h[c="27FC"] mjx-beg mjx-c:before{content:"\2223";padding:.627em 0 .015em}.MJX-TEX mjx-stretchy-h[c="27FC"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="27FC"] mjx-end mjx-c:before{content:"\2192";padding:.511em 0 .011em}.MJX-TEX .mjx-stretched mjx-c[c="27FD"]:before{content:"\2906"}.MJX-TEX mjx-stretchy-h[c="27FD"] mjx-beg mjx-c:before{content:"\21D0";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-h[c="27FD"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-h[c="27FD"] mjx-end mjx-c:before{content:"\2223";padding:.627em 0 .015em}.MJX-TEX .mjx-stretched mjx-c[c="27FE"]:before{content:"\2907"}.MJX-TEX mjx-stretchy-h[c="27FE"] mjx-beg mjx-c:before{content:"\22A8";padding:.75em 0 .249em}.MJX-TEX mjx-stretchy-h[c="27FE"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-h[c="27FE"] mjx-end mjx-c:before{content:"\21D2";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-h[c="2906"] mjx-beg mjx-c:before{content:"\21D0";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-h[c="2906"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-h[c="2906"] mjx-end mjx-c:before{content:"\2223";padding:.627em 0 .015em}.MJX-TEX mjx-stretchy-h[c="2907"] mjx-beg mjx-c:before{content:"\22A8";padding:.75em 0 .249em}.MJX-TEX mjx-stretchy-h[c="2907"] mjx-ext mjx-c:before{content:"="}.MJX-TEX mjx-stretchy-h[c="2907"] mjx-end mjx-c:before{content:"\21D2";padding:.525em 0 .024em}.MJX-TEX mjx-stretchy-h[c="294E"] mjx-beg mjx-c:before{content:"\21BC";padding:.511em 0 0}.MJX-TEX mjx-stretchy-h[c="294E"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="294E"] mjx-end mjx-c:before{content:"\21C0";padding:.511em 0 0}.MJX-TEX mjx-stretchy-v[c="294F"] mjx-beg mjx-c:before{content:"\21BE";width:.646em;padding:.694em 0 .194em .229em}.MJX-TEX mjx-stretchy-v[c="294F"] mjx-ext mjx-c:before{content:"\23D0";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="294F"] mjx-end mjx-c:before{content:"\21C2";width:.646em;padding:.694em 0 .194em .229em}.MJX-TEX mjx-stretchy-v[c="294F"]>mjx-end{margin-top:-.888em}.MJX-TEX mjx-stretchy-v[c="294F"]>mjx-ext{border-top-width:.858em;border-bottom-width:.858em}.MJX-TEX mjx-stretchy-h[c="2950"] mjx-beg mjx-c:before{content:"\21BD";padding:.27em 0 .011em}.MJX-TEX mjx-stretchy-h[c="2950"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="2950"] mjx-end mjx-c:before{content:"\21C1";padding:.27em 0 .011em}.MJX-TEX mjx-stretchy-v[c="2951"] mjx-beg mjx-c:before{content:"\21BF";width:.646em;padding:.694em 0 .194em .229em}.MJX-TEX mjx-stretchy-v[c="2951"] mjx-ext mjx-c:before{content:"\23D0";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="2951"] mjx-end mjx-c:before{content:"\21C3";width:.646em;padding:.694em 0 .194em .229em}.MJX-TEX mjx-stretchy-v[c="2951"]>mjx-end{margin-top:-.888em}.MJX-TEX mjx-stretchy-v[c="2951"]>mjx-ext{border-top-width:.858em;border-bottom-width:.858em}.MJX-TEX mjx-stretchy-h[c="295A"] mjx-beg mjx-c:before{content:"\21BC";padding:.511em 0 0}.MJX-TEX mjx-stretchy-h[c="295A"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="295A"] mjx-end mjx-c:before,.MJX-TEX mjx-stretchy-h[c="295B"] mjx-beg mjx-c:before{content:"\2223";padding:.627em 0 .015em}.MJX-TEX mjx-stretchy-h[c="295B"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="295B"] mjx-end mjx-c:before{content:"\21C0";padding:.511em 0 0}.MJX-TEX mjx-stretchy-v[c="295C"] mjx-beg mjx-c:before{content:"\21BE";width:.646em;padding:.694em 0 .194em .229em}.MJX-TEX mjx-stretchy-v[c="295C"] mjx-ext mjx-c:before{content:"\23D0";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="295C"] mjx-end mjx-c:before{content:"\22A5";width:.827em;padding:.668em 0 0 .048em}.MJX-TEX mjx-stretchy-v[c="295C"]>mjx-end{margin-top:-.668em}.MJX-TEX mjx-stretchy-v[c="295C"]>mjx-ext{border-top-width:.858em;border-bottom-width:.638em}.MJX-TEX mjx-stretchy-v[c="295D"] mjx-beg mjx-c:before{content:"\22A4";width:.827em;padding:.668em 0 0 .048em}.MJX-TEX mjx-stretchy-v[c="295D"] mjx-ext mjx-c:before{content:"\23D0";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="295D"] mjx-end mjx-c:before{content:"\21C2";width:.646em;padding:.694em 0 .194em .229em}.MJX-TEX mjx-stretchy-v[c="295D"]>mjx-end{margin-top:-.888em}.MJX-TEX mjx-stretchy-v[c="295D"]>mjx-ext{border-top-width:.638em;border-bottom-width:.858em}.MJX-TEX mjx-stretchy-h[c="295E"] mjx-beg mjx-c:before{content:"\21BD";padding:.27em 0 .011em}.MJX-TEX mjx-stretchy-h[c="295E"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="295E"] mjx-end mjx-c:before,.MJX-TEX mjx-stretchy-h[c="295F"] mjx-beg mjx-c:before{content:"\2223";padding:.627em 0 .015em}.MJX-TEX mjx-stretchy-h[c="295F"] mjx-ext mjx-c:before{content:"\2212"}.MJX-TEX mjx-stretchy-h[c="295F"] mjx-end mjx-c:before{content:"\21C1";padding:.27em 0 .011em}.MJX-TEX mjx-stretchy-v[c="2960"] mjx-beg mjx-c:before{content:"\21BF";width:.646em;padding:.694em 0 .194em .229em}.MJX-TEX mjx-stretchy-v[c="2960"] mjx-ext mjx-c:before{content:"\23D0";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="2960"] mjx-end mjx-c:before{content:"\22A5";width:.827em;padding:.668em 0 0 .048em}.MJX-TEX mjx-stretchy-v[c="2960"]>mjx-end{margin-top:-.668em}.MJX-TEX mjx-stretchy-v[c="2960"]>mjx-ext{border-top-width:.858em;border-bottom-width:.638em}.MJX-TEX mjx-stretchy-v[c="2961"] mjx-beg mjx-c:before{content:"\22A4";width:.827em;padding:.668em 0 0 .048em}.MJX-TEX mjx-stretchy-v[c="2961"] mjx-ext mjx-c:before{content:"\23D0";width:.771em;padding-left:.104em}.MJX-TEX mjx-stretchy-v[c="2961"] mjx-end mjx-c:before{content:"\21C3";width:.646em;padding:.694em 0 .194em .229em}.MJX-TEX mjx-stretchy-v[c="2961"]>mjx-end{margin-top:-.888em}.MJX-TEX mjx-stretchy-v[c="2961"]>mjx-ext{border-top-width:.638em;border-bottom-width:.858em}.MJX-TEX .mjx-stretched mjx-c[c="3008"]:before{content:"\27E8"}.MJX-TEX .mjx-stretched mjx-c[c="3009"]:before{content:"\27E9"}.MJX-TEX .mjx-stretched mjx-c[c=FE37]:before{content:"\23DE"}.MJX-TEX mjx-stretchy-h[c=FE37] mjx-beg mjx-c:before{content:"\E150";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c=FE37] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c=FE37] mjx-end mjx-c:before{content:"\E151";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c=FE37] mjx-mid mjx-c:before{content:"\E153\E152";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c=FE37]>mjx-ext{width:50%}.MJX-TEX .mjx-stretched mjx-c[c=FE38]:before{content:"\23DF"}.MJX-TEX mjx-stretchy-h[c=FE38] mjx-beg mjx-c:before{content:"\E152";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c=FE38] mjx-ext mjx-c:before{content:"\E154"}.MJX-TEX mjx-stretchy-h[c=FE38] mjx-end mjx-c:before{content:"\E153";padding:.333em 0 0}.MJX-TEX mjx-stretchy-h[c=FE38] mjx-mid mjx-c:before{content:"\E151\E150";padding:.12em 0 .213em}.MJX-TEX mjx-stretchy-h[c=FE38]>mjx-ext{width:50%}.MJX-TEX mjx-c[c=" "]:before{width:.25em;content:" "}.MJX-TEX mjx-c[c="!"]:before{width:.278em;padding:.716em 0 0;content:"!"}.MJX-TEX mjx-c[c="22"]:before{width:.5em;padding:.694em 0 0;content:"\22"}.MJX-TEX mjx-c[c="#"]:before{width:.833em;padding:.694em 0 .194em;content:"#"}.MJX-TEX mjx-c[c="$"]:before{width:.5em;padding:.75em 0 .056em;content:"$"}.MJX-TEX mjx-c[c="%"]:before{width:.833em;padding:.75em 0 .056em;content:"%"}.MJX-TEX mjx-c[c="&"]:before{width:.778em;padding:.716em 0 .022em;content:"&"}.MJX-TEX mjx-c[c="27"]:before{width:.278em;padding:.694em 0 0;content:"\27"}.MJX-TEX mjx-c[c="("]:before{width:.389em;padding:.75em 0 .25em;content:"("}.MJX-TEX mjx-c[c=")"]:before{width:.389em;padding:.75em 0 .25em;content:")"}.MJX-TEX mjx-c[c="*"]:before{width:.5em;padding:.75em 0 0;content:"*"}.MJX-TEX mjx-c[c="+"]:before{width:.778em;padding:.583em 0 .082em;content:"+"}.MJX-TEX mjx-c[c=","]:before{width:.278em;padding:.121em 0 .194em;content:","}.MJX-TEX mjx-c[c="-"]:before{width:.333em;padding:.252em 0 0;content:"-"}.MJX-TEX mjx-c[c="."]:before{width:.278em;padding:.12em 0 0;content:"."}.MJX-TEX mjx-c[c="/"]:before{width:.5em;padding:.75em 0 .25em;content:"/"}.MJX-TEX mjx-c[c="0"]:before{width:.5em;padding:.666em 0 .022em;content:"0"}.MJX-TEX mjx-c[c="1"]:before{width:.5em;padding:.666em 0 0;content:"1"}.MJX-TEX mjx-c[c="2"]:before{width:.5em;padding:.666em 0 0;content:"2"}.MJX-TEX mjx-c[c="3"]:before{width:.5em;padding:.665em 0 .022em;content:"3"}.MJX-TEX mjx-c[c="4"]:before{width:.5em;padding:.677em 0 0;content:"4"}.MJX-TEX mjx-c[c="5"]:before{width:.5em;padding:.666em 0 .022em;content:"5"}.MJX-TEX mjx-c[c="6"]:before{width:.5em;padding:.666em 0 .022em;content:"6"}.MJX-TEX mjx-c[c="7"]:before{width:.5em;padding:.676em 0 .022em;content:"7"}.MJX-TEX mjx-c[c="8"]:before{width:.5em;padding:.666em 0 .022em;content:"8"}.MJX-TEX mjx-c[c="9"]:before{width:.5em;padding:.666em 0 .022em;content:"9"}.MJX-TEX mjx-c[c=":"]:before{width:.278em;padding:.43em 0 0;content:":"}.MJX-TEX mjx-c[c=";"]:before{width:.278em;padding:.43em 0 .194em;content:";"}.MJX-TEX mjx-c[c="<"]:before{width:.778em;padding:.54em 0 .04em;content:"<"}.MJX-TEX mjx-c[c="="]:before{width:.778em;padding:.583em 0 .082em;content:"="}.MJX-TEX mjx-c[c=">"]:before{width:.778em;padding:.54em 0 .04em;content:">"}.MJX-TEX mjx-c[c="?"]:before{width:.472em;padding:.705em 0 0;content:"?"}.MJX-TEX mjx-c[c="@"]:before{width:.778em;padding:.705em 0 .011em;content:"@"}.MJX-TEX mjx-c[c=A]:before{width:.75em;padding:.716em 0 0;content:"A"}.MJX-TEX mjx-c[c=B]:before{width:.708em;padding:.683em 0 0;content:"B"}.MJX-TEX mjx-c[c=C]:before{width:.722em;padding:.705em 0 .021em;content:"C"}.MJX-TEX mjx-c[c=D]:before{width:.764em;padding:.683em 0 0;content:"D"}.MJX-TEX mjx-c[c=E]:before{width:.681em;padding:.68em 0 0;content:"E"}.MJX-TEX mjx-c[c=F]:before{width:.653em;padding:.68em 0 0;content:"F"}.MJX-TEX mjx-c[c=G]:before{width:.785em;padding:.705em 0 .022em;content:"G"}.MJX-TEX mjx-c[c=H]:before{width:.75em;padding:.683em 0 0;content:"H"}.MJX-TEX mjx-c[c=I]:before{width:.361em;padding:.683em 0 0;content:"I"}.MJX-TEX mjx-c[c=J]:before{width:.514em;padding:.683em 0 .022em;content:"J"}.MJX-TEX mjx-c[c=K]:before{width:.778em;padding:.683em 0 0;content:"K"}.MJX-TEX mjx-c[c=L]:before{width:.625em;padding:.683em 0 0;content:"L"}.MJX-TEX mjx-c[c=M]:before{width:.917em;padding:.683em 0 0;content:"M"}.MJX-TEX mjx-c[c=N]:before{width:.75em;padding:.683em 0 0;content:"N"}.MJX-TEX mjx-c[c=O]:before{width:.778em;padding:.705em 0 .022em;content:"O"}.MJX-TEX mjx-c[c=P]:before{width:.681em;padding:.683em 0 0;content:"P"}.MJX-TEX mjx-c[c=Q]:before{width:.778em;padding:.705em 0 .193em;content:"Q"}.MJX-TEX mjx-c[c=R]:before{width:.736em;padding:.683em 0 .022em;content:"R"}.MJX-TEX mjx-c[c=S]:before{width:.556em;padding:.705em 0 .022em;content:"S"}.MJX-TEX mjx-c[c=T]:before{width:.722em;padding:.677em 0 0;content:"T"}.MJX-TEX mjx-c[c=U]:before{width:.75em;padding:.683em 0 .022em;content:"U"}.MJX-TEX mjx-c[c=V]:before{width:.75em;padding:.683em 0 .022em;content:"V"}.MJX-TEX mjx-c[c=W]:before{width:1.028em;padding:.683em 0 .022em;content:"W"}.MJX-TEX mjx-c[c=X]:before{width:.75em;padding:.683em 0 0;content:"X"}.MJX-TEX mjx-c[c=Y]:before{width:.75em;padding:.683em 0 0;content:"Y"}.MJX-TEX mjx-c[c=Z]:before{width:.611em;padding:.683em 0 0;content:"Z"}.MJX-TEX mjx-c[c="["]:before{width:.278em;padding:.75em 0 .25em;content:"["}.MJX-TEX mjx-c[c="5C"]:before{width:.5em;padding:.75em 0 .25em;content:"\5C"}.MJX-TEX mjx-c[c="]"]:before{width:.278em;padding:.75em 0 .25em;content:"]"}.MJX-TEX mjx-c[c="^"]:before{width:.5em;padding:.694em 0 0;content:"^"}.MJX-TEX mjx-c[c=_]:before{width:.5em;padding:0 0 .062em;content:"_"}.MJX-TEX mjx-c[c="`"]:before{width:.5em;padding:.699em 0 0;content:"`"}.MJX-TEX mjx-c[c=a]:before{width:.5em;padding:.448em 0 .011em;content:"a"}.MJX-TEX mjx-c[c=b]:before{width:.556em;padding:.694em 0 .011em;content:"b"}.MJX-TEX mjx-c[c=c]:before{width:.444em;padding:.448em 0 .011em;content:"c"}.MJX-TEX mjx-c[c=d]:before{width:.556em;padding:.694em 0 .011em;content:"d"}.MJX-TEX mjx-c[c=e]:before{width:.444em;padding:.448em 0 .011em;content:"e"}.MJX-TEX mjx-c[c=f]:before{width:.306em;padding:.705em 0 0;content:"f"}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c=f]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c=f]:last-child:before{width:.372em}.MJX-TEX mjx-c[c=g]:before{width:.5em;padding:.453em 0 .206em;content:"g"}.MJX-TEX mjx-c[c=h]:before{width:.556em;padding:.694em 0 0;content:"h"}.MJX-TEX mjx-c[c=i]:before{width:.278em;padding:.669em 0 0;content:"i"}.MJX-TEX mjx-c[c=j]:before{width:.306em;padding:.669em 0 .205em;content:"j"}.MJX-TEX mjx-c[c=k]:before{width:.528em;padding:.694em 0 0;content:"k"}.MJX-TEX mjx-c[c=l]:before{width:.278em;padding:.694em 0 0;content:"l"}.MJX-TEX mjx-c[c=m]:before{width:.833em;padding:.442em 0 0;content:"m"}.MJX-TEX mjx-c[c=n]:before{width:.556em;padding:.442em 0 0;content:"n"}.MJX-TEX mjx-c[c=o]:before{width:.5em;padding:.448em 0 .01em;content:"o"}.MJX-TEX mjx-c[c=p]:before{width:.556em;padding:.442em 0 .194em;content:"p"}.MJX-TEX mjx-c[c=q]:before{width:.528em;padding:.442em 0 .194em;content:"q"}.MJX-TEX mjx-c[c=r]:before{width:.392em;padding:.442em 0 0;content:"r"}.MJX-TEX mjx-c[c=s]:before{width:.394em;padding:.448em 0 .011em;content:"s"}.MJX-TEX mjx-c[c=t]:before{width:.389em;padding:.615em 0 .01em;content:"t"}.MJX-TEX mjx-c[c=u]:before{width:.556em;padding:.442em 0 .011em;content:"u"}.MJX-TEX mjx-c[c=v]:before{width:.528em;padding:.431em 0 .011em;content:"v"}.MJX-TEX mjx-c[c=w]:before{width:.722em;padding:.431em 0 .011em;content:"w"}.MJX-TEX mjx-c[c=x]:before{width:.528em;padding:.431em 0 0;content:"x"}.MJX-TEX mjx-c[c=y]:before{width:.528em;padding:.431em 0 .204em;content:"y"}.MJX-TEX mjx-c[c=z]:before{width:.444em;padding:.431em 0 0;content:"z"}.MJX-TEX mjx-c[c="{"]:before{width:.5em;padding:.75em 0 .25em;content:"{"}.MJX-TEX mjx-c[c="|"]:before{width:.278em;padding:.75em 0 .249em;content:"|"}.MJX-TEX mjx-c[c="}"]:before{width:.5em;padding:.75em 0 .25em;content:"}"}.MJX-TEX mjx-c[c="~"]:before{width:.5em;padding:.318em 0 0;content:"~"}.MJX-TEX mjx-c[c=A0]:before{width:.25em;content:"\A0"}.MJX-TEX mjx-c[c=A3]:before{width:.769em;padding:.714em 0 .011em;content:"\A3";font-family:MJXZERO,MJXTEX-MI}.MJX-TEX mjx-c[c=A5]:before{width:.75em;padding:.683em 0 0;content:"\A5"}.MJX-TEX mjx-c[c=A8]:before{width:.5em;padding:.669em 0 0;content:"\A8"}.MJX-TEX mjx-c[c=AC]:before{width:.667em;padding:.356em 0 0;content:"\AC"}.MJX-TEX mjx-c[c=AE]:before{width:.947em;padding:.709em 0 .175em;content:"\AE"}.MJX-TEX mjx-c[c=AF]:before{width:.5em;padding:.59em 0 0;content:"\AF"}.MJX-TEX mjx-c[c=B0]:before{width:.5em;padding:.715em 0 0;content:"\B0"}.MJX-TEX mjx-c[c=B1]:before{width:.778em;padding:.666em 0 0;content:"\B1"}.MJX-TEX mjx-c[c=B4]:before{width:.5em;padding:.699em 0 0;content:"\B4"}.MJX-TEX mjx-c[c=B7]:before{width:.278em;padding:.31em 0 0;content:"\22C5"}.MJX-TEX mjx-c[c=D7]:before{width:.778em;padding:.491em 0 0;content:"\D7"}.MJX-TEX mjx-c[c=F0]:before{width:.556em;padding:.749em 0 .021em;content:"\F0"}.MJX-TEX mjx-c[c=F7]:before{width:.778em;padding:.537em 0 .036em;content:"\F7"}.MJX-TEX mjx-c[c="127"]:before{width:.54em;padding:.695em 0 .013em;content:"\127"}.MJX-TEX mjx-c[c="131"]:before{width:.278em;padding:.442em 0 0;content:"\131"}.MJX-TEX mjx-c[c="237"]:before{width:.306em;padding:.442em 0 .205em;content:"\237"}.MJX-TEX mjx-c[c="2B9"]:before{width:.275em;padding:.56em 0 0;content:"\2032"}.MJX-TEX mjx-c[c="2C6"]:before{width:.5em;padding:.694em 0 0;content:"\2C6"}.MJX-TEX mjx-c[c="2C7"]:before{width:.5em;padding:.644em 0 0;content:"\2C7"}.MJX-TEX mjx-c[c="2C9"]:before{width:.5em;padding:.59em 0 0;content:"\2C9"}.MJX-TEX mjx-c[c="2CA"]:before{width:.5em;padding:.699em 0 0;content:"\2CA"}.MJX-TEX mjx-c[c="2CB"]:before{width:.5em;padding:.699em 0 0;content:"\2CB"}.MJX-TEX mjx-c[c="2D8"]:before{width:.5em;padding:.694em 0 0;content:"\2D8"}.MJX-TEX mjx-c[c="2D9"]:before{width:.5em;padding:.669em 0 0;content:"\2D9"}.MJX-TEX mjx-c[c="2DA"]:before{width:.5em;padding:.715em 0 0;content:"\2DA"}.MJX-TEX mjx-c[c="2DC"]:before{width:.5em;padding:.668em 0 0;content:"\2DC"}.MJX-TEX mjx-c[c="300"]:before{width:0;padding:.699em 0 0;content:"\300"}.MJX-TEX mjx-c[c="301"]:before{width:0;padding:.699em 0 0;content:"\301"}.MJX-TEX mjx-c[c="302"]:before{width:0;padding:.694em 0 0;content:"\302"}.MJX-TEX mjx-c[c="303"]:before{width:0;padding:.668em 0 0;content:"\303"}.MJX-TEX mjx-c[c="304"]:before{width:0;padding:.59em 0 0;content:"\304"}.MJX-TEX mjx-c[c="306"]:before{width:0;padding:.694em 0 0;content:"\306"}.MJX-TEX mjx-c[c="307"]:before{width:0;padding:.669em 0 0;content:"\307"}.MJX-TEX mjx-c[c="308"]:before{width:0;padding:.669em 0 0;content:"\308"}.MJX-TEX mjx-c[c="30A"]:before{width:0;padding:.715em 0 0;content:"\30A"}.MJX-TEX mjx-c[c="30B"]:before{width:0;padding:.701em 0 0;content:"\30B"}.MJX-TEX mjx-c[c="30C"]:before{width:0;padding:.644em 0 0;content:"\30C"}.MJX-TEX mjx-c[c="338"]:before{width:0;padding:.716em 0 .215em;content:"\338"}.MJX-TEX mjx-c[c="391"]:before{width:.75em;padding:.716em 0 0;content:"A"}.MJX-TEX mjx-c[c="392"]:before{width:.708em;padding:.683em 0 0;content:"B"}.MJX-TEX mjx-c[c="393"]:before{width:.625em;padding:.68em 0 0;content:"\393"}.MJX-TEX mjx-c[c="394"]:before{width:.833em;padding:.716em 0 0;content:"\394"}.MJX-TEX mjx-c[c="395"]:before{width:.681em;padding:.68em 0 0;content:"E"}.MJX-TEX mjx-c[c="396"]:before{width:.611em;padding:.683em 0 0;content:"Z"}.MJX-TEX mjx-c[c="397"]:before{width:.75em;padding:.683em 0 0;content:"H"}.MJX-TEX mjx-c[c="398"]:before{width:.778em;padding:.705em 0 .022em;content:"\398"}.MJX-TEX mjx-c[c="399"]:before{width:.361em;padding:.683em 0 0;content:"I"}.MJX-TEX mjx-c[c="39A"]:before{width:.778em;padding:.683em 0 0;content:"K"}.MJX-TEX mjx-c[c="39B"]:before{width:.694em;padding:.716em 0 0;content:"\39B"}.MJX-TEX mjx-c[c="39C"]:before{width:.917em;padding:.683em 0 0;content:"M"}.MJX-TEX mjx-c[c="39D"]:before{width:.75em;padding:.683em 0 0;content:"N"}.MJX-TEX mjx-c[c="39E"]:before{width:.667em;padding:.677em 0 0;content:"\39E"}.MJX-TEX mjx-c[c="39F"]:before{width:.778em;padding:.705em 0 .022em;content:"O"}.MJX-TEX mjx-c[c="3A0"]:before{width:.75em;padding:.68em 0 0;content:"\3A0"}.MJX-TEX mjx-c[c="3A1"]:before{width:.681em;padding:.683em 0 0;content:"P"}.MJX-TEX mjx-c[c="3A2"]:before{width:.778em;padding:.705em 0 .022em;content:"\398"}.MJX-TEX mjx-c[c="3A3"]:before{width:.722em;padding:.683em 0 0;content:"\3A3"}.MJX-TEX mjx-c[c="3A4"]:before{width:.722em;padding:.677em 0 0;content:"T"}.MJX-TEX mjx-c[c="3A5"]:before{width:.778em;padding:.705em 0 0;content:"\3A5"}.MJX-TEX mjx-c[c="3A6"]:before{width:.722em;padding:.683em 0 0;content:"\3A6"}.MJX-TEX mjx-c[c="3A7"]:before{width:.75em;padding:.683em 0 0;content:"X"}.MJX-TEX mjx-c[c="3A8"]:before{width:.778em;padding:.683em 0 0;content:"\3A8"}.MJX-TEX mjx-c[c="3A9"]:before{width:.722em;padding:.704em 0 0;content:"\3A9"}.MJX-TEX mjx-c[c="3D2"]:before{width:.778em;padding:.705em 0 0;content:"\3A5"}.MJX-TEX mjx-c[c="3DC"]:before{width:.653em;padding:.68em 0 0;content:"F"}.MJX-TEX mjx-c[c="3DD"]:before{width:.778em;padding:.605em 0 .085em;content:"\3DD"}.MJX-TEX mjx-c[c="3F0"]:before{width:.667em;padding:.434em 0 .006em;content:"\3F0"}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="3F0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="3F0"]:last-child:before{width:.734em}.MJX-TEX mjx-c[c="3F6"]:before{width:.429em;padding:.44em 0 0;content:"\220D"}.MJX-TEX mjx-c[c="2000"]:before{width:.5em;content:"\2000"}.MJX-TEX mjx-c[c="2001"]:before{width:1em;content:"\2001"}.MJX-TEX mjx-c[c="2002"]:before{width:.5em;content:"\2002"}.MJX-TEX mjx-c[c="2003"]:before{width:1em;content:"\2003"}.MJX-TEX mjx-c[c="2004"]:before{width:.333em;content:"\2004"}.MJX-TEX mjx-c[c="2005"]:before{width:.25em;content:"\2005"}.MJX-TEX mjx-c[c="2006"]:before{width:.167em;content:"\2006"}.MJX-TEX mjx-c[c="2009"]:before{width:.167em;content:"\2009"}.MJX-TEX mjx-c[c="200A"]:before{width:.1em;content:"\200A"}.MJX-TEX mjx-c[c="200B"]:before{width:0;content:"\200B"}.MJX-TEX mjx-c[c="200C"]:before{width:0;content:"\200C"}.MJX-TEX mjx-c[c="2013"]:before{width:.5em;padding:.285em 0 0;content:"\2013"}.MJX-TEX mjx-c[c="2014"]:before,.MJX-TEX mjx-c[c="2015"]:before{width:1em;padding:.285em 0 0;content:"\2014"}.MJX-TEX mjx-c[c="2016"]:before{width:.5em;padding:.75em 0 .25em;content:"\2225"}.MJX-TEX mjx-c[c="2017"]:before{width:.5em;padding:0 0 .062em;content:"_"}.MJX-TEX mjx-c[c="2018"]:before{width:.278em;padding:.694em 0 0;content:"\2018"}.MJX-TEX mjx-c[c="2019"]:before{width:.278em;padding:.694em 0 0;content:"\2019"}.MJX-TEX mjx-c[c="201C"]:before{width:.5em;padding:.694em 0 0;content:"\201C"}.MJX-TEX mjx-c[c="201D"]:before{width:.5em;padding:.694em 0 0;content:"\201D"}.MJX-TEX mjx-c[c="2020"]:before{width:.444em;padding:.705em 0 .216em;content:"\2020"}.MJX-TEX mjx-c[c="2021"]:before{width:.444em;padding:.705em 0 .205em;content:"\2021"}.MJX-TEX mjx-c[c="2022"]:before{width:.5em;padding:.444em 0 0;content:"\2219"}.MJX-TEX mjx-c[c="2026"]:before{width:1.172em;padding:.12em 0 0;content:"\2026"}.MJX-TEX mjx-c[c="2032"]:before{width:.275em;padding:.56em 0 0;content:"\2032"}.MJX-TEX mjx-c[c="2033"]:before{width:.55em;padding:.56em 0 0;content:"\2032\2032"}.MJX-TEX mjx-c[c="2034"]:before{width:.825em;padding:.56em 0 0;content:"\2032\2032\2032"}.MJX-TEX mjx-c[c="2035"]:before{width:.275em;padding:.56em 0 0;content:"\2035"}.MJX-TEX mjx-c[c="2036"]:before{width:.55em;padding:.56em 0 0;content:"\2035\2035"}.MJX-TEX mjx-c[c="2037"]:before{width:.825em;padding:.56em 0 0;content:"\2035\2035\2035"}.MJX-TEX mjx-c[c="203E"]:before{width:.5em;padding:.59em 0 0;content:"\2C9"}.MJX-TEX mjx-c[c="2044"]:before{width:.5em;padding:.75em 0 .25em;content:"/"}.MJX-TEX mjx-c[c="2057"]:before{width:1.1em;padding:.56em 0 0;content:"\2032\2032\2032\2032"}.MJX-TEX mjx-c[c="2061"]:before{width:0;content:"\2061"}.MJX-TEX mjx-c[c="2062"]:before{width:0;content:"\2062"}.MJX-TEX mjx-c[c="2063"]:before{width:0;content:"\2063"}.MJX-TEX mjx-c[c="2064"]:before{width:0;content:"\2064"}.MJX-TEX mjx-c[c="20D7"]:before{width:.5em;padding:.714em 0 0;content:"\2192";font-family:MJXZERO,MJXTEX-V}.MJX-TEX mjx-c[c="2102"]:before{width:.722em;padding:.702em 0 .019em;content:"C";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="210B"]:before{width:.969em;padding:.717em 0 .036em;content:"H";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="210B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="210B"]:last-child:before{width:1.241em}.MJX-TEX mjx-c[c="210C"]:before{width:.72em;padding:.666em 0 .133em;content:"H";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="210D"]:before{width:.778em;padding:.683em 0 0;content:"H";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="210E"]:before{width:.576em;padding:.694em 0 .011em;content:"h";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="210F"]:before{width:.54em;padding:.695em 0 .013em;content:"\210F";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="2110"]:before{width:1.052em;padding:.717em 0 .314em;content:"J";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="2110"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="2110"]:last-child:before{width:1.133em}.MJX-TEX mjx-c[c="2111"]:before{width:.554em;padding:.686em 0 .026em;content:"I";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="2112"]:before{width:.874em;padding:.717em 0 .017em;content:"L";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="2112"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="2112"]:last-child:before{width:1.035em}.MJX-TEX mjx-c[c="2113"]:before{width:.417em;padding:.705em 0 .02em;content:"\2113"}.MJX-TEX mjx-c[c="2115"]:before{width:.722em;padding:.683em 0 .02em;content:"N";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="2118"]:before{width:.636em;padding:.453em 0 .216em;content:"\2118"}.MJX-TEX mjx-c[c="2119"]:before{width:.611em;padding:.683em 0 0;content:"P";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="211A"]:before{width:.778em;padding:.701em 0 .181em;content:"Q";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="211B"]:before{width:.85em;padding:.717em 0 .017em;content:"R";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="211C"]:before{width:.828em;padding:.686em 0 .026em;content:"R";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="211D"]:before{width:.722em;padding:.683em 0 0;content:"R";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="2124"]:before{width:.667em;padding:.683em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="2126"]:before{width:.722em;padding:.704em 0 0;content:"\3A9";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="2127"]:before{width:.722em;padding:.684em 0 .022em;content:"\2127"}.MJX-TEX mjx-c[c="2128"]:before{width:.602em;padding:.729em 0 .139em;content:"Z";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="212C"]:before{width:.908em;padding:.708em 0 .028em;content:"B";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="212D"]:before{width:.613em;padding:.685em 0 .024em;content:"C";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="2130"]:before{width:.562em;padding:.707em 0 .008em;content:"E";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="2130"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="2130"]:last-child:before{width:.718em}.MJX-TEX mjx-c[c="2131"]:before{width:.895em;padding:.735em 0 .036em;content:"F";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="2131"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="2131"]:last-child:before{width:.99em}.MJX-TEX mjx-c[c="2132"]:before{width:.556em;padding:.695em 0 0;content:"\2132"}.MJX-TEX mjx-c[c="2133"]:before{width:1.08em;padding:.721em 0 .05em;content:"M";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="2133"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="2133"]:last-child:before{width:1.216em}.MJX-TEX mjx-c[c="2135"]:before{width:.611em;padding:.694em 0 0;content:"\2135"}.MJX-TEX mjx-c[c="2136"]:before{width:.667em;padding:.763em 0 .021em;content:"\2136"}.MJX-TEX mjx-c[c="2137"]:before{width:.444em;padding:.764em 0 .043em;content:"\2137"}.MJX-TEX mjx-c[c="2138"]:before{width:.667em;padding:.764em 0 .043em;content:"\2138"}.MJX-TEX mjx-c[c="2141"]:before{width:.639em;padding:.705em 0 .023em;content:"\2141"}.MJX-TEX mjx-c[c="2190"]:before{width:1em;padding:.511em 0 .011em;content:"\2190"}.MJX-TEX mjx-c[c="2191"]:before{width:.5em;padding:.694em 0 .193em;content:"\2191"}.MJX-TEX mjx-c[c="2192"]:before{width:1em;padding:.511em 0 .011em;content:"\2192"}.MJX-TEX mjx-c[c="2193"]:before{width:.5em;padding:.694em 0 .194em;content:"\2193"}.MJX-TEX mjx-c[c="2194"]:before{width:1em;padding:.511em 0 .011em;content:"\2194"}.MJX-TEX mjx-c[c="2195"]:before{width:.5em;padding:.772em 0 .272em;content:"\2195"}.MJX-TEX mjx-c[c="2196"]:before{width:1em;padding:.72em 0 .195em;content:"\2196"}.MJX-TEX mjx-c[c="2197"]:before{width:1em;padding:.72em 0 .195em;content:"\2197"}.MJX-TEX mjx-c[c="2198"]:before{width:1em;padding:.695em 0 .22em;content:"\2198"}.MJX-TEX mjx-c[c="2199"]:before{width:1em;padding:.695em 0 .22em;content:"\2199"}.MJX-TEX mjx-c[c="219A"]:before{width:1em;padding:.437em 0 0;content:"\219A"}.MJX-TEX mjx-c[c="219B"]:before{width:1em;padding:.437em 0 0;content:"\219B"}.MJX-TEX mjx-c[c="219E"]:before{width:1em;padding:.417em 0 0;content:"\219E"}.MJX-TEX mjx-c[c="21A0"]:before{width:1em;padding:.417em 0 0;content:"\21A0"}.MJX-TEX mjx-c[c="21A2"]:before{width:1.111em;padding:.417em 0 0;content:"\21A2"}.MJX-TEX mjx-c[c="21A3"]:before{width:1.111em;padding:.417em 0 0;content:"\21A3"}.MJX-TEX mjx-c[c="21A6"]:before{width:1em;padding:.511em 0 .011em;content:"\21A6"}.MJX-TEX mjx-c[c="21A9"]:before{width:1.126em;padding:.511em 0 .011em;content:"\21A9"}.MJX-TEX mjx-c[c="21AA"]:before{width:1.126em;padding:.511em 0 .011em;content:"\21AA"}.MJX-TEX mjx-c[c="21AB"]:before{width:1em;padding:.575em 0 .041em;content:"\21AB"}.MJX-TEX mjx-c[c="21AC"]:before{width:1em;padding:.575em 0 .041em;content:"\21AC"}.MJX-TEX mjx-c[c="21AD"]:before{width:1.389em;padding:.417em 0 0;content:"\21AD"}.MJX-TEX mjx-c[c="21AE"]:before{width:1em;padding:.437em 0 0;content:"\21AE"}.MJX-TEX mjx-c[c="21B0"]:before{width:.5em;padding:.722em 0 0;content:"\21B0"}.MJX-TEX mjx-c[c="21B1"]:before{width:.5em;padding:.722em 0 0;content:"\21B1"}.MJX-TEX mjx-c[c="21B6"]:before{width:1em;padding:.461em 0 0;content:"\21B6"}.MJX-TEX mjx-c[c="21B7"]:before{width:1em;padding:.46em 0 0;content:"\21B7"}.MJX-TEX mjx-c[c="21BA"]:before{width:.778em;padding:.65em 0 .083em;content:"\21BA"}.MJX-TEX mjx-c[c="21BB"]:before{width:.778em;padding:.65em 0 .083em;content:"\21BB"}.MJX-TEX mjx-c[c="21BC"]:before{width:1em;padding:.511em 0 0;content:"\21BC"}.MJX-TEX mjx-c[c="21BD"]:before{width:1em;padding:.27em 0 .011em;content:"\21BD"}.MJX-TEX mjx-c[c="21BE"]:before{width:.417em;padding:.694em 0 .194em;content:"\21BE"}.MJX-TEX mjx-c[c="21BF"]:before{width:.417em;padding:.694em 0 .194em;content:"\21BF"}.MJX-TEX mjx-c[c="21C0"]:before{width:1em;padding:.511em 0 0;content:"\21C0"}.MJX-TEX mjx-c[c="21C1"]:before{width:1em;padding:.27em 0 .011em;content:"\21C1"}.MJX-TEX mjx-c[c="21C2"]:before{width:.417em;padding:.694em 0 .194em;content:"\21C2"}.MJX-TEX mjx-c[c="21C3"]:before{width:.417em;padding:.694em 0 .194em;content:"\21C3"}.MJX-TEX mjx-c[c="21C4"]:before{width:1em;padding:.667em 0 0;content:"\21C4"}.MJX-TEX mjx-c[c="21C6"]:before{width:1em;padding:.667em 0 0;content:"\21C6"}.MJX-TEX mjx-c[c="21C7"]:before{width:1em;padding:.583em 0 .083em;content:"\21C7"}.MJX-TEX mjx-c[c="21C8"]:before{width:.833em;padding:.694em 0 .193em;content:"\21C8"}.MJX-TEX mjx-c[c="21C9"]:before{width:1em;padding:.583em 0 .083em;content:"\21C9"}.MJX-TEX mjx-c[c="21CA"]:before{width:.833em;padding:.694em 0 .194em;content:"\21CA"}.MJX-TEX mjx-c[c="21CB"]:before{width:1em;padding:.514em 0 .014em;content:"\21CB"}.MJX-TEX mjx-c[c="21CC"]:before{width:1em;padding:.671em 0 .011em;content:"\21CC"}.MJX-TEX mjx-c[c="21CD"]:before{width:1em;padding:.534em 0 .035em;content:"\21CD"}.MJX-TEX mjx-c[c="21CE"]:before{width:1em;padding:.534em 0 .037em;content:"\21CE"}.MJX-TEX mjx-c[c="21CF"]:before{width:1em;padding:.534em 0 .035em;content:"\21CF"}.MJX-TEX mjx-c[c="21D0"]:before{width:1em;padding:.525em 0 .024em;content:"\21D0"}.MJX-TEX mjx-c[c="21D1"]:before{width:.611em;padding:.694em 0 .194em;content:"\21D1"}.MJX-TEX mjx-c[c="21D2"]:before{width:1em;padding:.525em 0 .024em;content:"\21D2"}.MJX-TEX mjx-c[c="21D3"]:before{width:.611em;padding:.694em 0 .194em;content:"\21D3"}.MJX-TEX mjx-c[c="21D4"]:before{width:1em;padding:.526em 0 .025em;content:"\21D4"}.MJX-TEX mjx-c[c="21D5"]:before{width:.611em;padding:.772em 0 .272em;content:"\21D5"}.MJX-TEX mjx-c[c="21DA"]:before{width:1em;padding:.611em 0 .111em;content:"\21DA"}.MJX-TEX mjx-c[c="21DB"]:before{width:1em;padding:.611em 0 .111em;content:"\21DB"}.MJX-TEX mjx-c[c="21DD"]:before{width:1em;padding:.417em 0 0;content:"\21DD"}.MJX-TEX mjx-c[c="21E0"]:before{width:1.334em;padding:.437em 0 0;content:"\21E0"}.MJX-TEX mjx-c[c="21E2"]:before{width:1.334em;padding:.437em 0 0;content:"\21E2"}.MJX-TEX mjx-c[c="2200"]:before{width:.556em;padding:.694em 0 .022em;content:"\2200"}.MJX-TEX mjx-c[c="2201"]:before{width:.5em;padding:.846em 0 .021em;content:"\2201"}.MJX-TEX mjx-c[c="2202"]:before{width:.531em;padding:.715em 0 .022em;content:"\2202"}.MJX-TEX mjx-c[c="2203"]:before{width:.556em;padding:.694em 0 0;content:"\2203"}.MJX-TEX mjx-c[c="2204"]:before{width:.556em;padding:.716em 0 .215em;content:"\2203\338"}.MJX-TEX mjx-c[c="2205"]:before{width:.5em;padding:.772em 0 .078em;content:"\2205"}.MJX-TEX mjx-c[c="2206"]:before{width:.833em;padding:.716em 0 0;content:"\394"}.MJX-TEX mjx-c[c="2207"]:before{width:.833em;padding:.683em 0 .033em;content:"\2207"}.MJX-TEX mjx-c[c="2208"]:before{width:.667em;padding:.54em 0 .04em;content:"\2208"}.MJX-TEX mjx-c[c="2209"]:before{width:.667em;padding:.716em 0 .215em;content:"\2209"}.MJX-TEX mjx-c[c="220B"]:before{width:.667em;padding:.54em 0 .04em;content:"\220B"}.MJX-TEX mjx-c[c="220C"]:before{width:.667em;padding:.716em 0 .215em;content:"\220B\338"}.MJX-TEX mjx-c[c="220D"]:before{width:.429em;padding:.44em 0 0;content:"\220D"}.MJX-TEX mjx-c[c="220F"]:before{width:.944em;padding:.75em 0 .25em;content:"\220F"}.MJX-TEX mjx-c[c="2210"]:before{width:.944em;padding:.75em 0 .25em;content:"\2210"}.MJX-TEX mjx-c[c="2211"]:before{width:1.056em;padding:.75em 0 .25em;content:"\2211"}.MJX-TEX mjx-c[c="2212"]:before{width:.778em;padding:.583em 0 .082em;content:"\2212"}.MJX-TEX mjx-c[c="2213"]:before{width:.778em;padding:.5em 0 .166em;content:"\2213"}.MJX-TEX mjx-c[c="2214"]:before{width:.778em;padding:.766em 0 .093em;content:"\2214"}.MJX-TEX mjx-c[c="2215"]:before{width:.5em;padding:.75em 0 .25em;content:"\2215"}.MJX-TEX mjx-c[c="2216"]:before{width:.778em;padding:.43em 0 .023em;content:"\2216";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="2217"]:before{width:.5em;padding:.465em 0 0;content:"\2217"}.MJX-TEX mjx-c[c="2218"]:before{width:.5em;padding:.444em 0 0;content:"\2218"}.MJX-TEX mjx-c[c="2219"]:before{width:.5em;padding:.444em 0 0;content:"\2219"}.MJX-TEX mjx-c[c="221A"]:before{width:.833em;padding:.8em 0 .2em;content:"\221A"}.MJX-TEX mjx-c[c="221D"]:before{width:.778em;padding:.442em 0 .011em;content:"\221D"}.MJX-TEX mjx-c[c="221E"]:before{width:1em;padding:.442em 0 .011em;content:"\221E"}.MJX-TEX mjx-c[c="2220"]:before{width:.722em;padding:.694em 0 0;content:"\2220"}.MJX-TEX mjx-c[c="2221"]:before{width:.722em;padding:.714em 0 .02em;content:"\2221"}.MJX-TEX mjx-c[c="2222"]:before{width:.722em;padding:.551em 0 .051em;content:"\2222"}.MJX-TEX mjx-c[c="2223"]:before{width:.278em;padding:.75em 0 .249em;content:"\2223"}.MJX-TEX mjx-c[c="2224"]:before{width:.278em;padding:.75em 0 .252em;content:"\2224"}.MJX-TEX mjx-c[c="2225"]:before{width:.5em;padding:.75em 0 .25em;content:"\2225"}.MJX-TEX mjx-c[c="2226"]:before{width:.5em;padding:.75em 0 .25em;content:"\2226"}.MJX-TEX mjx-c[c="2227"]:before{width:.667em;padding:.598em 0 .022em;content:"\2227"}.MJX-TEX mjx-c[c="2228"]:before{width:.667em;padding:.598em 0 .022em;content:"\2228"}.MJX-TEX mjx-c[c="2229"]:before{width:.667em;padding:.598em 0 .022em;content:"\2229"}.MJX-TEX mjx-c[c="222A"]:before{width:.667em;padding:.598em 0 .022em;content:"\222A"}.MJX-TEX mjx-c[c="222B"]:before{width:.417em;padding:.716em 0 .216em;content:"\222B"}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="222B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="222B"]:last-child:before{width:.472em}.MJX-TEX mjx-c[c="222C"]:before{width:.819em;padding:.805em 0 .306em;content:"\222C"}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="222C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="222C"]:last-child:before{width:.957em}.MJX-TEX mjx-c[c="222D"]:before{width:1.166em;padding:.805em 0 .306em;content:"\222D"}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="222D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="222D"]:last-child:before{width:1.304em}.MJX-TEX mjx-c[c="222E"]:before{width:.472em;padding:.805em 0 .306em;content:"\222E"}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="222E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="222E"]:last-child:before{width:.61em}.MJX-TEX mjx-c[c="2234"]:before{width:.667em;padding:.471em 0 .082em;content:"\2234"}.MJX-TEX mjx-c[c="2235"]:before{width:.667em;padding:.471em 0 .082em;content:"\2235"}.MJX-TEX mjx-c[c="223C"]:before{width:.778em;padding:.367em 0 0;content:"\223C"}.MJX-TEX mjx-c[c="223D"]:before{width:.778em;padding:.367em 0 0;content:"\223D"}.MJX-TEX mjx-c[c="2240"]:before{width:.278em;padding:.583em 0 .083em;content:"\2240"}.MJX-TEX mjx-c[c="2241"]:before{width:.778em;padding:.467em 0 0;content:"\2241"}.MJX-TEX mjx-c[c="2242"]:before{width:.778em;padding:.463em 0 0;content:"\2242"}.MJX-TEX mjx-c[c="2243"]:before{width:.778em;padding:.464em 0 0;content:"\2243"}.MJX-TEX mjx-c[c="2244"]:before{width:.778em;padding:.716em 0 .215em;content:"\2243\338"}.MJX-TEX mjx-c[c="2245"]:before{width:.778em;padding:.589em 0 0;content:"\2245"}.MJX-TEX mjx-c[c="2246"]:before,.MJX-TEX mjx-c[c="2247"]:before{width:.778em;padding:.652em 0 .155em;content:"\2246"}.MJX-TEX mjx-c[c="2248"]:before{width:.778em;padding:.483em 0 0;content:"\2248"}.MJX-TEX mjx-c[c="2249"]:before{width:.778em;padding:.716em 0 .215em;content:"\2248\338"}.MJX-TEX mjx-c[c="224A"]:before{width:.778em;padding:.579em 0 .039em;content:"\224A"}.MJX-TEX mjx-c[c="224D"]:before{width:.778em;padding:.484em 0 0;content:"\224D"}.MJX-TEX mjx-c[c="224E"]:before{width:.778em;padding:.492em 0 0;content:"\224E"}.MJX-TEX mjx-c[c="224F"]:before{width:.778em;padding:.492em 0 0;content:"\224F"}.MJX-TEX mjx-c[c="2250"]:before{width:.778em;padding:.67em 0 0;content:"\2250"}.MJX-TEX mjx-c[c="2251"]:before{width:.778em;padding:.609em 0 .108em;content:"\2251"}.MJX-TEX mjx-c[c="2252"]:before{width:.778em;padding:.601em 0 .101em;content:"\2252"}.MJX-TEX mjx-c[c="2253"]:before{width:.778em;padding:.601em 0 .102em;content:"\2253"}.MJX-TEX mjx-c[c="2256"]:before{width:.778em;padding:.367em 0 0;content:"\2256"}.MJX-TEX mjx-c[c="2257"]:before{width:.778em;padding:.721em 0 0;content:"\2257"}.MJX-TEX mjx-c[c="225C"]:before{width:.778em;padding:.859em 0 0;content:"\225C"}.MJX-TEX mjx-c[c="2260"]:before{width:.778em;padding:.716em 0 .215em;content:"\2260"}.MJX-TEX mjx-c[c="2261"]:before{width:.778em;padding:.464em 0 0;content:"\2261"}.MJX-TEX mjx-c[c="2262"]:before{width:.778em;padding:.716em 0 .215em;content:"\2261\338"}.MJX-TEX mjx-c[c="2264"]:before{width:.778em;padding:.636em 0 .138em;content:"\2264"}.MJX-TEX mjx-c[c="2265"]:before{width:.778em;padding:.636em 0 .138em;content:"\2265"}.MJX-TEX mjx-c[c="2266"]:before{width:.778em;padding:.753em 0 .175em;content:"\2266"}.MJX-TEX mjx-c[c="2267"]:before{width:.778em;padding:.753em 0 .175em;content:"\2267"}.MJX-TEX mjx-c[c="2268"]:before{width:.778em;padding:.752em 0 .286em;content:"\2268"}.MJX-TEX mjx-c[c="2269"]:before{width:.778em;padding:.752em 0 .286em;content:"\2269"}.MJX-TEX mjx-c[c="226A"]:before{width:1em;padding:.568em 0 .067em;content:"\226A"}.MJX-TEX mjx-c[c="226B"]:before{width:1em;padding:.567em 0 .067em;content:"\226B"}.MJX-TEX mjx-c[c="226C"]:before{width:.5em;padding:.75em 0 .25em;content:"\226C"}.MJX-TEX mjx-c[c="226D"]:before{width:.778em;padding:.716em 0 .215em;content:"\224D\338"}.MJX-TEX mjx-c[c="226E"]:before{width:.778em;padding:.708em 0 .209em;content:"\226E"}.MJX-TEX mjx-c[c="226F"]:before{width:.778em;padding:.708em 0 .209em;content:"\226F"}.MJX-TEX mjx-c[c="2270"]:before{width:.778em;padding:.801em 0 .303em;content:"\2270"}.MJX-TEX mjx-c[c="2271"]:before{width:.778em;padding:.801em 0 .303em;content:"\2271"}.MJX-TEX mjx-c[c="2272"]:before{width:.778em;padding:.732em 0 .228em;content:"\2272"}.MJX-TEX mjx-c[c="2273"]:before{width:.778em;padding:.732em 0 .228em;content:"\2273"}.MJX-TEX mjx-c[c="2274"]:before{width:.778em;padding:.732em 0 .228em;content:"\2272\338"}.MJX-TEX mjx-c[c="2275"]:before{width:.778em;padding:.732em 0 .228em;content:"\2273\338"}.MJX-TEX mjx-c[c="2276"]:before{width:.778em;padding:.681em 0 .253em;content:"\2276"}.MJX-TEX mjx-c[c="2277"]:before{width:.778em;padding:.681em 0 .253em;content:"\2277"}.MJX-TEX mjx-c[c="2278"]:before{width:.778em;padding:.716em 0 .253em;content:"\2276\338"}.MJX-TEX mjx-c[c="2279"]:before{width:.778em;padding:.716em 0 .253em;content:"\2277\338"}.MJX-TEX mjx-c[c="227A"]:before{width:.778em;padding:.539em 0 .041em;content:"\227A"}.MJX-TEX mjx-c[c="227B"]:before{width:.778em;padding:.539em 0 .041em;content:"\227B"}.MJX-TEX mjx-c[c="227C"]:before{width:.778em;padding:.58em 0 .153em;content:"\227C"}.MJX-TEX mjx-c[c="227D"]:before{width:.778em;padding:.58em 0 .154em;content:"\227D"}.MJX-TEX mjx-c[c="227E"]:before{width:.778em;padding:.732em 0 .228em;content:"\227E"}.MJX-TEX mjx-c[c="227F"]:before{width:.778em;padding:.732em 0 .228em;content:"\227F"}.MJX-TEX mjx-c[c="2280"]:before{width:.778em;padding:.705em 0 .208em;content:"\2280"}.MJX-TEX mjx-c[c="2281"]:before{width:.778em;padding:.705em 0 .208em;content:"\2281"}.MJX-TEX mjx-c[c="2282"]:before{width:.778em;padding:.54em 0 .04em;content:"\2282"}.MJX-TEX mjx-c[c="2283"]:before{width:.778em;padding:.54em 0 .04em;content:"\2283"}.MJX-TEX mjx-c[c="2284"]:before{width:.778em;padding:.716em 0 .215em;content:"\2282\338"}.MJX-TEX mjx-c[c="2285"]:before{width:.778em;padding:.716em 0 .215em;content:"\2283\338"}.MJX-TEX mjx-c[c="2286"]:before{width:.778em;padding:.636em 0 .138em;content:"\2286"}.MJX-TEX mjx-c[c="2287"]:before{width:.778em;padding:.636em 0 .138em;content:"\2287"}.MJX-TEX mjx-c[c="2288"]:before{width:.778em;padding:.801em 0 .303em;content:"\2288"}.MJX-TEX mjx-c[c="2289"]:before{width:.778em;padding:.801em 0 .303em;content:"\2289"}.MJX-TEX mjx-c[c="228A"]:before{width:.778em;padding:.635em 0 .241em;content:"\228A"}.MJX-TEX mjx-c[c="228B"]:before{width:.778em;padding:.635em 0 .241em;content:"\228B"}.MJX-TEX mjx-c[c="228E"]:before{width:.667em;padding:.598em 0 .022em;content:"\228E"}.MJX-TEX mjx-c[c="228F"]:before{width:.778em;padding:.539em 0 .041em;content:"\228F"}.MJX-TEX mjx-c[c="2290"]:before{width:.778em;padding:.539em 0 .041em;content:"\2290"}.MJX-TEX mjx-c[c="2291"]:before{width:.778em;padding:.636em 0 .138em;content:"\2291"}.MJX-TEX mjx-c[c="2292"]:before{width:.778em;padding:.636em 0 .138em;content:"\2292"}.MJX-TEX mjx-c[c="2293"]:before{width:.667em;padding:.598em 0 0;content:"\2293"}.MJX-TEX mjx-c[c="2294"]:before{width:.667em;padding:.598em 0 0;content:"\2294"}.MJX-TEX mjx-c[c="2295"]:before{width:.778em;padding:.583em 0 .083em;content:"\2295"}.MJX-TEX mjx-c[c="2296"]:before{width:.778em;padding:.583em 0 .083em;content:"\2296"}.MJX-TEX mjx-c[c="2297"]:before{width:.778em;padding:.583em 0 .083em;content:"\2297"}.MJX-TEX mjx-c[c="2298"]:before{width:.778em;padding:.583em 0 .083em;content:"\2298"}.MJX-TEX mjx-c[c="2299"]:before{width:.778em;padding:.583em 0 .083em;content:"\2299"}.MJX-TEX mjx-c[c="229A"]:before{width:.778em;padding:.582em 0 .082em;content:"\229A"}.MJX-TEX mjx-c[c="229B"]:before{width:.778em;padding:.582em 0 .082em;content:"\229B"}.MJX-TEX mjx-c[c="229D"]:before{width:.778em;padding:.582em 0 .082em;content:"\229D"}.MJX-TEX mjx-c[c="229E"]:before{width:.778em;padding:.689em 0 0;content:"\229E"}.MJX-TEX mjx-c[c="229F"]:before{width:.778em;padding:.689em 0 0;content:"\229F"}.MJX-TEX mjx-c[c="22A0"]:before{width:.778em;padding:.689em 0 0;content:"\22A0"}.MJX-TEX mjx-c[c="22A1"]:before{width:.778em;padding:.689em 0 0;content:"\22A1"}.MJX-TEX mjx-c[c="22A2"]:before{width:.611em;padding:.694em 0 0;content:"\22A2"}.MJX-TEX mjx-c[c="22A3"]:before{width:.611em;padding:.694em 0 0;content:"\22A3"}.MJX-TEX mjx-c[c="22A4"]:before{width:.778em;padding:.668em 0 0;content:"\22A4"}.MJX-TEX mjx-c[c="22A5"]:before{width:.778em;padding:.668em 0 0;content:"\22A5"}.MJX-TEX mjx-c[c="22A8"]:before{width:.867em;padding:.75em 0 .249em;content:"\22A8"}.MJX-TEX mjx-c[c="22A9"]:before{width:.722em;padding:.694em 0 0;content:"\22A9"}.MJX-TEX mjx-c[c="22AA"]:before{width:.889em;padding:.694em 0 0;content:"\22AA"}.MJX-TEX mjx-c[c="22AC"]:before{width:.611em;padding:.695em 0 0;content:"\22AC"}.MJX-TEX mjx-c[c="22AD"]:before{width:.611em;padding:.695em 0 0;content:"\22AD"}.MJX-TEX mjx-c[c="22AE"]:before{width:.722em;padding:.695em 0 0;content:"\22AE"}.MJX-TEX mjx-c[c="22AF"]:before{width:.722em;padding:.695em 0 0;content:"\22AF"}.MJX-TEX mjx-c[c="22B2"]:before{width:.778em;padding:.539em 0 .041em;content:"\22B2"}.MJX-TEX mjx-c[c="22B3"]:before{width:.778em;padding:.539em 0 .041em;content:"\22B3"}.MJX-TEX mjx-c[c="22B4"]:before{width:.778em;padding:.636em 0 .138em;content:"\22B4"}.MJX-TEX mjx-c[c="22B5"]:before{width:.778em;padding:.636em 0 .138em;content:"\22B5"}.MJX-TEX mjx-c[c="22B8"]:before{width:1.111em;padding:.408em 0 0;content:"\22B8"}.MJX-TEX mjx-c[c="22BA"]:before{width:.556em;padding:.431em 0 .212em;content:"\22BA"}.MJX-TEX mjx-c[c="22BB"]:before{width:.611em;padding:.716em 0 0;content:"\22BB"}.MJX-TEX mjx-c[c="22BC"]:before{width:.611em;padding:.716em 0 0;content:"\22BC"}.MJX-TEX mjx-c[c="22C0"]:before{width:.833em;padding:.75em 0 .249em;content:"\22C0"}.MJX-TEX mjx-c[c="22C1"]:before{width:.833em;padding:.75em 0 .249em;content:"\22C1"}.MJX-TEX mjx-c[c="22C2"]:before{width:.833em;padding:.75em 0 .249em;content:"\22C2"}.MJX-TEX mjx-c[c="22C3"]:before{width:.833em;padding:.75em 0 .249em;content:"\22C3"}.MJX-TEX mjx-c[c="22C4"]:before{width:.5em;padding:.488em 0 0;content:"\22C4"}.MJX-TEX mjx-c[c="22C5"]:before{width:.278em;padding:.31em 0 0;content:"\22C5"}.MJX-TEX mjx-c[c="22C6"]:before{width:.5em;padding:.486em 0 0;content:"\22C6"}.MJX-TEX mjx-c[c="22C7"]:before{width:.778em;padding:.545em 0 .044em;content:"\22C7"}.MJX-TEX mjx-c[c="22C8"]:before{width:.9em;padding:.505em 0 .005em;content:"\22C8"}.MJX-TEX mjx-c[c="22C9"]:before{width:.778em;padding:.492em 0 0;content:"\22C9"}.MJX-TEX mjx-c[c="22CA"]:before{width:.778em;padding:.492em 0 0;content:"\22CA"}.MJX-TEX mjx-c[c="22CB"]:before{width:.778em;padding:.694em 0 .022em;content:"\22CB"}.MJX-TEX mjx-c[c="22CC"]:before{width:.778em;padding:.694em 0 .022em;content:"\22CC"}.MJX-TEX mjx-c[c="22CD"]:before{width:.778em;padding:.464em 0 0;content:"\22CD"}.MJX-TEX mjx-c[c="22CE"]:before{width:.76em;padding:.578em 0 .021em;content:"\22CE"}.MJX-TEX mjx-c[c="22CF"]:before{width:.76em;padding:.578em 0 .022em;content:"\22CF"}.MJX-TEX mjx-c[c="22D0"]:before{width:.778em;padding:.54em 0 .04em;content:"\22D0"}.MJX-TEX mjx-c[c="22D1"]:before{width:.778em;padding:.54em 0 .04em;content:"\22D1"}.MJX-TEX mjx-c[c="22D2"]:before{width:.667em;padding:.598em 0 .022em;content:"\22D2"}.MJX-TEX mjx-c[c="22D3"]:before{width:.667em;padding:.598em 0 .022em;content:"\22D3"}.MJX-TEX mjx-c[c="22D4"]:before{width:.667em;padding:.736em 0 .022em;content:"\22D4"}.MJX-TEX mjx-c[c="22D6"]:before{width:.778em;padding:.541em 0 .041em;content:"\22D6"}.MJX-TEX mjx-c[c="22D7"]:before{width:.778em;padding:.541em 0 .041em;content:"\22D7"}.MJX-TEX mjx-c[c="22D8"]:before{width:1.333em;padding:.568em 0 .067em;content:"\22D8"}.MJX-TEX mjx-c[c="22D9"]:before{width:1.333em;padding:.568em 0 .067em;content:"\22D9"}.MJX-TEX mjx-c[c="22DA"]:before{width:.778em;padding:.886em 0 .386em;content:"\22DA"}.MJX-TEX mjx-c[c="22DB"]:before{width:.778em;padding:.886em 0 .386em;content:"\22DB"}.MJX-TEX mjx-c[c="22DE"]:before{width:.778em;padding:.734em 0 0;content:"\22DE"}.MJX-TEX mjx-c[c="22DF"]:before{width:.778em;padding:.734em 0 0;content:"\22DF"}.MJX-TEX mjx-c[c="22E0"]:before{width:.778em;padding:.801em 0 .303em;content:"\22E0"}.MJX-TEX mjx-c[c="22E1"]:before{width:.778em;padding:.801em 0 .303em;content:"\22E1"}.MJX-TEX mjx-c[c="22E2"]:before{width:.778em;padding:.716em 0 .215em;content:"\2291\338"}.MJX-TEX mjx-c[c="22E3"]:before{width:.778em;padding:.716em 0 .215em;content:"\2292\338"}.MJX-TEX mjx-c[c="22E6"]:before{width:.778em;padding:.73em 0 .359em;content:"\22E6"}.MJX-TEX mjx-c[c="22E7"]:before{width:.778em;padding:.73em 0 .359em;content:"\22E7"}.MJX-TEX mjx-c[c="22E8"]:before{width:.778em;padding:.73em 0 .359em;content:"\22E8"}.MJX-TEX mjx-c[c="22E9"]:before{width:.778em;padding:.73em 0 .359em;content:"\22E9"}.MJX-TEX mjx-c[c="22EA"]:before{width:.778em;padding:.706em 0 .208em;content:"\22EA"}.MJX-TEX mjx-c[c="22EB"]:before{width:.778em;padding:.706em 0 .208em;content:"\22EB"}.MJX-TEX mjx-c[c="22EC"]:before{width:.778em;padding:.802em 0 .303em;content:"\22EC"}.MJX-TEX mjx-c[c="22ED"]:before{width:.778em;padding:.801em 0 .303em;content:"\22ED"}.MJX-TEX mjx-c[c="22EE"]:before{width:.278em;padding:1.3em 0 .03em;content:"\22EE"}.MJX-TEX mjx-c[c="22EF"]:before{width:1.172em;padding:.31em 0 0;content:"\22EF"}.MJX-TEX mjx-c[c="22F1"]:before{width:1.282em;padding:1.52em 0 0;content:"\22F1"}.MJX-TEX mjx-c[c="2305"]:before{width:.611em;padding:.716em 0 0;content:"\22BC"}.MJX-TEX mjx-c[c="2306"]:before{width:.611em;padding:.813em 0 .097em;content:"\2A5E"}.MJX-TEX mjx-c[c="2308"]:before{width:.444em;padding:.75em 0 .25em;content:"\2308"}.MJX-TEX mjx-c[c="2309"]:before{width:.444em;padding:.75em 0 .25em;content:"\2309"}.MJX-TEX mjx-c[c="230A"]:before{width:.444em;padding:.75em 0 .25em;content:"\230A"}.MJX-TEX mjx-c[c="230B"]:before{width:.444em;padding:.75em 0 .25em;content:"\230B"}.MJX-TEX mjx-c[c="231C"]:before{width:.5em;padding:.694em 0 0;content:"\250C"}.MJX-TEX mjx-c[c="231D"]:before{width:.5em;padding:.694em 0 0;content:"\2510"}.MJX-TEX mjx-c[c="231E"]:before{width:.5em;padding:.366em 0 .022em;content:"\2514"}.MJX-TEX mjx-c[c="231F"]:before{width:.5em;padding:.366em 0 .022em;content:"\2518"}.MJX-TEX mjx-c[c="2322"]:before{width:1em;padding:.388em 0 0;content:"\2322"}.MJX-TEX mjx-c[c="2323"]:before{width:1em;padding:.378em 0 0;content:"\2323"}.MJX-TEX mjx-c[c="2329"]:before{width:.389em;padding:.75em 0 .25em;content:"\27E8"}.MJX-TEX mjx-c[c="232A"]:before{width:.389em;padding:.75em 0 .25em;content:"\27E9"}.MJX-TEX mjx-c[c="23B0"]:before{width:.412em;padding:.744em 0 .244em;content:"\23B0"}.MJX-TEX mjx-c[c="23B1"]:before{width:.412em;padding:.744em 0 .244em;content:"\23B1"}.MJX-TEX mjx-c[c="23D0"]:before{width:.667em;padding:.602em 0 0;content:"\23D0"}.MJX-TEX mjx-c[c="24C8"]:before{width:.902em;padding:.709em 0 .175em;content:"\24C8"}.MJX-TEX mjx-c[c="250C"]:before{width:.5em;padding:.694em 0 0;content:"\250C"}.MJX-TEX mjx-c[c="2510"]:before{width:.5em;padding:.694em 0 0;content:"\2510"}.MJX-TEX mjx-c[c="2514"]:before{width:.5em;padding:.366em 0 .022em;content:"\2514"}.MJX-TEX mjx-c[c="2518"]:before{width:.5em;padding:.366em 0 .022em;content:"\2518"}.MJX-TEX mjx-c[c="2571"]:before{width:.889em;padding:.694em 0 .195em;content:"\2571"}.MJX-TEX mjx-c[c="2572"]:before{width:.889em;padding:.694em 0 .195em;content:"\2572"}.MJX-TEX mjx-c[c="25A0"]:before{width:.778em;padding:.689em 0 0;content:"\25A0"}.MJX-TEX mjx-c[c="25A1"]:before{width:.778em;padding:.689em 0 0;content:"\25A1"}.MJX-TEX mjx-c[c="25AA"]:before{width:.778em;padding:.689em 0 0;content:"\25A0"}.MJX-TEX mjx-c[c="25B2"]:before{width:.722em;padding:.575em 0 .02em;content:"\25B2"}.MJX-TEX mjx-c[c="25B3"]:before{width:.889em;padding:.716em 0 0;content:"\25B3"}.MJX-TEX mjx-c[c="25B4"]:before{width:.722em;padding:.575em 0 .02em;content:"\25B2"}.MJX-TEX mjx-c[c="25B5"]:before{width:.889em;padding:.716em 0 0;content:"\25B3"}.MJX-TEX mjx-c[c="25B6"]:before,.MJX-TEX mjx-c[c="25B8"]:before{width:.778em;padding:.539em 0 .041em;content:"\25B6"}.MJX-TEX mjx-c[c="25B9"]:before{width:.5em;padding:.505em 0 .005em;content:"\25B9"}.MJX-TEX mjx-c[c="25BC"]:before{width:.722em;padding:.576em 0 .019em;content:"\25BC"}.MJX-TEX mjx-c[c="25BD"]:before{width:.889em;padding:.5em 0 .215em;content:"\25BD"}.MJX-TEX mjx-c[c="25BE"]:before{width:.722em;padding:.576em 0 .019em;content:"\25BC"}.MJX-TEX mjx-c[c="25BF"]:before{width:.889em;padding:.5em 0 .215em;content:"\25BD"}.MJX-TEX mjx-c[c="25C0"]:before,.MJX-TEX mjx-c[c="25C2"]:before{width:.778em;padding:.539em 0 .041em;content:"\25C0"}.MJX-TEX mjx-c[c="25C3"]:before{width:.5em;padding:.505em 0 .005em;content:"\25C3"}.MJX-TEX mjx-c[c="25CA"]:before{width:.667em;padding:.716em 0 .132em;content:"\25CA"}.MJX-TEX mjx-c[c="25EF"]:before{width:1em;padding:.715em 0 .215em;content:"\25EF"}.MJX-TEX mjx-c[c="25FB"]:before{width:.778em;padding:.689em 0 0;content:"\25A1"}.MJX-TEX mjx-c[c="25FC"]:before{width:.778em;padding:.689em 0 0;content:"\25A0"}.MJX-TEX mjx-c[c="2605"]:before{width:.944em;padding:.694em 0 .111em;content:"\2605"}.MJX-TEX mjx-c[c="2660"]:before{width:.778em;padding:.727em 0 .13em;content:"\2660"}.MJX-TEX mjx-c[c="2661"]:before{width:.778em;padding:.716em 0 .033em;content:"\2661"}.MJX-TEX mjx-c[c="2662"]:before{width:.778em;padding:.727em 0 .162em;content:"\2662"}.MJX-TEX mjx-c[c="2663"]:before{width:.778em;padding:.726em 0 .13em;content:"\2663"}.MJX-TEX mjx-c[c="266D"]:before{width:.389em;padding:.75em 0 .022em;content:"\266D"}.MJX-TEX mjx-c[c="266E"]:before{width:.389em;padding:.734em 0 .223em;content:"\266E"}.MJX-TEX mjx-c[c="266F"]:before{width:.389em;padding:.723em 0 .223em;content:"\266F"}.MJX-TEX mjx-c[c="2713"]:before{width:.833em;padding:.706em 0 .034em;content:"\2713"}.MJX-TEX mjx-c[c="2720"]:before{width:.833em;padding:.716em 0 .022em;content:"\2720"}.MJX-TEX mjx-c[c="2758"]:before{width:.278em;padding:.75em 0 .249em;content:"\2223"}.MJX-TEX mjx-c[c="27E8"]:before{width:.389em;padding:.75em 0 .25em;content:"\27E8"}.MJX-TEX mjx-c[c="27E9"]:before{width:.389em;padding:.75em 0 .25em;content:"\27E9"}.MJX-TEX mjx-c[c="27EE"]:before{width:.412em;padding:.744em 0 .244em;content:"\27EE"}.MJX-TEX mjx-c[c="27EF"]:before{width:.412em;padding:.744em 0 .244em;content:"\27EF"}.MJX-TEX mjx-c[c="27F5"]:before{width:1.609em;padding:.511em 0 .011em;content:"\27F5"}.MJX-TEX mjx-c[c="27F6"]:before{width:1.638em;padding:.511em 0 .011em;content:"\27F6"}.MJX-TEX mjx-c[c="27F7"]:before{width:1.859em;padding:.511em 0 .011em;content:"\27F7"}.MJX-TEX mjx-c[c="27F8"]:before{width:1.609em;padding:.525em 0 .024em;content:"\27F8"}.MJX-TEX mjx-c[c="27F9"]:before{width:1.638em;padding:.525em 0 .024em;content:"\27F9"}.MJX-TEX mjx-c[c="27FA"]:before{width:1.858em;padding:.525em 0 .024em;content:"\27FA"}.MJX-TEX mjx-c[c="27FC"]:before{width:1.638em;padding:.511em 0 .011em;content:"\27FC"}.MJX-TEX mjx-c[c="29EB"]:before{width:.667em;padding:.716em 0 .132em;content:"\29EB"}.MJX-TEX mjx-c[c="29F8"]:before{width:.778em;padding:.716em 0 .215em;content:"/";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="2A00"]:before{width:1.111em;padding:.75em 0 .25em;content:"\2A00"}.MJX-TEX mjx-c[c="2A01"]:before{width:1.111em;padding:.75em 0 .25em;content:"\2A01"}.MJX-TEX mjx-c[c="2A02"]:before{width:1.111em;padding:.75em 0 .25em;content:"\2A02"}.MJX-TEX mjx-c[c="2A04"]:before{width:.833em;padding:.75em 0 .249em;content:"\2A04"}.MJX-TEX mjx-c[c="2A06"]:before{width:.833em;padding:.75em 0 .249em;content:"\2A06"}.MJX-TEX mjx-c[c="2A0C"]:before{width:1.638em;padding:.805em 0 .306em;content:"\222C\222C"}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="2A0C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="2A0C"]:last-child:before{width:1.776em}.MJX-TEX mjx-c[c="2A2F"]:before{width:.778em;padding:.491em 0 0;content:"\D7"}.MJX-TEX mjx-c[c="2A3F"]:before{width:.75em;padding:.683em 0 0;content:"\2A3F"}.MJX-TEX mjx-c[c="2A5E"]:before{width:.611em;padding:.813em 0 .097em;content:"\2A5E"}.MJX-TEX mjx-c[c="2A7D"]:before{width:.778em;padding:.636em 0 .138em;content:"\2A7D"}.MJX-TEX mjx-c[c="2A7E"]:before{width:.778em;padding:.636em 0 .138em;content:"\2A7E"}.MJX-TEX mjx-c[c="2A85"]:before{width:.778em;padding:.762em 0 .29em;content:"\2A85"}.MJX-TEX mjx-c[c="2A86"]:before{width:.778em;padding:.762em 0 .29em;content:"\2A86"}.MJX-TEX mjx-c[c="2A87"]:before{width:.778em;padding:.635em 0 .241em;content:"\2A87"}.MJX-TEX mjx-c[c="2A88"]:before{width:.778em;padding:.635em 0 .241em;content:"\2A88"}.MJX-TEX mjx-c[c="2A89"]:before{width:.778em;padding:.761em 0 .387em;content:"\2A89"}.MJX-TEX mjx-c[c="2A8A"]:before{width:.778em;padding:.761em 0 .387em;content:"\2A8A"}.MJX-TEX mjx-c[c="2A8B"]:before{width:.778em;padding:1.003em 0 .463em;content:"\2A8B"}.MJX-TEX mjx-c[c="2A8C"]:before{width:.778em;padding:1.003em 0 .463em;content:"\2A8C"}.MJX-TEX mjx-c[c="2A95"]:before{width:.778em;padding:.636em 0 .138em;content:"\2A95"}.MJX-TEX mjx-c[c="2A96"]:before{width:.778em;padding:.636em 0 .138em;content:"\2A96"}.MJX-TEX mjx-c[c="2AAF"]:before{width:.778em;padding:.636em 0 .138em;content:"\2AAF"}.MJX-TEX mjx-c[c="2AB0"]:before{width:.778em;padding:.636em 0 .138em;content:"\2AB0"}.MJX-TEX mjx-c[c="2AB5"]:before{width:.778em;padding:.752em 0 .286em;content:"\2AB5"}.MJX-TEX mjx-c[c="2AB6"]:before{width:.778em;padding:.752em 0 .286em;content:"\2AB6"}.MJX-TEX mjx-c[c="2AB7"]:before{width:.778em;padding:.761em 0 .294em;content:"\2AB7"}.MJX-TEX mjx-c[c="2AB8"]:before{width:.778em;padding:.761em 0 .294em;content:"\2AB8"}.MJX-TEX mjx-c[c="2AB9"]:before{width:.778em;padding:.761em 0 .337em;content:"\2AB9"}.MJX-TEX mjx-c[c="2ABA"]:before{width:.778em;padding:.761em 0 .337em;content:"\2ABA"}.MJX-TEX mjx-c[c="2AC5"]:before{width:.778em;padding:.753em 0 .215em;content:"\2AC5"}.MJX-TEX mjx-c[c="2AC6"]:before{width:.778em;padding:.753em 0 .215em;content:"\2AC6"}.MJX-TEX mjx-c[c="2ACB"]:before{width:.778em;padding:.783em 0 .385em;content:"\2ACB"}.MJX-TEX mjx-c[c="2ACC"]:before{width:.778em;padding:.783em 0 .385em;content:"\2ACC"}.MJX-TEX mjx-c[c="3008"]:before{width:.389em;padding:.75em 0 .25em;content:"\27E8"}.MJX-TEX mjx-c[c="3009"]:before{width:.389em;padding:.75em 0 .25em;content:"\27E9"}.MJX-TEX mjx-c[c=E006]:before{width:.222em;padding:.43em 0 .023em;content:"\E006"}.MJX-TEX mjx-c[c=E007]:before{width:.389em;padding:.431em 0 .024em;content:"\E007"}.MJX-TEX mjx-c[c=E008]:before{width:.778em;padding:.605em 0 .085em;content:"\E008"}.MJX-TEX mjx-c[c=E009]:before{width:.667em;padding:.434em 0 .006em;content:"\E009"}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c=E009]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c=E009]:last-child:before{width:.734em}.MJX-TEX mjx-c[c=E00C]:before{width:.778em;padding:.752em 0 .284em;content:"\E00C"}.MJX-TEX mjx-c[c=E00D]:before{width:.778em;padding:.752em 0 .284em;content:"\E00D"}.MJX-TEX mjx-c[c=E00E]:before{width:.778em;padding:.919em 0 .421em;content:"\E00E"}.MJX-TEX mjx-c[c=E00F]:before{width:.778em;padding:.801em 0 .303em;content:"\E00F"}.MJX-TEX mjx-c[c=E010]:before{width:.778em;padding:.801em 0 .303em;content:"\E010"}.MJX-TEX mjx-c[c=E011]:before{width:.778em;padding:.919em 0 .421em;content:"\E011"}.MJX-TEX mjx-c[c=E016]:before{width:.778em;padding:.828em 0 .33em;content:"\E016"}.MJX-TEX mjx-c[c=E017]:before{width:.778em;padding:.752em 0 .332em;content:"\E017"}.MJX-TEX mjx-c[c=E018]:before{width:.778em;padding:.828em 0 .33em;content:"\E018"}.MJX-TEX mjx-c[c=E019]:before{width:.778em;padding:.752em 0 .333em;content:"\E019"}.MJX-TEX mjx-c[c=E01A]:before{width:.778em;padding:.634em 0 .255em;content:"\E01A"}.MJX-TEX mjx-c[c=E01B]:before{width:.778em;padding:.634em 0 .254em;content:"\E01B"}.MJX-TEX mjx-c[c="1D400"]:before{width:.869em;padding:.698em 0 0;content:"A";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D401"]:before{width:.818em;padding:.686em 0 0;content:"B";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D402"]:before{width:.831em;padding:.697em 0 .011em;content:"C";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D403"]:before{width:.882em;padding:.686em 0 0;content:"D";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D404"]:before{width:.756em;padding:.68em 0 0;content:"E";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D405"]:before{width:.724em;padding:.68em 0 0;content:"F";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D406"]:before{width:.904em;padding:.697em 0 .01em;content:"G";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D407"]:before{width:.9em;padding:.686em 0 0;content:"H";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D408"]:before{width:.436em;padding:.686em 0 0;content:"I";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D409"]:before{width:.594em;padding:.686em 0 .011em;content:"J";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D40A"]:before{width:.901em;padding:.686em 0 0;content:"K";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D40B"]:before{width:.692em;padding:.686em 0 0;content:"L";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D40C"]:before{width:1.092em;padding:.686em 0 0;content:"M";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D40D"]:before{width:.9em;padding:.686em 0 0;content:"N";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D40E"]:before{width:.864em;padding:.696em 0 .01em;content:"O";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D40F"]:before{width:.786em;padding:.686em 0 0;content:"P";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D410"]:before{width:.864em;padding:.696em 0 .193em;content:"Q";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D411"]:before{width:.862em;padding:.686em 0 .011em;content:"R";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D412"]:before{width:.639em;padding:.697em 0 .011em;content:"S";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D413"]:before{width:.8em;padding:.675em 0 0;content:"T";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D414"]:before{width:.885em;padding:.686em 0 .011em;content:"U";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D415"]:before{width:.869em;padding:.686em 0 .007em;content:"V";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D416"]:before{width:1.189em;padding:.686em 0 .007em;content:"W";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D417"]:before{width:.869em;padding:.686em 0 0;content:"X";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D418"]:before{width:.869em;padding:.686em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D419"]:before{width:.703em;padding:.686em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D41A"]:before{width:.559em;padding:.453em 0 .006em;content:"a";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D41B"]:before{width:.639em;padding:.694em 0 .006em;content:"b";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D41C"]:before{width:.511em;padding:.453em 0 .006em;content:"c";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D41D"]:before{width:.639em;padding:.694em 0 .006em;content:"d";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D41E"]:before{width:.527em;padding:.452em 0 .006em;content:"e";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D41F"]:before{width:.351em;padding:.7em 0 0;content:"f";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D41F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D41F"]:last-child:before{width:.452em}.MJX-TEX mjx-c[c="1D420"]:before{width:.575em;padding:.455em 0 .201em;content:"g";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D421"]:before{width:.639em;padding:.694em 0 0;content:"h";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D422"]:before{width:.319em;padding:.695em 0 0;content:"i";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D423"]:before{width:.351em;padding:.695em 0 .2em;content:"j";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D424"]:before{width:.607em;padding:.694em 0 0;content:"k";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D425"]:before{width:.319em;padding:.694em 0 0;content:"l";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D426"]:before{width:.958em;padding:.45em 0 0;content:"m";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D427"]:before{width:.639em;padding:.45em 0 0;content:"n";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D428"]:before{width:.575em;padding:.452em 0 .005em;content:"o";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D429"]:before{width:.639em;padding:.45em 0 .194em;content:"p";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D42A"]:before{width:.607em;padding:.45em 0 .194em;content:"q";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D42B"]:before{width:.474em;padding:.45em 0 0;content:"r";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D42C"]:before{width:.454em;padding:.453em 0 .006em;content:"s";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D42D"]:before{width:.447em;padding:.635em 0 .005em;content:"t";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D42E"]:before{width:.639em;padding:.45em 0 .006em;content:"u";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D42F"]:before{width:.607em;padding:.444em 0 0;content:"v";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D430"]:before{width:.831em;padding:.444em 0 0;content:"w";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D431"]:before{width:.607em;padding:.444em 0 0;content:"x";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D432"]:before{width:.607em;padding:.444em 0 .2em;content:"y";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D433"]:before{width:.511em;padding:.444em 0 0;content:"z";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D434"]:before{width:.75em;padding:.716em 0 0;content:"A";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D435"]:before{width:.759em;padding:.683em 0 0;content:"B";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D436"]:before{width:.715em;padding:.705em 0 .022em;content:"C";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D437"]:before{width:.828em;padding:.683em 0 0;content:"D";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D438"]:before{width:.738em;padding:.68em 0 0;content:"E";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D439"]:before{width:.643em;padding:.68em 0 0;content:"F";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D439"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D439"]:last-child:before{width:.749em}.MJX-TEX mjx-c[c="1D43A"]:before{width:.786em;padding:.705em 0 .022em;content:"G";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D43B"]:before{width:.831em;padding:.683em 0 0;content:"H";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D43B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D43B"]:last-child:before{width:.888em}.MJX-TEX mjx-c[c="1D43C"]:before{width:.44em;padding:.683em 0 0;content:"I";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D43C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D43C"]:last-child:before{width:.504em}.MJX-TEX mjx-c[c="1D43D"]:before{width:.555em;padding:.683em 0 .022em;content:"J";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D43D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D43D"]:last-child:before{width:.633em}.MJX-TEX mjx-c[c="1D43E"]:before{width:.849em;padding:.683em 0 0;content:"K";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D43F"]:before{width:.681em;padding:.683em 0 0;content:"L";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D440"]:before{width:.97em;padding:.683em 0 0;content:"M";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D440"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D440"]:last-child:before{width:1.051em}.MJX-TEX mjx-c[c="1D441"]:before{width:.803em;padding:.683em 0 0;content:"N";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D441"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D441"]:last-child:before{width:.888em}.MJX-TEX mjx-c[c="1D442"]:before{width:.763em;padding:.704em 0 .022em;content:"O";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D443"]:before{width:.642em;padding:.683em 0 0;content:"P";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D443"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D443"]:last-child:before{width:.751em}.MJX-TEX mjx-c[c="1D444"]:before{width:.791em;padding:.704em 0 .194em;content:"Q";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D445"]:before{width:.759em;padding:.683em 0 .021em;content:"R";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D446"]:before{width:.613em;padding:.705em 0 .022em;content:"S";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D447"]:before{width:.584em;padding:.677em 0 0;content:"T";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D447"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D447"]:last-child:before{width:.704em}.MJX-TEX mjx-c[c="1D448"]:before{width:.683em;padding:.683em 0 .022em;content:"U";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D448"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D448"]:last-child:before{width:.767em}.MJX-TEX mjx-c[c="1D449"]:before{width:.583em;padding:.683em 0 .022em;content:"V";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D449"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D449"]:last-child:before{width:.769em}.MJX-TEX mjx-c[c="1D44A"]:before{width:.944em;padding:.683em 0 .022em;content:"W";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D44A"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D44A"]:last-child:before{width:1.048em}.MJX-TEX mjx-c[c="1D44B"]:before{width:.828em;padding:.683em 0 0;content:"X";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D44C"]:before{width:.581em;padding:.683em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D44C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D44C"]:last-child:before{width:.763em}.MJX-TEX mjx-c[c="1D44D"]:before{width:.683em;padding:.683em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D44E"]:before{width:.529em;padding:.441em 0 .01em;content:"a";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D44F"]:before{width:.429em;padding:.694em 0 .011em;content:"b";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D450"]:before{width:.433em;padding:.442em 0 .011em;content:"c";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D451"]:before{width:.52em;padding:.694em 0 .01em;content:"d";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D452"]:before{width:.466em;padding:.442em 0 .011em;content:"e";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D453"]:before{width:.49em;padding:.705em 0 .205em;content:"f";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D453"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D453"]:last-child:before{width:.55em}.MJX-TEX mjx-c[c="1D454"]:before{width:.477em;padding:.442em 0 .205em;content:"g";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D455"]:before{width:.576em;padding:.694em 0 .011em;content:"h";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D456"]:before{width:.345em;padding:.661em 0 .011em;content:"i";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D457"]:before{width:.412em;padding:.661em 0 .204em;content:"j";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D458"]:before{width:.521em;padding:.694em 0 .011em;content:"k";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D459"]:before{width:.298em;padding:.694em 0 .011em;content:"l";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D45A"]:before{width:.878em;padding:.442em 0 .011em;content:"m";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D45B"]:before{width:.6em;padding:.442em 0 .011em;content:"n";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D45C"]:before{width:.485em;padding:.441em 0 .011em;content:"o";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D45D"]:before{width:.503em;padding:.442em 0 .194em;content:"p";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D45E"]:before{width:.446em;padding:.442em 0 .194em;content:"q";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D45F"]:before{width:.451em;padding:.442em 0 .011em;content:"r";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D460"]:before{width:.469em;padding:.442em 0 .01em;content:"s";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D461"]:before{width:.361em;padding:.626em 0 .011em;content:"t";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D462"]:before{width:.572em;padding:.442em 0 .011em;content:"u";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D463"]:before{width:.485em;padding:.443em 0 .011em;content:"v";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D464"]:before{width:.716em;padding:.443em 0 .011em;content:"w";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D465"]:before{width:.572em;padding:.442em 0 .011em;content:"x";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D466"]:before{width:.49em;padding:.442em 0 .205em;content:"y";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D467"]:before{width:.465em;padding:.442em 0 .011em;content:"z";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D468"]:before{width:.869em;padding:.711em 0 0;content:"A";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D469"]:before{width:.866em;padding:.686em 0 0;content:"B";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D46A"]:before{width:.817em;padding:.703em 0 .017em;content:"C";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D46B"]:before{width:.938em;padding:.686em 0 0;content:"D";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D46C"]:before{width:.81em;padding:.68em 0 0;content:"E";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D46D"]:before{width:.689em;padding:.68em 0 0;content:"F";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D46D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D46D"]:last-child:before{width:.809em}.MJX-TEX mjx-c[c="1D46E"]:before{width:.887em;padding:.703em 0 .016em;content:"G";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D46F"]:before{width:.982em;padding:.686em 0 0;content:"H";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D470"]:before{width:.511em;padding:.686em 0 0;content:"I";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D470"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D470"]:last-child:before{width:.573em}.MJX-TEX mjx-c[c="1D471"]:before{width:.631em;padding:.686em 0 .017em;content:"J";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D471"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D471"]:last-child:before{width:.694em}.MJX-TEX mjx-c[c="1D472"]:before{width:.971em;padding:.686em 0 0;content:"K";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D473"]:before{width:.756em;padding:.686em 0 0;content:"L";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D474"]:before{width:1.142em;padding:.686em 0 0;content:"M";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D474"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D474"]:last-child:before{width:1.219em}.MJX-TEX mjx-c[c="1D475"]:before{width:.95em;padding:.686em 0 0;content:"N";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D475"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D475"]:last-child:before{width:1.027em}.MJX-TEX mjx-c[c="1D476"]:before{width:.837em;padding:.703em 0 .017em;content:"O";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D477"]:before{width:.723em;padding:.686em 0 0;content:"P";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D477"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D477"]:last-child:before{width:.847em}.MJX-TEX mjx-c[c="1D478"]:before{width:.869em;padding:.703em 0 .194em;content:"Q";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D479"]:before{width:.872em;padding:.686em 0 .017em;content:"R";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D47A"]:before{width:.693em;padding:.703em 0 .017em;content:"S";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D47B"]:before{width:.637em;padding:.675em 0 0;content:"T";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D47B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D47B"]:last-child:before{width:.772em}.MJX-TEX mjx-c[c="1D47C"]:before{width:.8em;padding:.686em 0 .016em;content:"U";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D47C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D47C"]:last-child:before{width:.877em}.MJX-TEX mjx-c[c="1D47D"]:before{width:.678em;padding:.686em 0 .016em;content:"V";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D47D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D47D"]:last-child:before{width:.886em}.MJX-TEX mjx-c[c="1D47E"]:before{width:1.093em;padding:.686em 0 .017em;content:"W";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D47E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D47E"]:last-child:before{width:1.207em}.MJX-TEX mjx-c[c="1D47F"]:before{width:.947em;padding:.686em 0 0;content:"X";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D480"]:before{width:.675em;padding:.686em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D480"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D480"]:last-child:before{width:.876em}.MJX-TEX mjx-c[c="1D481"]:before{width:.773em;padding:.686em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D482"]:before{width:.633em;padding:.452em 0 .008em;content:"a";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D483"]:before{width:.521em;padding:.694em 0 .008em;content:"b";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D484"]:before{width:.513em;padding:.451em 0 .008em;content:"c";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D485"]:before{width:.61em;padding:.694em 0 .008em;content:"d";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D486"]:before{width:.554em;padding:.452em 0 .008em;content:"e";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D487"]:before{width:.568em;padding:.701em 0 .201em;content:"f";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D487"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D487"]:last-child:before{width:.624em}.MJX-TEX mjx-c[c="1D488"]:before{width:.545em;padding:.452em 0 .202em;content:"g";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D489"]:before{width:.668em;padding:.694em 0 .008em;content:"h";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D48A"]:before{width:.405em;padding:.694em 0 .008em;content:"i";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D48B"]:before{width:.471em;padding:.694em 0 .202em;content:"j";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D48C"]:before{width:.604em;padding:.694em 0 .008em;content:"k";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D48D"]:before{width:.348em;padding:.694em 0 .008em;content:"l";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D48E"]:before{width:1.032em;padding:.452em 0 .008em;content:"m";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D48F"]:before{width:.713em;padding:.452em 0 .008em;content:"n";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D490"]:before{width:.585em;padding:.452em 0 .008em;content:"o";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D491"]:before{width:.601em;padding:.452em 0 .194em;content:"p";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D492"]:before{width:.542em;padding:.452em 0 .194em;content:"q";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D493"]:before{width:.529em;padding:.452em 0 .008em;content:"r";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D494"]:before{width:.531em;padding:.451em 0 .008em;content:"s";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D495"]:before{width:.415em;padding:.643em 0 .007em;content:"t";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D496"]:before{width:.681em;padding:.452em 0 .008em;content:"u";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D497"]:before{width:.567em;padding:.453em 0 .008em;content:"v";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D498"]:before{width:.831em;padding:.453em 0 .008em;content:"w";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D499"]:before{width:.659em;padding:.452em 0 .008em;content:"x";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D49A"]:before{width:.59em;padding:.452em 0 .202em;content:"y";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D49B"]:before{width:.555em;padding:.452em 0 .008em;content:"z";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D49C"]:before{width:.803em;padding:.717em 0 .008em;content:"A";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D49C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D49C"]:last-child:before{width:1.016em}.MJX-TEX mjx-c[c="1D49D"]:before{width:.908em;padding:.708em 0 .028em;content:"B";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="1D49E"]:before{width:.666em;padding:.728em 0 .026em;content:"C";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D49E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D49E"]:last-child:before{width:.819em}.MJX-TEX mjx-c[c="1D49F"]:before{width:.774em;padding:.708em 0 .031em;content:"D";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D49F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D49F"]:last-child:before{width:.855em}.MJX-TEX mjx-c[c="1D4A0"]:before{width:.562em;padding:.707em 0 .008em;content:"E";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A0"]:last-child:before{width:.718em}.MJX-TEX mjx-c[c="1D4A1"]:before{width:.895em;padding:.735em 0 .036em;content:"F";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A1"]:last-child:before{width:.99em}.MJX-TEX mjx-c[c="1D4A2"]:before{width:.61em;padding:.717em 0 .037em;content:"G";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A2"]:last-child:before{width:.738em}.MJX-TEX mjx-c[c="1D4A3"]:before{width:.969em;padding:.717em 0 .036em;content:"H";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A3"]:last-child:before{width:1.241em}.MJX-TEX mjx-c[c="1D4A4"]:before{width:.809em;padding:.717em 0 .017em;content:"I";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A4"]:last-child:before{width:.946em}.MJX-TEX mjx-c[c="1D4A5"]:before{width:1.052em;padding:.717em 0 .314em;content:"J";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A5"]:last-child:before{width:1.133em}.MJX-TEX mjx-c[c="1D4A6"]:before{width:.914em;padding:.717em 0 .037em;content:"K";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A6"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A6"]:last-child:before{width:1.204em}.MJX-TEX mjx-c[c="1D4A7"]:before{width:.874em;padding:.717em 0 .017em;content:"L";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A7"]:last-child:before{width:1.035em}.MJX-TEX mjx-c[c="1D4A8"]:before{width:1.08em;padding:.721em 0 .05em;content:"M";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A8"]:last-child:before{width:1.216em}.MJX-TEX mjx-c[c="1D4A9"]:before{width:.902em;padding:.726em 0 .036em;content:"N";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4A9"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4A9"]:last-child:before{width:1.208em}.MJX-TEX mjx-c[c="1D4AA"]:before{width:.738em;padding:.707em 0 .008em;content:"O";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4AA"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4AA"]:last-child:before{width:.805em}.MJX-TEX mjx-c[c="1D4AB"]:before{width:1.013em;padding:.716em 0 .037em;content:"P";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="1D4AC"]:before{width:.883em;padding:.717em 0 .017em;content:"Q";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="1D4AD"]:before{width:.85em;padding:.717em 0 .017em;content:"R";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="1D4AE"]:before{width:.868em;padding:.708em 0 .036em;content:"S";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4AE"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4AE"]:last-child:before{width:1.016em}.MJX-TEX mjx-c[c="1D4AF"]:before{width:.747em;padding:.735em 0 .037em;content:"T";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4AF"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4AF"]:last-child:before{width:.996em}.MJX-TEX mjx-c[c="1D4B0"]:before{width:.8em;padding:.717em 0 .017em;content:"U";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4B0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4B0"]:last-child:before{width:.96em}.MJX-TEX mjx-c[c="1D4B1"]:before{width:.622em;padding:.717em 0 .017em;content:"V";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4B1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4B1"]:last-child:before{width:.85em}.MJX-TEX mjx-c[c="1D4B2"]:before{width:.805em;padding:.717em 0 .017em;content:"W";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4B2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4B2"]:last-child:before{width:1.026em}.MJX-TEX mjx-c[c="1D4B3"]:before{width:.944em;padding:.717em 0 .017em;content:"X";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4B3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4B3"]:last-child:before{width:1.131em}.MJX-TEX mjx-c[c="1D4B4"]:before{width:.71em;padding:.716em 0 .017em;content:"Y";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4B4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4B4"]:last-child:before{width:.959em}.MJX-TEX mjx-c[c="1D4B5"]:before{width:.821em;padding:.717em 0 .016em;content:"Z";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4B5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4B5"]:last-child:before{width:1.032em}.MJX-TEX mjx-c[c="1D4B6"]:before{width:.529em;padding:.441em 0 .01em;content:"a";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4B7"]:before{width:.429em;padding:.694em 0 .011em;content:"b";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4B8"]:before{width:.433em;padding:.442em 0 .011em;content:"c";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4B9"]:before{width:.52em;padding:.694em 0 .01em;content:"d";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4BA"]:before{width:.466em;padding:.442em 0 .011em;content:"e";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4BB"]:before{width:.49em;padding:.705em 0 .205em;content:"f";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4BB"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4BB"]:last-child:before{width:.55em}.MJX-TEX mjx-c[c="1D4BC"]:before{width:.477em;padding:.442em 0 .205em;content:"g";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4BD"]:before{width:.576em;padding:.694em 0 .011em;content:"h";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4BE"]:before{width:.345em;padding:.661em 0 .011em;content:"i";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4BF"]:before{width:.412em;padding:.661em 0 .204em;content:"j";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C0"]:before{width:.521em;padding:.694em 0 .011em;content:"k";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C1"]:before{width:.298em;padding:.694em 0 .011em;content:"l";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C2"]:before{width:.878em;padding:.442em 0 .011em;content:"m";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C3"]:before{width:.6em;padding:.442em 0 .011em;content:"n";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C4"]:before{width:.485em;padding:.441em 0 .011em;content:"o";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C5"]:before{width:.503em;padding:.442em 0 .194em;content:"p";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C6"]:before{width:.446em;padding:.442em 0 .194em;content:"q";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C7"]:before{width:.451em;padding:.442em 0 .011em;content:"r";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C8"]:before{width:.469em;padding:.442em 0 .01em;content:"s";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4C9"]:before{width:.361em;padding:.626em 0 .011em;content:"t";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4CA"]:before{width:.572em;padding:.442em 0 .011em;content:"u";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4CB"]:before{width:.485em;padding:.443em 0 .011em;content:"v";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4CC"]:before{width:.716em;padding:.443em 0 .011em;content:"w";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4CD"]:before{width:.572em;padding:.442em 0 .011em;content:"x";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4CE"]:before{width:.49em;padding:.442em 0 .205em;content:"y";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4CF"]:before{width:.465em;padding:.442em 0 .011em;content:"z";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D4D0"]:before{width:.803em;padding:.717em 0 .008em;content:"A";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D0"]:last-child:before{width:1.016em}.MJX-TEX mjx-c[c="1D4D1"]:before{width:.908em;padding:.708em 0 .028em;content:"B";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="1D4D2"]:before{width:.666em;padding:.728em 0 .026em;content:"C";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D2"]:last-child:before{width:.819em}.MJX-TEX mjx-c[c="1D4D3"]:before{width:.774em;padding:.708em 0 .031em;content:"D";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D3"]:last-child:before{width:.855em}.MJX-TEX mjx-c[c="1D4D4"]:before{width:.562em;padding:.707em 0 .008em;content:"E";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D4"]:last-child:before{width:.718em}.MJX-TEX mjx-c[c="1D4D5"]:before{width:.895em;padding:.735em 0 .036em;content:"F";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D5"]:last-child:before{width:.99em}.MJX-TEX mjx-c[c="1D4D6"]:before{width:.61em;padding:.717em 0 .037em;content:"G";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D6"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D6"]:last-child:before{width:.738em}.MJX-TEX mjx-c[c="1D4D7"]:before{width:.969em;padding:.717em 0 .036em;content:"H";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D7"]:last-child:before{width:1.241em}.MJX-TEX mjx-c[c="1D4D8"]:before{width:.809em;padding:.717em 0 .017em;content:"I";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D8"]:last-child:before{width:.946em}.MJX-TEX mjx-c[c="1D4D9"]:before{width:1.052em;padding:.717em 0 .314em;content:"J";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4D9"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4D9"]:last-child:before{width:1.133em}.MJX-TEX mjx-c[c="1D4DA"]:before{width:.914em;padding:.717em 0 .037em;content:"K";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4DA"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4DA"]:last-child:before{width:1.204em}.MJX-TEX mjx-c[c="1D4DB"]:before{width:.874em;padding:.717em 0 .017em;content:"L";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4DB"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4DB"]:last-child:before{width:1.035em}.MJX-TEX mjx-c[c="1D4DC"]:before{width:1.08em;padding:.721em 0 .05em;content:"M";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4DC"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4DC"]:last-child:before{width:1.216em}.MJX-TEX mjx-c[c="1D4DD"]:before{width:.902em;padding:.726em 0 .036em;content:"N";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4DD"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4DD"]:last-child:before{width:1.208em}.MJX-TEX mjx-c[c="1D4DE"]:before{width:.738em;padding:.707em 0 .008em;content:"O";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4DE"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4DE"]:last-child:before{width:.805em}.MJX-TEX mjx-c[c="1D4DF"]:before{width:1.013em;padding:.716em 0 .037em;content:"P";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="1D4E0"]:before{width:.883em;padding:.717em 0 .017em;content:"Q";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="1D4E1"]:before{width:.85em;padding:.717em 0 .017em;content:"R";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-c[c="1D4E2"]:before{width:.868em;padding:.708em 0 .036em;content:"S";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4E2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4E2"]:last-child:before{width:1.016em}.MJX-TEX mjx-c[c="1D4E3"]:before{width:.747em;padding:.735em 0 .037em;content:"T";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4E3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4E3"]:last-child:before{width:.996em}.MJX-TEX mjx-c[c="1D4E4"]:before{width:.8em;padding:.717em 0 .017em;content:"U";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4E4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4E4"]:last-child:before{width:.96em}.MJX-TEX mjx-c[c="1D4E5"]:before{width:.622em;padding:.717em 0 .017em;content:"V";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4E5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4E5"]:last-child:before{width:.85em}.MJX-TEX mjx-c[c="1D4E6"]:before{width:.805em;padding:.717em 0 .017em;content:"W";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4E6"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4E6"]:last-child:before{width:1.026em}.MJX-TEX mjx-c[c="1D4E7"]:before{width:.944em;padding:.717em 0 .017em;content:"X";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4E7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4E7"]:last-child:before{width:1.131em}.MJX-TEX mjx-c[c="1D4E8"]:before{width:.71em;padding:.716em 0 .017em;content:"Y";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4E8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4E8"]:last-child:before{width:.959em}.MJX-TEX mjx-c[c="1D4E9"]:before{width:.821em;padding:.717em 0 .016em;content:"Z";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4E9"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4E9"]:last-child:before{width:1.032em}.MJX-TEX mjx-c[c="1D4EA"]:before{width:.633em;padding:.452em 0 .008em;content:"a";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4EB"]:before{width:.521em;padding:.694em 0 .008em;content:"b";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4EC"]:before{width:.513em;padding:.451em 0 .008em;content:"c";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4ED"]:before{width:.61em;padding:.694em 0 .008em;content:"d";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4EE"]:before{width:.554em;padding:.452em 0 .008em;content:"e";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4EF"]:before{width:.568em;padding:.701em 0 .201em;content:"f";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D4EF"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D4EF"]:last-child:before{width:.624em}.MJX-TEX mjx-c[c="1D4F0"]:before{width:.545em;padding:.452em 0 .202em;content:"g";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F1"]:before{width:.668em;padding:.694em 0 .008em;content:"h";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F2"]:before{width:.405em;padding:.694em 0 .008em;content:"i";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F3"]:before{width:.471em;padding:.694em 0 .202em;content:"j";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F4"]:before{width:.604em;padding:.694em 0 .008em;content:"k";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F5"]:before{width:.348em;padding:.694em 0 .008em;content:"l";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F6"]:before{width:1.032em;padding:.452em 0 .008em;content:"m";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F7"]:before{width:.713em;padding:.452em 0 .008em;content:"n";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F8"]:before{width:.585em;padding:.452em 0 .008em;content:"o";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4F9"]:before{width:.601em;padding:.452em 0 .194em;content:"p";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4FA"]:before{width:.542em;padding:.452em 0 .194em;content:"q";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4FB"]:before{width:.529em;padding:.452em 0 .008em;content:"r";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4FC"]:before{width:.531em;padding:.451em 0 .008em;content:"s";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4FD"]:before{width:.415em;padding:.643em 0 .007em;content:"t";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4FE"]:before{width:.681em;padding:.452em 0 .008em;content:"u";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D4FF"]:before{width:.567em;padding:.453em 0 .008em;content:"v";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D500"]:before{width:.831em;padding:.453em 0 .008em;content:"w";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D501"]:before{width:.659em;padding:.452em 0 .008em;content:"x";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D502"]:before{width:.59em;padding:.452em 0 .202em;content:"y";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D503"]:before{width:.555em;padding:.452em 0 .008em;content:"z";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D504"]:before{width:.718em;padding:.696em 0 .026em;content:"A";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D505"]:before{width:.884em;padding:.691em 0 .027em;content:"B";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D506"]:before{width:.613em;padding:.685em 0 .024em;content:"C";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D507"]:before{width:.832em;padding:.685em 0 .027em;content:"D";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D508"]:before{width:.663em;padding:.685em 0 .024em;content:"E";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D509"]:before{width:.611em;padding:.686em 0 .153em;content:"F";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D50A"]:before{width:.785em;padding:.69em 0 .026em;content:"G";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D50B"]:before{width:.72em;padding:.666em 0 .133em;content:"H";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D50C"]:before{width:.554em;padding:.686em 0 .026em;content:"I";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D50D"]:before{width:.552em;padding:.686em 0 .139em;content:"J";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D50E"]:before{width:.668em;padding:.68em 0 .027em;content:"K";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D50F"]:before{width:.666em;padding:.686em 0 .026em;content:"L";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D510"]:before{width:1.05em;padding:.692em 0 .027em;content:"M";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D511"]:before{width:.832em;padding:.686em 0 .025em;content:"N";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D512"]:before{width:.827em;padding:.729em 0 .027em;content:"O";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D513"]:before{width:.828em;padding:.692em 0 .218em;content:"P";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D514"]:before{width:.827em;padding:.729em 0 .069em;content:"Q";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D515"]:before{width:.828em;padding:.686em 0 .026em;content:"R";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D516"]:before{width:.829em;padding:.692em 0 .027em;content:"S";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D517"]:before{width:.669em;padding:.701em 0 .027em;content:"T";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D518"]:before{width:.646em;padding:.697em 0 .027em;content:"U";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D519"]:before{width:.831em;padding:.686em 0 .026em;content:"V";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D51A"]:before{width:1.046em;padding:.686em 0 .027em;content:"W";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D51B"]:before{width:.719em;padding:.688em 0 .027em;content:"X";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D51C"]:before{width:.833em;padding:.686em 0 .218em;content:"Y";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D51D"]:before{width:.602em;padding:.729em 0 .139em;content:"Z";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D51E"]:before{width:.5em;padding:.47em 0 .035em;content:"a";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D51F"]:before{width:.513em;padding:.685em 0 .031em;content:"b";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D520"]:before{width:.389em;padding:.466em 0 .029em;content:"c";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D521"]:before{width:.499em;padding:.609em 0 .033em;content:"d";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D522"]:before{width:.401em;padding:.467em 0 .03em;content:"e";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D523"]:before{width:.326em;padding:.681em 0 .221em;content:"f";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D524"]:before{width:.504em;padding:.47em 0 .209em;content:"g";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D525"]:before{width:.521em;padding:.688em 0 .205em;content:"h";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D526"]:before{width:.279em;padding:.673em 0 .02em;content:"i";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D527"]:before{width:.281em;padding:.672em 0 .208em;content:"j";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D528"]:before{width:.389em;padding:.689em 0 .025em;content:"k";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D529"]:before{width:.28em;padding:.685em 0 .02em;content:"l";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D52A"]:before{width:.767em;padding:.475em 0 .026em;content:"m";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D52B"]:before{width:.527em;padding:.475em 0 .022em;content:"n";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D52C"]:before{width:.489em;padding:.48em 0 .028em;content:"o";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D52D"]:before{width:.5em;padding:.541em 0 .212em;content:"p";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D52E"]:before{width:.489em;padding:.479em 0 .219em;content:"q";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D52F"]:before{width:.389em;padding:.474em 0 .021em;content:"r";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D530"]:before{width:.443em;padding:.478em 0 .029em;content:"s";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D531"]:before{width:.333em;padding:.64em 0 .02em;content:"t";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D532"]:before{width:.517em;padding:.474em 0 .023em;content:"u";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D533"]:before{width:.512em;padding:.53em 0 .028em;content:"v";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D534"]:before{width:.774em;padding:.532em 0 .028em;content:"w";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D535"]:before{width:.389em;padding:.472em 0 .188em;content:"x";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D536"]:before{width:.499em;padding:.528em 0 .218em;content:"y";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D537"]:before{width:.391em;padding:.471em 0 .214em;content:"z";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX mjx-c[c="1D538"]:before{width:.722em;padding:.701em 0 0;content:"A";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D539"]:before{width:.667em;padding:.683em 0 0;content:"B";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D53A"]:before{width:.722em;padding:.702em 0 .019em;content:"C";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D53B"]:before{width:.722em;padding:.683em 0 0;content:"D";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D53C"]:before{width:.667em;padding:.683em 0 0;content:"E";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D53D"]:before{width:.611em;padding:.683em 0 0;content:"F";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D53E"]:before{width:.778em;padding:.702em 0 .019em;content:"G";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D53F"]:before{width:.778em;padding:.683em 0 0;content:"H";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D540"]:before{width:.389em;padding:.683em 0 0;content:"I";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D541"]:before{width:.5em;padding:.683em 0 .077em;content:"J";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D542"]:before{width:.778em;padding:.683em 0 0;content:"K";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D543"]:before{width:.667em;padding:.683em 0 0;content:"L";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D544"]:before{width:.944em;padding:.683em 0 0;content:"M";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D545"]:before{width:.722em;padding:.683em 0 .02em;content:"N";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D546"]:before{width:.778em;padding:.701em 0 .019em;content:"O";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D547"]:before{width:.611em;padding:.683em 0 0;content:"P";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D548"]:before{width:.778em;padding:.701em 0 .181em;content:"Q";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D549"]:before{width:.722em;padding:.683em 0 0;content:"R";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D54A"]:before{width:.556em;padding:.702em 0 .012em;content:"S";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D54B"]:before{width:.667em;padding:.683em 0 0;content:"T";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D54C"]:before{width:.722em;padding:.683em 0 .019em;content:"U";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D54D"]:before{width:.722em;padding:.683em 0 .02em;content:"V";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D54E"]:before{width:1em;padding:.683em 0 .019em;content:"W";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D54F"]:before{width:.722em;padding:.683em 0 0;content:"X";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D550"]:before{width:.722em;padding:.683em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D551"]:before{width:.667em;padding:.683em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D552"]:before{width:.559em;padding:.453em 0 .006em;content:"a";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D553"]:before{width:.639em;padding:.694em 0 .006em;content:"b";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D554"]:before{width:.511em;padding:.453em 0 .006em;content:"c";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D555"]:before{width:.639em;padding:.694em 0 .006em;content:"d";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D556"]:before{width:.527em;padding:.452em 0 .006em;content:"e";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D557"]:before{width:.351em;padding:.7em 0 0;content:"f";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D557"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D557"]:last-child:before{width:.452em}.MJX-TEX mjx-c[c="1D558"]:before{width:.575em;padding:.455em 0 .201em;content:"g";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D559"]:before{width:.639em;padding:.694em 0 0;content:"h";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D55A"]:before{width:.319em;padding:.695em 0 0;content:"i";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D55B"]:before{width:.351em;padding:.695em 0 .2em;content:"j";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D55C"]:before{width:.556em;padding:.683em 0 0;content:"k";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D55D"]:before{width:.319em;padding:.694em 0 0;content:"l";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D55E"]:before{width:.958em;padding:.45em 0 0;content:"m";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D55F"]:before{width:.639em;padding:.45em 0 0;content:"n";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D560"]:before{width:.575em;padding:.452em 0 .005em;content:"o";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D561"]:before{width:.639em;padding:.45em 0 .194em;content:"p";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D562"]:before{width:.607em;padding:.45em 0 .194em;content:"q";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D563"]:before{width:.474em;padding:.45em 0 0;content:"r";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D564"]:before{width:.454em;padding:.453em 0 .006em;content:"s";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D565"]:before{width:.447em;padding:.635em 0 .005em;content:"t";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D566"]:before{width:.639em;padding:.45em 0 .006em;content:"u";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D567"]:before{width:.607em;padding:.444em 0 0;content:"v";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D568"]:before{width:.831em;padding:.444em 0 0;content:"w";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D569"]:before{width:.607em;padding:.444em 0 0;content:"x";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D56A"]:before{width:.607em;padding:.444em 0 .2em;content:"y";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D56B"]:before{width:.511em;padding:.444em 0 0;content:"z";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D56C"]:before{width:.847em;padding:.686em 0 .031em;content:"A";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D56D"]:before{width:1.044em;padding:.684em 0 .031em;content:"B";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D56E"]:before{width:.723em;padding:.676em 0 .032em;content:"C";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D56F"]:before{width:.982em;padding:.683em 0 .029em;content:"D";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D570"]:before{width:.783em;padding:.686em 0 .029em;content:"E";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D571"]:before{width:.722em;padding:.684em 0 .146em;content:"F";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D572"]:before{width:.927em;padding:.687em 0 .029em;content:"G";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D573"]:before{width:.851em;padding:.683em 0 .126em;content:"H";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D574"]:before{width:.655em;padding:.681em 0 .025em;content:"I";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D575"]:before{width:.652em;padding:.68em 0 .141em;content:"J";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D576"]:before{width:.789em;padding:.681em 0 .026em;content:"K";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D577"]:before{width:.786em;padding:.683em 0 .028em;content:"L";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D578"]:before{width:1.239em;padding:.683em 0 .032em;content:"M";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D579"]:before{width:.983em;padding:.679em 0 .03em;content:"N";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D57A"]:before{width:.976em;padding:.726em 0 .03em;content:"O";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D57B"]:before{width:.977em;padding:.688em 0 .223em;content:"P";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D57C"]:before{width:.976em;padding:.726em 0 .083em;content:"Q";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D57D"]:before{width:.978em;padding:.688em 0 .028em;content:"R";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D57E"]:before{width:.978em;padding:.685em 0 .031em;content:"S";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D57F"]:before{width:.79em;padding:.686em 0 .03em;content:"T";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D580"]:before{width:.851em;padding:.688em 0 .039em;content:"U";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D581"]:before{width:.982em;padding:.685em 0 .029em;content:"V";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D582"]:before{width:1.235em;padding:.683em 0 .03em;content:"W";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D583"]:before{width:.849em;padding:.681em 0 .035em;content:"X";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D584"]:before{width:.984em;padding:.688em 0 .214em;content:"Y";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D585"]:before{width:.711em;padding:.677em 0 .148em;content:"Z";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D586"]:before{width:.603em;padding:.472em 0 .032em;content:"a";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D587"]:before{width:.59em;padding:.69em 0 .032em;content:"b";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D588"]:before{width:.464em;padding:.473em 0 .026em;content:"c";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D589"]:before{width:.589em;padding:.632em 0 .028em;content:"d";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D58A"]:before{width:.472em;padding:.471em 0 .027em;content:"e";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D58B"]:before{width:.388em;padding:.687em 0 .222em;content:"f";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D58C"]:before{width:.595em;padding:.472em 0 .208em;content:"g";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D58D"]:before{width:.615em;padding:.687em 0 .207em;content:"h";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D58E"]:before{width:.331em;padding:.686em 0 .025em;content:"i";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D58F"]:before{width:.332em;padding:.682em 0 .203em;content:"j";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D590"]:before{width:.464em;padding:.682em 0 .025em;content:"k";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D591"]:before{width:.337em;padding:.681em 0 .024em;content:"l";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D592"]:before{width:.921em;padding:.476em 0 .031em;content:"m";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D593"]:before{width:.654em;padding:.473em 0 .028em;content:"n";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D594"]:before{width:.609em;padding:.482em 0 .034em;content:"o";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D595"]:before{width:.604em;padding:.557em 0 .207em;content:"p";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D596"]:before{width:.596em;padding:.485em 0 .211em;content:"q";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D597"]:before{width:.46em;padding:.472em 0 .026em;content:"r";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D598"]:before{width:.523em;padding:.479em 0 .034em;content:"s";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D599"]:before{width:.393em;padding:.648em 0 .027em;content:"t";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D59A"]:before{width:.589em;padding:.472em 0 .032em;content:"u";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D59B"]:before{width:.604em;padding:.546em 0 .027em;content:"v";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D59C"]:before{width:.918em;padding:.549em 0 .032em;content:"w";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D59D"]:before{width:.459em;padding:.471em 0 .188em;content:"x";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D59E"]:before{width:.589em;padding:.557em 0 .221em;content:"y";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D59F"]:before{width:.461em;padding:.471em 0 .214em;content:"z";font-family:MJXZERO,MJXTEX-FR-B}.MJX-TEX mjx-c[c="1D5A0"]:before{width:.667em;padding:.694em 0 0;content:"A";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A1"]:before{width:.667em;padding:.694em 0 0;content:"B";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A2"]:before{width:.639em;padding:.705em 0 .011em;content:"C";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A3"]:before{width:.722em;padding:.694em 0 0;content:"D";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A4"]:before{width:.597em;padding:.691em 0 0;content:"E";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A5"]:before{width:.569em;padding:.691em 0 0;content:"F";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A6"]:before{width:.667em;padding:.704em 0 .011em;content:"G";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A7"]:before{width:.708em;padding:.694em 0 0;content:"H";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A8"]:before{width:.278em;padding:.694em 0 0;content:"I";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5A9"]:before{width:.472em;padding:.694em 0 .022em;content:"J";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5AA"]:before{width:.694em;padding:.694em 0 0;content:"K";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5AB"]:before{width:.542em;padding:.694em 0 0;content:"L";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5AC"]:before{width:.875em;padding:.694em 0 0;content:"M";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5AD"]:before{width:.708em;padding:.694em 0 0;content:"N";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5AE"]:before{width:.736em;padding:.715em 0 .022em;content:"O";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5AF"]:before{width:.639em;padding:.694em 0 0;content:"P";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B0"]:before{width:.736em;padding:.715em 0 .125em;content:"Q";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B1"]:before{width:.646em;padding:.694em 0 0;content:"R";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B2"]:before{width:.556em;padding:.716em 0 .022em;content:"S";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B3"]:before{width:.681em;padding:.688em 0 0;content:"T";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B4"]:before{width:.688em;padding:.694em 0 .022em;content:"U";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B5"]:before{width:.667em;padding:.694em 0 0;content:"V";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B6"]:before{width:.944em;padding:.694em 0 0;content:"W";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B7"]:before{width:.667em;padding:.694em 0 0;content:"X";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B8"]:before{width:.667em;padding:.694em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5B9"]:before{width:.611em;padding:.694em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5BA"]:before{width:.481em;padding:.46em 0 .01em;content:"a";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5BB"]:before{width:.517em;padding:.694em 0 .011em;content:"b";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5BC"]:before{width:.444em;padding:.46em 0 .01em;content:"c";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5BD"]:before{width:.517em;padding:.694em 0 .01em;content:"d";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5BE"]:before{width:.444em;padding:.461em 0 .01em;content:"e";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5BF"]:before{width:.306em;padding:.705em 0 0;content:"f";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C0"]:before{width:.5em;padding:.455em 0 .206em;content:"g";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C1"]:before{width:.517em;padding:.694em 0 0;content:"h";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C2"]:before{width:.239em;padding:.68em 0 0;content:"i";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C3"]:before{width:.267em;padding:.68em 0 .205em;content:"j";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C4"]:before{width:.489em;padding:.694em 0 0;content:"k";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C5"]:before{width:.239em;padding:.694em 0 0;content:"l";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C6"]:before{width:.794em;padding:.455em 0 0;content:"m";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C7"]:before{width:.517em;padding:.455em 0 0;content:"n";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C8"]:before{width:.5em;padding:.46em 0 .01em;content:"o";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5C9"]:before{content:"p"}.MJX-TEX mjx-c[c="1D5C9"]:before,.MJX-TEX mjx-c[c="1D5CA"]:before{width:.517em;padding:.455em 0 .194em;font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5CA"]:before{content:"q"}.MJX-TEX mjx-c[c="1D5CB"]:before{width:.342em;padding:.455em 0 0;content:"r";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5CC"]:before{width:.383em;padding:.46em 0 .01em;content:"s";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5CD"]:before{width:.361em;padding:.571em 0 .01em;content:"t";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5CE"]:before{width:.517em;padding:.444em 0 .01em;content:"u";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5CF"]:before{width:.461em;padding:.444em 0 0;content:"v";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5D0"]:before{width:.683em;padding:.444em 0 0;content:"w";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5D1"]:before{width:.461em;padding:.444em 0 0;content:"x";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5D2"]:before{width:.461em;padding:.444em 0 .204em;content:"y";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5D3"]:before{width:.435em;padding:.444em 0 0;content:"z";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D5D4"]:before{width:.733em;padding:.694em 0 0;content:"A";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5D5"]:before{width:.733em;padding:.694em 0 0;content:"B";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5D6"]:before{width:.703em;padding:.704em 0 .011em;content:"C";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5D7"]:before{width:.794em;padding:.694em 0 0;content:"D";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5D8"]:before{width:.642em;padding:.691em 0 0;content:"E";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5D9"]:before{width:.611em;padding:.691em 0 0;content:"F";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5DA"]:before{width:.733em;padding:.705em 0 .011em;content:"G";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5DB"]:before{width:.794em;padding:.694em 0 0;content:"H";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5DC"]:before{width:.331em;padding:.694em 0 0;content:"I";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5DD"]:before{width:.519em;padding:.694em 0 .022em;content:"J";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5DE"]:before{width:.764em;padding:.694em 0 0;content:"K";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5DF"]:before{width:.581em;padding:.694em 0 0;content:"L";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E0"]:before{width:.978em;padding:.694em 0 0;content:"M";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E1"]:before{width:.794em;padding:.694em 0 0;content:"N";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E2"]:before{width:.794em;padding:.716em 0 .022em;content:"O";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E3"]:before{width:.703em;padding:.694em 0 0;content:"P";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E4"]:before{width:.794em;padding:.716em 0 .106em;content:"Q";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E5"]:before{width:.703em;padding:.694em 0 0;content:"R";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E6"]:before{width:.611em;padding:.716em 0 .022em;content:"S";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E7"]:before{width:.733em;padding:.688em 0 0;content:"T";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E8"]:before{width:.764em;padding:.694em 0 .022em;content:"U";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5E9"]:before{width:.733em;padding:.694em 0 0;content:"V";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5EA"]:before{width:1.039em;padding:.694em 0 0;content:"W";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5EB"]:before{width:.733em;padding:.694em 0 0;content:"X";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5EC"]:before{width:.733em;padding:.694em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5ED"]:before{width:.672em;padding:.694em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5EE"]:before{width:.525em;padding:.475em 0 .011em;content:"a";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5EF"]:before{width:.561em;padding:.694em 0 .01em;content:"b";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F0"]:before{width:.489em;padding:.475em 0 .011em;content:"c";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F1"]:before{width:.561em;padding:.694em 0 .011em;content:"d";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F2"]:before{width:.511em;padding:.474em 0 .01em;content:"e";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F3"]:before{width:.336em;padding:.705em 0 0;content:"f";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F4"]:before{width:.55em;padding:.469em 0 .206em;content:"g";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F5"]:before{width:.561em;padding:.694em 0 0;content:"h";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F6"]:before{width:.256em;padding:.695em 0 0;content:"i";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F7"]:before{width:.286em;padding:.695em 0 .205em;content:"j";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F8"]:before{width:.531em;padding:.694em 0 0;content:"k";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5F9"]:before{width:.256em;padding:.694em 0 0;content:"l";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5FA"]:before{width:.867em;padding:.469em 0 0;content:"m";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5FB"]:before{width:.561em;padding:.468em 0 0;content:"n";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5FC"]:before{width:.55em;padding:.474em 0 .011em;content:"o";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5FD"]:before{content:"p"}.MJX-TEX mjx-c[c="1D5FD"]:before,.MJX-TEX mjx-c[c="1D5FE"]:before{width:.561em;padding:.469em 0 .194em;font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D5FE"]:before{content:"q"}.MJX-TEX mjx-c[c="1D5FF"]:before{width:.372em;padding:.469em 0 0;content:"r";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D600"]:before{width:.422em;padding:.474em 0 .01em;content:"s";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D601"]:before{width:.404em;padding:.589em 0 .01em;content:"t";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D602"]:before{width:.561em;padding:.458em 0 .011em;content:"u";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D603"]:before{width:.5em;padding:.458em 0 0;content:"v";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D604"]:before{width:.744em;padding:.458em 0 0;content:"w";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D605"]:before{width:.5em;padding:.458em 0 0;content:"x";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D606"]:before{width:.5em;padding:.458em 0 .205em;content:"y";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D607"]:before{width:.476em;padding:.458em 0 0;content:"z";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D608"]:before{width:.667em;padding:.694em 0 0;content:"A";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D609"]:before{width:.667em;padding:.694em 0 0;content:"B";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D60A"]:before{width:.639em;padding:.705em 0 .01em;content:"C";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D60A"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D60A"]:last-child:before{width:.719em}.MJX-TEX mjx-c[c="1D60B"]:before{width:.722em;padding:.694em 0 0;content:"D";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D60C"]:before{width:.597em;padding:.691em 0 0;content:"E";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D60C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D60C"]:last-child:before{width:.688em}.MJX-TEX mjx-c[c="1D60D"]:before{width:.569em;padding:.691em 0 0;content:"F";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D60D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D60D"]:last-child:before{width:.673em}.MJX-TEX mjx-c[c="1D60E"]:before{width:.667em;padding:.705em 0 .011em;content:"G";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D60E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D60E"]:last-child:before{width:.73em}.MJX-TEX mjx-c[c="1D60F"]:before{width:.708em;padding:.694em 0 0;content:"H";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D60F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D60F"]:last-child:before{width:.768em}.MJX-TEX mjx-c[c="1D610"]:before{width:.278em;padding:.694em 0 0;content:"I";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D610"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D610"]:last-child:before{width:.338em}.MJX-TEX mjx-c[c="1D611"]:before{width:.472em;padding:.694em 0 .022em;content:"J";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D611"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D611"]:last-child:before{width:.535em}.MJX-TEX mjx-c[c="1D612"]:before{width:.694em;padding:.694em 0 0;content:"K";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D612"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D612"]:last-child:before{width:.785em}.MJX-TEX mjx-c[c="1D613"]:before{width:.542em;padding:.694em 0 0;content:"L";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D614"]:before{width:.875em;padding:.694em 0 0;content:"M";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D614"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D614"]:last-child:before{width:.929em}.MJX-TEX mjx-c[c="1D615"]:before{width:.708em;padding:.694em 0 0;content:"N";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D615"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D615"]:last-child:before{width:.766em}.MJX-TEX mjx-c[c="1D616"]:before{width:.736em;padding:.716em 0 .022em;content:"O";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D617"]:before{width:.639em;padding:.694em 0 0;content:"P";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D617"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D617"]:last-child:before{width:.69em}.MJX-TEX mjx-c[c="1D618"]:before{width:.736em;padding:.716em 0 .125em;content:"Q";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D619"]:before{width:.646em;padding:.694em 0 0;content:"R";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D619"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D619"]:last-child:before{width:.698em}.MJX-TEX mjx-c[c="1D61A"]:before{width:.556em;padding:.716em 0 .022em;content:"S";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D61A"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D61A"]:last-child:before{width:.609em}.MJX-TEX mjx-c[c="1D61B"]:before{width:.681em;padding:.688em 0 0;content:"T";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D61B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D61B"]:last-child:before{width:.79em}.MJX-TEX mjx-c[c="1D61C"]:before{width:.688em;padding:.694em 0 .022em;content:"U";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D61C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D61C"]:last-child:before{width:.747em}.MJX-TEX mjx-c[c="1D61D"]:before{width:.667em;padding:.694em 0 0;content:"V";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D61D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D61D"]:last-child:before{width:.799em}.MJX-TEX mjx-c[c="1D61E"]:before{width:.944em;padding:.694em 0 0;content:"W";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D61E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D61E"]:last-child:before{width:1.076em}.MJX-TEX mjx-c[c="1D61F"]:before{width:.667em;padding:.694em 0 0;content:"X";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D61F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D61F"]:last-child:before{width:.758em}.MJX-TEX mjx-c[c="1D620"]:before{width:.667em;padding:.694em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D620"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D620"]:last-child:before{width:.81em}.MJX-TEX mjx-c[c="1D621"]:before{width:.611em;padding:.694em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D621"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D621"]:last-child:before{width:.702em}.MJX-TEX mjx-c[c="1D622"]:before{width:.481em;padding:.461em 0 .01em;content:"a";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D623"]:before{width:.517em;padding:.694em 0 .011em;content:"b";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D624"]:before{width:.444em;padding:.46em 0 .011em;content:"c";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D624"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D624"]:last-child:before{width:.499em}.MJX-TEX mjx-c[c="1D625"]:before{width:.517em;padding:.694em 0 .01em;content:"d";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D625"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D625"]:last-child:before{width:.588em}.MJX-TEX mjx-c[c="1D626"]:before{width:.444em;padding:.46em 0 .011em;content:"e";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D627"]:before{width:.306em;padding:.705em 0 0;content:"f";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D627"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D627"]:last-child:before{width:.494em}.MJX-TEX mjx-c[c="1D628"]:before{width:.5em;padding:.455em 0 .206em;content:"g";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D628"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D628"]:last-child:before{width:.568em}.MJX-TEX mjx-c[c="1D629"]:before{width:.517em;padding:.694em 0 0;content:"h";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D62A"]:before{width:.239em;padding:.68em 0 0;content:"i";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D62A"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D62A"]:last-child:before{width:.315em}.MJX-TEX mjx-c[c="1D62B"]:before{width:.267em;padding:.68em 0 .204em;content:"j";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D62B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D62B"]:last-child:before{width:.336em}.MJX-TEX mjx-c[c="1D62C"]:before{width:.489em;padding:.694em 0 0;content:"k";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D62C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D62C"]:last-child:before{width:.543em}.MJX-TEX mjx-c[c="1D62D"]:before{width:.239em;padding:.694em 0 0;content:"l";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D62D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D62D"]:last-child:before{width:.311em}.MJX-TEX mjx-c[c="1D62E"]:before{width:.794em;padding:.455em 0 0;content:"m";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D62F"]:before{width:.517em;padding:.454em 0 0;content:"n";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D630"]:before{width:.5em;padding:.461em 0 .011em;content:"o";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D631"]:before{content:"p"}.MJX-TEX mjx-c[c="1D631"]:before,.MJX-TEX mjx-c[c="1D632"]:before{width:.517em;padding:.455em 0 .194em;font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D632"]:before{content:"q"}.MJX-TEX mjx-c[c="1D633"]:before{width:.342em;padding:.455em 0 0;content:"r";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D633"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D633"]:last-child:before{width:.424em}.MJX-TEX mjx-c[c="1D634"]:before{width:.383em;padding:.461em 0 .011em;content:"s";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D634"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D634"]:last-child:before{width:.436em}.MJX-TEX mjx-c[c="1D635"]:before{width:.361em;padding:.571em 0 .011em;content:"t";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D636"]:before{width:.517em;padding:.444em 0 .01em;content:"u";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D637"]:before{width:.461em;padding:.444em 0 0;content:"v";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D637"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D637"]:last-child:before{width:.54em}.MJX-TEX mjx-c[c="1D638"]:before{width:.683em;padding:.444em 0 0;content:"w";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D638"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D638"]:last-child:before{width:.762em}.MJX-TEX mjx-c[c="1D639"]:before{width:.461em;padding:.444em 0 0;content:"x";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D639"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D639"]:last-child:before{width:.537em}.MJX-TEX mjx-c[c="1D63A"]:before{width:.461em;padding:.444em 0 .205em;content:"y";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D63A"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D63A"]:last-child:before{width:.54em}.MJX-TEX mjx-c[c="1D63B"]:before{width:.435em;padding:.444em 0 0;content:"z";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D63B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D63B"]:last-child:before{width:.494em}.MJX-TEX mjx-c[c="1D63C"]:before{width:.667em;padding:.694em 0 0;content:"A";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D63D"]:before{width:.667em;padding:.694em 0 0;content:"B";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D63E"]:before{width:.639em;padding:.705em 0 .01em;content:"C";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D63E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D63E"]:last-child:before{width:.719em}.MJX-TEX mjx-c[c="1D63F"]:before{width:.722em;padding:.694em 0 0;content:"D";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D640"]:before{width:.597em;padding:.691em 0 0;content:"E";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D640"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D640"]:last-child:before{width:.688em}.MJX-TEX mjx-c[c="1D641"]:before{width:.569em;padding:.691em 0 0;content:"F";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D641"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D641"]:last-child:before{width:.673em}.MJX-TEX mjx-c[c="1D642"]:before{width:.667em;padding:.705em 0 .011em;content:"G";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D642"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D642"]:last-child:before{width:.73em}.MJX-TEX mjx-c[c="1D643"]:before{width:.708em;padding:.694em 0 0;content:"H";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D643"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D643"]:last-child:before{width:.768em}.MJX-TEX mjx-c[c="1D644"]:before{width:.278em;padding:.694em 0 0;content:"I";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D644"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D644"]:last-child:before{width:.338em}.MJX-TEX mjx-c[c="1D645"]:before{width:.472em;padding:.694em 0 .022em;content:"J";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D645"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D645"]:last-child:before{width:.535em}.MJX-TEX mjx-c[c="1D646"]:before{width:.694em;padding:.694em 0 0;content:"K";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D646"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D646"]:last-child:before{width:.785em}.MJX-TEX mjx-c[c="1D647"]:before{width:.542em;padding:.694em 0 0;content:"L";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D648"]:before{width:.875em;padding:.694em 0 0;content:"M";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D648"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D648"]:last-child:before{width:.929em}.MJX-TEX mjx-c[c="1D649"]:before{width:.708em;padding:.694em 0 0;content:"N";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D649"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D649"]:last-child:before{width:.766em}.MJX-TEX mjx-c[c="1D64A"]:before{width:.736em;padding:.716em 0 .022em;content:"O";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D64B"]:before{width:.639em;padding:.694em 0 0;content:"P";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D64B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D64B"]:last-child:before{width:.69em}.MJX-TEX mjx-c[c="1D64C"]:before{width:.736em;padding:.716em 0 .125em;content:"Q";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D64D"]:before{width:.646em;padding:.694em 0 0;content:"R";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D64D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D64D"]:last-child:before{width:.698em}.MJX-TEX mjx-c[c="1D64E"]:before{width:.556em;padding:.716em 0 .022em;content:"S";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D64E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D64E"]:last-child:before{width:.609em}.MJX-TEX mjx-c[c="1D64F"]:before{width:.681em;padding:.688em 0 0;content:"T";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D64F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D64F"]:last-child:before{width:.79em}.MJX-TEX mjx-c[c="1D650"]:before{width:.688em;padding:.694em 0 .022em;content:"U";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D650"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D650"]:last-child:before{width:.747em}.MJX-TEX mjx-c[c="1D651"]:before{width:.667em;padding:.694em 0 0;content:"V";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D651"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D651"]:last-child:before{width:.799em}.MJX-TEX mjx-c[c="1D652"]:before{width:.944em;padding:.694em 0 0;content:"W";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D652"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D652"]:last-child:before{width:1.076em}.MJX-TEX mjx-c[c="1D653"]:before{width:.667em;padding:.694em 0 0;content:"X";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D653"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D653"]:last-child:before{width:.758em}.MJX-TEX mjx-c[c="1D654"]:before{width:.667em;padding:.694em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D654"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D654"]:last-child:before{width:.81em}.MJX-TEX mjx-c[c="1D655"]:before{width:.611em;padding:.694em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D655"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D655"]:last-child:before{width:.702em}.MJX-TEX mjx-c[c="1D656"]:before{width:.481em;padding:.461em 0 .01em;content:"a";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D657"]:before{width:.517em;padding:.694em 0 .011em;content:"b";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D658"]:before{width:.444em;padding:.46em 0 .011em;content:"c";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D658"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D658"]:last-child:before{width:.499em}.MJX-TEX mjx-c[c="1D659"]:before{width:.517em;padding:.694em 0 .01em;content:"d";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D659"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D659"]:last-child:before{width:.588em}.MJX-TEX mjx-c[c="1D65A"]:before{width:.444em;padding:.46em 0 .011em;content:"e";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D65B"]:before{width:.306em;padding:.705em 0 0;content:"f";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D65B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D65B"]:last-child:before{width:.494em}.MJX-TEX mjx-c[c="1D65C"]:before{width:.5em;padding:.455em 0 .206em;content:"g";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D65C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D65C"]:last-child:before{width:.568em}.MJX-TEX mjx-c[c="1D65D"]:before{width:.517em;padding:.694em 0 0;content:"h";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D65E"]:before{width:.239em;padding:.68em 0 0;content:"i";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D65E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D65E"]:last-child:before{width:.315em}.MJX-TEX mjx-c[c="1D65F"]:before{width:.267em;padding:.68em 0 .204em;content:"j";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D65F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D65F"]:last-child:before{width:.336em}.MJX-TEX mjx-c[c="1D660"]:before{width:.489em;padding:.694em 0 0;content:"k";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D660"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D660"]:last-child:before{width:.543em}.MJX-TEX mjx-c[c="1D661"]:before{width:.239em;padding:.694em 0 0;content:"l";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D661"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D661"]:last-child:before{width:.311em}.MJX-TEX mjx-c[c="1D662"]:before{width:.794em;padding:.455em 0 0;content:"m";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D663"]:before{width:.517em;padding:.454em 0 0;content:"n";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D664"]:before{width:.5em;padding:.461em 0 .011em;content:"o";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D665"]:before{content:"p"}.MJX-TEX mjx-c[c="1D665"]:before,.MJX-TEX mjx-c[c="1D666"]:before{width:.517em;padding:.455em 0 .194em;font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D666"]:before{content:"q"}.MJX-TEX mjx-c[c="1D667"]:before{width:.342em;padding:.455em 0 0;content:"r";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D667"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D667"]:last-child:before{width:.424em}.MJX-TEX mjx-c[c="1D668"]:before{width:.383em;padding:.461em 0 .011em;content:"s";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D668"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D668"]:last-child:before{width:.436em}.MJX-TEX mjx-c[c="1D669"]:before{width:.361em;padding:.571em 0 .011em;content:"t";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D66A"]:before{width:.517em;padding:.444em 0 .01em;content:"u";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D66B"]:before{width:.461em;padding:.444em 0 0;content:"v";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D66B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D66B"]:last-child:before{width:.54em}.MJX-TEX mjx-c[c="1D66C"]:before{width:.683em;padding:.444em 0 0;content:"w";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D66C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D66C"]:last-child:before{width:.762em}.MJX-TEX mjx-c[c="1D66D"]:before{width:.461em;padding:.444em 0 0;content:"x";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D66D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D66D"]:last-child:before{width:.537em}.MJX-TEX mjx-c[c="1D66E"]:before{width:.461em;padding:.444em 0 .205em;content:"y";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D66E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D66E"]:last-child:before{width:.54em}.MJX-TEX mjx-c[c="1D66F"]:before{width:.435em;padding:.444em 0 0;content:"z";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D66F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D66F"]:last-child:before{width:.494em}.MJX-TEX mjx-c[c="1D670"]:before{width:.525em;padding:.623em 0 0;content:"A";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D671"]:before{width:.525em;padding:.611em 0 0;content:"B";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D672"]:before{width:.525em;padding:.622em 0 .011em;content:"C";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D673"]:before{width:.525em;padding:.611em 0 0;content:"D";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D674"]:before{width:.525em;padding:.611em 0 0;content:"E";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D675"]:before{width:.525em;padding:.611em 0 0;content:"F";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D676"]:before{width:.525em;padding:.622em 0 .011em;content:"G";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D677"]:before{width:.525em;padding:.611em 0 0;content:"H";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D678"]:before{width:.525em;padding:.611em 0 0;content:"I";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D679"]:before{width:.525em;padding:.611em 0 .011em;content:"J";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D67A"]:before{width:.525em;padding:.611em 0 0;content:"K";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D67B"]:before{width:.525em;padding:.611em 0 0;content:"L";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D67C"]:before{width:.525em;padding:.611em 0 0;content:"M";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D67D"]:before{width:.525em;padding:.611em 0 0;content:"N";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D67E"]:before{width:.525em;padding:.621em 0 .01em;content:"O";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D67F"]:before{width:.525em;padding:.611em 0 0;content:"P";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D680"]:before{width:.525em;padding:.621em 0 .138em;content:"Q";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D681"]:before{width:.525em;padding:.611em 0 .011em;content:"R";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D682"]:before{width:.525em;padding:.622em 0 .011em;content:"S";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D683"]:before{width:.525em;padding:.611em 0 0;content:"T";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D684"]:before{width:.525em;padding:.611em 0 .011em;content:"U";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D685"]:before{width:.525em;padding:.611em 0 .007em;content:"V";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D686"]:before{width:.525em;padding:.611em 0 .007em;content:"W";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D687"]:before{width:.525em;padding:.611em 0 0;content:"X";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D688"]:before{width:.525em;padding:.611em 0 0;content:"Y";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D689"]:before{width:.525em;padding:.611em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D68A"]:before{width:.525em;padding:.439em 0 .006em;content:"a";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D68B"]:before{width:.525em;padding:.611em 0 .006em;content:"b";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D68C"]:before{width:.525em;padding:.44em 0 .006em;content:"c";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D68D"]:before{width:.525em;padding:.611em 0 .006em;content:"d";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D68E"]:before{width:.525em;padding:.44em 0 .006em;content:"e";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D68F"]:before{width:.525em;padding:.617em 0 0;content:"f";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D690"]:before{width:.525em;padding:.442em 0 .229em;content:"g";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D691"]:before{width:.525em;padding:.611em 0 0;content:"h";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D692"]:before{width:.525em;padding:.612em 0 0;content:"i";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D693"]:before{width:.525em;padding:.612em 0 .228em;content:"j";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D694"]:before{width:.525em;padding:.611em 0 0;content:"k";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D695"]:before{width:.525em;padding:.611em 0 0;content:"l";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D696"]:before{width:.525em;padding:.436em 0 0;content:"m";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D697"]:before{width:.525em;padding:.436em 0 0;content:"n";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D698"]:before{width:.525em;padding:.44em 0 .006em;content:"o";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D699"]:before{width:.525em;padding:.437em 0 .221em;content:"p";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D69A"]:before{width:.525em;padding:.437em 0 .221em;content:"q";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D69B"]:before{width:.525em;padding:.437em 0 0;content:"r";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D69C"]:before{width:.525em;padding:.44em 0 .006em;content:"s";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D69D"]:before{width:.525em;padding:.554em 0 .006em;content:"t";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D69E"]:before{width:.525em;padding:.431em 0 .005em;content:"u";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D69F"]:before{width:.525em;padding:.431em 0 0;content:"v";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D6A0"]:before{width:.525em;padding:.431em 0 0;content:"w";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D6A1"]:before{width:.525em;padding:.431em 0 0;content:"x";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D6A2"]:before{width:.525em;padding:.431em 0 .228em;content:"y";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D6A3"]:before{width:.525em;padding:.431em 0 0;content:"z";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D6A4"]:before{width:.307em;padding:.441em 0 .01em;content:"\131";font-family:MJXZERO,MJXTEX-MI}.MJX-TEX mjx-c[c="1D6A5"]:before{width:.332em;padding:.442em 0 .204em;content:"\237";font-family:MJXZERO,MJXTEX-MI}.MJX-TEX mjx-c[c="1D6A8"]:before{width:.869em;padding:.698em 0 0;content:"A";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6A9"]:before{width:.818em;padding:.686em 0 0;content:"B";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6AA"]:before{width:.692em;padding:.68em 0 0;content:"\393";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6AB"]:before{width:.958em;padding:.698em 0 0;content:"\394";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6AC"]:before{width:.756em;padding:.68em 0 0;content:"E";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6AD"]:before{width:.703em;padding:.686em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6AE"]:before{width:.9em;padding:.686em 0 0;content:"H";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6AF"]:before{width:.894em;padding:.696em 0 .01em;content:"\398";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B0"]:before{width:.436em;padding:.686em 0 0;content:"I";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B1"]:before{width:.901em;padding:.686em 0 0;content:"K";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B2"]:before{width:.806em;padding:.698em 0 0;content:"\39B";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B3"]:before{width:1.092em;padding:.686em 0 0;content:"M";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B4"]:before{width:.9em;padding:.686em 0 0;content:"N";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B5"]:before{width:.767em;padding:.675em 0 0;content:"\39E";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B6"]:before{width:.864em;padding:.696em 0 .01em;content:"O";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B7"]:before{width:.9em;padding:.68em 0 0;content:"\3A0";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B8"]:before{width:.786em;padding:.686em 0 0;content:"P";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6B9"]:before{width:.894em;padding:.696em 0 .01em;content:"\398";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6BA"]:before{width:.831em;padding:.686em 0 0;content:"\3A3";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6BB"]:before{width:.8em;padding:.675em 0 0;content:"T";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6BC"]:before{width:.894em;padding:.697em 0 0;content:"\3A5";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6BD"]:before{width:.831em;padding:.686em 0 0;content:"\3A6";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6BE"]:before{width:.869em;padding:.686em 0 0;content:"X";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6BF"]:before{width:.894em;padding:.686em 0 0;content:"\3A8";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6C0"]:before{width:.831em;padding:.696em 0 0;content:"\3A9";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6C1"]:before{width:.958em;padding:.686em 0 .024em;content:"\2207";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D6C2"]:before{width:.761em;padding:.452em 0 .008em;content:"\3B1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6C3"]:before{width:.66em;padding:.701em 0 .194em;content:"\3B2";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6C4"]:before{width:.59em;padding:.451em 0 .211em;content:"\3B3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6C5"]:before{width:.522em;padding:.725em 0 .008em;content:"\3B4";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6C6"]:before{width:.529em;padding:.461em 0 .017em;content:"\3B5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6C7"]:before{width:.508em;padding:.711em 0 .202em;content:"\3B6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6C8"]:before{width:.6em;padding:.452em 0 .211em;content:"\3B7";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6C9"]:before{width:.562em;padding:.702em 0 .008em;content:"\3B8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6CA"]:before{width:.412em;padding:.452em 0 .008em;content:"\3B9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6CB"]:before{width:.668em;padding:.452em 0 .008em;content:"\3BA";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6CC"]:before{width:.671em;padding:.694em 0 .013em;content:"\3BB";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6CD"]:before{width:.708em;padding:.452em 0 .211em;content:"\3BC";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6CE"]:before{width:.577em;padding:.452em 0 0;content:"\3BD";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6CF"]:before{width:.508em;padding:.711em 0 .201em;content:"\3BE";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D0"]:before{width:.585em;padding:.452em 0 .008em;content:"\3BF";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D1"]:before{width:.682em;padding:.444em 0 .008em;content:"\3C0";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D2"]:before{width:.612em;padding:.451em 0 .211em;content:"\3C1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D3"]:before{width:.424em;padding:.451em 0 .105em;content:"\3C2";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D4"]:before{width:.686em;padding:.444em 0 .008em;content:"\3C3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D5"]:before{width:.521em;padding:.444em 0 .013em;content:"\3C4";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6D5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6D5"]:last-child:before{width:.61em}.MJX-TEX mjx-c[c="1D6D6"]:before{width:.631em;padding:.453em 0 .008em;content:"\3C5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D7"]:before{width:.747em;padding:.452em 0 .216em;content:"\3C6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D8"]:before{width:.718em;padding:.452em 0 .201em;content:"\3C7";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6D9"]:before{width:.758em;padding:.694em 0 .202em;content:"\3C8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6DA"]:before{width:.718em;padding:.453em 0 .008em;content:"\3C9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6DB"]:before{width:.628em;padding:.71em 0 .017em;content:"\2202";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6DC"]:before{width:.483em;padding:.444em 0 .007em;content:"\3F5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6DD"]:before{width:.692em;padding:.701em 0 .008em;content:"\3D1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6DE"]:before{width:.667em;padding:.434em 0 .006em;content:"\E009";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6DE"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6DE"]:last-child:before{width:.734em}.MJX-TEX mjx-c[c="1D6DF"]:before{width:.712em;padding:.694em 0 .202em;content:"\3D5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6E0"]:before{width:.612em;padding:.451em 0 .194em;content:"\3F1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6E1"]:before{width:.975em;padding:.444em 0 .008em;content:"\3D6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D6E2"]:before{width:.75em;padding:.716em 0 0;content:"A";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6E3"]:before{width:.759em;padding:.683em 0 0;content:"B";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6E4"]:before{width:.615em;padding:.68em 0 0;content:"\393";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6E4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6E4"]:last-child:before{width:.721em}.MJX-TEX mjx-c[c="1D6E5"]:before{width:.833em;padding:.716em 0 0;content:"\394";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6E6"]:before{width:.738em;padding:.68em 0 0;content:"E";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6E7"]:before{width:.683em;padding:.683em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6E8"]:before{width:.831em;padding:.683em 0 0;content:"H";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6E8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6E8"]:last-child:before{width:.888em}.MJX-TEX mjx-c[c="1D6E9"]:before{width:.763em;padding:.704em 0 .022em;content:"\398";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6EA"]:before{width:.44em;padding:.683em 0 0;content:"I";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6EA"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6EA"]:last-child:before{width:.504em}.MJX-TEX mjx-c[c="1D6EB"]:before{width:.849em;padding:.683em 0 0;content:"K";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6EC"]:before{width:.694em;padding:.716em 0 0;content:"\39B";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6ED"]:before{width:.97em;padding:.683em 0 0;content:"M";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6ED"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6ED"]:last-child:before{width:1.051em}.MJX-TEX mjx-c[c="1D6EE"]:before{width:.803em;padding:.683em 0 0;content:"N";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6EE"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6EE"]:last-child:before{width:.888em}.MJX-TEX mjx-c[c="1D6EF"]:before{width:.742em;padding:.677em 0 0;content:"\39E";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6F0"]:before{width:.763em;padding:.704em 0 .022em;content:"O";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6F1"]:before{width:.831em;padding:.68em 0 0;content:"\3A0";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6F1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6F1"]:last-child:before{width:.887em}.MJX-TEX mjx-c[c="1D6F2"]:before{width:.642em;padding:.683em 0 0;content:"P";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6F2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6F2"]:last-child:before{width:.751em}.MJX-TEX mjx-c[c="1D6F3"]:before{width:.763em;padding:.704em 0 .022em;content:"\398";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6F4"]:before{width:.78em;padding:.683em 0 0;content:"\3A3";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6F5"]:before{width:.584em;padding:.677em 0 0;content:"T";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6F5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6F5"]:last-child:before{width:.704em}.MJX-TEX mjx-c[c="1D6F6"]:before{width:.583em;padding:.705em 0 0;content:"\3A5";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6F6"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6F6"]:last-child:before{width:.7em}.MJX-TEX mjx-c[c="1D6F7"]:before{width:.667em;padding:.683em 0 0;content:"\3A6";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6F8"]:before{width:.828em;padding:.683em 0 0;content:"X";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6F9"]:before{width:.612em;padding:.683em 0 0;content:"\3A8";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D6F9"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D6F9"]:last-child:before{width:.692em}.MJX-TEX mjx-c[c="1D6FA"]:before{width:.772em;padding:.704em 0 0;content:"\3A9";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6FB"]:before{width:.833em;padding:.683em 0 .033em;content:"\2207";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="1D6FC"]:before{width:.64em;padding:.442em 0 .011em;content:"\3B1";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6FD"]:before{width:.566em;padding:.705em 0 .194em;content:"\3B2";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6FE"]:before{width:.518em;padding:.441em 0 .216em;content:"\3B3";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D6FF"]:before{width:.444em;padding:.717em 0 .01em;content:"\3B4";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D700"]:before{width:.466em;padding:.452em 0 .022em;content:"\3B5";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D701"]:before{width:.438em;padding:.704em 0 .204em;content:"\3B6";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D702"]:before{width:.497em;padding:.442em 0 .216em;content:"\3B7";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D703"]:before{width:.469em;padding:.705em 0 .01em;content:"\3B8";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D704"]:before{width:.354em;padding:.442em 0 .01em;content:"\3B9";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D705"]:before{width:.576em;padding:.442em 0 .011em;content:"\3BA";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D706"]:before{width:.583em;padding:.694em 0 .012em;content:"\3BB";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D707"]:before{width:.603em;padding:.442em 0 .216em;content:"\3BC";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D708"]:before{width:.494em;padding:.442em 0 0;content:"\3BD";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D709"]:before{width:.438em;padding:.704em 0 .205em;content:"\3BE";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D70A"]:before{width:.485em;padding:.441em 0 .011em;content:"\3BF";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D70B"]:before{width:.57em;padding:.431em 0 .011em;content:"\3C0";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D70C"]:before{width:.517em;padding:.442em 0 .216em;content:"\3C1";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D70D"]:before{width:.363em;padding:.442em 0 .107em;content:"\3C2";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D70E"]:before{width:.571em;padding:.431em 0 .011em;content:"\3C3";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D70F"]:before{width:.437em;padding:.431em 0 .013em;content:"\3C4";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D70F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D70F"]:last-child:before{width:.517em}.MJX-TEX mjx-c[c="1D710"]:before{width:.54em;padding:.443em 0 .01em;content:"\3C5";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D711"]:before{width:.654em;padding:.442em 0 .218em;content:"\3C6";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D712"]:before{width:.626em;padding:.442em 0 .204em;content:"\3C7";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D713"]:before{width:.651em;padding:.694em 0 .205em;content:"\3C8";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D714"]:before{width:.622em;padding:.443em 0 .011em;content:"\3C9";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D715"]:before{width:.531em;padding:.715em 0 .022em;content:"\2202";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="1D716"]:before{width:.406em;padding:.431em 0 .011em;content:"\3F5";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D717"]:before{width:.591em;padding:.705em 0 .011em;content:"\3D1";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D718"]:before{width:.667em;padding:.434em 0 .006em;content:"\E009";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D718"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D718"]:last-child:before{width:.734em}.MJX-TEX mjx-c[c="1D719"]:before{width:.596em;padding:.694em 0 .205em;content:"\3D5";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D71A"]:before{width:.517em;padding:.442em 0 .194em;content:"\3F1";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D71B"]:before{width:.828em;padding:.431em 0 .01em;content:"\3D6";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-c[c="1D71C"]:before{width:.869em;padding:.711em 0 0;content:"A";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D71D"]:before{width:.866em;padding:.686em 0 0;content:"B";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D71E"]:before{width:.657em;padding:.68em 0 0;content:"\393";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D71E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D71E"]:last-child:before{width:.777em}.MJX-TEX mjx-c[c="1D71F"]:before{width:.958em;padding:.711em 0 0;content:"\394";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D720"]:before{width:.81em;padding:.68em 0 0;content:"E";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D721"]:before{width:.773em;padding:.686em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D722"]:before{width:.982em;padding:.686em 0 0;content:"H";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D723"]:before{width:.867em;padding:.702em 0 .017em;content:"\398";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D724"]:before{width:.511em;padding:.686em 0 0;content:"I";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D724"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D724"]:last-child:before{width:.573em}.MJX-TEX mjx-c[c="1D725"]:before{width:.971em;padding:.686em 0 0;content:"K";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D726"]:before{width:.806em;padding:.711em 0 0;content:"\39B";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D727"]:before{width:1.142em;padding:.686em 0 0;content:"M";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D727"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D727"]:last-child:before{width:1.219em}.MJX-TEX mjx-c[c="1D728"]:before{width:.95em;padding:.686em 0 0;content:"N";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D728"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D728"]:last-child:before{width:1.027em}.MJX-TEX mjx-c[c="1D729"]:before{width:.841em;padding:.675em 0 0;content:"\39E";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D72A"]:before{width:.837em;padding:.703em 0 .017em;content:"O";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D72B"]:before{width:.982em;padding:.68em 0 0;content:"\3A0";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D72C"]:before{width:.723em;padding:.686em 0 0;content:"P";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D72C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D72C"]:last-child:before{width:.847em}.MJX-TEX mjx-c[c="1D72D"]:before{width:.867em;padding:.702em 0 .017em;content:"\398";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D72E"]:before{width:.885em;padding:.686em 0 0;content:"\3A3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D72F"]:before{width:.637em;padding:.675em 0 0;content:"T";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D72F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D72F"]:last-child:before{width:.772em}.MJX-TEX mjx-c[c="1D730"]:before{width:.671em;padding:.703em 0 0;content:"\3A5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D730"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D730"]:last-child:before{width:.802em}.MJX-TEX mjx-c[c="1D731"]:before{width:.767em;padding:.686em 0 0;content:"\3A6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D732"]:before{width:.947em;padding:.686em 0 0;content:"X";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D733"]:before{width:.714em;padding:.686em 0 0;content:"\3A8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D733"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D733"]:last-child:before{width:.79em}.MJX-TEX mjx-c[c="1D734"]:before{width:.879em;padding:.703em 0 0;content:"\3A9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D735"]:before{width:.833em;padding:.683em 0 .033em;content:"\2207";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="1D736"]:before{width:.761em;padding:.452em 0 .008em;content:"\3B1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D737"]:before{width:.66em;padding:.701em 0 .194em;content:"\3B2";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D738"]:before{width:.59em;padding:.451em 0 .211em;content:"\3B3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D739"]:before{width:.522em;padding:.725em 0 .008em;content:"\3B4";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D73A"]:before{width:.529em;padding:.461em 0 .017em;content:"\3B5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D73B"]:before{width:.508em;padding:.711em 0 .202em;content:"\3B6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D73C"]:before{width:.6em;padding:.452em 0 .211em;content:"\3B7";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D73D"]:before{width:.562em;padding:.702em 0 .008em;content:"\3B8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D73E"]:before{width:.412em;padding:.452em 0 .008em;content:"\3B9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D73F"]:before{width:.668em;padding:.452em 0 .008em;content:"\3BA";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D740"]:before{width:.671em;padding:.694em 0 .013em;content:"\3BB";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D741"]:before{width:.708em;padding:.452em 0 .211em;content:"\3BC";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D742"]:before{width:.577em;padding:.452em 0 0;content:"\3BD";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D743"]:before{width:.508em;padding:.711em 0 .201em;content:"\3BE";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D744"]:before{width:.585em;padding:.452em 0 .008em;content:"\3BF";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D745"]:before{width:.682em;padding:.444em 0 .008em;content:"\3C0";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D746"]:before{width:.612em;padding:.451em 0 .211em;content:"\3C1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D747"]:before{width:.424em;padding:.451em 0 .105em;content:"\3C2";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D748"]:before{width:.686em;padding:.444em 0 .008em;content:"\3C3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D749"]:before{width:.521em;padding:.444em 0 .013em;content:"\3C4";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D749"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D749"]:last-child:before{width:.61em}.MJX-TEX mjx-c[c="1D74A"]:before{width:.631em;padding:.453em 0 .008em;content:"\3C5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D74B"]:before{width:.747em;padding:.452em 0 .216em;content:"\3C6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D74C"]:before{width:.718em;padding:.452em 0 .201em;content:"\3C7";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D74D"]:before{width:.758em;padding:.694em 0 .202em;content:"\3C8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D74E"]:before{width:.718em;padding:.453em 0 .008em;content:"\3C9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D74F"]:before{width:.531em;padding:.715em 0 .022em;content:"\2202";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="1D750"]:before{width:.483em;padding:.444em 0 .007em;content:"\3F5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D751"]:before{width:.692em;padding:.701em 0 .008em;content:"\3D1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D752"]:before{width:.667em;padding:.434em 0 .006em;content:"\E009";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D752"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D752"]:last-child:before{width:.734em}.MJX-TEX mjx-c[c="1D753"]:before{width:.712em;padding:.694em 0 .202em;content:"\3D5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D754"]:before{width:.612em;padding:.451em 0 .194em;content:"\3F1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D755"]:before{width:.975em;padding:.444em 0 .008em;content:"\3D6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D756"]:before{width:.733em;padding:.694em 0 0;content:"A";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D757"]:before{width:.733em;padding:.694em 0 0;content:"B";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D758"]:before{width:.581em;padding:.691em 0 0;content:"\393";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D759"]:before{width:.917em;padding:.694em 0 0;content:"\394";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D75A"]:before{width:.642em;padding:.691em 0 0;content:"E";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D75B"]:before{width:.672em;padding:.694em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D75C"]:before{width:.794em;padding:.694em 0 0;content:"H";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D75D"]:before{width:.856em;padding:.716em 0 .022em;content:"\398";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D75E"]:before{width:.331em;padding:.694em 0 0;content:"I";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D75F"]:before{width:.764em;padding:.694em 0 0;content:"K";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D760"]:before{width:.672em;padding:.694em 0 0;content:"\39B";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D761"]:before{width:.978em;padding:.694em 0 0;content:"M";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D762"]:before{width:.794em;padding:.694em 0 0;content:"N";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D763"]:before{width:.733em;padding:.688em 0 0;content:"\39E";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D764"]:before{width:.794em;padding:.716em 0 .022em;content:"O";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D765"]:before{width:.794em;padding:.691em 0 0;content:"\3A0";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D766"]:before{width:.703em;padding:.694em 0 0;content:"P";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D767"]:before{width:.856em;padding:.716em 0 .022em;content:"\398";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D768"]:before{width:.794em;padding:.694em 0 0;content:"\3A3";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D769"]:before{width:.733em;padding:.688em 0 0;content:"T";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D76A"]:before{width:.856em;padding:.715em 0 0;content:"\3A5";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D76B"]:before{width:.794em;padding:.694em 0 0;content:"\3A6";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D76C"]:before{width:.733em;padding:.694em 0 0;content:"X";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D76D"]:before{width:.856em;padding:.694em 0 0;content:"\3A8";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D76E"]:before{width:.794em;padding:.716em 0 0;content:"\3A9";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D76F"]:before{width:.833em;padding:.683em 0 .033em;content:"\2207";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="1D770"]:before{width:.761em;padding:.452em 0 .008em;content:"\3B1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D771"]:before{width:.66em;padding:.701em 0 .194em;content:"\3B2";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D772"]:before{width:.59em;padding:.451em 0 .211em;content:"\3B3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D773"]:before{width:.522em;padding:.725em 0 .008em;content:"\3B4";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D774"]:before{width:.529em;padding:.461em 0 .017em;content:"\3B5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D775"]:before{width:.508em;padding:.711em 0 .202em;content:"\3B6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D776"]:before{width:.6em;padding:.452em 0 .211em;content:"\3B7";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D777"]:before{width:.562em;padding:.702em 0 .008em;content:"\3B8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D778"]:before{width:.412em;padding:.452em 0 .008em;content:"\3B9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D779"]:before{width:.668em;padding:.452em 0 .008em;content:"\3BA";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D77A"]:before{width:.671em;padding:.694em 0 .013em;content:"\3BB";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D77B"]:before{width:.708em;padding:.452em 0 .211em;content:"\3BC";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D77C"]:before{width:.577em;padding:.452em 0 0;content:"\3BD";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D77D"]:before{width:.508em;padding:.711em 0 .201em;content:"\3BE";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D77E"]:before{width:.585em;padding:.452em 0 .008em;content:"\3BF";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D77F"]:before{width:.682em;padding:.444em 0 .008em;content:"\3C0";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D780"]:before{width:.612em;padding:.451em 0 .211em;content:"\3C1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D781"]:before{width:.424em;padding:.451em 0 .105em;content:"\3C2";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D782"]:before{width:.686em;padding:.444em 0 .008em;content:"\3C3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D783"]:before{width:.521em;padding:.444em 0 .013em;content:"\3C4";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D783"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D783"]:last-child:before{width:.61em}.MJX-TEX mjx-c[c="1D784"]:before{width:.631em;padding:.453em 0 .008em;content:"\3C5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D785"]:before{width:.747em;padding:.452em 0 .216em;content:"\3C6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D786"]:before{width:.718em;padding:.452em 0 .201em;content:"\3C7";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D787"]:before{width:.758em;padding:.694em 0 .202em;content:"\3C8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D788"]:before{width:.718em;padding:.453em 0 .008em;content:"\3C9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D789"]:before{width:.531em;padding:.715em 0 .022em;content:"\2202";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="1D78A"]:before{width:.483em;padding:.444em 0 .007em;content:"\3F5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D78B"]:before{width:.692em;padding:.701em 0 .008em;content:"\3D1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D78C"]:before{width:.667em;padding:.434em 0 .006em;content:"\E009";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D78C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D78C"]:last-child:before{width:.734em}.MJX-TEX mjx-c[c="1D78D"]:before{width:.712em;padding:.694em 0 .202em;content:"\3D5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D78E"]:before{width:.612em;padding:.451em 0 .194em;content:"\3F1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D78F"]:before{width:.975em;padding:.444em 0 .008em;content:"\3D6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D790"]:before{width:.667em;padding:.694em 0 0;content:"A";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D791"]:before{width:.667em;padding:.694em 0 0;content:"B";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D792"]:before{width:.542em;padding:.691em 0 0;content:"\393";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D792"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D792"]:last-child:before{width:.646em}.MJX-TEX mjx-c[c="1D793"]:before{width:.833em;padding:.694em 0 0;content:"\394";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D794"]:before{width:.597em;padding:.691em 0 0;content:"E";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D794"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D794"]:last-child:before{width:.688em}.MJX-TEX mjx-c[c="1D795"]:before{width:.611em;padding:.694em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D795"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D795"]:last-child:before{width:.702em}.MJX-TEX mjx-c[c="1D796"]:before{width:.708em;padding:.694em 0 0;content:"H";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D796"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D796"]:last-child:before{width:.768em}.MJX-TEX mjx-c[c="1D797"]:before{width:.778em;padding:.715em 0 .022em;content:"\398";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D798"]:before{width:.278em;padding:.694em 0 0;content:"I";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D798"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D798"]:last-child:before{width:.338em}.MJX-TEX mjx-c[c="1D799"]:before{width:.694em;padding:.694em 0 0;content:"K";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D799"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D799"]:last-child:before{width:.785em}.MJX-TEX mjx-c[c="1D79A"]:before{width:.611em;padding:.694em 0 0;content:"\39B";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D79B"]:before{width:.875em;padding:.694em 0 0;content:"M";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D79B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D79B"]:last-child:before{width:.929em}.MJX-TEX mjx-c[c="1D79C"]:before{width:.708em;padding:.694em 0 0;content:"N";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D79C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D79C"]:last-child:before{width:.766em}.MJX-TEX mjx-c[c="1D79D"]:before{width:.667em;padding:.688em 0 0;content:"\39E";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D79D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D79D"]:last-child:before{width:.765em}.MJX-TEX mjx-c[c="1D79E"]:before{width:.736em;padding:.716em 0 .022em;content:"O";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D79F"]:before{width:.708em;padding:.691em 0 0;content:"\3A0";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D79F"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D79F"]:last-child:before{width:.768em}.MJX-TEX mjx-c[c="1D7A0"]:before{width:.639em;padding:.694em 0 0;content:"P";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7A0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7A0"]:last-child:before{width:.69em}.MJX-TEX mjx-c[c="1D7A1"]:before{width:.778em;padding:.715em 0 .022em;content:"\398";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D7A2"]:before{width:.722em;padding:.694em 0 0;content:"\3A3";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7A2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7A2"]:last-child:before{width:.813em}.MJX-TEX mjx-c[c="1D7A3"]:before{width:.681em;padding:.688em 0 0;content:"T";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7A3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7A3"]:last-child:before{width:.79em}.MJX-TEX mjx-c[c="1D7A4"]:before{width:.778em;padding:.716em 0 0;content:"\3A5";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7A4"]:last-child:before{width:.843em}.MJX-TEX mjx-c[c="1D7A5"]:before{width:.722em;padding:.694em 0 0;content:"\3A6";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D7A6"]:before{width:.667em;padding:.694em 0 0;content:"X";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7A6"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7A6"]:last-child:before{width:.758em}.MJX-TEX mjx-c[c="1D7A7"]:before{width:.778em;padding:.694em 0 0;content:"\3A8";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7A7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7A7"]:last-child:before{width:.854em}.MJX-TEX mjx-c[c="1D7A8"]:before{width:.722em;padding:.716em 0 0;content:"\3A9";font-family:MJXZERO,MJXTEX-SS-I}.MJX-TEX mjx-c[c="1D7A9"]:before{width:.833em;padding:.683em 0 .033em;content:"\2207";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="1D7AA"]:before{width:.761em;padding:.452em 0 .008em;content:"\3B1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7AB"]:before{width:.66em;padding:.701em 0 .194em;content:"\3B2";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7AC"]:before{width:.59em;padding:.451em 0 .211em;content:"\3B3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7AD"]:before{width:.522em;padding:.725em 0 .008em;content:"\3B4";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7AE"]:before{width:.529em;padding:.461em 0 .017em;content:"\3B5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7AF"]:before{width:.508em;padding:.711em 0 .202em;content:"\3B6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B0"]:before{width:.6em;padding:.452em 0 .211em;content:"\3B7";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B1"]:before{width:.562em;padding:.702em 0 .008em;content:"\3B8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B2"]:before{width:.412em;padding:.452em 0 .008em;content:"\3B9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B3"]:before{width:.668em;padding:.452em 0 .008em;content:"\3BA";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B4"]:before{width:.671em;padding:.694em 0 .013em;content:"\3BB";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B5"]:before{width:.708em;padding:.452em 0 .211em;content:"\3BC";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B6"]:before{width:.577em;padding:.452em 0 0;content:"\3BD";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B7"]:before{width:.508em;padding:.711em 0 .201em;content:"\3BE";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B8"]:before{width:.585em;padding:.452em 0 .008em;content:"\3BF";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7B9"]:before{width:.682em;padding:.444em 0 .008em;content:"\3C0";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7BA"]:before{width:.612em;padding:.451em 0 .211em;content:"\3C1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7BB"]:before{width:.424em;padding:.451em 0 .105em;content:"\3C2";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7BC"]:before{width:.686em;padding:.444em 0 .008em;content:"\3C3";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7BD"]:before{width:.521em;padding:.444em 0 .013em;content:"\3C4";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7BD"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7BD"]:last-child:before{width:.61em}.MJX-TEX mjx-c[c="1D7BE"]:before{width:.631em;padding:.453em 0 .008em;content:"\3C5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7BF"]:before{width:.747em;padding:.452em 0 .216em;content:"\3C6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7C0"]:before{width:.718em;padding:.452em 0 .201em;content:"\3C7";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7C1"]:before{width:.758em;padding:.694em 0 .202em;content:"\3C8";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7C2"]:before{width:.718em;padding:.453em 0 .008em;content:"\3C9";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7C3"]:before{width:.531em;padding:.715em 0 .022em;content:"\2202";font-family:MJXZERO,MJXTEX}.MJX-TEX mjx-c[c="1D7C4"]:before{width:.483em;padding:.444em 0 .007em;content:"\3F5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7C5"]:before{width:.692em;padding:.701em 0 .008em;content:"\3D1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7C6"]:before{width:.667em;padding:.434em 0 .006em;content:"\E009";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7C6"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7C6"]:last-child:before{width:.734em}.MJX-TEX mjx-c[c="1D7C7"]:before{width:.712em;padding:.694em 0 .202em;content:"\3D5";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7C8"]:before{width:.612em;padding:.451em 0 .194em;content:"\3F1";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7C9"]:before{width:.975em;padding:.444em 0 .008em;content:"\3D6";font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-c[c="1D7CA"]:before{width:.643em;padding:.68em 0 0;content:"F";font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true])mjx-c[c="1D7CA"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true])mjx-c[c="1D7CA"]:last-child:before{width:.749em}.MJX-TEX mjx-c[c="1D7CB"]:before{width:.778em;padding:.605em 0 .085em;content:"\3DD";font-family:MJXZERO,MJXTEX-A}.MJX-TEX mjx-c[c="1D7CE"]:before{width:.575em;padding:.654em 0 .01em;content:"0";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7CF"]:before{width:.575em;padding:.655em 0 0;content:"1";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D0"]:before{width:.575em;padding:.654em 0 0;content:"2";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D1"]:before{width:.575em;padding:.655em 0 .011em;content:"3";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D2"]:before{width:.575em;padding:.656em 0 0;content:"4";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D3"]:before{width:.575em;padding:.655em 0 .011em;content:"5";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D4"]:before{width:.575em;padding:.655em 0 .011em;content:"6";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D5"]:before{width:.575em;padding:.676em 0 .011em;content:"7";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D6"]:before{width:.575em;padding:.654em 0 .011em;content:"8";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D7"]:before{width:.575em;padding:.654em 0 .011em;content:"9";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D8"]:before{width:.575em;padding:.654em 0 .01em;content:"0";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7D9"]:before{width:.575em;padding:.655em 0 0;content:"1";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7DA"]:before{width:.575em;padding:.654em 0 0;content:"2";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7DB"]:before{width:.575em;padding:.655em 0 .011em;content:"3";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7DC"]:before{width:.575em;padding:.656em 0 0;content:"4";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7DD"]:before{width:.575em;padding:.655em 0 .011em;content:"5";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7DE"]:before{width:.575em;padding:.655em 0 .011em;content:"6";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7DF"]:before{width:.575em;padding:.676em 0 .011em;content:"7";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7E0"]:before{width:.575em;padding:.654em 0 .011em;content:"8";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7E1"]:before{width:.575em;padding:.654em 0 .011em;content:"9";font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-c[c="1D7E2"]:before{width:.5em;padding:.678em 0 .022em;content:"0";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7E3"]:before{width:.5em;padding:.678em 0 0;content:"1";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7E4"]:before{width:.5em;padding:.677em 0 0;content:"2";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7E5"]:before{width:.5em;padding:.678em 0 .022em;content:"3";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7E6"]:before{width:.5em;padding:.656em 0 0;content:"4";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7E7"]:before{width:.5em;padding:.656em 0 .021em;content:"5";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7E8"]:before{width:.5em;padding:.677em 0 .022em;content:"6";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7E9"]:before{width:.5em;padding:.656em 0 .011em;content:"7";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7EA"]:before{width:.5em;padding:.678em 0 .022em;content:"8";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7EB"]:before{width:.5em;padding:.677em 0 .022em;content:"9";font-family:MJXZERO,MJXTEX-SS}.MJX-TEX mjx-c[c="1D7EC"]:before{width:.55em;padding:.715em 0 .022em;content:"0";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7ED"]:before{width:.55em;padding:.716em 0 0;content:"1";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7EE"]:before{width:.55em;padding:.716em 0 0;content:"2";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7EF"]:before{width:.55em;padding:.716em 0 .022em;content:"3";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7F0"]:before{width:.55em;padding:.694em 0 0;content:"4";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7F1"]:before{width:.55em;padding:.694em 0 .022em;content:"5";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7F2"]:before{width:.55em;padding:.716em 0 .022em;content:"6";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7F3"]:before{width:.55em;padding:.695em 0 .011em;content:"7";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7F4"]:before{width:.55em;padding:.715em 0 .022em;content:"8";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7F5"]:before{width:.55em;padding:.716em 0 .022em;content:"9";font-family:MJXZERO,MJXTEX-SS-B}.MJX-TEX mjx-c[c="1D7F6"]:before{width:.525em;padding:.621em 0 .01em;content:"0";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7F7"]:before{width:.525em;padding:.622em 0 0;content:"1";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7F8"]:before{width:.525em;padding:.622em 0 0;content:"2";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7F9"]:before{width:.525em;padding:.622em 0 .011em;content:"3";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7FA"]:before{width:.525em;padding:.624em 0 0;content:"4";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7FB"]:before{width:.525em;padding:.611em 0 .01em;content:"5";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7FC"]:before{width:.525em;padding:.622em 0 .011em;content:"6";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7FD"]:before{width:.525em;padding:.627em 0 .01em;content:"7";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7FE"]:before{width:.525em;padding:.621em 0 .01em;content:"8";font-family:MJXZERO,MJXTEX-T}.MJX-TEX mjx-c[c="1D7FF"]:before{width:.525em;padding:.622em 0 .011em;content:"9";font-family:MJXZERO,MJXTEX-T}.MJX-TEX .mjx-b mjx-c[c="!"]:before{width:.35em;padding:.705em 0 0}.MJX-TEX .mjx-b mjx-c[c="22"]:before{width:.603em}.MJX-TEX .mjx-b mjx-c[c="#"]:before{width:.958em}.MJX-TEX .mjx-b mjx-c[c="$"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="%"]:before{width:.958em}.MJX-TEX .mjx-b mjx-c[c="&"]:before{width:.894em;padding:.705em 0 .011em}.MJX-TEX .mjx-b mjx-c[c="27"]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c="("]:before,.MJX-TEX .mjx-b mjx-c[c=")"]:before{width:.447em}.MJX-TEX .mjx-b mjx-c[c="*"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="+"]:before{width:.894em;padding:.633em 0 .131em}.MJX-TEX .mjx-b mjx-c[c=","]:before{width:.319em;padding:.171em 0 .194em}.MJX-TEX .mjx-b mjx-c[c="-"]:before{width:.383em;padding:.278em 0 0}.MJX-TEX .mjx-b mjx-c[c="."]:before{width:.319em;padding:.171em 0 0}.MJX-TEX .mjx-b mjx-c[c="/"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="0"]:before{width:.575em;padding:.654em 0 .01em}.MJX-TEX .mjx-b mjx-c[c="1"]:before{width:.575em;padding:.655em 0 0}.MJX-TEX .mjx-b mjx-c[c="2"]:before{width:.575em;padding:.654em 0 0}.MJX-TEX .mjx-b mjx-c[c="3"]:before{width:.575em;padding:.655em 0 .011em}.MJX-TEX .mjx-b mjx-c[c="4"]:before{width:.575em;padding:.656em 0 0}.MJX-TEX .mjx-b mjx-c[c="5"]:before,.MJX-TEX .mjx-b mjx-c[c="6"]:before{width:.575em;padding:.655em 0 .011em}.MJX-TEX .mjx-b mjx-c[c="7"]:before{width:.575em;padding:.676em 0 .011em}.MJX-TEX .mjx-b mjx-c[c="8"]:before,.MJX-TEX .mjx-b mjx-c[c="9"]:before{width:.575em;padding:.654em 0 .011em}.MJX-TEX .mjx-b mjx-c[c=":"]:before{width:.319em;padding:.444em 0 0}.MJX-TEX .mjx-b mjx-c[c=";"]:before{width:.319em;padding:.444em 0 .194em}.MJX-TEX .mjx-b mjx-c[c="<"]:before{width:.894em;padding:.587em 0 .085em}.MJX-TEX .mjx-b mjx-c[c="="]:before{width:.894em;padding:.393em 0 0}.MJX-TEX .mjx-b mjx-c[c=">"]:before{width:.894em;padding:.587em 0 .085em}.MJX-TEX .mjx-b mjx-c[c="?"]:before{width:.543em;padding:.7em 0 0}.MJX-TEX .mjx-b mjx-c[c="@"]:before{width:.894em;padding:.699em 0 .006em}.MJX-TEX .mjx-b mjx-c[c=A]:before{width:.869em;padding:.698em 0 0}.MJX-TEX .mjx-b mjx-c[c=B]:before{width:.818em}.MJX-TEX .mjx-b mjx-c[c=C]:before{width:.831em;padding:.697em 0 .011em}.MJX-TEX .mjx-b mjx-c[c=D]:before{width:.882em}.MJX-TEX .mjx-b mjx-c[c=E]:before{width:.756em}.MJX-TEX .mjx-b mjx-c[c=F]:before{width:.724em}.MJX-TEX .mjx-b mjx-c[c=G]:before{width:.904em;padding:.697em 0 .01em}.MJX-TEX .mjx-b mjx-c[c=H]:before{width:.9em}.MJX-TEX .mjx-b mjx-c[c=I]:before{width:.436em}.MJX-TEX .mjx-b mjx-c[c=J]:before{width:.594em;padding:.686em 0 .011em}.MJX-TEX .mjx-b mjx-c[c=K]:before{width:.901em}.MJX-TEX .mjx-b mjx-c[c=L]:before{width:.692em}.MJX-TEX .mjx-b mjx-c[c=M]:before{width:1.092em}.MJX-TEX .mjx-b mjx-c[c=N]:before{width:.9em}.MJX-TEX .mjx-b mjx-c[c=O]:before{width:.864em;padding:.696em 0 .01em}.MJX-TEX .mjx-b mjx-c[c=P]:before{width:.786em}.MJX-TEX .mjx-b mjx-c[c=Q]:before{width:.864em;padding:.696em 0 .193em}.MJX-TEX .mjx-b mjx-c[c=R]:before{width:.862em;padding:.686em 0 .011em}.MJX-TEX .mjx-b mjx-c[c=S]:before{width:.639em;padding:.697em 0 .011em}.MJX-TEX .mjx-b mjx-c[c=T]:before{width:.8em}.MJX-TEX .mjx-b mjx-c[c=U]:before{width:.885em;padding:.686em 0 .011em}.MJX-TEX .mjx-b mjx-c[c=V]:before{width:.869em;padding:.686em 0 .007em}.MJX-TEX .mjx-b mjx-c[c=W]:before{width:1.189em;padding:.686em 0 .007em}.MJX-TEX .mjx-b mjx-c[c=X]:before,.MJX-TEX .mjx-b mjx-c[c=Y]:before{width:.869em}.MJX-TEX .mjx-b mjx-c[c=Z]:before{width:.703em}.MJX-TEX .mjx-b mjx-c[c="["]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c="5C"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="]"]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c="^"]:before,.MJX-TEX .mjx-b mjx-c[c=_]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="`"]:before{width:.575em;padding:.706em 0 0}.MJX-TEX .mjx-b mjx-c[c=a]:before{width:.559em;padding:.453em 0 .006em}.MJX-TEX .mjx-b mjx-c[c=b]:before{width:.639em}.MJX-TEX .mjx-b mjx-c[c=c]:before{width:.511em;padding:.453em 0 .006em}.MJX-TEX .mjx-b mjx-c[c=d]:before{width:.639em}.MJX-TEX .mjx-b mjx-c[c=e]:before{width:.527em}.MJX-TEX .mjx-b mjx-c[c=f]:before{width:.351em;padding:.7em 0 0}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b mjx-c[c=f]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b mjx-c[c=f]:last-child:before{width:.452em}.MJX-TEX .mjx-b mjx-c[c=g]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c=h]:before{width:.639em}.MJX-TEX .mjx-b mjx-c[c=i]:before{width:.319em;padding:.695em 0 0}.MJX-TEX .mjx-b mjx-c[c=j]:before{width:.351em;padding:.695em 0 .2em}.MJX-TEX .mjx-b mjx-c[c=k]:before{width:.607em}.MJX-TEX .mjx-b mjx-c[c=l]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c=m]:before{width:.958em;padding:.45em 0 0}.MJX-TEX .mjx-b mjx-c[c=n]:before{width:.639em;padding:.45em 0 0}.MJX-TEX .mjx-b mjx-c[c=o]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c=p]:before{width:.639em;padding:.45em 0 .194em}.MJX-TEX .mjx-b mjx-c[c=q]:before{width:.607em;padding:.45em 0 .194em}.MJX-TEX .mjx-b mjx-c[c=r]:before{width:.474em;padding:.45em 0 0}.MJX-TEX .mjx-b mjx-c[c=s]:before{width:.454em;padding:.453em 0 .006em}.MJX-TEX .mjx-b mjx-c[c=t]:before{width:.447em;padding:.635em 0 .005em}.MJX-TEX .mjx-b mjx-c[c=u]:before{width:.639em;padding:.45em 0 .006em}.MJX-TEX .mjx-b mjx-c[c=v]:before{width:.607em;padding:.444em 0 0}.MJX-TEX .mjx-b mjx-c[c=w]:before{width:.831em;padding:.444em 0 0}.MJX-TEX .mjx-b mjx-c[c=x]:before{width:.607em;padding:.444em 0 0}.MJX-TEX .mjx-b mjx-c[c=y]:before{width:.607em;padding:.444em 0 .2em}.MJX-TEX .mjx-b mjx-c[c=z]:before{width:.511em;padding:.444em 0 0}.MJX-TEX .mjx-b mjx-c[c="{"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="|"]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c="}"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="~"]:before{width:.575em;padding:.344em 0 0}.MJX-TEX .mjx-b mjx-c[c=A8]:before{width:.575em;padding:.695em 0 0}.MJX-TEX .mjx-b mjx-c[c=AC]:before{width:.767em;padding:.371em 0 0}.MJX-TEX .mjx-b mjx-c[c=AF]:before{width:.575em;padding:.607em 0 0}.MJX-TEX .mjx-b mjx-c[c=B0]:before{width:.575em;padding:.702em 0 0}.MJX-TEX .mjx-b mjx-c[c=B1]:before{width:.894em;padding:.728em 0 .035em}.MJX-TEX .mjx-b mjx-c[c=B4]:before{width:.575em;padding:.706em 0 0}.MJX-TEX .mjx-b mjx-c[c=B7]:before{width:.319em;padding:.336em 0 0}.MJX-TEX .mjx-b mjx-c[c=D7]:before{width:.894em;padding:.53em 0 .028em}.MJX-TEX .mjx-b mjx-c[c=F7]:before{width:.894em;padding:.597em 0 .096em}.MJX-TEX .mjx-b mjx-c[c="131"]:before{width:.394em;padding:.452em 0 .008em}.MJX-TEX .mjx-b mjx-c[c="237"]:before{width:.439em;padding:.451em 0 .201em}.MJX-TEX .mjx-b mjx-c[c="2B9"]:before{width:.344em}.MJX-TEX .mjx-b mjx-c[c="2C6"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="2C7"]:before{width:.575em;padding:.66em 0 0}.MJX-TEX .mjx-b mjx-c[c="2C9"]:before{width:.575em;padding:.607em 0 0}.MJX-TEX .mjx-b mjx-c[c="2CA"]:before,.MJX-TEX .mjx-b mjx-c[c="2CB"]:before{width:.575em;padding:.706em 0 0}.MJX-TEX .mjx-b mjx-c[c="2D8"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="2D9"]:before{width:.575em;padding:.695em 0 0}.MJX-TEX .mjx-b mjx-c[c="2DA"]:before{width:.575em;padding:.702em 0 0}.MJX-TEX .mjx-b mjx-c[c="2DC"]:before{width:.575em;padding:.694em 0 0}.MJX-TEX .mjx-b mjx-c[c="300"]:before,.MJX-TEX .mjx-b mjx-c[c="301"]:before{padding:.706em 0 0}.MJX-TEX .mjx-b mjx-c[c="303"]:before{padding:.694em 0 0}.MJX-TEX .mjx-b mjx-c[c="304"]:before{padding:.607em 0 0}.MJX-TEX .mjx-b mjx-c[c="307"]:before,.MJX-TEX .mjx-b mjx-c[c="308"]:before{padding:.695em 0 0}.MJX-TEX .mjx-b mjx-c[c="30A"]:before{padding:.702em 0 0}.MJX-TEX .mjx-b mjx-c[c="30B"]:before{padding:.714em 0 0}.MJX-TEX .mjx-b mjx-c[c="30C"]:before{padding:.66em 0 0}.MJX-TEX .mjx-b mjx-c[c="338"]:before{padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="391"]:before{width:.869em;padding:.698em 0 0}.MJX-TEX .mjx-b mjx-c[c="392"]:before{width:.818em}.MJX-TEX .mjx-b mjx-c[c="393"]:before{width:.692em}.MJX-TEX .mjx-b mjx-c[c="394"]:before{width:.958em;padding:.698em 0 0}.MJX-TEX .mjx-b mjx-c[c="395"]:before{width:.756em}.MJX-TEX .mjx-b mjx-c[c="396"]:before{width:.703em}.MJX-TEX .mjx-b mjx-c[c="397"]:before{width:.9em}.MJX-TEX .mjx-b mjx-c[c="398"]:before{width:.894em;padding:.696em 0 .01em}.MJX-TEX .mjx-b mjx-c[c="399"]:before{width:.436em}.MJX-TEX .mjx-b mjx-c[c="39A"]:before{width:.901em}.MJX-TEX .mjx-b mjx-c[c="39B"]:before{width:.806em;padding:.698em 0 0}.MJX-TEX .mjx-b mjx-c[c="39C"]:before{width:1.092em}.MJX-TEX .mjx-b mjx-c[c="39D"]:before{width:.9em}.MJX-TEX .mjx-b mjx-c[c="39E"]:before{width:.767em}.MJX-TEX .mjx-b mjx-c[c="39F"]:before{width:.864em;padding:.696em 0 .01em}.MJX-TEX .mjx-b mjx-c[c="3A0"]:before{width:.9em}.MJX-TEX .mjx-b mjx-c[c="3A1"]:before{width:.786em}.MJX-TEX .mjx-b mjx-c[c="3A2"]:before{width:.894em;padding:.696em 0 .01em}.MJX-TEX .mjx-b mjx-c[c="3A3"]:before{width:.831em}.MJX-TEX .mjx-b mjx-c[c="3A4"]:before{width:.8em}.MJX-TEX .mjx-b mjx-c[c="3A5"]:before{width:.894em;padding:.697em 0 0}.MJX-TEX .mjx-b mjx-c[c="3A6"]:before{width:.831em}.MJX-TEX .mjx-b mjx-c[c="3A7"]:before{width:.869em}.MJX-TEX .mjx-b mjx-c[c="3A8"]:before{width:.894em}.MJX-TEX .mjx-b mjx-c[c="3A9"]:before{width:.831em;padding:.696em 0 0}.MJX-TEX .mjx-b mjx-c[c="3B1"]:before{width:.761em;padding:.452em 0 .008em;content:"\3B1"}.MJX-TEX .mjx-b mjx-c[c="3B2"]:before{width:.66em;padding:.701em 0 .194em;content:"\3B2"}.MJX-TEX .mjx-b mjx-c[c="3B3"]:before{width:.59em;padding:.451em 0 .211em;content:"\3B3"}.MJX-TEX .mjx-b mjx-c[c="3B4"]:before{width:.522em;padding:.725em 0 .008em;content:"\3B4"}.MJX-TEX .mjx-b mjx-c[c="3B5"]:before{width:.529em;padding:.461em 0 .017em;content:"\3B5"}.MJX-TEX .mjx-b mjx-c[c="3B6"]:before{width:.508em;padding:.711em 0 .202em;content:"\3B6"}.MJX-TEX .mjx-b mjx-c[c="3B7"]:before{width:.6em;padding:.452em 0 .211em;content:"\3B7"}.MJX-TEX .mjx-b mjx-c[c="3B8"]:before{width:.562em;padding:.702em 0 .008em;content:"\3B8"}.MJX-TEX .mjx-b mjx-c[c="3B9"]:before{width:.412em;padding:.452em 0 .008em;content:"\3B9"}.MJX-TEX .mjx-b mjx-c[c="3BA"]:before{width:.668em;padding:.452em 0 .008em;content:"\3BA"}.MJX-TEX .mjx-b mjx-c[c="3BB"]:before{width:.671em;padding:.694em 0 .013em;content:"\3BB"}.MJX-TEX .mjx-b mjx-c[c="3BC"]:before{width:.708em;padding:.452em 0 .211em;content:"\3BC"}.MJX-TEX .mjx-b mjx-c[c="3BD"]:before{width:.577em;padding:.452em 0 0;content:"\3BD"}.MJX-TEX .mjx-b mjx-c[c="3BE"]:before{width:.508em;padding:.711em 0 .201em;content:"\3BE"}.MJX-TEX .mjx-b mjx-c[c="3BF"]:before{width:.585em;padding:.452em 0 .008em;content:"\3BF"}.MJX-TEX .mjx-b mjx-c[c="3C0"]:before{width:.682em;padding:.444em 0 .008em;content:"\3C0"}.MJX-TEX .mjx-b mjx-c[c="3C1"]:before{width:.612em;padding:.451em 0 .211em;content:"\3C1"}.MJX-TEX .mjx-b mjx-c[c="3C2"]:before{width:.424em;padding:.451em 0 .105em;content:"\3C2"}.MJX-TEX .mjx-b mjx-c[c="3C3"]:before{width:.686em;padding:.444em 0 .008em;content:"\3C3"}.MJX-TEX .mjx-b mjx-c[c="3C4"]:before{width:.521em;padding:.444em 0 .013em;content:"\3C4"}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b mjx-c[c="3C4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b mjx-c[c="3C4"]:last-child:before{width:.61em}.MJX-TEX .mjx-b mjx-c[c="3C5"]:before{width:.631em;padding:.453em 0 .008em;content:"\3C5"}.MJX-TEX .mjx-b mjx-c[c="3C6"]:before{width:.747em;padding:.452em 0 .216em;content:"\3C6"}.MJX-TEX .mjx-b mjx-c[c="3C7"]:before{width:.718em;padding:.452em 0 .201em;content:"\3C7"}.MJX-TEX .mjx-b mjx-c[c="3C8"]:before{width:.758em;padding:.694em 0 .202em;content:"\3C8"}.MJX-TEX .mjx-b mjx-c[c="3C9"]:before{width:.718em;padding:.453em 0 .008em;content:"\3C9"}.MJX-TEX .mjx-b mjx-c[c="3D1"]:before{width:.692em;padding:.701em 0 .008em;content:"\3D1"}.MJX-TEX .mjx-b mjx-c[c="3D2"]:before{width:.894em;padding:.697em 0 0}.MJX-TEX .mjx-b mjx-c[c="3D5"]:before{width:.712em;padding:.694em 0 .202em;content:"\3D5"}.MJX-TEX .mjx-b mjx-c[c="3D6"]:before{width:.975em;padding:.444em 0 .008em;content:"\3D6"}.MJX-TEX .mjx-b mjx-c[c="3DC"]:before{width:.724em}.MJX-TEX .mjx-b mjx-c[c="3F1"]:before{width:.612em;padding:.451em 0 .194em;content:"\3F1"}.MJX-TEX .mjx-b mjx-c[c="3F5"]:before{width:.483em;padding:.444em 0 .007em;content:"\3F5"}.MJX-TEX .mjx-b mjx-c[c="2003"]:before{width:.999em}.MJX-TEX .mjx-b mjx-c[c="200A"]:before{width:.083em}.MJX-TEX .mjx-b mjx-c[c="2013"]:before{width:.575em;padding:.3em 0 0}.MJX-TEX .mjx-b mjx-c[c="2014"]:before,.MJX-TEX .mjx-b mjx-c[c="2015"]:before{width:1.15em;padding:.3em 0 0}.MJX-TEX .mjx-b mjx-c[c="2016"]:before,.MJX-TEX .mjx-b mjx-c[c="2017"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="2018"]:before,.MJX-TEX .mjx-b mjx-c[c="2019"]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c="201C"]:before,.MJX-TEX .mjx-b mjx-c[c="201D"]:before{width:.603em}.MJX-TEX .mjx-b mjx-c[c="2020"]:before{width:.511em;padding:.702em 0 .211em}.MJX-TEX .mjx-b mjx-c[c="2021"]:before{width:.511em}.MJX-TEX .mjx-b mjx-c[c="2022"]:before{width:.575em;padding:.474em 0 0}.MJX-TEX .mjx-b mjx-c[c="2026"]:before{width:1.295em;padding:.171em 0 0}.MJX-TEX .mjx-b mjx-c[c="2032"]:before{width:.344em}.MJX-TEX .mjx-b mjx-c[c="2033"]:before{width:.688em}.MJX-TEX .mjx-b mjx-c[c="2034"]:before{width:1.032em}.MJX-TEX .mjx-b mjx-c[c="203E"]:before{width:.575em;padding:.607em 0 0}.MJX-TEX .mjx-b mjx-c[c="2044"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="2057"]:before{width:1.376em}.MJX-TEX .mjx-b mjx-c[c="20D7"]:before{width:.575em;padding:.723em 0 0;font-family:MJXZERO,MJXTEX-VB}.MJX-TEX .mjx-b mjx-c[c="210F"]:before{width:.668em}.MJX-TEX .mjx-b mjx-c[c="2113"]:before{width:.474em}.MJX-TEX .mjx-b mjx-c[c="2118"]:before{width:.74em;padding:.461em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="2135"]:before{width:.703em}.MJX-TEX .mjx-b mjx-c[c="2190"]:before{width:1.15em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="2191"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="2192"]:before{width:1.15em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="2193"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="2194"]:before{width:1.15em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="2195"]:before{width:.575em;padding:.767em 0 .267em}.MJX-TEX .mjx-b mjx-c[c="2196"]:before,.MJX-TEX .mjx-b mjx-c[c="2197"]:before,.MJX-TEX .mjx-b mjx-c[c="2198"]:before,.MJX-TEX .mjx-b mjx-c[c="2199"]:before{width:1.15em}.MJX-TEX .mjx-b mjx-c[c="219A"]:before{width:1.15em;padding:.711em 0 .21em;content:"\2190\338"}.MJX-TEX .mjx-b mjx-c[c="219B"]:before{width:1.15em;padding:.711em 0 .21em;content:"\2192\338"}.MJX-TEX .mjx-b mjx-c[c="21A6"]:before{width:1.15em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="21A9"]:before,.MJX-TEX .mjx-b mjx-c[c="21AA"]:before{width:1.282em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="21AE"]:before{width:1.15em;padding:.711em 0 .21em;content:"\2194\338"}.MJX-TEX .mjx-b mjx-c[c="21BC"]:before{width:1.15em;padding:.518em 0 0}.MJX-TEX .mjx-b mjx-c[c="21BD"]:before{width:1.15em;padding:.281em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="21C0"]:before{width:1.15em;padding:.518em 0 0}.MJX-TEX .mjx-b mjx-c[c="21C1"]:before{width:1.15em;padding:.281em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="21CC"]:before{width:1.15em;padding:.718em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="21CD"]:before{width:1.15em;padding:.711em 0 .21em;content:"\21D0\338"}.MJX-TEX .mjx-b mjx-c[c="21CE"]:before{width:1.15em;padding:.711em 0 .21em;content:"\21D4\338"}.MJX-TEX .mjx-b mjx-c[c="21CF"]:before{width:1.15em;padding:.711em 0 .21em;content:"\21D2\338"}.MJX-TEX .mjx-b mjx-c[c="21D0"]:before{width:1.15em;padding:.547em 0 .046em}.MJX-TEX .mjx-b mjx-c[c="21D1"]:before{width:.703em}.MJX-TEX .mjx-b mjx-c[c="21D2"]:before{width:1.15em;padding:.547em 0 .046em}.MJX-TEX .mjx-b mjx-c[c="21D3"]:before{width:.703em}.MJX-TEX .mjx-b mjx-c[c="21D4"]:before{width:1.15em;padding:.547em 0 .046em}.MJX-TEX .mjx-b mjx-c[c="21D5"]:before{width:.703em;padding:.767em 0 .267em}.MJX-TEX .mjx-b mjx-c[c="2200"]:before{width:.639em;padding:.694em 0 .016em}.MJX-TEX .mjx-b mjx-c[c="2202"]:before{width:.628em;padding:.71em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="2203"]:before{width:.639em}.MJX-TEX .mjx-b mjx-c[c="2204"]:before{width:.639em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="2205"]:before{width:.575em;padding:.767em 0 .073em}.MJX-TEX .mjx-b mjx-c[c="2206"]:before{width:.958em;padding:.698em 0 0}.MJX-TEX .mjx-b mjx-c[c="2207"]:before{width:.958em;padding:.686em 0 .024em}.MJX-TEX .mjx-b mjx-c[c="2208"]:before{width:.767em;padding:.587em 0 .086em}.MJX-TEX .mjx-b mjx-c[c="2209"]:before{width:.767em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="220B"]:before{width:.767em;padding:.587em 0 .086em}.MJX-TEX .mjx-b mjx-c[c="220C"]:before{width:.767em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="2212"]:before{width:.894em;padding:.281em 0 0}.MJX-TEX .mjx-b mjx-c[c="2213"]:before{width:.894em;padding:.537em 0 .227em}.MJX-TEX .mjx-b mjx-c[c="2215"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="2216"]:before{width:.575em;padding:.75em 0 .25em}.MJX-TEX .mjx-b mjx-c[c="2217"]:before{width:.575em;padding:.472em 0 0}.MJX-TEX .mjx-b mjx-c[c="2218"]:before,.MJX-TEX .mjx-b mjx-c[c="2219"]:before{width:.575em;padding:.474em 0 0}.MJX-TEX .mjx-b mjx-c[c="221A"]:before{width:.958em;padding:.82em 0 .18em}.MJX-TEX .mjx-b mjx-c[c="221D"]:before{width:.894em;padding:.451em 0 .008em}.MJX-TEX .mjx-b mjx-c[c="221E"]:before{width:1.15em;padding:.452em 0 .008em}.MJX-TEX .mjx-b mjx-c[c="2220"]:before{padding:.714em 0 0}.MJX-TEX .mjx-b mjx-c[c="2223"]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c="2224"]:before{width:.319em;content:"\2223\338"}.MJX-TEX .mjx-b mjx-c[c="2225"]:before{width:.575em}.MJX-TEX .mjx-b mjx-c[c="2226"]:before{width:.575em;content:"\2225\338"}.MJX-TEX .mjx-b mjx-c[c="2227"]:before{width:.767em;padding:.604em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="2228"]:before{width:.767em;padding:.604em 0 .016em}.MJX-TEX .mjx-b mjx-c[c="2229"]:before{width:.767em;padding:.603em 0 .016em}.MJX-TEX .mjx-b mjx-c[c="222A"]:before{width:.767em;padding:.604em 0 .016em}.MJX-TEX .mjx-b mjx-c[c="222B"]:before{width:.569em;padding:.711em 0 .211em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b mjx-c[c="222B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b mjx-c[c="222B"]:last-child:before{width:.632em}.MJX-TEX .mjx-b mjx-c[c="223C"]:before{width:.894em;padding:.391em 0 0}.MJX-TEX .mjx-b mjx-c[c="2240"]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c="2241"]:before{width:.894em;padding:.711em 0 .21em;content:"\223C\338"}.MJX-TEX .mjx-b mjx-c[c="2243"]:before{width:.894em;padding:.502em 0 0}.MJX-TEX .mjx-b mjx-c[c="2244"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="2245"]:before{width:.894em;padding:.638em 0 .027em}.MJX-TEX .mjx-b mjx-c[c="2247"]:before{width:.894em;padding:.711em 0 .21em;content:"\2245\338"}.MJX-TEX .mjx-b mjx-c[c="2248"]:before{width:.894em;padding:.524em 0 0}.MJX-TEX .mjx-b mjx-c[c="2249"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="224D"]:before{width:.894em;padding:.533em 0 .032em}.MJX-TEX .mjx-b mjx-c[c="2250"]:before{width:.894em;padding:.721em 0 0}.MJX-TEX .mjx-b mjx-c[c="2260"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="2261"]:before{width:.894em;padding:.505em 0 0}.MJX-TEX .mjx-b mjx-c[c="2262"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="2264"]:before,.MJX-TEX .mjx-b mjx-c[c="2265"]:before{width:.894em;padding:.697em 0 .199em}.MJX-TEX .mjx-b mjx-c[c="226A"]:before{width:1.15em;padding:.617em 0 .116em}.MJX-TEX .mjx-b mjx-c[c="226B"]:before{width:1.15em;padding:.618em 0 .116em}.MJX-TEX .mjx-b mjx-c[c="226D"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="226E"]:before{width:.894em;content:"<\338"}.MJX-TEX .mjx-b mjx-c[c="226F"]:before{width:.894em;content:">\338"}.MJX-TEX .mjx-b mjx-c[c="2270"]:before{width:.894em;padding:.711em 0 .21em;content:"\2264\338"}.MJX-TEX .mjx-b mjx-c[c="2271"]:before{width:.894em;padding:.711em 0 .21em;content:"\2265\338"}.MJX-TEX .mjx-b mjx-c[c="227A"]:before{width:.894em;padding:.585em 0 .086em}.MJX-TEX .mjx-b mjx-c[c="227B"]:before{width:.894em;padding:.586em 0 .086em}.MJX-TEX .mjx-b mjx-c[c="2280"]:before{width:.894em;padding:.711em 0 .21em;content:"\227A\338"}.MJX-TEX .mjx-b mjx-c[c="2281"]:before{width:.894em;padding:.711em 0 .21em;content:"\227B\338"}.MJX-TEX .mjx-b mjx-c[c="2282"]:before{width:.894em;padding:.587em 0 .085em}.MJX-TEX .mjx-b mjx-c[c="2283"]:before{width:.894em;padding:.587em 0 .086em}.MJX-TEX .mjx-b mjx-c[c="2284"]:before,.MJX-TEX .mjx-b mjx-c[c="2285"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="2286"]:before,.MJX-TEX .mjx-b mjx-c[c="2287"]:before{width:.894em;padding:.697em 0 .199em}.MJX-TEX .mjx-b mjx-c[c="2288"]:before{width:.894em;padding:.711em 0 .21em;content:"\2286\338"}.MJX-TEX .mjx-b mjx-c[c="2289"]:before{width:.894em;padding:.711em 0 .21em;content:"\2287\338"}.MJX-TEX .mjx-b mjx-c[c="228E"]:before{width:.767em;padding:.604em 0 .016em}.MJX-TEX .mjx-b mjx-c[c="2291"]:before,.MJX-TEX .mjx-b mjx-c[c="2292"]:before{width:.894em;padding:.697em 0 .199em}.MJX-TEX .mjx-b mjx-c[c="2293"]:before,.MJX-TEX .mjx-b mjx-c[c="2294"]:before{width:.767em;padding:.604em 0 0}.MJX-TEX .mjx-b mjx-c[c="2295"]:before,.MJX-TEX .mjx-b mjx-c[c="2296"]:before,.MJX-TEX .mjx-b mjx-c[c="2297"]:before,.MJX-TEX .mjx-b mjx-c[c="2298"]:before,.MJX-TEX .mjx-b mjx-c[c="2299"]:before{width:.894em;padding:.632em 0 .132em}.MJX-TEX .mjx-b mjx-c[c="22A2"]:before,.MJX-TEX .mjx-b mjx-c[c="22A3"]:before{width:.703em}.MJX-TEX .mjx-b mjx-c[c="22A4"]:before{width:.894em;padding:.694em 0 0}.MJX-TEX .mjx-b mjx-c[c="22A5"]:before{width:.894em;padding:.693em 0 0}.MJX-TEX .mjx-b mjx-c[c="22A8"]:before{width:.974em}.MJX-TEX .mjx-b mjx-c[c="22AC"]:before{width:.703em;padding:.711em 0 .21em;content:"\22A2\338"}.MJX-TEX .mjx-b mjx-c[c="22AD"]:before{width:.974em;padding:.75em 0 .249em;content:"\22A8\338"}.MJX-TEX .mjx-b mjx-c[c="22C4"]:before{width:.575em;padding:.523em 0 .021em}.MJX-TEX .mjx-b mjx-c[c="22C5"]:before{width:.319em;padding:.336em 0 0}.MJX-TEX .mjx-b mjx-c[c="22C6"]:before{width:.575em;padding:.502em 0 0}.MJX-TEX .mjx-b mjx-c[c="22C8"]:before{width:1em;padding:.54em 0 .039em}.MJX-TEX .mjx-b mjx-c[c="22E2"]:before,.MJX-TEX .mjx-b mjx-c[c="22E3"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="22EE"]:before{width:.319em;padding:.951em 0 .029em}.MJX-TEX .mjx-b mjx-c[c="22EF"]:before{width:1.295em;padding:.336em 0 0}.MJX-TEX .mjx-b mjx-c[c="22F1"]:before{width:1.323em;padding:.871em 0 0}.MJX-TEX .mjx-b mjx-c[c="230A"]:before,.MJX-TEX .mjx-b mjx-c[c="230B"]:before,.MJX-TEX .mjx-b mjx-c[c="2308"]:before,.MJX-TEX .mjx-b mjx-c[c="2309"]:before{width:.511em}.MJX-TEX .mjx-b mjx-c[c="2322"]:before{width:1.15em;padding:.405em 0 0}.MJX-TEX .mjx-b mjx-c[c="2323"]:before{width:1.15em;padding:.392em 0 0}.MJX-TEX .mjx-b mjx-c[c="232A"]:before,.MJX-TEX .mjx-b mjx-c[c="2329"]:before{width:.447em}.MJX-TEX .mjx-b mjx-c[c="25B3"]:before,.MJX-TEX .mjx-b mjx-c[c="25B5"]:before{width:1.022em;padding:.711em 0 0}.MJX-TEX .mjx-b mjx-c[c="25B9"]:before{width:.575em;padding:.54em 0 .039em}.MJX-TEX .mjx-b mjx-c[c="25BD"]:before,.MJX-TEX .mjx-b mjx-c[c="25BF"]:before{width:1.022em;padding:.5em 0 .21em}.MJX-TEX .mjx-b mjx-c[c="25C3"]:before{width:.575em;padding:.539em 0 .038em}.MJX-TEX .mjx-b mjx-c[c="25EF"]:before{width:1.15em}.MJX-TEX .mjx-b mjx-c[c="2660"]:before{width:.894em;padding:.719em 0 .129em}.MJX-TEX .mjx-b mjx-c[c="2661"]:before{width:.894em;padding:.711em 0 .024em}.MJX-TEX .mjx-b mjx-c[c="2662"]:before{width:.894em;padding:.719em 0 .154em}.MJX-TEX .mjx-b mjx-c[c="2663"]:before{width:.894em;padding:.719em 0 .129em}.MJX-TEX .mjx-b mjx-c[c="266D"]:before{width:.447em}.MJX-TEX .mjx-b mjx-c[c="266E"]:before{width:.447em;padding:.741em 0 .223em}.MJX-TEX .mjx-b mjx-c[c="266F"]:before{width:.447em}.MJX-TEX .mjx-b mjx-c[c="2758"]:before{width:.319em}.MJX-TEX .mjx-b mjx-c[c="27E8"]:before,.MJX-TEX .mjx-b mjx-c[c="27E9"]:before{width:.447em}.MJX-TEX .mjx-b mjx-c[c="27F5"]:before{width:1.805em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="27F6"]:before{width:1.833em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="27F7"]:before{width:2.126em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="27F8"]:before{width:1.868em;padding:.547em 0 .046em}.MJX-TEX .mjx-b mjx-c[c="27F9"]:before{width:1.87em;padding:.547em 0 .046em}.MJX-TEX .mjx-b mjx-c[c="27FA"]:before{width:2.126em;padding:.547em 0 .046em}.MJX-TEX .mjx-b mjx-c[c="27FC"]:before{width:1.833em;padding:.518em 0 .017em}.MJX-TEX .mjx-b mjx-c[c="29F8"]:before{width:.894em;padding:.711em 0 .21em;font-family:MJXZERO,MJXTEX-BI}.MJX-TEX .mjx-b mjx-c[c="2A2F"]:before{width:.894em;padding:.53em 0 .028em}.MJX-TEX .mjx-b mjx-c[c="2A3F"]:before{width:.9em}.MJX-TEX .mjx-b mjx-c[c="2AAF"]:before{width:.894em;padding:.696em 0 .199em}.MJX-TEX .mjx-b mjx-c[c="2AB0"]:before{width:.894em;padding:.697em 0 .199em}.MJX-TEX .mjx-b mjx-c[c="3008"]:before,.MJX-TEX .mjx-b mjx-c[c="3009"]:before{width:.447em}.MJX-TEX .mjx-i mjx-c[c="!"]:before{width:.307em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="!"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="!"]:last-child:before{width:.38em}.MJX-TEX .mjx-i mjx-c[c="22"]:before{width:.514em}.MJX-TEX .mjx-i mjx-c[c="#"]:before,.MJX-TEX .mjx-i mjx-c[c="%"]:before{width:.818em}.MJX-TEX .mjx-i mjx-c[c="&"]:before{width:.767em}.MJX-TEX .mjx-i mjx-c[c="27"]:before{width:.307em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="27"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="27"]:last-child:before{width:.377em}.MJX-TEX .mjx-i mjx-c[c="("]:before{width:.409em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="("]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="("]:last-child:before{width:.517em}.MJX-TEX .mjx-i mjx-c[c=")"]:before{width:.409em}.MJX-TEX .mjx-i mjx-c[c="*"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="*"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="*"]:last-child:before{width:.584em}.MJX-TEX .mjx-i mjx-c[c="+"]:before{width:.767em;padding:.557em 0 .057em}.MJX-TEX .mjx-i mjx-c[c=","]:before{width:.307em}.MJX-TEX .mjx-i mjx-c[c="-"]:before{width:.358em}.MJX-TEX .mjx-i mjx-c[c="."]:before{width:.307em}.MJX-TEX .mjx-i mjx-c[c="/"]:before{width:.778em;padding:.716em 0 .215em}.MJX-TEX .mjx-i mjx-c[c="0"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="0"]:last-child:before{width:.562em}.MJX-TEX .mjx-i mjx-c[c="1"]:before{width:.511em}.MJX-TEX .mjx-i mjx-c[c="2"]:before{width:.511em;padding:.666em 0 .022em}.MJX-TEX .mjx-i mjx-c[c="3"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3"]:last-child:before{width:.562em}.MJX-TEX .mjx-i mjx-c[c="4"]:before{width:.511em;padding:.666em 0 .194em}.MJX-TEX .mjx-i mjx-c[c="5"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="5"]:last-child:before{width:.567em}.MJX-TEX .mjx-i mjx-c[c="6"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="6"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="6"]:last-child:before{width:.565em}.MJX-TEX .mjx-i mjx-c[c="7"]:before{width:.511em;padding:.666em 0 .022em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="7"]:last-child:before{width:.634em}.MJX-TEX .mjx-i mjx-c[c="8"]:before,.MJX-TEX .mjx-i mjx-c[c="9"]:before{width:.511em}.MJX-TEX .mjx-i mjx-c[c=":"]:before,.MJX-TEX .mjx-i mjx-c[c=";"]:before{width:.307em}.MJX-TEX .mjx-i mjx-c[c="="]:before{width:.767em;padding:.367em 0 0}.MJX-TEX .mjx-i mjx-c[c="?"]:before{width:.511em;padding:.716em 0 0}.MJX-TEX .mjx-i mjx-c[c="@"]:before{width:.767em}.MJX-TEX .mjx-i mjx-c[c=B]:before{width:.759em}.MJX-TEX .mjx-i mjx-c[c=C]:before{width:.715em}.MJX-TEX .mjx-i mjx-c[c=D]:before{width:.828em}.MJX-TEX .mjx-i mjx-c[c=E]:before{width:.738em}.MJX-TEX .mjx-i mjx-c[c=F]:before{width:.643em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=F]:last-child:before{width:.749em}.MJX-TEX .mjx-i mjx-c[c=G]:before{width:.786em}.MJX-TEX .mjx-i mjx-c[c=H]:before{width:.831em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=H]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=H]:last-child:before{width:.888em}.MJX-TEX .mjx-i mjx-c[c=I]:before{width:.44em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=I]:last-child:before{width:.504em}.MJX-TEX .mjx-i mjx-c[c=J]:before{width:.555em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=J]:last-child:before{width:.633em}.MJX-TEX .mjx-i mjx-c[c=K]:before{width:.849em}.MJX-TEX .mjx-i mjx-c[c=L]:before{width:.681em}.MJX-TEX .mjx-i mjx-c[c=M]:before{width:.97em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=M]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=M]:last-child:before{width:1.051em}.MJX-TEX .mjx-i mjx-c[c=N]:before{width:.803em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=N]:last-child:before{width:.888em}.MJX-TEX .mjx-i mjx-c[c=O]:before{width:.763em}.MJX-TEX .mjx-i mjx-c[c=P]:before{width:.642em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=P]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=P]:last-child:before{width:.751em}.MJX-TEX .mjx-i mjx-c[c=Q]:before{width:.791em}.MJX-TEX .mjx-i mjx-c[c=R]:before{width:.759em}.MJX-TEX .mjx-i mjx-c[c=S]:before{width:.613em}.MJX-TEX .mjx-i mjx-c[c=T]:before{width:.584em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=T]:last-child:before{width:.704em}.MJX-TEX .mjx-i mjx-c[c=U]:before{width:.683em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=U]:last-child:before{width:.767em}.MJX-TEX .mjx-i mjx-c[c=V]:before{width:.583em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=V]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=V]:last-child:before{width:.769em}.MJX-TEX .mjx-i mjx-c[c=W]:before{width:.944em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=W]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=W]:last-child:before{width:1.048em}.MJX-TEX .mjx-i mjx-c[c=X]:before{width:.828em}.MJX-TEX .mjx-i mjx-c[c=Y]:before{width:.581em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=Y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=Y]:last-child:before{width:.763em}.MJX-TEX .mjx-i mjx-c[c=Z]:before{width:.683em}.MJX-TEX .mjx-i mjx-c[c="["]:before{width:.307em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="["]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="["]:last-child:before{width:.446em}.MJX-TEX .mjx-i mjx-c[c="]"]:before{width:.307em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="]"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="]"]:last-child:before{width:.359em}.MJX-TEX .mjx-i mjx-c[c="^"]:before,.MJX-TEX .mjx-i mjx-c[c=_]:before{width:.511em}.MJX-TEX .mjx-i mjx-c[c=a]:before{width:.529em;padding:.441em 0 .01em}.MJX-TEX .mjx-i mjx-c[c=b]:before{width:.429em}.MJX-TEX .mjx-i mjx-c[c=c]:before{width:.433em;padding:.442em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=d]:before{width:.52em}.MJX-TEX .mjx-i mjx-c[c=e]:before{width:.466em;padding:.442em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=f]:before{width:.49em;padding:.705em 0 .205em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c=f]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c=f]:last-child:before{width:.55em}.MJX-TEX .mjx-i mjx-c[c=g]:before{width:.477em;padding:.442em 0 .205em}.MJX-TEX .mjx-i mjx-c[c=h]:before{width:.576em;padding:.694em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=i]:before{width:.345em;padding:.661em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=j]:before{width:.412em;padding:.661em 0 .204em}.MJX-TEX .mjx-i mjx-c[c=k]:before{width:.521em;padding:.694em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=l]:before{width:.298em;padding:.694em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=m]:before{width:.878em;padding:.442em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=n]:before{width:.6em;padding:.442em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=o]:before{width:.485em;padding:.441em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=p]:before{width:.503em}.MJX-TEX .mjx-i mjx-c[c=q]:before{width:.446em}.MJX-TEX .mjx-i mjx-c[c=r]:before{width:.451em;padding:.442em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=s]:before{width:.469em;padding:.442em 0 .01em}.MJX-TEX .mjx-i mjx-c[c=t]:before{width:.361em;padding:.626em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=u]:before{width:.572em}.MJX-TEX .mjx-i mjx-c[c=v]:before{width:.485em;padding:.443em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=w]:before{width:.716em;padding:.443em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=x]:before{width:.572em;padding:.442em 0 .011em}.MJX-TEX .mjx-i mjx-c[c=y]:before{width:.49em;padding:.442em 0 .205em}.MJX-TEX .mjx-i mjx-c[c=z]:before{width:.465em;padding:.442em 0 .011em}.MJX-TEX .mjx-i mjx-c[c="~"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="~"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="~"]:last-child:before{width:.571em}.MJX-TEX .mjx-i mjx-c[c="131"]:before{width:.307em;padding:.441em 0 .01em}.MJX-TEX .mjx-i mjx-c[c="237"]:before{width:.332em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="303"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="303"]:last-child:before{width:.06em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="304"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="304"]:last-child:before{width:.054em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="306"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="306"]:last-child:before{width:.062em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="30B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="30B"]:last-child:before{width:.065em}.MJX-TEX .mjx-i mjx-c[c="30C"]:before{padding:.638em 0 0}.MJX-TEX .mjx-i mjx-c[c="392"]:before{width:.759em}.MJX-TEX .mjx-i mjx-c[c="393"]:before{width:.615em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="393"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="393"]:last-child:before{width:.721em}.MJX-TEX .mjx-i mjx-c[c="395"]:before{width:.738em}.MJX-TEX .mjx-i mjx-c[c="396"]:before{width:.683em}.MJX-TEX .mjx-i mjx-c[c="397"]:before{width:.831em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="397"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="397"]:last-child:before{width:.888em}.MJX-TEX .mjx-i mjx-c[c="398"]:before{width:.763em}.MJX-TEX .mjx-i mjx-c[c="399"]:before{width:.44em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="399"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="399"]:last-child:before{width:.504em}.MJX-TEX .mjx-i mjx-c[c="39A"]:before{width:.849em}.MJX-TEX .mjx-i mjx-c[c="39C"]:before{width:.97em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="39C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="39C"]:last-child:before{width:1.051em}.MJX-TEX .mjx-i mjx-c[c="39D"]:before{width:.803em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="39D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="39D"]:last-child:before{width:.888em}.MJX-TEX .mjx-i mjx-c[c="39E"]:before{width:.742em}.MJX-TEX .mjx-i mjx-c[c="39F"]:before{width:.763em}.MJX-TEX .mjx-i mjx-c[c="3A0"]:before{width:.831em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3A0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3A0"]:last-child:before{width:.887em}.MJX-TEX .mjx-i mjx-c[c="3A1"]:before{width:.642em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3A1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3A1"]:last-child:before{width:.751em}.MJX-TEX .mjx-i mjx-c[c="3A2"]:before{width:.763em}.MJX-TEX .mjx-i mjx-c[c="3A3"]:before{width:.78em}.MJX-TEX .mjx-i mjx-c[c="3A4"]:before{width:.584em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3A4"]:last-child:before{width:.704em}.MJX-TEX .mjx-i mjx-c[c="3A5"]:before{width:.583em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3A5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3A5"]:last-child:before{width:.7em}.MJX-TEX .mjx-i mjx-c[c="3A6"]:before{width:.667em}.MJX-TEX .mjx-i mjx-c[c="3A7"]:before{width:.828em}.MJX-TEX .mjx-i mjx-c[c="3A8"]:before{width:.612em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3A8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3A8"]:last-child:before{width:.692em}.MJX-TEX .mjx-i mjx-c[c="3A9"]:before{width:.772em}.MJX-TEX .mjx-i mjx-c[c="3B1"]:before{width:.64em;padding:.442em 0 .011em;content:"\3B1"}.MJX-TEX .mjx-i mjx-c[c="3B2"]:before{width:.566em;padding:.705em 0 .194em;content:"\3B2"}.MJX-TEX .mjx-i mjx-c[c="3B3"]:before{width:.518em;padding:.441em 0 .216em;content:"\3B3"}.MJX-TEX .mjx-i mjx-c[c="3B4"]:before{width:.444em;padding:.717em 0 .01em;content:"\3B4"}.MJX-TEX .mjx-i mjx-c[c="3B5"]:before{width:.466em;padding:.452em 0 .022em;content:"\3B5"}.MJX-TEX .mjx-i mjx-c[c="3B6"]:before{width:.438em;padding:.704em 0 .204em;content:"\3B6"}.MJX-TEX .mjx-i mjx-c[c="3B7"]:before{width:.497em;padding:.442em 0 .216em;content:"\3B7"}.MJX-TEX .mjx-i mjx-c[c="3B8"]:before{width:.469em;padding:.705em 0 .01em;content:"\3B8"}.MJX-TEX .mjx-i mjx-c[c="3B9"]:before{width:.354em;padding:.442em 0 .01em;content:"\3B9"}.MJX-TEX .mjx-i mjx-c[c="3BA"]:before{width:.576em;padding:.442em 0 .011em;content:"\3BA"}.MJX-TEX .mjx-i mjx-c[c="3BB"]:before{width:.583em;padding:.694em 0 .012em;content:"\3BB"}.MJX-TEX .mjx-i mjx-c[c="3BC"]:before{width:.603em;padding:.442em 0 .216em;content:"\3BC"}.MJX-TEX .mjx-i mjx-c[c="3BD"]:before{width:.494em;padding:.442em 0 0;content:"\3BD"}.MJX-TEX .mjx-i mjx-c[c="3BE"]:before{width:.438em;padding:.704em 0 .205em;content:"\3BE"}.MJX-TEX .mjx-i mjx-c[c="3BF"]:before{width:.485em;padding:.441em 0 .011em;content:"\3BF"}.MJX-TEX .mjx-i mjx-c[c="3C0"]:before{width:.57em;padding:.431em 0 .011em;content:"\3C0"}.MJX-TEX .mjx-i mjx-c[c="3C1"]:before{width:.517em;padding:.442em 0 .216em;content:"\3C1"}.MJX-TEX .mjx-i mjx-c[c="3C2"]:before{width:.363em;padding:.442em 0 .107em;content:"\3C2"}.MJX-TEX .mjx-i mjx-c[c="3C3"]:before{width:.571em;padding:.431em 0 .011em;content:"\3C3"}.MJX-TEX .mjx-i mjx-c[c="3C4"]:before{width:.437em;padding:.431em 0 .013em;content:"\3C4"}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3C4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3C4"]:last-child:before{width:.517em}.MJX-TEX .mjx-i mjx-c[c="3C5"]:before{width:.54em;padding:.443em 0 .01em;content:"\3C5"}.MJX-TEX .mjx-i mjx-c[c="3C6"]:before{width:.654em;padding:.442em 0 .218em;content:"\3C6"}.MJX-TEX .mjx-i mjx-c[c="3C7"]:before{width:.626em;padding:.442em 0 .204em;content:"\3C7"}.MJX-TEX .mjx-i mjx-c[c="3C8"]:before{width:.651em;padding:.694em 0 .205em;content:"\3C8"}.MJX-TEX .mjx-i mjx-c[c="3C9"]:before{width:.622em;padding:.443em 0 .011em;content:"\3C9"}.MJX-TEX .mjx-i mjx-c[c="3D1"]:before{width:.591em;padding:.705em 0 .011em;content:"\3D1"}.MJX-TEX .mjx-i mjx-c[c="3D2"]:before{width:.583em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3D2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3D2"]:last-child:before{width:.7em}.MJX-TEX .mjx-i mjx-c[c="3D5"]:before{width:.596em;padding:.694em 0 .205em;content:"\3D5"}.MJX-TEX .mjx-i mjx-c[c="3D6"]:before{width:.828em;padding:.431em 0 .01em;content:"\3D6"}.MJX-TEX .mjx-i mjx-c[c="3DC"]:before{width:.643em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="3DC"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="3DC"]:last-child:before{width:.749em}.MJX-TEX .mjx-i mjx-c[c="3F1"]:before{width:.517em;padding:.442em 0 .194em;content:"\3F1"}.MJX-TEX .mjx-i mjx-c[c="3F5"]:before{width:.406em;padding:.431em 0 .011em;content:"\3F5"}.MJX-TEX .mjx-i mjx-c[c="2013"]:before{width:.511em}.MJX-TEX .mjx-i mjx-c[c="2014"]:before,.MJX-TEX .mjx-i mjx-c[c="2015"]:before{width:1.022em}.MJX-TEX .mjx-i mjx-c[c="2017"]:before{width:.511em}.MJX-TEX .mjx-i mjx-c[c="2018"]:before{width:.307em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="2018"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="2018"]:last-child:before{width:.362em}.MJX-TEX .mjx-i mjx-c[c="2019"]:before{width:.307em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="2019"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="2019"]:last-child:before{width:.377em}.MJX-TEX .mjx-i mjx-c[c="201C"]:before{width:.514em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-i mjx-c[c="201C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-i mjx-c[c="201C"]:last-child:before{width:.606em}.MJX-TEX .mjx-i mjx-c[c="201D"]:before{width:.514em}.MJX-TEX .mjx-i mjx-c[c="2044"]:before{width:.778em;padding:.716em 0 .215em}.MJX-TEX .mjx-i mjx-c[c="210E"]:before{width:.576em;padding:.694em 0 .011em;content:"h";font-family:MJXZERO,MJXTEX-I}.MJX-TEX .mjx-i mjx-c[c="29F8"]:before{width:.778em;padding:.716em 0 .215em;content:"/";font-family:MJXZERO,MJXTEX-I}.MJX-TEX .mjx-b.mjx-i mjx-c[c="/"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=A]:before{padding:.711em 0 0}.MJX-TEX .mjx-b.mjx-i mjx-c[c=B]:before{width:.866em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=C]:before{width:.817em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=D]:before{width:.938em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=E]:before{width:.81em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=F]:before{width:.689em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=F]:last-child:before{width:.809em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=G]:before{width:.887em;padding:.703em 0 .016em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=H]:before{width:.982em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=I]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=I]:last-child:before{width:.573em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=J]:before{width:.631em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=J]:last-child:before{width:.694em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=K]:before{width:.971em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=L]:before{width:.756em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=M]:before{width:1.142em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=M]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=M]:last-child:before{width:1.219em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=N]:before{width:.95em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=N]:last-child:before{width:1.027em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=O]:before{width:.837em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=P]:before{width:.723em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=P]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=P]:last-child:before{width:.847em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=Q]:before{width:.869em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=R]:before{width:.872em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=S]:before{width:.693em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=T]:before{width:.637em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=T]:last-child:before{width:.772em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=U]:before{width:.8em;padding:.686em 0 .016em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=U]:last-child:before{width:.877em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=V]:before{width:.678em;padding:.686em 0 .016em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=V]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=V]:last-child:before{width:.886em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=W]:before{width:1.093em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=W]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=W]:last-child:before{width:1.207em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=X]:before{width:.947em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=Y]:before{width:.675em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=Y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=Y]:last-child:before{width:.876em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=Z]:before{width:.773em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=a]:before{width:.633em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=b]:before{width:.521em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=c]:before{width:.513em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=d]:before{width:.61em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=e]:before{width:.554em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=f]:before{width:.568em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c=f]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c=f]:last-child:before{width:.624em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=g]:before{width:.545em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=h]:before{width:.668em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=i]:before{width:.405em;padding:.694em 0 .008em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=j]:before{width:.471em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=k]:before{width:.604em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=l]:before{width:.348em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=m]:before{width:1.032em;padding:.452em 0 .008em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=n]:before{width:.713em;padding:.452em 0 .008em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=o]:before{width:.585em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=p]:before{width:.601em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=q]:before{width:.542em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=r]:before{width:.529em;padding:.452em 0 .008em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=s]:before{width:.531em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=t]:before{width:.415em;padding:.643em 0 .007em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=u]:before{width:.681em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=v]:before{width:.567em;padding:.453em 0 .008em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=w]:before{padding:.453em 0 .008em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=x]:before{width:.659em;padding:.452em 0 .008em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=y]:before{width:.59em;padding:.452em 0 .202em}.MJX-TEX .mjx-b.mjx-i mjx-c[c=z]:before{width:.555em;padding:.452em 0 .008em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="391"]:before{padding:.711em 0 0}.MJX-TEX .mjx-b.mjx-i mjx-c[c="392"]:before{width:.866em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="393"]:before{width:.657em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="393"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="393"]:last-child:before{width:.777em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="394"]:before{padding:.711em 0 0}.MJX-TEX .mjx-b.mjx-i mjx-c[c="395"]:before{width:.81em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="396"]:before{width:.773em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="397"]:before{width:.982em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="398"]:before{width:.867em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="399"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="399"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="399"]:last-child:before{width:.573em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="39A"]:before{width:.971em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="39B"]:before{padding:.711em 0 0}.MJX-TEX .mjx-b.mjx-i mjx-c[c="39C"]:before{width:1.142em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="39C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="39C"]:last-child:before{width:1.219em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="39D"]:before{width:.95em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="39D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="39D"]:last-child:before{width:1.027em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="39E"]:before{width:.841em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="39F"]:before{width:.837em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A0"]:before{width:.982em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A1"]:before{width:.723em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3A1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3A1"]:last-child:before{width:.847em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A2"]:before{width:.867em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A3"]:before{width:.885em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A4"]:before{width:.637em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3A4"]:last-child:before{width:.772em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A5"]:before{width:.671em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3A5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3A5"]:last-child:before{width:.802em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A6"]:before{width:.767em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A7"]:before{width:.947em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A8"]:before{width:.714em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3A8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3A8"]:last-child:before{width:.79em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3A9"]:before{width:.879em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3C4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3C4"]:last-child:before{width:.61em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3D2"]:before{width:.671em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3D2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3D2"]:last-child:before{width:.802em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="3DC"]:before{width:.689em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3DC"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-b.mjx-i mjx-c[c="3DC"]:last-child:before{width:.809em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="2044"]:before{width:.894em;padding:.711em 0 .21em}.MJX-TEX .mjx-b.mjx-i mjx-c[c="2206"]:before{padding:.711em 0 0}.MJX-TEX .mjx-b.mjx-i mjx-c[c="29F8"]:before{width:.894em;padding:.711em 0 .21em;font-family:MJXZERO,MJXTEX-BI}.MJX-TEX .mjx-ds mjx-c[c=A]:before{width:.722em}.MJX-TEX .mjx-ds mjx-c[c=B]:before{width:.667em}.MJX-TEX .mjx-ds mjx-c[c=D]:before{width:.722em}.MJX-TEX .mjx-ds mjx-c[c=E]:before{width:.667em}.MJX-TEX .mjx-ds mjx-c[c=F]:before{width:.611em}.MJX-TEX .mjx-ds mjx-c[c=G]:before,.MJX-TEX .mjx-ds mjx-c[c=H]:before{width:.778em}.MJX-TEX .mjx-ds mjx-c[c=I]:before{width:.389em}.MJX-TEX .mjx-ds mjx-c[c=J]:before{width:.5em;padding:.683em 0 .077em}.MJX-TEX .mjx-ds mjx-c[c=L]:before{width:.667em}.MJX-TEX .mjx-ds mjx-c[c=M]:before{width:.944em}.MJX-TEX .mjx-ds mjx-c[c=N]:before{width:.722em;padding:.683em 0 .02em}.MJX-TEX .mjx-ds mjx-c[c=P]:before{width:.611em}.MJX-TEX .mjx-ds mjx-c[c=Q]:before{padding:.701em 0 .181em}.MJX-TEX .mjx-ds mjx-c[c=R]:before{width:.722em;padding:.683em 0 0}.MJX-TEX .mjx-ds mjx-c[c=S]:before{padding:.702em 0 .012em}.MJX-TEX .mjx-ds mjx-c[c=T]:before{width:.667em;padding:.683em 0 0}.MJX-TEX .mjx-ds mjx-c[c=U]:before,.MJX-TEX .mjx-ds mjx-c[c=V]:before{width:.722em}.MJX-TEX .mjx-ds mjx-c[c=W]:before{width:1em}.MJX-TEX .mjx-ds mjx-c[c=X]:before,.MJX-TEX .mjx-ds mjx-c[c=Y]:before{width:.722em}.MJX-TEX .mjx-ds mjx-c[c=Z]:before{width:.667em}.MJX-TEX .mjx-ds mjx-c[c=k]:before{width:.556em;padding:.683em 0 0}.MJX-TEX .mjx-ds mjx-c[c="3A1"]:before,.MJX-TEX .mjx-ds mjx-c[c="3A2"]:before,.MJX-TEX .mjx-ds mjx-c[c="3A4"]:before,.MJX-TEX .mjx-ds mjx-c[c="3A7"]:before,.MJX-TEX .mjx-ds mjx-c[c="3D2"]:before,.MJX-TEX .mjx-ds mjx-c[c="3DC"]:before,.MJX-TEX .mjx-ds mjx-c[c="39A"]:before,.MJX-TEX .mjx-ds mjx-c[c="39C"]:before,.MJX-TEX .mjx-ds mjx-c[c="39D"]:before,.MJX-TEX .mjx-ds mjx-c[c="39F"]:before,.MJX-TEX .mjx-ds mjx-c[c="391"]:before,.MJX-TEX .mjx-ds mjx-c[c="392"]:before,.MJX-TEX .mjx-ds mjx-c[c="395"]:before,.MJX-TEX .mjx-ds mjx-c[c="396"]:before,.MJX-TEX .mjx-ds mjx-c[c="397"]:before,.MJX-TEX .mjx-ds mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX-B}.MJX-TEX .mjx-ds mjx-c[c="2102"]:before{width:.722em;padding:.702em 0 .019em;content:"C";font-family:MJXZERO,MJXTEX-A}.MJX-TEX .mjx-ds mjx-c[c="210D"]:before{width:.778em;padding:.683em 0 0;content:"H";font-family:MJXZERO,MJXTEX-A}.MJX-TEX .mjx-ds mjx-c[c="2115"]:before{width:.722em;padding:.683em 0 .02em;content:"N";font-family:MJXZERO,MJXTEX-A}.MJX-TEX .mjx-ds mjx-c[c="2119"]:before{width:.611em;padding:.683em 0 0;content:"P";font-family:MJXZERO,MJXTEX-A}.MJX-TEX .mjx-ds mjx-c[c="211A"]:before{width:.778em;padding:.701em 0 .181em;content:"Q";font-family:MJXZERO,MJXTEX-A}.MJX-TEX .mjx-ds mjx-c[c="211D"]:before{width:.722em;padding:.683em 0 0;content:"R";font-family:MJXZERO,MJXTEX-A}.MJX-TEX .mjx-ds mjx-c[c="2124"]:before{width:.667em;padding:.683em 0 0;content:"Z";font-family:MJXZERO,MJXTEX-A}.MJX-TEX .mjx-fr mjx-c[c="!"]:before{width:.296em;padding:.689em 0 .012em}.MJX-TEX .mjx-fr mjx-c[c="22"]:before{width:.215em}.MJX-TEX .mjx-fr mjx-c[c="&"]:before{width:.738em;padding:.698em 0 .011em}.MJX-TEX .mjx-fr mjx-c[c="27"]:before{width:.212em}.MJX-TEX .mjx-fr mjx-c[c="("]:before{padding:.737em 0 .186em}.MJX-TEX .mjx-fr mjx-c[c=")"]:before{padding:.735em 0 .187em}.MJX-TEX .mjx-fr mjx-c[c="*"]:before{width:.278em;padding:.692em 0 0}.MJX-TEX .mjx-fr mjx-c[c="+"]:before{width:.756em;padding:.598em 0 .082em}.MJX-TEX .mjx-fr mjx-c[c=","]:before{padding:.107em 0 .191em}.MJX-TEX .mjx-fr mjx-c[c="-"]:before{width:.756em;padding:.275em 0 0}.MJX-TEX .mjx-fr mjx-c[c="."]:before{padding:.102em 0 .015em}.MJX-TEX .mjx-fr mjx-c[c="/"]:before{width:.502em;padding:.721em 0 .182em}.MJX-TEX .mjx-fr mjx-c[c="0"]:before{width:.502em;padding:.492em 0 .013em}.MJX-TEX .mjx-fr mjx-c[c="1"]:before{width:.502em;padding:.468em 0 0}.MJX-TEX .mjx-fr mjx-c[c="2"]:before{width:.502em;padding:.474em 0 0}.MJX-TEX .mjx-fr mjx-c[c="3"]:before{width:.502em;padding:.473em 0 .182em}.MJX-TEX .mjx-fr mjx-c[c="4"]:before{width:.502em;padding:.476em 0 .191em}.MJX-TEX .mjx-fr mjx-c[c="5"]:before{width:.502em;padding:.458em 0 .184em}.MJX-TEX .mjx-fr mjx-c[c="6"]:before{width:.502em;padding:.7em 0 .013em}.MJX-TEX .mjx-fr mjx-c[c="7"]:before{width:.502em;padding:.468em 0 .181em}.MJX-TEX .mjx-fr mjx-c[c="8"]:before{width:.502em;padding:.705em 0 .01em}.MJX-TEX .mjx-fr mjx-c[c="9"]:before{width:.502em;padding:.469em 0 .182em}.MJX-TEX .mjx-fr mjx-c[c=":"]:before{width:.216em;padding:.457em 0 .012em}.MJX-TEX .mjx-fr mjx-c[c=";"]:before{width:.216em;padding:.458em 0 .189em}.MJX-TEX .mjx-fr mjx-c[c="="]:before{width:.756em;padding:.368em 0 0}.MJX-TEX .mjx-fr mjx-c[c="?"]:before{width:.362em;padding:.693em 0 .011em}.MJX-TEX .mjx-fr mjx-c[c=A]:before{width:.718em;padding:.696em 0 .026em}.MJX-TEX .mjx-fr mjx-c[c=B]:before{width:.884em;padding:.691em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=C]:before{width:.613em;padding:.685em 0 .024em}.MJX-TEX .mjx-fr mjx-c[c=D]:before{width:.832em;padding:.685em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=E]:before{width:.663em;padding:.685em 0 .024em}.MJX-TEX .mjx-fr mjx-c[c=F]:before{width:.611em;padding:.686em 0 .153em}.MJX-TEX .mjx-fr mjx-c[c=G]:before{padding:.69em 0 .026em}.MJX-TEX .mjx-fr mjx-c[c=H]:before{width:.72em;padding:.666em 0 .133em}.MJX-TEX .mjx-fr mjx-c[c=I]:before{width:.554em;padding:.686em 0 .026em}.MJX-TEX .mjx-fr mjx-c[c=J]:before{width:.552em;padding:.686em 0 .139em}.MJX-TEX .mjx-fr mjx-c[c=K]:before{width:.668em;padding:.68em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=L]:before{width:.666em;padding:.686em 0 .026em}.MJX-TEX .mjx-fr mjx-c[c=M]:before{width:1.05em;padding:.692em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=N]:before{width:.832em;padding:.686em 0 .025em}.MJX-TEX .mjx-fr mjx-c[c=O]:before{width:.827em;padding:.729em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=P]:before{width:.828em;padding:.692em 0 .218em}.MJX-TEX .mjx-fr mjx-c[c=Q]:before{width:.827em;padding:.729em 0 .069em}.MJX-TEX .mjx-fr mjx-c[c=R]:before{width:.828em}.MJX-TEX .mjx-fr mjx-c[c=S]:before{width:.829em;padding:.692em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=T]:before{width:.669em;padding:.701em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=U]:before{width:.646em;padding:.697em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=V]:before{width:.831em}.MJX-TEX .mjx-fr mjx-c[c=W]:before{width:1.046em;padding:.686em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=X]:before{width:.719em;padding:.688em 0 .027em}.MJX-TEX .mjx-fr mjx-c[c=Y]:before{width:.833em;padding:.686em 0 .218em}.MJX-TEX .mjx-fr mjx-c[c=Z]:before{width:.602em;padding:.729em 0 .139em}.MJX-TEX .mjx-fr mjx-c[c="["]:before{padding:.74em 0 .13em}.MJX-TEX .mjx-fr mjx-c[c="]"]:before{padding:.738em 0 .131em}.MJX-TEX .mjx-fr mjx-c[c="^"]:before{padding:.734em 0 0}.MJX-TEX .mjx-fr mjx-c[c=a]:before{padding:.47em 0 .035em}.MJX-TEX .mjx-fr mjx-c[c=b]:before{width:.513em;padding:.685em 0 .031em}.MJX-TEX .mjx-fr mjx-c[c=c]:before{width:.389em;padding:.466em 0 .029em}.MJX-TEX .mjx-fr mjx-c[c=d]:before{width:.499em;padding:.609em 0 .033em}.MJX-TEX .mjx-fr mjx-c[c=e]:before{width:.401em;padding:.467em 0 .03em}.MJX-TEX .mjx-fr mjx-c[c=f]:before{width:.326em;padding:.681em 0 .221em}.MJX-TEX .mjx-fr mjx-c[c=g]:before{width:.504em;padding:.47em 0 .209em}.MJX-TEX .mjx-fr mjx-c[c=h]:before{width:.521em;padding:.688em 0 .205em}.MJX-TEX .mjx-fr mjx-c[c=i]:before{width:.279em;padding:.673em 0 .02em}.MJX-TEX .mjx-fr mjx-c[c=j]:before{width:.281em}.MJX-TEX .mjx-fr mjx-c[c=k]:before{width:.389em;padding:.689em 0 .025em}.MJX-TEX .mjx-fr mjx-c[c=l]:before{width:.28em;padding:.685em 0 .02em}.MJX-TEX .mjx-fr mjx-c[c=m]:before{width:.767em;padding:.475em 0 .026em}.MJX-TEX .mjx-fr mjx-c[c=n]:before{width:.527em;padding:.475em 0 .022em}.MJX-TEX .mjx-fr mjx-c[c=o]:before{width:.489em;padding:.48em 0 .028em}.MJX-TEX .mjx-fr mjx-c[c=p]:before{width:.5em;padding:.541em 0 .212em}.MJX-TEX .mjx-fr mjx-c[c=q]:before{width:.489em;padding:.479em 0 .219em}.MJX-TEX .mjx-fr mjx-c[c=r]:before{width:.389em;padding:.474em 0 .021em}.MJX-TEX .mjx-fr mjx-c[c=s]:before{width:.443em;padding:.478em 0 .029em}.MJX-TEX .mjx-fr mjx-c[c=t]:before{width:.333em;padding:.64em 0 .02em}.MJX-TEX .mjx-fr mjx-c[c=u]:before{width:.517em;padding:.474em 0 .023em}.MJX-TEX .mjx-fr mjx-c[c=v]:before{width:.512em;padding:.53em 0 .028em}.MJX-TEX .mjx-fr mjx-c[c=w]:before{width:.774em;padding:.532em 0 .028em}.MJX-TEX .mjx-fr mjx-c[c=x]:before{width:.389em;padding:.472em 0 .188em}.MJX-TEX .mjx-fr mjx-c[c=y]:before{width:.499em;padding:.528em 0 .218em}.MJX-TEX .mjx-fr mjx-c[c=z]:before{width:.391em;padding:.471em 0 .214em}.MJX-TEX .mjx-fr mjx-c[c="3A1"]:before,.MJX-TEX .mjx-fr mjx-c[c="3A2"]:before,.MJX-TEX .mjx-fr mjx-c[c="3A4"]:before,.MJX-TEX .mjx-fr mjx-c[c="3A7"]:before,.MJX-TEX .mjx-fr mjx-c[c="3D2"]:before,.MJX-TEX .mjx-fr mjx-c[c="3DC"]:before,.MJX-TEX .mjx-fr mjx-c[c="39A"]:before,.MJX-TEX .mjx-fr mjx-c[c="39C"]:before,.MJX-TEX .mjx-fr mjx-c[c="39D"]:before,.MJX-TEX .mjx-fr mjx-c[c="39F"]:before,.MJX-TEX .mjx-fr mjx-c[c="391"]:before,.MJX-TEX .mjx-fr mjx-c[c="392"]:before,.MJX-TEX .mjx-fr mjx-c[c="395"]:before,.MJX-TEX .mjx-fr mjx-c[c="396"]:before,.MJX-TEX .mjx-fr mjx-c[c="397"]:before,.MJX-TEX .mjx-fr mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX}.MJX-TEX .mjx-fr mjx-c[c="2018"]:before{width:.215em;padding:.708em 0 0}.MJX-TEX .mjx-fr mjx-c[c="2019"]:before{width:.215em}.MJX-TEX .mjx-fr mjx-c[c="2044"]:before{width:.502em;padding:.721em 0 .182em}.MJX-TEX .mjx-fr mjx-c[c="210C"]:before{width:.72em;padding:.666em 0 .133em;content:"H";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX .mjx-fr mjx-c[c="2111"]:before{width:.554em;padding:.686em 0 .026em;content:"I";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX .mjx-fr mjx-c[c="211C"]:before{width:.828em;padding:.686em 0 .026em;content:"R";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX .mjx-fr mjx-c[c="2128"]:before{width:.602em;padding:.729em 0 .139em;content:"Z";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX .mjx-fr mjx-c[c="212D"]:before{width:.613em;padding:.685em 0 .024em;content:"C";font-family:MJXZERO,MJXTEX-FR}.MJX-TEX .mjx-fr mjx-c[c=E300]:before{width:.497em;padding:.683em 0 .032em;content:"\E300"}.MJX-TEX .mjx-fr mjx-c[c=E301]:before{width:.498em;padding:.616em 0 .03em;content:"\E301"}.MJX-TEX .mjx-fr mjx-c[c=E302]:before{width:.333em;padding:.68em 0 .215em;content:"\E302"}.MJX-TEX .mjx-fr mjx-c[c=E303]:before{width:.329em;padding:.679em 0 .224em;content:"\E303"}.MJX-TEX .mjx-fr mjx-c[c=E304]:before{width:.503em;padding:.471em 0 .214em;content:"\E304"}.MJX-TEX .mjx-fr mjx-c[c=E305]:before{width:.333em;padding:.686em 0 .02em;content:"\E305"}.MJX-TEX .mjx-fr mjx-c[c=E306]:before{width:.334em;padding:.577em 0 .021em;content:"\E306"}.MJX-TEX .mjx-fr mjx-c[c=E307]:before{width:.501em;padding:.475em 0 .022em;content:"\E307"}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="!"]:before{width:.349em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="22"]:before{width:.254em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="&"]:before{width:.871em;padding:.696em 0 .016em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="27"]:before{width:.25em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="("]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c=")"]:before{width:.459em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="*"]:before{width:.328em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="+"]:before{width:.893em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=","]:before{width:.328em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="-"]:before{width:.893em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="."]:before{width:.328em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="/"]:before{width:.593em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="0"]:before{width:.593em;padding:.501em 0 .012em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="1"]:before{width:.593em;padding:.489em 0 0}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="2"]:before{width:.593em;padding:.491em 0 0}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="3"]:before{width:.593em;padding:.487em 0 .193em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="4"]:before{width:.593em;padding:.495em 0 .196em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="5"]:before{width:.593em;padding:.481em 0 .19em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="6"]:before{width:.593em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="7"]:before{width:.593em;padding:.479em 0 .197em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="8"]:before{width:.593em;padding:.714em 0 .005em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="9"]:before{width:.593em;padding:.487em 0 .195em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=":"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c=";"]:before{width:.255em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="="]:before{width:.582em;padding:.343em 0 0}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="?"]:before{width:.428em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=A]:before{width:.847em;padding:.686em 0 .031em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=B]:before{width:1.044em;padding:.684em 0 .031em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=C]:before{width:.723em;padding:.676em 0 .032em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=D]:before{width:.982em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=E]:before{width:.783em;padding:.686em 0 .029em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=F]:before{width:.722em;padding:.684em 0 .146em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=G]:before{width:.927em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=H]:before{width:.851em;padding:.683em 0 .126em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=I]:before{width:.655em;padding:.681em 0 .025em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=J]:before{width:.652em;padding:.68em 0 .141em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=K]:before{width:.789em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=L]:before{width:.786em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=M]:before{width:1.239em;padding:.683em 0 .032em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=N]:before{width:.983em;padding:.679em 0 .03em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=O]:before{width:.976em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=P]:before{width:.977em;padding:.688em 0 .223em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=Q]:before{width:.976em;padding:.726em 0 .083em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=R]:before{width:.978em;padding:.688em 0 .028em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=S]:before{width:.978em;padding:.685em 0 .031em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=T]:before{width:.79em;padding:.686em 0 .03em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=U]:before{width:.851em;padding:.688em 0 .039em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=V]:before{width:.982em;padding:.685em 0 .029em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=W]:before{width:1.235em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=X]:before{width:.849em;padding:.681em 0 .035em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=Y]:before{width:.984em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=Z]:before{width:.711em;padding:.677em 0 .148em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="["]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="]"]:before{width:.257em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="^"]:before{width:.59em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=a]:before{width:.603em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=b]:before{width:.59em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=c]:before{width:.464em;padding:.473em 0 .026em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=d]:before{width:.589em;padding:.632em 0 .028em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=e]:before{width:.472em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=f]:before{width:.388em;padding:.687em 0 .222em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=g]:before{width:.595em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=h]:before{width:.615em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=i]:before{width:.331em;padding:.686em 0 .025em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=j]:before{width:.332em;padding:.682em 0 .203em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=k]:before{width:.464em;padding:.682em 0 .025em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=l]:before{width:.337em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=m]:before{width:.921em;padding:.476em 0 .031em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=n]:before{width:.654em;padding:.473em 0 .028em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=o]:before{width:.609em;padding:.482em 0 .034em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=p]:before{width:.604em;padding:.557em 0 .207em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=q]:before{width:.596em;padding:.485em 0 .211em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=r]:before{width:.46em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=s]:before{width:.523em;padding:.479em 0 .034em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=t]:before{width:.393em;padding:.648em 0 .027em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=u]:before{width:.589em;padding:.472em 0 .032em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=v]:before{width:.604em;padding:.546em 0 .027em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=w]:before{width:.918em;padding:.549em 0 .032em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=x]:before{width:.459em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=y]:before{width:.589em;padding:.557em 0 .221em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=z]:before{width:.461em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="3A1"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="3A2"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="3A4"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="3A7"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="3D2"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="3DC"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="39A"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="39C"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="39D"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="39F"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="391"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="392"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="395"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="396"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="397"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX-B}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="2018"]:before,.MJX-TEX .mjx-fr.mjx-b mjx-c[c="2019"]:before{width:.254em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c="2044"]:before{width:.593em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=E301]:before{width:.587em;padding:.63em 0 .027em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=E302]:before{width:.394em;padding:.693em 0 .212em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=E303]:before{width:.387em;padding:.681em 0 .219em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=E304]:before{width:.593em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=E305]:before{width:.393em;padding:.684em 0 .027em}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=E308]:before{width:.981em;padding:.679em 0 .22em;content:"\E308"}.MJX-TEX .mjx-fr.mjx-b mjx-c[c=E309]:before{width:.727em;padding:.717em 0 .137em;content:"\E309"}.MJX-TEX .mjx-sc mjx-c[c=A]:before{width:.803em;padding:.717em 0 .008em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=A]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=A]:last-child:before{width:1.016em}.MJX-TEX .mjx-sc mjx-c[c=B]:before{width:.908em;padding:.708em 0 .028em}.MJX-TEX .mjx-sc mjx-c[c=C]:before{width:.666em;padding:.728em 0 .026em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=C]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=C]:last-child:before{width:.819em}.MJX-TEX .mjx-sc mjx-c[c=D]:before{width:.774em;padding:.708em 0 .031em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=D]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=D]:last-child:before{width:.855em}.MJX-TEX .mjx-sc mjx-c[c=E]:before{width:.562em;padding:.707em 0 .008em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=E]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=E]:last-child:before{width:.718em}.MJX-TEX .mjx-sc mjx-c[c=F]:before{width:.895em;padding:.735em 0 .036em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=F]:last-child:before{width:.99em}.MJX-TEX .mjx-sc mjx-c[c=G]:before{width:.61em;padding:.717em 0 .037em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=G]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=G]:last-child:before{width:.738em}.MJX-TEX .mjx-sc mjx-c[c=H]:before{width:.969em;padding:.717em 0 .036em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=H]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=H]:last-child:before{width:1.241em}.MJX-TEX .mjx-sc mjx-c[c=I]:before{width:.809em;padding:.717em 0 .017em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=I]:last-child:before{width:.946em}.MJX-TEX .mjx-sc mjx-c[c=J]:before{width:1.052em;padding:.717em 0 .314em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=J]:last-child:before{width:1.133em}.MJX-TEX .mjx-sc mjx-c[c=K]:before{width:.914em;padding:.717em 0 .037em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=K]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=K]:last-child:before{width:1.204em}.MJX-TEX .mjx-sc mjx-c[c=L]:before{width:.874em;padding:.717em 0 .017em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=L]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=L]:last-child:before{width:1.035em}.MJX-TEX .mjx-sc mjx-c[c=M]:before{width:1.08em;padding:.721em 0 .05em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=M]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=M]:last-child:before{width:1.216em}.MJX-TEX .mjx-sc mjx-c[c=N]:before{width:.902em;padding:.726em 0 .036em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=N]:last-child:before{width:1.208em}.MJX-TEX .mjx-sc mjx-c[c=O]:before{width:.738em;padding:.707em 0 .008em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=O]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=O]:last-child:before{width:.805em}.MJX-TEX .mjx-sc mjx-c[c=P]:before{width:1.013em;padding:.716em 0 .037em}.MJX-TEX .mjx-sc mjx-c[c=Q]:before{width:.883em;padding:.717em 0 .017em}.MJX-TEX .mjx-sc mjx-c[c=R]:before{width:.85em;padding:.717em 0 .017em}.MJX-TEX .mjx-sc mjx-c[c=S]:before{width:.868em;padding:.708em 0 .036em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=S]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=S]:last-child:before{width:1.016em}.MJX-TEX .mjx-sc mjx-c[c=T]:before{width:.747em;padding:.735em 0 .037em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=T]:last-child:before{width:.996em}.MJX-TEX .mjx-sc mjx-c[c=U]:before{width:.8em;padding:.717em 0 .017em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=U]:last-child:before{width:.96em}.MJX-TEX .mjx-sc mjx-c[c=V]:before{width:.622em;padding:.717em 0 .017em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=V]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=V]:last-child:before{width:.85em}.MJX-TEX .mjx-sc mjx-c[c=W]:before{width:.805em;padding:.717em 0 .017em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=W]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=W]:last-child:before{width:1.026em}.MJX-TEX .mjx-sc mjx-c[c=X]:before{width:.944em;padding:.717em 0 .017em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=X]:last-child:before{width:1.131em}.MJX-TEX .mjx-sc mjx-c[c=Y]:before{width:.71em;padding:.716em 0 .017em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=Y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=Y]:last-child:before{width:.959em}.MJX-TEX .mjx-sc mjx-c[c=Z]:before{width:.821em;padding:.717em 0 .016em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c=Z]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c=Z]:last-child:before{width:1.032em}.MJX-TEX .mjx-sc mjx-c[c="3A1"]:before,.MJX-TEX .mjx-sc mjx-c[c="3A2"]:before,.MJX-TEX .mjx-sc mjx-c[c="3A4"]:before,.MJX-TEX .mjx-sc mjx-c[c="3A7"]:before,.MJX-TEX .mjx-sc mjx-c[c="3D2"]:before,.MJX-TEX .mjx-sc mjx-c[c="3DC"]:before,.MJX-TEX .mjx-sc mjx-c[c="39A"]:before,.MJX-TEX .mjx-sc mjx-c[c="39C"]:before,.MJX-TEX .mjx-sc mjx-c[c="39D"]:before,.MJX-TEX .mjx-sc mjx-c[c="39F"]:before,.MJX-TEX .mjx-sc mjx-c[c="391"]:before,.MJX-TEX .mjx-sc mjx-c[c="392"]:before,.MJX-TEX .mjx-sc mjx-c[c="395"]:before,.MJX-TEX .mjx-sc mjx-c[c="396"]:before,.MJX-TEX .mjx-sc mjx-c[c="397"]:before,.MJX-TEX .mjx-sc mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX}.MJX-TEX .mjx-sc mjx-c[c="210B"]:before{width:.969em;padding:.717em 0 .036em;content:"H";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c="210B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c="210B"]:last-child:before{width:1.241em}.MJX-TEX .mjx-sc mjx-c[c="2110"]:before{width:1.052em;padding:.717em 0 .314em;content:"J";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c="2110"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c="2110"]:last-child:before{width:1.133em}.MJX-TEX .mjx-sc mjx-c[c="2112"]:before{width:.874em;padding:.717em 0 .017em;content:"L";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c="2112"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c="2112"]:last-child:before{width:1.035em}.MJX-TEX .mjx-sc mjx-c[c="211B"]:before{width:.85em;padding:.717em 0 .017em;content:"R";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX .mjx-sc mjx-c[c="212C"]:before{width:.908em;padding:.708em 0 .028em;content:"B";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX .mjx-sc mjx-c[c="2130"]:before{width:.562em;padding:.707em 0 .008em;content:"E";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c="2130"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c="2130"]:last-child:before{width:.718em}.MJX-TEX .mjx-sc mjx-c[c="2131"]:before{width:.895em;padding:.735em 0 .036em;content:"F";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c="2131"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c="2131"]:last-child:before{width:.99em}.MJX-TEX .mjx-sc mjx-c[c="2133"]:before{width:1.08em;padding:.721em 0 .05em;content:"M";font-family:MJXZERO,MJXTEX-SC}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc mjx-c[c="2133"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc mjx-c[c="2133"]:last-child:before{width:1.216em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=A]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=A]:last-child:before{width:1.016em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=C]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=C]:last-child:before{width:.819em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=D]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=D]:last-child:before{width:.855em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=E]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=E]:last-child:before{width:.718em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=F]:last-child:before{width:.99em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=G]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=G]:last-child:before{width:.738em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=H]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=H]:last-child:before{width:1.241em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=I]:last-child:before{width:.946em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=J]:last-child:before{width:1.133em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=K]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=K]:last-child:before{width:1.204em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=L]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=L]:last-child:before{width:1.035em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=M]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=M]:last-child:before{width:1.216em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=N]:last-child:before{width:1.208em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=O]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=O]:last-child:before{width:.805em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=S]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=S]:last-child:before{width:1.016em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=T]:last-child:before{width:.996em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=U]:last-child:before{width:.96em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=V]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=V]:last-child:before{width:.85em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=W]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=W]:last-child:before{width:1.026em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=X]:last-child:before{width:1.131em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=Y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=Y]:last-child:before{width:.959em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=Z]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sc.mjx-b mjx-c[c=Z]:last-child:before{width:1.032em}.MJX-TEX .mjx-sc.mjx-b mjx-c[c="3A1"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="3A2"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="3A4"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="3A7"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="3D2"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="3DC"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="39A"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="39C"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="39D"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="39F"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="391"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="392"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="395"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="396"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="397"]:before,.MJX-TEX .mjx-sc.mjx-b mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX-B}.MJX-TEX .mjx-ss mjx-c[c="!"]:before{width:.319em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="&"]:before{width:.758em}.MJX-TEX .mjx-ss mjx-c[c=","]:before{padding:.098em 0 .125em}.MJX-TEX .mjx-ss mjx-c[c="-"]:before{padding:.259em 0 0}.MJX-TEX .mjx-ss mjx-c[c="."]:before{padding:.098em 0 0}.MJX-TEX .mjx-ss mjx-c[c="0"]:before{padding:.678em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c="1"]:before{padding:.678em 0 0}.MJX-TEX .mjx-ss mjx-c[c="2"]:before{padding:.677em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3"]:before{padding:.678em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c="4"]:before{padding:.656em 0 0}.MJX-TEX .mjx-ss mjx-c[c="5"]:before{padding:.656em 0 .021em}.MJX-TEX .mjx-ss mjx-c[c="6"]:before{padding:.677em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c="7"]:before{padding:.656em 0 .011em}.MJX-TEX .mjx-ss mjx-c[c="8"]:before{padding:.678em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c="9"]:before{padding:.677em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c=":"]:before{padding:.444em 0 0}.MJX-TEX .mjx-ss mjx-c[c=";"]:before{padding:.444em 0 .125em}.MJX-TEX .mjx-ss mjx-c[c="="]:before{padding:.37em 0 0}.MJX-TEX .mjx-ss mjx-c[c="@"]:before{width:.667em}.MJX-TEX .mjx-ss mjx-c[c=A]:before,.MJX-TEX .mjx-ss mjx-c[c=B]:before{width:.667em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=C]:before{width:.639em;padding:.705em 0 .011em}.MJX-TEX .mjx-ss mjx-c[c=D]:before{width:.722em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=E]:before{width:.597em;padding:.691em 0 0}.MJX-TEX .mjx-ss mjx-c[c=F]:before{width:.569em;padding:.691em 0 0}.MJX-TEX .mjx-ss mjx-c[c=G]:before{width:.667em;padding:.704em 0 .011em}.MJX-TEX .mjx-ss mjx-c[c=H]:before{width:.708em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=I]:before{width:.278em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=J]:before{width:.472em;padding:.694em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c=K]:before{width:.694em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=L]:before{width:.542em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=M]:before{width:.875em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=N]:before{width:.708em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=O]:before{width:.736em;padding:.715em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c=P]:before{width:.639em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=Q]:before{width:.736em;padding:.715em 0 .125em}.MJX-TEX .mjx-ss mjx-c[c=R]:before{width:.646em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=S]:before{padding:.716em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c=T]:before{width:.681em;padding:.688em 0 0}.MJX-TEX .mjx-ss mjx-c[c=U]:before{width:.688em;padding:.694em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c=V]:before{width:.667em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=W]:before{width:.944em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=X]:before,.MJX-TEX .mjx-ss mjx-c[c=Y]:before{width:.667em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c=Z]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="["]:before,.MJX-TEX .mjx-ss mjx-c[c="]"]:before{width:.289em}.MJX-TEX .mjx-ss mjx-c[c=_]:before{padding:0 0 .114em}.MJX-TEX .mjx-ss mjx-c[c=a]:before{width:.481em;padding:.46em 0 .01em}.MJX-TEX .mjx-ss mjx-c[c=b]:before{width:.517em}.MJX-TEX .mjx-ss mjx-c[c=c]:before{padding:.46em 0 .01em}.MJX-TEX .mjx-ss mjx-c[c=d]:before{width:.517em}.MJX-TEX .mjx-ss mjx-c[c=e]:before{padding:.461em 0 .01em}.MJX-TEX .mjx-ss mjx-c[c=h]:before{width:.517em}.MJX-TEX .mjx-ss mjx-c[c=i]:before{width:.239em;padding:.68em 0 0}.MJX-TEX .mjx-ss mjx-c[c=j]:before{width:.267em;padding:.68em 0 .205em}.MJX-TEX .mjx-ss mjx-c[c=k]:before{width:.489em}.MJX-TEX .mjx-ss mjx-c[c=l]:before{width:.239em}.MJX-TEX .mjx-ss mjx-c[c=m]:before{width:.794em;padding:.455em 0 0}.MJX-TEX .mjx-ss mjx-c[c=n]:before{width:.517em;padding:.455em 0 0}.MJX-TEX .mjx-ss mjx-c[c=o]:before{padding:.46em 0 .01em}.MJX-TEX .mjx-ss mjx-c[c=p]:before,.MJX-TEX .mjx-ss mjx-c[c=q]:before{width:.517em;padding:.455em 0 .194em}.MJX-TEX .mjx-ss mjx-c[c=r]:before{width:.342em;padding:.455em 0 0}.MJX-TEX .mjx-ss mjx-c[c=s]:before{width:.383em;padding:.46em 0 .01em}.MJX-TEX .mjx-ss mjx-c[c=t]:before{width:.361em;padding:.571em 0 .01em}.MJX-TEX .mjx-ss mjx-c[c=u]:before{width:.517em}.MJX-TEX .mjx-ss mjx-c[c=v]:before{width:.461em;padding:.444em 0 0}.MJX-TEX .mjx-ss mjx-c[c=w]:before{width:.683em;padding:.444em 0 0}.MJX-TEX .mjx-ss mjx-c[c=x]:before{width:.461em;padding:.444em 0 0}.MJX-TEX .mjx-ss mjx-c[c=y]:before{width:.461em;padding:.444em 0 .204em}.MJX-TEX .mjx-ss mjx-c[c=z]:before{width:.435em;padding:.444em 0 0}.MJX-TEX .mjx-ss mjx-c[c="~"]:before{padding:.327em 0 0}.MJX-TEX .mjx-ss mjx-c[c="131"]:before{width:.239em}.MJX-TEX .mjx-ss mjx-c[c="237"]:before{width:.267em}.MJX-TEX .mjx-ss mjx-c[c="300"]:before,.MJX-TEX .mjx-ss mjx-c[c="301"]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="303"]:before{padding:.677em 0 0}.MJX-TEX .mjx-ss mjx-c[c="304"]:before{padding:.631em 0 0}.MJX-TEX .mjx-ss mjx-c[c="307"]:before,.MJX-TEX .mjx-ss mjx-c[c="308"]:before{padding:.68em 0 0}.MJX-TEX .mjx-ss mjx-c[c="30A"]:before,.MJX-TEX .mjx-ss mjx-c[c="30B"]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="30C"]:before{padding:.654em 0 0}.MJX-TEX .mjx-ss mjx-c[c="391"]:before,.MJX-TEX .mjx-ss mjx-c[c="392"]:before{width:.667em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="393"]:before{width:.542em;padding:.691em 0 0}.MJX-TEX .mjx-ss mjx-c[c="394"]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="395"]:before{width:.597em;padding:.691em 0 0}.MJX-TEX .mjx-ss mjx-c[c="396"]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="397"]:before{width:.708em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="398"]:before{padding:.716em 0 .021em}.MJX-TEX .mjx-ss mjx-c[c="399"]:before{width:.278em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="39A"]:before{width:.694em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="39B"]:before{width:.611em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="39C"]:before{width:.875em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="39D"]:before{width:.708em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="39E"]:before{padding:.688em 0 0}.MJX-TEX .mjx-ss mjx-c[c="39F"]:before{width:.736em;padding:.715em 0 .022em}.MJX-TEX .mjx-ss mjx-c[c="3A0"]:before{width:.708em;padding:.691em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3A1"]:before{width:.639em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3A2"]:before{padding:.716em 0 .021em}.MJX-TEX .mjx-ss mjx-c[c="3A3"]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3A4"]:before{width:.681em;padding:.688em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3A5"]:before{padding:.716em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3A6"]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3A7"]:before{width:.667em;padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3A8"]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3A9"]:before,.MJX-TEX .mjx-ss mjx-c[c="3D2"]:before{padding:.716em 0 0}.MJX-TEX .mjx-ss mjx-c[c="3DC"]:before{width:.569em;padding:.691em 0 0}.MJX-TEX .mjx-ss mjx-c[c="2013"]:before,.MJX-TEX .mjx-ss mjx-c[c="2014"]:before,.MJX-TEX .mjx-ss mjx-c[c="2015"]:before{padding:.312em 0 0}.MJX-TEX .mjx-ss mjx-c[c="2017"]:before{padding:0 0 .114em}.MJX-TEX .mjx-ss mjx-c[c="2206"]:before{padding:.694em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="!"]:before{width:.367em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="22"]:before{width:.558em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="#"]:before{width:.917em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="$"]:before{width:.55em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="%"]:before{width:1.029em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="&"]:before{width:.831em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="27"]:before{width:.306em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="("]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c=")"]:before{width:.428em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="*"]:before{width:.55em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="+"]:before{width:.856em;padding:.617em 0 .116em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=","]:before{width:.306em;padding:.146em 0 .106em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="-"]:before{width:.367em;padding:.273em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="."]:before{width:.306em;padding:.146em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="/"]:before{width:.55em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="0"]:before{width:.55em;padding:.715em 0 .022em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="1"]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2"]:before{width:.55em;padding:.716em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3"]:before{width:.55em;padding:.716em 0 .022em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="4"]:before{width:.55em;padding:.694em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="5"]:before{width:.55em;padding:.694em 0 .022em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="6"]:before{width:.55em;padding:.716em 0 .022em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="7"]:before{width:.55em;padding:.695em 0 .011em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="8"]:before{width:.55em;padding:.715em 0 .022em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="9"]:before{width:.55em;padding:.716em 0 .022em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=":"]:before{width:.306em;padding:.458em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=";"]:before{width:.306em;padding:.458em 0 .106em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="="]:before{width:.856em;padding:.407em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="?"]:before{width:.519em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="@"]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c=A]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c=B]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=C]:before{width:.703em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=D]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=E]:before{width:.642em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=F]:before{width:.611em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=G]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=H]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=I]:before{width:.331em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=J]:before{width:.519em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=K]:before{width:.764em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=L]:before{width:.581em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=M]:before{width:.978em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=N]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c=O]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=P]:before{width:.703em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=Q]:before{width:.794em;padding:.716em 0 .106em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=R]:before{width:.703em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=S]:before{width:.611em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=T]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=U]:before{width:.764em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=V]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=W]:before{width:1.039em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=X]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c=Y]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=Z]:before{width:.672em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="["]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c="]"]:before{width:.343em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="^"]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c=_]:before{width:.55em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=a]:before{width:.525em;padding:.475em 0 .011em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=b]:before{width:.561em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=c]:before{width:.489em;padding:.475em 0 .011em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=d]:before{width:.561em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=e]:before{width:.511em;padding:.474em 0 .01em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=f]:before{width:.336em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=g]:before{width:.55em;padding:.469em 0 .206em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=h]:before{width:.561em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=i]:before{width:.256em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=j]:before{width:.286em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=k]:before{width:.531em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=l]:before{width:.256em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=m]:before{width:.867em;padding:.469em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=n]:before{width:.561em;padding:.468em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=o]:before{width:.55em;padding:.474em 0 .011em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=p]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c=q]:before{width:.561em;padding:.469em 0 .194em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=r]:before{width:.372em;padding:.469em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=s]:before{width:.422em;padding:.474em 0 .01em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=t]:before{width:.404em;padding:.589em 0 .01em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=u]:before{width:.561em;padding:.458em 0 .011em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=v]:before{width:.5em;padding:.458em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=w]:before{width:.744em;padding:.458em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=x]:before{width:.5em;padding:.458em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=y]:before{width:.5em;padding:.458em 0 .205em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c=z]:before{width:.476em;padding:.458em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="~"]:before{width:.55em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="131"]:before{width:.256em;padding:.458em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="237"]:before{width:.286em;padding:.458em 0 .205em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="304"]:before{padding:.66em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="391"]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c="392"]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="393"]:before{width:.581em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="394"]:before{width:.917em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="395"]:before{width:.642em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="396"]:before{width:.672em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="397"]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="398"]:before{width:.856em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="399"]:before{width:.331em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="39A"]:before{width:.764em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="39B"]:before{width:.672em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="39C"]:before{width:.978em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="39D"]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="39E"]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A0"]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c="39F"]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A1"]:before{width:.703em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A2"]:before{width:.856em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A3"]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A4"]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A5"]:before{width:.856em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A6"]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A7"]:before{width:.733em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A8"]:before{width:.856em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3A9"]:before{width:.794em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3D2"]:before{width:.856em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="3DC"]:before{width:.611em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2013"]:before{width:.55em;padding:.327em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2014"]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2015"]:before{width:1.1em;padding:.327em 0 0}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2017"]:before{width:.55em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2018"]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2019"]:before{width:.306em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="201C"]:before,.MJX-TEX .mjx-ss.mjx-b mjx-c[c="201D"]:before{width:.558em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2044"]:before{width:.55em}.MJX-TEX .mjx-ss.mjx-b mjx-c[c="2206"]:before{width:.917em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="$"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="$"]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="27"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="27"]:last-child:before{width:.335em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="("]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="("]:last-child:before{width:.491em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="*"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="*"]:last-child:before{width:.568em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="/"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="/"]:last-child:before{width:.6em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2"]:last-child:before{width:.551em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="5"]:last-child:before{width:.555em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="7"]:last-child:before{width:.596em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="8"]:last-child:before{width:.554em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="?"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="?"]:last-child:before{width:.536em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=C]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=C]:last-child:before{width:.719em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=E]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=E]:last-child:before{width:.688em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=F]:last-child:before{width:.673em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=G]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=G]:last-child:before{width:.73em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=H]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=H]:last-child:before{width:.768em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=I]:last-child:before{width:.338em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=J]:last-child:before{width:.535em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=K]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=K]:last-child:before{width:.785em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=M]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=M]:last-child:before{width:.929em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=N]:last-child:before{width:.766em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=P]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=P]:last-child:before{width:.69em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=R]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=R]:last-child:before{width:.698em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=S]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=S]:last-child:before{width:.609em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=T]:last-child:before{width:.79em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=U]:last-child:before{width:.747em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=V]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=V]:last-child:before{width:.799em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=W]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=W]:last-child:before{width:1.076em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=X]:last-child:before{width:.758em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=Y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=Y]:last-child:before{width:.81em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=Z]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=Z]:last-child:before{width:.702em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="["]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="["]:last-child:before{width:.425em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="]"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="]"]:last-child:before{width:.353em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=_]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=_]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=c]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=c]:last-child:before{width:.499em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=d]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=d]:last-child:before{width:.588em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=f]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=f]:last-child:before{width:.494em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=g]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=g]:last-child:before{width:.568em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=i]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=i]:last-child:before{width:.315em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=j]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=j]:last-child:before{width:.336em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=k]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=k]:last-child:before{width:.543em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=l]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=l]:last-child:before{width:.311em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=r]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=r]:last-child:before{width:.424em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=s]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=s]:last-child:before{width:.436em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=v]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=v]:last-child:before{width:.54em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=w]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=w]:last-child:before{width:.762em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=x]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=x]:last-child:before{width:.537em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=y]:last-child:before{width:.54em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=z]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c=z]:last-child:before{width:.494em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="~"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="~"]:last-child:before{width:.56em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="301"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="301"]:last-child:before{width:.063em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="303"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="303"]:last-child:before{width:.06em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="304"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="304"]:last-child:before{width:.064em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="306"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="306"]:last-child:before{width:.073em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="30B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="30B"]:last-child:before{width:.063em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="30C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="30C"]:last-child:before{width:.06em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="393"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="393"]:last-child:before{width:.646em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="395"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="395"]:last-child:before{width:.688em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="396"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="396"]:last-child:before{width:.702em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="397"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="397"]:last-child:before{width:.768em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="399"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="399"]:last-child:before{width:.338em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="39A"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="39A"]:last-child:before{width:.785em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="39C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="39C"]:last-child:before{width:.929em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="39D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="39D"]:last-child:before{width:.766em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="39E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="39E"]:last-child:before{width:.765em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A0"]:last-child:before{width:.768em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A1"]:last-child:before{width:.69em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A3"]:last-child:before{width:.813em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A4"]:last-child:before{width:.79em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A5"]:last-child:before{width:.843em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A7"]:last-child:before{width:.758em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3A8"]:last-child:before{width:.854em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3D2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3D2"]:last-child:before{width:.843em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3DC"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="3DC"]:last-child:before{width:.673em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2013"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2013"]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2014"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2014"]:last-child:before{width:1.065em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2015"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2015"]:last-child:before{width:1.065em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2017"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2017"]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2018"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2018"]:last-child:before{width:.336em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2019"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2019"]:last-child:before{width:.335em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="201C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="201C"]:last-child:before{width:.614em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2044"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-i mjx-c[c="2044"]:last-child:before{width:.6em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="$"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="$"]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="27"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="27"]:last-child:before{width:.335em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="("]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="("]:last-child:before{width:.491em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="*"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="*"]:last-child:before{width:.568em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="/"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="/"]:last-child:before{width:.6em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2"]:last-child:before{width:.551em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="5"]:last-child:before{width:.555em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="7"]:last-child:before{width:.596em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="8"]:last-child:before{width:.554em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="?"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="?"]:last-child:before{width:.536em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=C]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=C]:last-child:before{width:.719em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=E]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=E]:last-child:before{width:.688em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=F]:last-child:before{width:.673em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=G]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=G]:last-child:before{width:.73em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=H]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=H]:last-child:before{width:.768em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=I]:last-child:before{width:.338em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=J]:last-child:before{width:.535em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=K]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=K]:last-child:before{width:.785em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=M]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=M]:last-child:before{width:.929em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=N]:last-child:before{width:.766em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=P]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=P]:last-child:before{width:.69em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=R]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=R]:last-child:before{width:.698em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=S]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=S]:last-child:before{width:.609em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=T]:last-child:before{width:.79em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=U]:last-child:before{width:.747em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=V]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=V]:last-child:before{width:.799em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=W]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=W]:last-child:before{width:1.076em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=X]:last-child:before{width:.758em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=Y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=Y]:last-child:before{width:.81em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=Z]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=Z]:last-child:before{width:.702em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="["]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="["]:last-child:before{width:.425em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="]"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="]"]:last-child:before{width:.353em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=_]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=_]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=c]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=c]:last-child:before{width:.499em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=d]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=d]:last-child:before{width:.588em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=f]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=f]:last-child:before{width:.494em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=g]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=g]:last-child:before{width:.568em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=i]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=i]:last-child:before{width:.315em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=j]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=j]:last-child:before{width:.336em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=k]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=k]:last-child:before{width:.543em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=l]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=l]:last-child:before{width:.311em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=r]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=r]:last-child:before{width:.424em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=s]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=s]:last-child:before{width:.436em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=v]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=v]:last-child:before{width:.54em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=w]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=w]:last-child:before{width:.762em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=x]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=x]:last-child:before{width:.537em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=y]:last-child:before{width:.54em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=z]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c=z]:last-child:before{width:.494em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="~"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="~"]:last-child:before{width:.56em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="301"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="301"]:last-child:before{width:.063em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="303"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="303"]:last-child:before{width:.06em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="304"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="304"]:last-child:before{width:.064em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="306"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="306"]:last-child:before{width:.073em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="30B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="30B"]:last-child:before{width:.063em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="30C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="30C"]:last-child:before{width:.06em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="393"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="393"]:last-child:before{width:.646em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="395"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="395"]:last-child:before{width:.688em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="396"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="396"]:last-child:before{width:.702em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="397"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="397"]:last-child:before{width:.768em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="399"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="399"]:last-child:before{width:.338em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="39A"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="39A"]:last-child:before{width:.785em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="39C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="39C"]:last-child:before{width:.929em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="39D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="39D"]:last-child:before{width:.766em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="39E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="39E"]:last-child:before{width:.765em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A0"]:last-child:before{width:.768em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A1"]:last-child:before{width:.69em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A3"]:last-child:before{width:.813em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A4"]:last-child:before{width:.79em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A5"]:last-child:before{width:.843em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A7"]:last-child:before{width:.758em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3A8"]:last-child:before{width:.854em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3D2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3D2"]:last-child:before{width:.843em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3DC"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="3DC"]:last-child:before{width:.673em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2013"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2013"]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2014"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2014"]:last-child:before{width:1.065em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2015"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2015"]:last-child:before{width:1.065em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2017"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2017"]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2018"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2018"]:last-child:before{width:.336em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2019"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2019"]:last-child:before{width:.335em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="201C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="201C"]:last-child:before{width:.614em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2044"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-ss.mjx-b.mjx-i mjx-c[c="2044"]:last-child:before{width:.6em}.MJX-TEX .mjx-ty mjx-c[c=" "]:before{width:.525em}.MJX-TEX .mjx-ty mjx-c[c="!"]:before{width:.525em;padding:.622em 0 0}.MJX-TEX .mjx-ty mjx-c[c="22"]:before{width:.525em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="#"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="$"]:before{width:.525em;padding:.694em 0 .082em}.MJX-TEX .mjx-ty mjx-c[c="%"]:before{width:.525em;padding:.694em 0 .083em}.MJX-TEX .mjx-ty mjx-c[c="&"]:before{width:.525em;padding:.622em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c="27"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="("]:before,.MJX-TEX .mjx-ty mjx-c[c=")"]:before{width:.525em;padding:.694em 0 .082em}.MJX-TEX .mjx-ty mjx-c[c="*"]:before{width:.525em;padding:.52em 0 0}.MJX-TEX .mjx-ty mjx-c[c="+"]:before{width:.525em;padding:.531em 0 0}.MJX-TEX .mjx-ty mjx-c[c=","]:before{width:.525em;padding:.14em 0 .139em}.MJX-TEX .mjx-ty mjx-c[c="-"]:before{width:.525em;padding:.341em 0 0}.MJX-TEX .mjx-ty mjx-c[c="."]:before{width:.525em;padding:.14em 0 0}.MJX-TEX .mjx-ty mjx-c[c="/"]:before{width:.525em;padding:.694em 0 .083em}.MJX-TEX .mjx-ty mjx-c[c="0"]:before{width:.525em;padding:.621em 0 .01em}.MJX-TEX .mjx-ty mjx-c[c="1"]:before,.MJX-TEX .mjx-ty mjx-c[c="2"]:before{width:.525em;padding:.622em 0 0}.MJX-TEX .mjx-ty mjx-c[c="3"]:before{width:.525em;padding:.622em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c="4"]:before{width:.525em;padding:.624em 0 0}.MJX-TEX .mjx-ty mjx-c[c="5"]:before{width:.525em;padding:.611em 0 .01em}.MJX-TEX .mjx-ty mjx-c[c="6"]:before{width:.525em;padding:.622em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c="7"]:before{width:.525em;padding:.627em 0 .01em}.MJX-TEX .mjx-ty mjx-c[c="8"]:before{width:.525em;padding:.621em 0 .01em}.MJX-TEX .mjx-ty mjx-c[c="9"]:before{width:.525em;padding:.622em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c=":"]:before{width:.525em}.MJX-TEX .mjx-ty mjx-c[c=";"]:before{width:.525em;padding:.431em 0 .139em}.MJX-TEX .mjx-ty mjx-c[c="<"]:before{width:.525em;padding:.557em 0 0}.MJX-TEX .mjx-ty mjx-c[c="="]:before{width:.525em;padding:.417em 0 0}.MJX-TEX .mjx-ty mjx-c[c=">"]:before{width:.525em;padding:.557em 0 0}.MJX-TEX .mjx-ty mjx-c[c="?"]:before{width:.525em;padding:.617em 0 0}.MJX-TEX .mjx-ty mjx-c[c="@"]:before{width:.525em;padding:.617em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=A]:before{width:.525em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c=B]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=C]:before{width:.525em;padding:.622em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c=D]:before,.MJX-TEX .mjx-ty mjx-c[c=E]:before,.MJX-TEX .mjx-ty mjx-c[c=F]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=G]:before{width:.525em;padding:.622em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c=H]:before,.MJX-TEX .mjx-ty mjx-c[c=I]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=J]:before{width:.525em;padding:.611em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c=K]:before,.MJX-TEX .mjx-ty mjx-c[c=L]:before,.MJX-TEX .mjx-ty mjx-c[c=M]:before,.MJX-TEX .mjx-ty mjx-c[c=N]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=O]:before{width:.525em;padding:.621em 0 .01em}.MJX-TEX .mjx-ty mjx-c[c=P]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=Q]:before{width:.525em;padding:.621em 0 .138em}.MJX-TEX .mjx-ty mjx-c[c=R]:before{width:.525em;padding:.611em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c=S]:before{width:.525em;padding:.622em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c=T]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=U]:before{width:.525em;padding:.611em 0 .011em}.MJX-TEX .mjx-ty mjx-c[c=V]:before,.MJX-TEX .mjx-ty mjx-c[c=W]:before{width:.525em;padding:.611em 0 .007em}.MJX-TEX .mjx-ty mjx-c[c=X]:before,.MJX-TEX .mjx-ty mjx-c[c=Y]:before,.MJX-TEX .mjx-ty mjx-c[c=Z]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="["]:before{width:.525em;padding:.694em 0 .082em}.MJX-TEX .mjx-ty mjx-c[c="5C"]:before{width:.525em;padding:.694em 0 .083em}.MJX-TEX .mjx-ty mjx-c[c="]"]:before{width:.525em;padding:.694em 0 .082em}.MJX-TEX .mjx-ty mjx-c[c="^"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=_]:before{width:.525em;padding:0 0 .095em}.MJX-TEX .mjx-ty mjx-c[c="`"]:before{width:.525em;padding:.681em 0 0}.MJX-TEX .mjx-ty mjx-c[c=a]:before{width:.525em;padding:.439em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=b]:before{width:.525em;padding:.611em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=c]:before{width:.525em;padding:.44em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=d]:before{width:.525em;padding:.611em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=e]:before{width:.525em;padding:.44em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=f]:before{width:.525em;padding:.617em 0 0}.MJX-TEX .mjx-ty mjx-c[c=g]:before{width:.525em;padding:.442em 0 .229em}.MJX-TEX .mjx-ty mjx-c[c=h]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=i]:before{width:.525em;padding:.612em 0 0}.MJX-TEX .mjx-ty mjx-c[c=j]:before{width:.525em;padding:.612em 0 .228em}.MJX-TEX .mjx-ty mjx-c[c=k]:before,.MJX-TEX .mjx-ty mjx-c[c=l]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c=m]:before,.MJX-TEX .mjx-ty mjx-c[c=n]:before{width:.525em;padding:.436em 0 0}.MJX-TEX .mjx-ty mjx-c[c=o]:before{width:.525em;padding:.44em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=p]:before,.MJX-TEX .mjx-ty mjx-c[c=q]:before{width:.525em;padding:.437em 0 .221em}.MJX-TEX .mjx-ty mjx-c[c=r]:before{width:.525em;padding:.437em 0 0}.MJX-TEX .mjx-ty mjx-c[c=s]:before{width:.525em;padding:.44em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=t]:before{width:.525em;padding:.554em 0 .006em}.MJX-TEX .mjx-ty mjx-c[c=u]:before{width:.525em;padding:.431em 0 .005em}.MJX-TEX .mjx-ty mjx-c[c=v]:before,.MJX-TEX .mjx-ty mjx-c[c=w]:before{width:.525em;padding:.431em 0 0}.MJX-TEX .mjx-ty mjx-c[c=x]:before{width:.525em}.MJX-TEX .mjx-ty mjx-c[c=y]:before{width:.525em;padding:.431em 0 .228em}.MJX-TEX .mjx-ty mjx-c[c=z]:before{width:.525em}.MJX-TEX .mjx-ty mjx-c[c="{"]:before{width:.525em;padding:.694em 0 .083em}.MJX-TEX .mjx-ty mjx-c[c="|"]:before{width:.525em;padding:.694em 0 .082em}.MJX-TEX .mjx-ty mjx-c[c="}"]:before{width:.525em;padding:.694em 0 .083em}.MJX-TEX .mjx-ty mjx-c[c="~"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="7F"]:before{width:.525em;padding:.612em 0 0;content:"\7F"}.MJX-TEX .mjx-ty mjx-c[c=A0]:before{width:.525em}.MJX-TEX .mjx-ty mjx-c[c="131"]:before{width:.525em;padding:.431em 0 0}.MJX-TEX .mjx-ty mjx-c[c="237"]:before{width:.525em;padding:.431em 0 .228em}.MJX-TEX .mjx-ty mjx-c[c="2B9"]:before{width:.525em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="300"]:before,.MJX-TEX .mjx-ty mjx-c[c="301"]:before,.MJX-TEX .mjx-ty mjx-c[c="302"]:before,.MJX-TEX .mjx-ty mjx-c[c="303"]:before{padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="304"]:before{padding:.577em 0 0}.MJX-TEX .mjx-ty mjx-c[c="306"]:before{padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="308"]:before{padding:.612em 0 0}.MJX-TEX .mjx-ty mjx-c[c="30A"]:before{padding:.619em 0 0}.MJX-TEX .mjx-ty mjx-c[c="30C"]:before{padding:.577em 0 0}.MJX-TEX .mjx-ty mjx-c[c="391"]:before{width:.525em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="392"]:before,.MJX-TEX .mjx-ty mjx-c[c="393"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="394"]:before{width:.525em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="395"]:before,.MJX-TEX .mjx-ty mjx-c[c="396"]:before,.MJX-TEX .mjx-ty mjx-c[c="397"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="398"]:before{width:.525em;padding:.621em 0 .01em}.MJX-TEX .mjx-ty mjx-c[c="39A"]:before,.MJX-TEX .mjx-ty mjx-c[c="399"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="39B"]:before{width:.525em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="39C"]:before,.MJX-TEX .mjx-ty mjx-c[c="39D"]:before,.MJX-TEX .mjx-ty mjx-c[c="39E"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="39F"]:before{width:.525em;padding:.621em 0 .01em}.MJX-TEX .mjx-ty mjx-c[c="3A0"]:before,.MJX-TEX .mjx-ty mjx-c[c="3A1"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="3A2"]:before{width:.525em;padding:.621em 0 .01em}.MJX-TEX .mjx-ty mjx-c[c="3A3"]:before,.MJX-TEX .mjx-ty mjx-c[c="3A4"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="3A5"]:before{width:.525em;padding:.622em 0 0}.MJX-TEX .mjx-ty mjx-c[c="3A6"]:before,.MJX-TEX .mjx-ty mjx-c[c="3A7"]:before,.MJX-TEX .mjx-ty mjx-c[c="3A8"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="3A9"]:before,.MJX-TEX .mjx-ty mjx-c[c="3D2"]:before{width:.525em;padding:.622em 0 0}.MJX-TEX .mjx-ty mjx-c[c="3DC"]:before{width:.525em;padding:.611em 0 0}.MJX-TEX .mjx-ty mjx-c[c="2017"]:before{width:.525em;padding:0 0 .095em}.MJX-TEX .mjx-ty mjx-c[c="2032"]:before{width:.525em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="2033"]:before{width:1.05em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="2034"]:before{width:1.575em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="2044"]:before{width:.525em;padding:.694em 0 .083em}.MJX-TEX .mjx-ty mjx-c[c="2057"]:before{width:2.1em;padding:.623em 0 0}.MJX-TEX .mjx-ty mjx-c[c="2206"]:before{width:.525em;padding:.623em 0 0}.MJX-TEX .mjx-sop mjx-c[c="("]:before,.MJX-TEX .mjx-sop mjx-c[c=")"]:before{width:.458em;padding:.85em 0 .349em}.MJX-TEX .mjx-sop mjx-c[c="/"]:before{width:.578em;padding:.85em 0 .349em}.MJX-TEX .mjx-sop mjx-c[c="["]:before{width:.417em;padding:.85em 0 .349em}.MJX-TEX .mjx-sop mjx-c[c="5C"]:before{width:.578em;padding:.85em 0 .349em}.MJX-TEX .mjx-sop mjx-c[c="]"]:before{width:.417em;padding:.85em 0 .349em}.MJX-TEX .mjx-sop mjx-c[c="{"]:before,.MJX-TEX .mjx-sop mjx-c[c="}"]:before{width:.583em;padding:.85em 0 .349em}.MJX-TEX .mjx-sop mjx-c[c="2C6"]:before{width:.556em;padding:.744em 0 0}.MJX-TEX .mjx-sop mjx-c[c="2DC"]:before{width:.556em;padding:.722em 0 0}.MJX-TEX .mjx-sop mjx-c[c="302"]:before{padding:.744em 0 0}.MJX-TEX .mjx-sop mjx-c[c="303"]:before{padding:.722em 0 0}.MJX-TEX .mjx-sop mjx-c[c="2016"]:before{width:.778em;padding:.602em 0 0;content:"\2016"}.MJX-TEX .mjx-sop mjx-c[c="2044"]:before{width:.578em;padding:.85em 0 .349em}.MJX-TEX .mjx-sop mjx-c[c="2191"]:before,.MJX-TEX .mjx-sop mjx-c[c="2193"]:before{width:.667em;padding:.6em 0 0}.MJX-TEX .mjx-sop mjx-c[c="21D1"]:before{width:.778em;padding:.599em 0 0}.MJX-TEX .mjx-sop mjx-c[c="21D3"]:before{width:.778em;padding:.6em 0 0}.MJX-TEX .mjx-sop mjx-c[c="221A"]:before{width:1em;padding:.85em 0 .35em}.MJX-TEX .mjx-sop mjx-c[c="2223"]:before{width:.333em;padding:.627em 0 .015em}.MJX-TEX .mjx-sop mjx-c[c="2225"]:before{width:.556em;padding:.627em 0 .015em}.MJX-TEX .mjx-sop mjx-c[c="222B"]:before{width:.472em;padding:.805em 0 .306em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sop mjx-c[c="222B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sop mjx-c[c="222B"]:last-child:before{width:.61em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sop mjx-c[c="222C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sop mjx-c[c="222C"]:last-child:before{width:.957em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sop mjx-c[c="222D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sop mjx-c[c="222D"]:last-child:before{width:1.304em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sop mjx-c[c="222E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sop mjx-c[c="222E"]:last-child:before{width:.61em}.MJX-TEX .mjx-sop mjx-c[c="230A"]:before,.MJX-TEX .mjx-sop mjx-c[c="230B"]:before,.MJX-TEX .mjx-sop mjx-c[c="2308"]:before,.MJX-TEX .mjx-sop mjx-c[c="2309"]:before{width:.472em;padding:.85em 0 .349em}.MJX-TEX .mjx-sop mjx-c[c="232A"]:before,.MJX-TEX .mjx-sop mjx-c[c="2329"]:before{width:.472em;padding:.85em 0 .35em}.MJX-TEX .mjx-sop mjx-c[c="2758"]:before{width:.333em;padding:.627em 0 .015em}.MJX-TEX .mjx-sop mjx-c[c="27E8"]:before,.MJX-TEX .mjx-sop mjx-c[c="27E9"]:before{width:.472em;padding:.85em 0 .35em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-sop mjx-c[c="2A0C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-sop mjx-c[c="2A0C"]:last-child:before{width:1.776em}.MJX-TEX .mjx-sop mjx-c[c="3008"]:before,.MJX-TEX .mjx-sop mjx-c[c="3009"]:before{width:.472em;padding:.85em 0 .35em}.MJX-TEX .mjx-lop mjx-c[c="("]:before,.MJX-TEX .mjx-lop mjx-c[c=")"]:before{width:.597em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="/"]:before{width:.811em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="["]:before{width:.472em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="5C"]:before{width:.811em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="]"]:before{width:.472em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="{"]:before,.MJX-TEX .mjx-lop mjx-c[c="}"]:before{width:.667em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="2C6"]:before{width:1em;padding:.772em 0 0}.MJX-TEX .mjx-lop mjx-c[c="2DC"]:before{width:1em;padding:.75em 0 0}.MJX-TEX .mjx-lop mjx-c[c="302"]:before{padding:.772em 0 0}.MJX-TEX .mjx-lop mjx-c[c="303"]:before{padding:.75em 0 0}.MJX-TEX .mjx-lop mjx-c[c="2016"]:before{width:.778em;padding:.602em 0 0;content:"\2016"}.MJX-TEX .mjx-lop mjx-c[c="2044"]:before{width:.811em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="2191"]:before,.MJX-TEX .mjx-lop mjx-c[c="2193"]:before{width:.667em;padding:.6em 0 0}.MJX-TEX .mjx-lop mjx-c[c="21D1"]:before{width:.778em;padding:.599em 0 0}.MJX-TEX .mjx-lop mjx-c[c="21D3"]:before{width:.778em;padding:.6em 0 0}.MJX-TEX .mjx-lop mjx-c[c="220F"]:before,.MJX-TEX .mjx-lop mjx-c[c="2210"]:before{width:1.278em;padding:.95em 0 .45em}.MJX-TEX .mjx-lop mjx-c[c="2211"]:before{width:1.444em;padding:.95em 0 .45em}.MJX-TEX .mjx-lop mjx-c[c="221A"]:before{width:1em;padding:1.15em 0 .65em}.MJX-TEX .mjx-lop mjx-c[c="2223"]:before{width:.333em;padding:.627em 0 .015em}.MJX-TEX .mjx-lop mjx-c[c="2225"]:before{width:.556em;padding:.627em 0 .015em}.MJX-TEX .mjx-lop mjx-c[c="222B"]:before{width:.556em;padding:1.36em 0 .862em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-lop mjx-c[c="222B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-lop mjx-c[c="222B"]:last-child:before{width:.944em}.MJX-TEX .mjx-lop mjx-c[c="222C"]:before{width:1.084em;padding:1.36em 0 .862em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-lop mjx-c[c="222C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-lop mjx-c[c="222C"]:last-child:before{width:1.472em}.MJX-TEX .mjx-lop mjx-c[c="222D"]:before{width:1.592em;padding:1.36em 0 .862em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-lop mjx-c[c="222D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-lop mjx-c[c="222D"]:last-child:before{width:1.98em}.MJX-TEX .mjx-lop mjx-c[c="222E"]:before{width:.556em;padding:1.36em 0 .862em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-lop mjx-c[c="222E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-lop mjx-c[c="222E"]:last-child:before{width:.944em}.MJX-TEX .mjx-lop mjx-c[c="22C0"]:before,.MJX-TEX .mjx-lop mjx-c[c="22C1"]:before{width:1.111em;padding:.95em 0 .45em}.MJX-TEX .mjx-lop mjx-c[c="22C2"]:before{width:1.111em;padding:.949em 0 .45em}.MJX-TEX .mjx-lop mjx-c[c="22C3"]:before{width:1.111em;padding:.95em 0 .449em}.MJX-TEX .mjx-lop mjx-c[c="230A"]:before,.MJX-TEX .mjx-lop mjx-c[c="230B"]:before,.MJX-TEX .mjx-lop mjx-c[c="2308"]:before,.MJX-TEX .mjx-lop mjx-c[c="2309"]:before{width:.528em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="232A"]:before,.MJX-TEX .mjx-lop mjx-c[c="2329"]:before{width:.611em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="2758"]:before{width:.333em;padding:.627em 0 .015em}.MJX-TEX .mjx-lop mjx-c[c="27E8"]:before,.MJX-TEX .mjx-lop mjx-c[c="27E9"]:before{width:.611em;padding:1.15em 0 .649em}.MJX-TEX .mjx-lop mjx-c[c="2A00"]:before,.MJX-TEX .mjx-lop mjx-c[c="2A01"]:before,.MJX-TEX .mjx-lop mjx-c[c="2A02"]:before{width:1.511em;padding:.949em 0 .449em}.MJX-TEX .mjx-lop mjx-c[c="2A04"]:before{width:1.111em;padding:.95em 0 .449em}.MJX-TEX .mjx-lop mjx-c[c="2A06"]:before{width:1.111em;padding:.95em 0 .45em}.MJX-TEX .mjx-lop mjx-c[c="2A0C"]:before{width:2.168em;padding:1.36em 0 .862em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-lop mjx-c[c="2A0C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-lop mjx-c[c="2A0C"]:last-child:before{width:2.556em}.MJX-TEX .mjx-lop mjx-c[c="3008"]:before,.MJX-TEX .mjx-lop mjx-c[c="3009"]:before{width:.611em;padding:1.15em 0 .649em}.MJX-TEX .mjx-s3 mjx-c[c="("]:before,.MJX-TEX .mjx-s3 mjx-c[c=")"]:before{width:.736em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="/"]:before{width:1.044em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="["]:before{width:.528em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="5C"]:before{width:1.044em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="]"]:before{width:.528em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="{"]:before,.MJX-TEX .mjx-s3 mjx-c[c="}"]:before{width:.75em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="2C6"]:before{width:1.444em;padding:.772em 0 0}.MJX-TEX .mjx-s3 mjx-c[c="2DC"]:before{width:1.444em;padding:.749em 0 0}.MJX-TEX .mjx-s3 mjx-c[c="302"]:before{padding:.772em 0 0}.MJX-TEX .mjx-s3 mjx-c[c="303"]:before{padding:.749em 0 0}.MJX-TEX .mjx-s3 mjx-c[c="2044"]:before{width:1.044em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="221A"]:before{width:1em;padding:1.45em 0 .95em}.MJX-TEX .mjx-s3 mjx-c[c="230A"]:before,.MJX-TEX .mjx-s3 mjx-c[c="230B"]:before,.MJX-TEX .mjx-s3 mjx-c[c="2308"]:before,.MJX-TEX .mjx-s3 mjx-c[c="2309"]:before{width:.583em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="2329"]:before{width:.75em;padding:1.45em 0 .95em}.MJX-TEX .mjx-s3 mjx-c[c="232A"]:before{width:.75em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="27E8"]:before{width:.75em;padding:1.45em 0 .95em}.MJX-TEX .mjx-s3 mjx-c[c="27E9"]:before{width:.75em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s3 mjx-c[c="3008"]:before{width:.75em;padding:1.45em 0 .95em}.MJX-TEX .mjx-s3 mjx-c[c="3009"]:before{width:.75em;padding:1.45em 0 .949em}.MJX-TEX .mjx-s4 mjx-c[c="("]:before,.MJX-TEX .mjx-s4 mjx-c[c=")"]:before{width:.792em;padding:1.75em 0 1.249em}.MJX-TEX .mjx-s4 mjx-c[c="/"]:before{width:1.278em;padding:1.75em 0 1.249em}.MJX-TEX .mjx-s4 mjx-c[c="["]:before{width:.583em;padding:1.75em 0 1.249em}.MJX-TEX .mjx-s4 mjx-c[c="5C"]:before{width:1.278em;padding:1.75em 0 1.249em}.MJX-TEX .mjx-s4 mjx-c[c="]"]:before{width:.583em;padding:1.75em 0 1.249em}.MJX-TEX .mjx-s4 mjx-c[c="{"]:before,.MJX-TEX .mjx-s4 mjx-c[c="}"]:before{width:.806em;padding:1.75em 0 1.249em}.MJX-TEX .mjx-s4 mjx-c[c="2C6"]:before{width:1.889em;padding:.845em 0 0}.MJX-TEX .mjx-s4 mjx-c[c="2DC"]:before{width:1.889em;padding:.823em 0 0}.MJX-TEX .mjx-s4 mjx-c[c="302"]:before{padding:.845em 0 0}.MJX-TEX .mjx-s4 mjx-c[c="303"]:before{padding:.823em 0 0}.MJX-TEX .mjx-s4 mjx-c[c="2044"]:before{width:1.278em;padding:1.75em 0 1.249em}.MJX-TEX .mjx-s4 mjx-c[c="221A"]:before{width:1em;padding:1.75em 0 1.25em}.MJX-TEX .mjx-s4 mjx-c[c="230A"]:before,.MJX-TEX .mjx-s4 mjx-c[c="230B"]:before,.MJX-TEX .mjx-s4 mjx-c[c="2308"]:before,.MJX-TEX .mjx-s4 mjx-c[c="2309"]:before{width:.639em;padding:1.75em 0 1.249em}.MJX-TEX .mjx-s4 mjx-c[c="232A"]:before,.MJX-TEX .mjx-s4 mjx-c[c="2329"]:before{width:.806em;padding:1.75em 0 1.248em}.MJX-TEX .mjx-s4 mjx-c[c="239B"]:before{width:.875em;padding:1.154em 0 .655em;content:"\239B"}.MJX-TEX .mjx-s4 mjx-c[c="239C"]:before{width:.875em;padding:.61em 0 .01em;content:"\239C"}.MJX-TEX .mjx-s4 mjx-c[c="239D"]:before{width:.875em;padding:1.165em 0 .644em;content:"\239D"}.MJX-TEX .mjx-s4 mjx-c[c="239E"]:before{width:.875em;padding:1.154em 0 .655em;content:"\239E"}.MJX-TEX .mjx-s4 mjx-c[c="239F"]:before{width:.875em;padding:.61em 0 .01em;content:"\239F"}.MJX-TEX .mjx-s4 mjx-c[c="23A0"]:before{width:.875em;padding:1.165em 0 .644em;content:"\23A0"}.MJX-TEX .mjx-s4 mjx-c[c="23A1"]:before{width:.667em;padding:1.154em 0 .645em;content:"\23A1"}.MJX-TEX .mjx-s4 mjx-c[c="23A2"]:before{width:.667em;padding:.602em 0 0;content:"\23A2"}.MJX-TEX .mjx-s4 mjx-c[c="23A3"]:before{width:.667em;padding:1.155em 0 .644em;content:"\23A3"}.MJX-TEX .mjx-s4 mjx-c[c="23A4"]:before{width:.667em;padding:1.154em 0 .645em;content:"\23A4"}.MJX-TEX .mjx-s4 mjx-c[c="23A5"]:before{width:.667em;padding:.602em 0 0;content:"\23A5"}.MJX-TEX .mjx-s4 mjx-c[c="23A6"]:before{width:.667em;padding:1.155em 0 .644em;content:"\23A6"}.MJX-TEX .mjx-s4 mjx-c[c="23A7"]:before{width:.889em;padding:.899em 0 .01em;content:"\23A7"}.MJX-TEX .mjx-s4 mjx-c[c="23A8"]:before{width:.889em;padding:1.16em 0 .66em;content:"\23A8"}.MJX-TEX .mjx-s4 mjx-c[c="23A9"]:before{width:.889em;padding:.01em 0 .899em;content:"\23A9"}.MJX-TEX .mjx-s4 mjx-c[c="23AA"]:before{width:.889em;padding:.29em 0 .015em;content:"\23AA"}.MJX-TEX .mjx-s4 mjx-c[c="23AB"]:before{width:.889em;padding:.899em 0 .01em;content:"\23AB"}.MJX-TEX .mjx-s4 mjx-c[c="23AC"]:before{width:.889em;padding:1.16em 0 .66em;content:"\23AC"}.MJX-TEX .mjx-s4 mjx-c[c="23AD"]:before{width:.889em;padding:.01em 0 .899em;content:"\23AD"}.MJX-TEX .mjx-s4 mjx-c[c="23B7"]:before{width:1.056em;padding:.935em 0 .885em;content:"\23B7"}.MJX-TEX .mjx-s4 mjx-c[c="27E8"]:before,.MJX-TEX .mjx-s4 mjx-c[c="27E9"]:before,.MJX-TEX .mjx-s4 mjx-c[c="3008"]:before,.MJX-TEX .mjx-s4 mjx-c[c="3009"]:before{width:.806em;padding:1.75em 0 1.248em}.MJX-TEX .mjx-s4 mjx-c[c=E000]:before{width:1.056em;padding:.625em 0 .014em;content:"\E000"}.MJX-TEX .mjx-s4 mjx-c[c=E001]:before{width:1.056em;padding:.605em 0 .014em;content:"\E001"}.MJX-TEX .mjx-s4 mjx-c[c=E150]:before{width:.45em;padding:.12em 0 .213em;content:"\E150"}.MJX-TEX .mjx-s4 mjx-c[c=E151]:before{width:.45em;padding:.12em 0 .213em;content:"\E151"}.MJX-TEX .mjx-s4 mjx-c[c=E152]:before{width:.45em;padding:.333em 0 0;content:"\E152"}.MJX-TEX .mjx-s4 mjx-c[c=E153]:before{width:.45em;padding:.333em 0 0;content:"\E153"}.MJX-TEX .mjx-s4 mjx-c[c=E154]:before{width:.4em;padding:.32em 0 .2em;content:"\E154"}.MJX-TEX .mjx-s4 mjx-c[c=E155]:before{width:.9em;padding:.333em 0 0;content:"\E153\E152"}.MJX-TEX .mjx-s4 mjx-c[c=E156]:before{width:.9em;padding:.12em 0 .213em;content:"\E151\E150"}.MJX-TEX .mjx-cal mjx-c[c="0"]:before{padding:.452em 0 .022em}.MJX-TEX .mjx-cal mjx-c[c="1"]:before,.MJX-TEX .mjx-cal mjx-c[c="2"]:before{padding:.453em 0 0}.MJX-TEX .mjx-cal mjx-c[c="3"]:before{padding:.452em 0 .216em}.MJX-TEX .mjx-cal mjx-c[c="4"]:before{padding:.464em 0 .194em}.MJX-TEX .mjx-cal mjx-c[c="5"]:before{padding:.453em 0 .216em}.MJX-TEX .mjx-cal mjx-c[c="7"]:before{padding:.463em 0 .216em}.MJX-TEX .mjx-cal mjx-c[c="9"]:before{padding:.453em 0 .216em}.MJX-TEX .mjx-cal mjx-c[c=A]:before{width:.798em;padding:.728em 0 .05em}.MJX-TEX .mjx-cal mjx-c[c=B]:before{width:.657em;padding:.705em 0 .022em}.MJX-TEX .mjx-cal mjx-c[c=C]:before{width:.527em}.MJX-TEX .mjx-cal mjx-c[c=D]:before{width:.771em}.MJX-TEX .mjx-cal mjx-c[c=E]:before{width:.528em;padding:.705em 0 .022em}.MJX-TEX .mjx-cal mjx-c[c=F]:before{width:.719em;padding:.683em 0 .032em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c=F]:last-child:before{width:.829em}.MJX-TEX .mjx-cal mjx-c[c=G]:before{width:.595em;padding:.704em 0 .119em}.MJX-TEX .mjx-cal mjx-c[c=H]:before{width:.845em;padding:.683em 0 .048em}.MJX-TEX .mjx-cal mjx-c[c=I]:before{width:.545em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c=I]:last-child:before{width:.642em}.MJX-TEX .mjx-cal mjx-c[c=J]:before{width:.678em;padding:.683em 0 .119em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c=J]:last-child:before{width:.839em}.MJX-TEX .mjx-cal mjx-c[c=K]:before{width:.762em;padding:.705em 0 .022em}.MJX-TEX .mjx-cal mjx-c[c=L]:before{width:.69em;padding:.705em 0 .022em}.MJX-TEX .mjx-cal mjx-c[c=M]:before{width:1.201em;padding:.705em 0 .05em}.MJX-TEX .mjx-cal mjx-c[c=N]:before{width:.82em;padding:.789em 0 .05em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c=N]:last-child:before{width:.979em}.MJX-TEX .mjx-cal mjx-c[c=O]:before{width:.796em}.MJX-TEX .mjx-cal mjx-c[c=P]:before{width:.696em;padding:.683em 0 .057em}.MJX-TEX .mjx-cal mjx-c[c=Q]:before{width:.817em;padding:.705em 0 .131em}.MJX-TEX .mjx-cal mjx-c[c=R]:before{width:.848em}.MJX-TEX .mjx-cal mjx-c[c=S]:before{width:.606em}.MJX-TEX .mjx-cal mjx-c[c=T]:before{width:.545em;padding:.717em 0 .068em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c=T]:last-child:before{width:.833em}.MJX-TEX .mjx-cal mjx-c[c=U]:before{width:.626em;padding:.683em 0 .028em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c=U]:last-child:before{width:.687em}.MJX-TEX .mjx-cal mjx-c[c=V]:before{width:.613em;padding:.683em 0 .052em}.MJX-TEX .mjx-cal mjx-c[c=W]:before{width:.988em;padding:.683em 0 .053em}.MJX-TEX .mjx-cal mjx-c[c=X]:before{width:.713em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c=X]:last-child:before{width:.807em}.MJX-TEX .mjx-cal mjx-c[c=Y]:before{width:.668em;padding:.683em 0 .143em}.MJX-TEX .mjx-cal mjx-c[c=Z]:before{width:.725em}.MJX-TEX .mjx-cal mjx-c[c="391"]:before,.MJX-TEX .mjx-cal mjx-c[c="392"]:before,.MJX-TEX .mjx-cal mjx-c[c="395"]:before,.MJX-TEX .mjx-cal mjx-c[c="396"]:before,.MJX-TEX .mjx-cal mjx-c[c="397"]:before{font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c="397"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c="397"]:last-child:before{width:.888em}.MJX-TEX .mjx-cal mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c="399"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c="399"]:last-child:before{width:.504em}.MJX-TEX .mjx-cal mjx-c[c="39A"]:before,.MJX-TEX .mjx-cal mjx-c[c="39C"]:before{font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c="39C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c="39C"]:last-child:before{width:1.051em}.MJX-TEX .mjx-cal mjx-c[c="39D"]:before{font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c="39D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c="39D"]:last-child:before{width:.888em}.MJX-TEX .mjx-cal mjx-c[c="3A1"]:before,.MJX-TEX .mjx-cal mjx-c[c="39F"]:before{font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c="3A1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c="3A1"]:last-child:before{width:.751em}.MJX-TEX .mjx-cal mjx-c[c="3A2"]:before,.MJX-TEX .mjx-cal mjx-c[c="3A4"]:before{font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c="3A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c="3A4"]:last-child:before{width:.704em}.MJX-TEX .mjx-cal mjx-c[c="3A7"]:before,.MJX-TEX .mjx-cal mjx-c[c="3D2"]:before{font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c="3D2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c="3D2"]:last-child:before{width:.7em}.MJX-TEX .mjx-cal mjx-c[c="3DC"]:before{font-family:MJXZERO,MJXTEX-I}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal mjx-c[c="3DC"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal mjx-c[c="3DC"]:last-child:before{width:.749em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="0"]:before{padding:.46em 0 .017em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="1"]:before{padding:.461em 0 0}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="2"]:before{padding:.46em 0 0}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="3"]:before{padding:.461em 0 .211em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="5"]:before{padding:.461em 0 .211em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="6"]:before{padding:.66em 0 .017em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="7"]:before{padding:.476em 0 .211em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="8"]:before{padding:.661em 0 .017em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="9"]:before{padding:.461em 0 .21em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=A]:before{width:.921em;padding:.751em 0 .049em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=A]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=A]:last-child:before{width:.989em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=B]:before{width:.748em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=C]:before{width:.613em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=D]:before{width:.892em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=E]:before{width:.607em;padding:.703em 0 .016em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=F]:before{width:.814em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=F]:last-child:before{width:.93em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=G]:before{width:.682em;padding:.703em 0 .113em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=H]:before{width:.987em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=I]:before{width:.642em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=I]:last-child:before{width:.746em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=J]:before{width:.779em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=J]:last-child:before{width:.937em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=K]:before{width:.871em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=L]:before{width:.788em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=M]:before{width:1.378em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=N]:before{width:.937em;padding:.84em 0 .049em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=N]:last-child:before{width:1.105em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=O]:before{width:.906em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=P]:before{width:.81em;padding:.686em 0 .067em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=Q]:before{width:.939em;padding:.703em 0 .146em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=R]:before{width:.99em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=S]:before{width:.696em;padding:.703em 0 .016em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=T]:before{width:.644em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=T]:last-child:before{width:.947em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=U]:before{width:.715em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=U]:last-child:before{width:.771em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=V]:before{width:.737em;padding:.686em 0 .077em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=W]:before{width:1.169em;padding:.686em 0 .077em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=X]:before{width:.817em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=X]:last-child:before{width:.906em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=Y]:before{width:.759em;padding:.686em 0 .164em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=Z]:before{width:.818em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=f]:before{padding:.701em 0 .201em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=f]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c=f]:last-child:before{width:.624em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=h]:before{padding:.694em 0 .008em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c=k]:before,.MJX-TEX .mjx-cal.mjx-b mjx-c[c=l]:before{padding:.694em 0 .008em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="391"]:before,.MJX-TEX .mjx-cal.mjx-b mjx-c[c="392"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="393"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="393"]:last-child:before{width:.777em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="395"]:before,.MJX-TEX .mjx-cal.mjx-b mjx-c[c="396"]:before,.MJX-TEX .mjx-cal.mjx-b mjx-c[c="397"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="399"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="399"]:last-child:before{width:.573em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="39A"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="39C"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="39C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="39C"]:last-child:before{width:1.219em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="39D"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="39D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="39D"]:last-child:before{width:1.027em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="39F"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="3A1"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3A1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3A1"]:last-child:before{width:.847em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="3A2"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="3A4"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3A4"]:last-child:before{width:.772em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3A5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3A5"]:last-child:before{width:.802em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="3A7"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3A8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3A8"]:last-child:before{width:.79em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3C4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3C4"]:last-child:before{width:.61em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="3D2"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3D2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3D2"]:last-child:before{width:.802em}.MJX-TEX .mjx-cal.mjx-b mjx-c[c="3DC"]:before{font-family:MJXZERO,MJXTEX-BI}.MJX-TEX mjx-mi:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3DC"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-cal.mjx-b mjx-c[c="3DC"]:last-child:before{width:.809em}.MJX-TEX .mjx-os mjx-c[c="0"]:before{padding:.452em 0 .022em}.MJX-TEX .mjx-os mjx-c[c="1"]:before,.MJX-TEX .mjx-os mjx-c[c="2"]:before{padding:.453em 0 0}.MJX-TEX .mjx-os mjx-c[c="3"]:before{padding:.452em 0 .216em}.MJX-TEX .mjx-os mjx-c[c="4"]:before{padding:.464em 0 .194em}.MJX-TEX .mjx-os mjx-c[c="5"]:before{padding:.453em 0 .216em}.MJX-TEX .mjx-os mjx-c[c="7"]:before{padding:.463em 0 .216em}.MJX-TEX .mjx-os mjx-c[c="9"]:before{padding:.453em 0 .216em}.MJX-TEX .mjx-os mjx-c[c=A]:before{width:.798em;padding:.728em 0 .05em}.MJX-TEX .mjx-os mjx-c[c=B]:before{width:.657em;padding:.705em 0 .022em}.MJX-TEX .mjx-os mjx-c[c=C]:before{width:.527em}.MJX-TEX .mjx-os mjx-c[c=D]:before{width:.771em}.MJX-TEX .mjx-os mjx-c[c=E]:before{width:.528em;padding:.705em 0 .022em}.MJX-TEX .mjx-os mjx-c[c=F]:before{width:.719em;padding:.683em 0 .032em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os mjx-c[c=F]:last-child:before{width:.829em}.MJX-TEX .mjx-os mjx-c[c=G]:before{width:.595em;padding:.704em 0 .119em}.MJX-TEX .mjx-os mjx-c[c=H]:before{width:.845em;padding:.683em 0 .048em}.MJX-TEX .mjx-os mjx-c[c=I]:before{width:.545em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os mjx-c[c=I]:last-child:before{width:.642em}.MJX-TEX .mjx-os mjx-c[c=J]:before{width:.678em;padding:.683em 0 .119em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os mjx-c[c=J]:last-child:before{width:.839em}.MJX-TEX .mjx-os mjx-c[c=K]:before{width:.762em;padding:.705em 0 .022em}.MJX-TEX .mjx-os mjx-c[c=L]:before{width:.69em;padding:.705em 0 .022em}.MJX-TEX .mjx-os mjx-c[c=M]:before{width:1.201em;padding:.705em 0 .05em}.MJX-TEX .mjx-os mjx-c[c=N]:before{width:.82em;padding:.789em 0 .05em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os mjx-c[c=N]:last-child:before{width:.979em}.MJX-TEX .mjx-os mjx-c[c=O]:before{width:.796em}.MJX-TEX .mjx-os mjx-c[c=P]:before{width:.696em;padding:.683em 0 .057em}.MJX-TEX .mjx-os mjx-c[c=Q]:before{width:.817em;padding:.705em 0 .131em}.MJX-TEX .mjx-os mjx-c[c=R]:before{width:.848em}.MJX-TEX .mjx-os mjx-c[c=S]:before{width:.606em}.MJX-TEX .mjx-os mjx-c[c=T]:before{width:.545em;padding:.717em 0 .068em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os mjx-c[c=T]:last-child:before{width:.833em}.MJX-TEX .mjx-os mjx-c[c=U]:before{width:.626em;padding:.683em 0 .028em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os mjx-c[c=U]:last-child:before{width:.687em}.MJX-TEX .mjx-os mjx-c[c=V]:before{width:.613em;padding:.683em 0 .052em}.MJX-TEX .mjx-os mjx-c[c=W]:before{width:.988em;padding:.683em 0 .053em}.MJX-TEX .mjx-os mjx-c[c=X]:before{width:.713em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os mjx-c[c=X]:last-child:before{width:.807em}.MJX-TEX .mjx-os mjx-c[c=Y]:before{width:.668em;padding:.683em 0 .143em}.MJX-TEX .mjx-os mjx-c[c=Z]:before{width:.725em}.MJX-TEX .mjx-os mjx-c[c="3A1"]:before,.MJX-TEX .mjx-os mjx-c[c="3A2"]:before,.MJX-TEX .mjx-os mjx-c[c="3A4"]:before,.MJX-TEX .mjx-os mjx-c[c="3A7"]:before,.MJX-TEX .mjx-os mjx-c[c="3D2"]:before,.MJX-TEX .mjx-os mjx-c[c="3DC"]:before,.MJX-TEX .mjx-os mjx-c[c="39A"]:before,.MJX-TEX .mjx-os mjx-c[c="39C"]:before,.MJX-TEX .mjx-os mjx-c[c="39D"]:before,.MJX-TEX .mjx-os mjx-c[c="39F"]:before,.MJX-TEX .mjx-os mjx-c[c="391"]:before,.MJX-TEX .mjx-os mjx-c[c="392"]:before,.MJX-TEX .mjx-os mjx-c[c="395"]:before,.MJX-TEX .mjx-os mjx-c[c="396"]:before,.MJX-TEX .mjx-os mjx-c[c="397"]:before,.MJX-TEX .mjx-os mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX}.MJX-TEX .mjx-os.mjx-b mjx-c[c="0"]:before{padding:.46em 0 .017em}.MJX-TEX .mjx-os.mjx-b mjx-c[c="1"]:before{padding:.461em 0 0}.MJX-TEX .mjx-os.mjx-b mjx-c[c="2"]:before{padding:.46em 0 0}.MJX-TEX .mjx-os.mjx-b mjx-c[c="3"]:before{padding:.461em 0 .211em}.MJX-TEX .mjx-os.mjx-b mjx-c[c="5"]:before{padding:.461em 0 .211em}.MJX-TEX .mjx-os.mjx-b mjx-c[c="6"]:before{padding:.66em 0 .017em}.MJX-TEX .mjx-os.mjx-b mjx-c[c="7"]:before{padding:.476em 0 .211em}.MJX-TEX .mjx-os.mjx-b mjx-c[c="8"]:before{padding:.661em 0 .017em}.MJX-TEX .mjx-os.mjx-b mjx-c[c="9"]:before{padding:.461em 0 .21em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=A]:before{width:.921em;padding:.751em 0 .049em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os.mjx-b mjx-c[c=A]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os.mjx-b mjx-c[c=A]:last-child:before{width:.989em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=B]:before{width:.748em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=C]:before{width:.613em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=D]:before{width:.892em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=E]:before{width:.607em;padding:.703em 0 .016em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=F]:before{width:.814em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os.mjx-b mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os.mjx-b mjx-c[c=F]:last-child:before{width:.93em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=G]:before{width:.682em;padding:.703em 0 .113em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=H]:before{width:.987em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=I]:before{width:.642em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os.mjx-b mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os.mjx-b mjx-c[c=I]:last-child:before{width:.746em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=J]:before{width:.779em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os.mjx-b mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os.mjx-b mjx-c[c=J]:last-child:before{width:.937em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=K]:before{width:.871em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=L]:before{width:.788em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=M]:before{width:1.378em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=N]:before{width:.937em;padding:.84em 0 .049em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os.mjx-b mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os.mjx-b mjx-c[c=N]:last-child:before{width:1.105em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=O]:before{width:.906em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=P]:before{width:.81em;padding:.686em 0 .067em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=Q]:before{width:.939em;padding:.703em 0 .146em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=R]:before{width:.99em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=S]:before{width:.696em;padding:.703em 0 .016em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=T]:before{width:.644em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os.mjx-b mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os.mjx-b mjx-c[c=T]:last-child:before{width:.947em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=U]:before{width:.715em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os.mjx-b mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os.mjx-b mjx-c[c=U]:last-child:before{width:.771em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=V]:before{width:.737em;padding:.686em 0 .077em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=W]:before{width:1.169em;padding:.686em 0 .077em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=X]:before{width:.817em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-os.mjx-b mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-os.mjx-b mjx-c[c=X]:last-child:before{width:.906em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=Y]:before{width:.759em;padding:.686em 0 .164em}.MJX-TEX .mjx-os.mjx-b mjx-c[c=Z]:before{width:.818em}.MJX-TEX .mjx-os.mjx-b mjx-c[c="3A1"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="3A2"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="3A4"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="3A7"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="3D2"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="3DC"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="39A"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="39C"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="39D"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="39F"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="391"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="392"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="395"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="396"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="397"]:before,.MJX-TEX .mjx-os.mjx-b mjx-c[c="399"]:before{font-family:MJXZERO,MJXTEX-B}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="!"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="!"]:last-child:before{width:.38em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="27"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="27"]:last-child:before{width:.377em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="("]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="("]:last-child:before{width:.517em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="*"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="*"]:last-child:before{width:.584em}.MJX-TEX .mjx-mit mjx-c[c="/"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="/"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="/"]:last-child:before{width:.617em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="0"]:last-child:before{width:.562em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3"]:last-child:before{width:.562em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="5"]:last-child:before{width:.567em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="6"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="6"]:last-child:before{width:.565em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="7"]:last-child:before{width:.634em}.MJX-TEX .mjx-mit mjx-c[c=A]:before{width:.743em}.MJX-TEX .mjx-mit mjx-c[c=B]:before{width:.704em}.MJX-TEX .mjx-mit mjx-c[c=C]:before{width:.716em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=C]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=C]:last-child:before{width:.812em}.MJX-TEX .mjx-mit mjx-c[c=D]:before{width:.755em}.MJX-TEX .mjx-mit mjx-c[c=E]:before{width:.678em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=E]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=E]:last-child:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=F]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=F]:last-child:before{width:.731em}.MJX-TEX .mjx-mit mjx-c[c=G]:before{width:.774em}.MJX-TEX .mjx-mit mjx-c[c=H]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=H]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=H]:last-child:before{width:.86em}.MJX-TEX .mjx-mit mjx-c[c=I]:before{width:.386em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=I]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=I]:last-child:before{width:.508em}.MJX-TEX .mjx-mit mjx-c[c=J]:before{width:.525em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=J]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=J]:last-child:before{width:.622em}.MJX-TEX .mjx-mit mjx-c[c=K]:before{width:.769em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=K]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=K]:last-child:before{width:.859em}.MJX-TEX .mjx-mit mjx-c[c=L]:before{width:.627em}.MJX-TEX .mjx-mit mjx-c[c=M]:before{width:.897em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=M]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=M]:last-child:before{width:1.01em}.MJX-TEX .mjx-mit mjx-c[c=N]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=N]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=N]:last-child:before{width:.86em}.MJX-TEX .mjx-mit mjx-c[c=O]:before{width:.767em}.MJX-TEX .mjx-mit mjx-c[c=P]:before{width:.678em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=P]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=P]:last-child:before{width:.729em}.MJX-TEX .mjx-mit mjx-c[c=Q]:before{width:.767em}.MJX-TEX .mjx-mit mjx-c[c=R]:before{width:.729em}.MJX-TEX .mjx-mit mjx-c[c=S]:before{width:.562em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=S]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=S]:last-child:before{width:.633em}.MJX-TEX .mjx-mit mjx-c[c=T]:before{width:.716em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=T]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=T]:last-child:before{width:.806em}.MJX-TEX .mjx-mit mjx-c[c=U]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=U]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=U]:last-child:before{width:.86em}.MJX-TEX .mjx-mit mjx-c[c=V]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=V]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=V]:last-child:before{width:.868em}.MJX-TEX .mjx-mit mjx-c[c=W]:before{width:.999em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=W]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=W]:last-child:before{width:1.124em}.MJX-TEX .mjx-mit mjx-c[c=X]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=X]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=X]:last-child:before{width:.825em}.MJX-TEX .mjx-mit mjx-c[c=Y]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=Y]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=Y]:last-child:before{width:.875em}.MJX-TEX .mjx-mit mjx-c[c=Z]:before{width:.613em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=Z]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=Z]:last-child:before{width:.704em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="["]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="["]:last-child:before{width:.446em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="]"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="]"]:last-child:before{width:.359em}.MJX-TEX .mjx-mit mjx-c[c=a]:before{width:.511em}.MJX-TEX .mjx-mit mjx-c[c=b]:before,.MJX-TEX .mjx-mit mjx-c[c=c]:before{width:.46em}.MJX-TEX .mjx-mit mjx-c[c=d]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=d]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=d]:last-child:before{width:.567em}.MJX-TEX .mjx-mit mjx-c[c=e]:before{width:.46em}.MJX-TEX .mjx-mit mjx-c[c=f]:before{width:.307em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=f]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=f]:last-child:before{width:.45em}.MJX-TEX .mjx-mit mjx-c[c=g]:before{width:.46em}.MJX-TEX .mjx-mit mjx-c[c=h]:before{width:.511em}.MJX-TEX .mjx-mit mjx-c[c=i]:before{width:.307em;padding:.656em 0 .01em}.MJX-TEX .mjx-mit mjx-c[c=j]:before{width:.307em;padding:.656em 0 .204em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=j]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=j]:last-child:before{width:.364em}.MJX-TEX .mjx-mit mjx-c[c=k]:before{width:.46em}.MJX-TEX .mjx-mit mjx-c[c=l]:before{width:.256em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=l]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=l]:last-child:before{width:.312em}.MJX-TEX .mjx-mit mjx-c[c=m]:before{width:.818em}.MJX-TEX .mjx-mit mjx-c[c=n]:before{width:.562em}.MJX-TEX .mjx-mit mjx-c[c=o]:before,.MJX-TEX .mjx-mit mjx-c[c=p]:before{width:.511em}.MJX-TEX .mjx-mit mjx-c[c=q]:before{width:.46em}.MJX-TEX .mjx-mit mjx-c[c=r]:before{width:.422em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=r]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=r]:last-child:before{width:.484em}.MJX-TEX .mjx-mit mjx-c[c=s]:before{width:.409em}.MJX-TEX .mjx-mit mjx-c[c=t]:before{width:.332em}.MJX-TEX .mjx-mit mjx-c[c=u]:before{width:.537em}.MJX-TEX .mjx-mit mjx-c[c=v]:before{width:.46em}.MJX-TEX .mjx-mit mjx-c[c=w]:before{width:.664em}.MJX-TEX .mjx-mit mjx-c[c=x]:before{width:.464em}.MJX-TEX .mjx-mit mjx-c[c=y]:before{width:.486em}.MJX-TEX .mjx-mit mjx-c[c=z]:before{width:.409em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c=z]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c=z]:last-child:before{width:.466em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="~"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="~"]:last-child:before{width:.571em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="303"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="303"]:last-child:before{width:.06em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="304"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="304"]:last-child:before{width:.054em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="306"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="306"]:last-child:before{width:.062em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="30B"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="30B"]:last-child:before{width:.065em}.MJX-TEX .mjx-mit mjx-c[c="391"]:before{width:.743em}.MJX-TEX .mjx-mit mjx-c[c="392"]:before{width:.704em}.MJX-TEX .mjx-mit mjx-c[c="393"]:before{width:.627em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="393"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="393"]:last-child:before{width:.705em}.MJX-TEX .mjx-mit mjx-c[c="394"]:before{width:.818em}.MJX-TEX .mjx-mit mjx-c[c="395"]:before{width:.678em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="395"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="395"]:last-child:before{width:.743em}.MJX-TEX .mjx-mit mjx-c[c="396"]:before{width:.613em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="396"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="396"]:last-child:before{width:.704em}.MJX-TEX .mjx-mit mjx-c[c="397"]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="397"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="397"]:last-child:before{width:.86em}.MJX-TEX .mjx-mit mjx-c[c="398"]:before{width:.767em}.MJX-TEX .mjx-mit mjx-c[c="399"]:before{width:.386em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="399"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="399"]:last-child:before{width:.508em}.MJX-TEX .mjx-mit mjx-c[c="39A"]:before{width:.769em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="39A"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="39A"]:last-child:before{width:.859em}.MJX-TEX .mjx-mit mjx-c[c="39B"]:before{width:.692em}.MJX-TEX .mjx-mit mjx-c[c="39C"]:before{width:.897em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="39C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="39C"]:last-child:before{width:1.01em}.MJX-TEX .mjx-mit mjx-c[c="39D"]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="39D"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="39D"]:last-child:before{width:.86em}.MJX-TEX .mjx-mit mjx-c[c="39E"]:before{width:.664em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="39E"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="39E"]:last-child:before{width:.754em}.MJX-TEX .mjx-mit mjx-c[c="39F"]:before{width:.767em}.MJX-TEX .mjx-mit mjx-c[c="3A0"]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3A0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3A0"]:last-child:before{width:.859em}.MJX-TEX .mjx-mit mjx-c[c="3A1"]:before{width:.678em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3A1"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3A1"]:last-child:before{width:.729em}.MJX-TEX .mjx-mit mjx-c[c="3A2"]:before{width:.767em}.MJX-TEX .mjx-mit mjx-c[c="3A3"]:before{width:.716em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3A3"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3A3"]:last-child:before{width:.782em}.MJX-TEX .mjx-mit mjx-c[c="3A4"]:before{width:.716em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3A4"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3A4"]:last-child:before{width:.806em}.MJX-TEX .mjx-mit mjx-c[c="3A5"]:before{width:.767em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3A5"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3A5"]:last-child:before{width:.832em}.MJX-TEX .mjx-mit mjx-c[c="3A6"]:before{width:.716em}.MJX-TEX .mjx-mit mjx-c[c="3A7"]:before{width:.743em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3A7"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3A7"]:last-child:before{width:.825em}.MJX-TEX .mjx-mit mjx-c[c="3A8"]:before{width:.767em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3A8"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3A8"]:last-child:before{width:.824em}.MJX-TEX .mjx-mit mjx-c[c="3A9"]:before{width:.716em}.MJX-TEX .mjx-mit mjx-c[c="3D2"]:before{width:.767em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3D2"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3D2"]:last-child:before{width:.832em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="3DC"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="3DC"]:last-child:before{width:.731em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="2018"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="2018"]:last-child:before{width:.362em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="2019"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="2019"]:last-child:before{width:.377em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="201C"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="201C"]:last-child:before{width:.606em}.MJX-TEX .mjx-mit mjx-c[c="2044"]:before{width:.511em}.MJX-TEX mjx-mi:not([noIC=true]).mjx-mit mjx-c[c="2044"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-mit mjx-c[c="2044"]:last-child:before{width:.617em}.MJX-TEX .mjx-mit mjx-c[c="2206"]:before{width:.818em}.MJX-TEX .mjx-v mjx-c[c=A]:before{width:.722em;padding:.701em 0 0}.MJX-TEX .mjx-v mjx-c[c=B]:before{width:.667em}.MJX-TEX .mjx-v mjx-c[c=D]:before{width:.722em}.MJX-TEX .mjx-v mjx-c[c=E]:before{width:.667em}.MJX-TEX .mjx-v mjx-c[c=F]:before{width:.611em}.MJX-TEX .mjx-v mjx-c[c=G]:before,.MJX-TEX .mjx-v mjx-c[c=H]:before{width:.778em}.MJX-TEX .mjx-v mjx-c[c=I]:before{width:.389em}.MJX-TEX .mjx-v mjx-c[c=J]:before{width:.5em;padding:.683em 0 .077em}.MJX-TEX .mjx-v mjx-c[c=L]:before{width:.667em}.MJX-TEX .mjx-v mjx-c[c=M]:before{width:.944em}.MJX-TEX .mjx-v mjx-c[c=N]:before{width:.722em;padding:.683em 0 .02em}.MJX-TEX .mjx-v mjx-c[c=P]:before{width:.611em}.MJX-TEX .mjx-v mjx-c[c=Q]:before{padding:.701em 0 .181em}.MJX-TEX .mjx-v mjx-c[c=R]:before{width:.722em;padding:.683em 0 0}.MJX-TEX .mjx-v mjx-c[c=S]:before{padding:.702em 0 .012em}.MJX-TEX .mjx-v mjx-c[c=T]:before{width:.667em;padding:.683em 0 0}.MJX-TEX .mjx-v mjx-c[c=U]:before,.MJX-TEX .mjx-v mjx-c[c=V]:before{width:.722em}.MJX-TEX .mjx-v mjx-c[c=W]:before{width:1em}.MJX-TEX .mjx-v mjx-c[c=X]:before,.MJX-TEX .mjx-v mjx-c[c=Y]:before{width:.722em}.MJX-TEX .mjx-v mjx-c[c=Z]:before{width:.667em}.MJX-TEX .mjx-v mjx-c[c=k]:before{width:.556em;padding:.683em 0 0}.MJX-TEX .mjx-v mjx-c[c="2C6"]:before{width:2.333em;padding:.845em 0 0}.MJX-TEX .mjx-v mjx-c[c="2DC"]:before{width:2.333em;padding:.899em 0 0}.MJX-TEX .mjx-v mjx-c[c="302"]:before{padding:.845em 0 0}.MJX-TEX .mjx-v mjx-c[c="303"]:before{padding:.899em 0 0}.MJX-TEX .mjx-v mjx-c[c="3DC"]:before{width:.778em;padding:.605em 0 .085em;content:"\E008"}.MJX-TEX .mjx-v mjx-c[c="3F0"]:before{content:"\E009"}.MJX-TEX mjx-mi:not([noIC=true]).mjx-v mjx-c[c="3F0"]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-v mjx-c[c="3F0"]:last-child:before{width:.734em}.MJX-TEX .mjx-v mjx-c[c="2190"]:before,.MJX-TEX .mjx-v mjx-c[c="2192"]:before{width:.5em;padding:.437em 0 0}.MJX-TEX .mjx-v mjx-c[c="21CC"]:before{padding:.514em 0 .014em}.MJX-TEX .mjx-v mjx-c[c="2204"]:before{padding:.86em 0 .166em;content:"\2204"}.MJX-TEX .mjx-v mjx-c[c="2205"]:before{width:.778em;padding:.587em 0 0}.MJX-TEX .mjx-v mjx-c[c="2212"]:before{width:.5em;padding:.27em 0 0}.MJX-TEX .mjx-v mjx-c[c="221D"]:before{padding:.472em 0 0}.MJX-TEX .mjx-v mjx-c[c="2223"]:before{width:.222em;padding:.43em 0 .023em}.MJX-TEX .mjx-v mjx-c[c="2224"]:before{width:.222em;padding:.43em 0 .023em;content:"\E006"}.MJX-TEX .mjx-v mjx-c[c="2225"]:before{width:.389em;padding:.431em 0 .023em}.MJX-TEX .mjx-v mjx-c[c="2226"]:before{width:.389em;padding:.431em 0 .024em;content:"\E007"}.MJX-TEX .mjx-v mjx-c[c="2268"]:before{content:"\E00C"}.MJX-TEX .mjx-v mjx-c[c="2269"]:before{content:"\E00D"}.MJX-TEX .mjx-v mjx-c[c="2270"]:before{padding:.919em 0 .421em;content:"\E011"}.MJX-TEX .mjx-v mjx-c[c="2271"]:before{padding:.919em 0 .421em;content:"\E00E"}.MJX-TEX .mjx-v mjx-c[c="2288"]:before{padding:.828em 0 .33em;content:"\E016"}.MJX-TEX .mjx-v mjx-c[c="2289"]:before{padding:.828em 0 .33em;content:"\E018"}.MJX-TEX .mjx-v mjx-c[c="228A"]:before{padding:.634em 0 .255em;content:"\E01A"}.MJX-TEX .mjx-v mjx-c[c="228B"]:before{padding:.634em 0 .254em;content:"\E01B"}.MJX-TEX .mjx-v mjx-c[c="22A8"]:before{width:.611em;padding:.694em 0 0}.MJX-TEX .mjx-v mjx-c[c="22C5"]:before{padding:.189em 0 0}.MJX-TEX .mjx-v mjx-c[c="2322"]:before{width:.778em;padding:.378em 0 0}.MJX-TEX .mjx-v mjx-c[c="2323"]:before{width:.778em}.MJX-TEX .mjx-v mjx-c[c="25B3"]:before{width:.722em;padding:.575em 0 .02em}.MJX-TEX .mjx-v mjx-c[c="25BD"]:before{width:.722em;padding:.576em 0 .019em}.MJX-TEX .mjx-v mjx-c[c="2A87"]:before{padding:.801em 0 .303em;content:"\E010"}.MJX-TEX .mjx-v mjx-c[c="2A88"]:before{padding:.801em 0 .303em;content:"\E00F"}.MJX-TEX .mjx-v mjx-c[c="2ACB"]:before{padding:.752em 0 .332em;content:"\E017"}.MJX-TEX .mjx-v mjx-c[c="2ACC"]:before{padding:.752em 0 .333em;content:"\E019"}.MJX-TEX mjx-mi:not([noIC=true]).mjx-v mjx-c[c=E009]:last-child:before,.MJX-TEX mjx-mo:not([noIC=true]).mjx-v mjx-c[c=E009]:last-child:before{width:.734em}mjx-container[display=true]{overflow-x:auto;overflow-y:hidden}.icon.outbound{color:#aaa;display:inline-block;vertical-align:middle;position:relative;top:-1px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.algolia-search-wrapper>span{vertical-align:middle}.algolia-search-wrapper .algolia-autocomplete{line-height:normal}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu{background-color:#fff;border:1px solid #999;border-radius:4px;font-size:16px;margin:6px 0 0;padding:4px;text-align:left}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu:before{border-color:#999}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu [class*=ds-dataset-]{border:none;padding:0}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu .ds-suggestions{margin-top:0}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu .ds-suggestion{border-bottom:1px solid #eaecef}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion--highlight{color:#2c815b}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion{border-color:#eaecef;padding:0}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--category-header{padding:5px 10px;margin-top:0;background:#3eaf7c;color:#fff;font-weight:600}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--highlight{background:hsla(0,0%,100%,.6)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--wrapper{padding:0}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--title{font-weight:600;margin-bottom:0;color:#2c3e50}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column{vertical-align:top;padding:5px 7px 5px 5px;border-color:#eaecef;background:#f1f3f5}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column:after{display:none}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column-text{color:#555}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-footer{border-color:#eaecef}.algolia-search-wrapper .algolia-autocomplete .ds-cursor .algolia-docsearch-suggestion--content{background-color:#e7edf3!important;color:#2c3e50}@media (min-width:719px){.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column{float:none;width:150px;min-width:150px;display:table-cell}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--content{float:none;display:table-cell;width:100%;vertical-align:top}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .ds-dropdown-menu{min-width:515px!important}}@media (max-width:719px){.algolia-search-wrapper .ds-dropdown-menu{min-width:calc(100vw - 4rem)!important;max-width:calc(100vw - 4rem)!important}.algolia-search-wrapper .algolia-docsearch-suggestion--wrapper{padding:5px 7px 5px 5px!important}.algolia-search-wrapper .algolia-docsearch-suggestion--subcategory-column{padding:0!important;background:#fff!important}.algolia-search-wrapper .algolia-docsearch-suggestion--subcategory-column-text:after{content:" > ";font-size:10px;line-height:14.4px;display:inline-block;width:5px;margin:-3px 3px 0;vertical-align:middle}}.home{padding:3.6rem 2rem 0;max-width:960px;margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.8rem auto}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:#6a8bad}.home .hero .action-button{display:inline-block;font-size:1.2rem;color:#fff;background-color:#3eaf7c;padding:.8rem 1.6rem;border-radius:4px;transition:background-color .1s ease;box-sizing:border-box;border-bottom:1px solid #389d70}.home .hero .action-button:hover{background-color:#4abf8a}.home .features{border-top:1px solid #eaecef;padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:#3a5169}.home .feature p{color:#4e6e8e}.home .footer{padding:2.5rem;border-top:1px solid #eaecef;text-align:center;color:#4e6e8e}@media (max-width:719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width:419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.search-box{display:inline-block;position:relative;margin-right:1rem}.search-box input{cursor:text;width:10rem;height:2rem;color:#4e6e8e;display:inline-block;border:1px solid #cfd4db;border-radius:2rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;transition:all .2s ease;background:#fff url(/Blog/assets/img/search.83621669.svg) .6rem .5rem no-repeat;background-size:1rem}.search-box input:focus{cursor:auto;border-color:#3eaf7c}.search-box .suggestions{background:#fff;width:20rem;position:absolute;top:2rem;border:1px solid #cfd4db;border-radius:6px;padding:.4rem;list-style-type:none}.search-box .suggestions.align-right{right:0}.search-box .suggestion{line-height:1.4;padding:.4rem .6rem;border-radius:4px;cursor:pointer}.search-box .suggestion a{white-space:normal;color:#5d82a6}.search-box .suggestion a .page-title{font-weight:600}.search-box .suggestion a .header{font-size:.9em;margin-left:.25em}.search-box .suggestion.focused{background-color:#f3f4f5}.search-box .suggestion.focused a{color:#3eaf7c}@media (max-width:959px){.search-box input{cursor:pointer;width:0;border-color:transparent;position:relative}.search-box input:focus{cursor:text;left:0;width:10rem}}@media (-ms-high-contrast:none){.search-box input{height:2rem}}@media (max-width:959px) and (min-width:719px){.search-box .suggestions{left:0}}@media (max-width:719px){.search-box{margin-right:0}.search-box input{left:1rem}.search-box .suggestions{right:0}}@media (max-width:419px){.search-box .suggestions{width:calc(100vw - 4rem)}.search-box input:focus{width:8rem}}.sidebar-button{cursor:pointer;display:none;width:1.25rem;height:1.25rem;position:absolute;padding:.6rem;top:.6rem;left:1rem}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media (max-width:719px){.sidebar-button{display:block}}.dropdown-enter,.dropdown-leave-to{height:0!important}.badge[data-v-15b7b770]{display:inline-block;font-size:14px;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:#fff}.badge.green[data-v-15b7b770],.badge.tip[data-v-15b7b770],.badge[data-v-15b7b770]{background-color:#42b983}.badge.error[data-v-15b7b770]{background-color:#da5961}.badge.warn[data-v-15b7b770],.badge.warning[data-v-15b7b770],.badge.yellow[data-v-15b7b770]{background-color:#e7c000}.badge+.badge[data-v-15b7b770]{margin-left:5px}.theme-code-block[data-v-759a7d02]{display:none}.theme-code-block__active[data-v-759a7d02]{display:block}.theme-code-block>pre[data-v-759a7d02]{background-color:orange}.theme-code-group__nav[data-v-deefee04]{margin-bottom:-35px;background-color:#282c34;padding-bottom:22px;border-top-left-radius:6px;border-top-right-radius:6px;padding-left:10px;padding-top:10px}.theme-code-group__ul[data-v-deefee04]{margin:auto 0;padding-left:0;display:inline-flex;list-style:none}.theme-code-group__nav-tab[data-v-deefee04]{border:0;padding:5px;cursor:pointer;background-color:transparent;font-size:.85em;line-height:1.4;color:hsla(0,0%,100%,.9);font-weight:600}.theme-code-group__nav-tab-active[data-v-deefee04]{border-bottom:1px solid #42b983}.pre-blank[data-v-deefee04]{color:#42b983}.searchbox{display:inline-block;position:relative;width:200px;height:32px!important;white-space:nowrap;box-sizing:border-box;visibility:visible!important}.searchbox .algolia-autocomplete{display:block;width:100%;height:100%}.searchbox__wrapper{width:100%;height:100%;z-index:999;position:relative}.searchbox__input{display:inline-block;box-sizing:border-box;transition:box-shadow .4s ease,background .4s ease;border:0;border-radius:16px;box-shadow:inset 0 0 0 1px #ccc;background:#fff!important;padding:0 26px 0 32px;width:100%;height:100%;vertical-align:middle;white-space:normal;font-size:12px;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbox__input::-webkit-search-cancel-button,.searchbox__input::-webkit-search-decoration,.searchbox__input::-webkit-search-results-button,.searchbox__input::-webkit-search-results-decoration{display:none}.searchbox__input:hover{box-shadow:inset 0 0 0 1px #b3b3b3}.searchbox__input:active,.searchbox__input:focus{outline:0;box-shadow:inset 0 0 0 1px #aaa;background:#fff}.searchbox__input::-moz-placeholder{color:#aaa}.searchbox__input::placeholder{color:#aaa}.searchbox__submit{position:absolute;top:0;margin:0;border:0;border-radius:16px 0 0 16px;background-color:rgba(69,142,225,0);padding:0;width:32px;height:100%;vertical-align:middle;text-align:center;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none;right:inherit;left:0}.searchbox__submit:before{display:inline-block;margin-right:-4px;height:100%;vertical-align:middle;content:""}.searchbox__submit:active,.searchbox__submit:hover{cursor:pointer}.searchbox__submit:focus{outline:0}.searchbox__submit svg{width:14px;height:14px;vertical-align:middle;fill:#6d7e96}.searchbox__reset{display:block;position:absolute;top:8px;right:8px;margin:0;border:0;background:none;cursor:pointer;padding:0;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;user-select:none;fill:rgba(0,0,0,.5)}.searchbox__reset.hide{display:none}.searchbox__reset:focus{outline:0}.searchbox__reset svg{display:block;margin:4px;width:8px;height:8px}.searchbox__input:valid~.searchbox__reset{display:block;animation-name:sbx-reset-in;animation-duration:.15s}@keyframes sbx-reset-in{0%{transform:translate3d(-20%,0,0);opacity:0}to{transform:none;opacity:1}}.algolia-autocomplete.algolia-autocomplete-right .ds-dropdown-menu{right:0!important;left:inherit!important}.algolia-autocomplete.algolia-autocomplete-right .ds-dropdown-menu:before{right:48px}.algolia-autocomplete.algolia-autocomplete-left .ds-dropdown-menu{left:0!important;right:inherit!important}.algolia-autocomplete.algolia-autocomplete-left .ds-dropdown-menu:before{left:48px}.algolia-autocomplete .ds-dropdown-menu{top:-6px;border-radius:4px;margin:6px 0 0;padding:0;text-align:left;height:auto;position:relative;background:transparent;border:none;z-index:999;max-width:600px;min-width:500px;box-shadow:0 1px 0 0 rgba(0,0,0,.2),0 2px 3px 0 rgba(0,0,0,.1)}.algolia-autocomplete .ds-dropdown-menu:before{display:block;position:absolute;content:"";width:14px;height:14px;background:#fff;z-index:1000;top:-7px;border-top:1px solid #d9d9d9;border-right:1px solid #d9d9d9;transform:rotate(-45deg);border-radius:2px}.algolia-autocomplete .ds-dropdown-menu .ds-suggestions{position:relative;z-index:1000;margin-top:8px}.algolia-autocomplete .ds-dropdown-menu .ds-suggestions a:hover{text-decoration:none}.algolia-autocomplete .ds-dropdown-menu .ds-suggestion{cursor:pointer}.algolia-autocomplete .ds-dropdown-menu .ds-suggestion.ds-cursor .algolia-docsearch-suggestion.suggestion-layout-simple,.algolia-autocomplete .ds-dropdown-menu .ds-suggestion.ds-cursor .algolia-docsearch-suggestion:not(.suggestion-layout-simple) .algolia-docsearch-suggestion--content{background-color:rgba(69,142,225,.05)}.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-]{position:relative;border:1px solid #d9d9d9;background:#fff;border-radius:4px;overflow:auto;padding:0 8px 8px}.algolia-autocomplete .ds-dropdown-menu *{box-sizing:border-box}.algolia-autocomplete .algolia-docsearch-suggestion{display:block;position:relative;padding:0 8px;background:#fff;color:#02060c;overflow:hidden}.algolia-autocomplete .algolia-docsearch-suggestion--highlight{color:#174d8c;background:rgba(143,187,237,.1);padding:.1em .05em}.algolia-autocomplete .algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--category-header-lvl0 .algolia-docsearch-suggestion--highlight,.algolia-autocomplete .algolia-docsearch-suggestion--category-header .algolia-docsearch-suggestion--category-header-lvl1 .algolia-docsearch-suggestion--highlight,.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight{padding:0 0 1px;background:inherit;box-shadow:inset 0 -2px 0 0 rgba(69,142,225,.8);color:inherit}.algolia-autocomplete .algolia-docsearch-suggestion--content{display:block;float:right;width:70%;position:relative;padding:5.33333px 0 5.33333px 10.66667px;cursor:pointer}.algolia-autocomplete .algolia-docsearch-suggestion--content:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;left:-1px}.algolia-autocomplete .algolia-docsearch-suggestion--category-header{position:relative;border-bottom:1px solid #ddd;display:none;margin-top:8px;padding:4px 0;font-size:1em;color:#33363d}.algolia-autocomplete .algolia-docsearch-suggestion--wrapper{width:100%;float:left;padding:8px 0 0}.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column{float:left;width:30%;text-align:right;position:relative;padding:5.33333px 10.66667px;color:#a4a7ae;font-size:.9em;word-wrap:break-word}.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;right:0}.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-inline{display:none}.algolia-autocomplete .algolia-docsearch-suggestion--title{margin-bottom:4px;color:#02060c;font-size:.9em;font-weight:700}.algolia-autocomplete .algolia-docsearch-suggestion--text{display:block;line-height:1.2em;font-size:.85em;color:#63676d}.algolia-autocomplete .algolia-docsearch-suggestion--no-results{width:100%;padding:8px 0;text-align:center;font-size:1.2em}.algolia-autocomplete .algolia-docsearch-suggestion--no-results:before{display:none}.algolia-autocomplete .algolia-docsearch-suggestion code{padding:1px 5px;font-size:90%;border:none;color:#222;background-color:#ebebeb;border-radius:3px;font-family:Menlo,Monaco,Consolas,Courier New,monospace}.algolia-autocomplete .algolia-docsearch-suggestion code .algolia-docsearch-suggestion--highlight{background:none}.algolia-autocomplete .algolia-docsearch-suggestion.algolia-docsearch-suggestion__main .algolia-docsearch-suggestion--category-header,.algolia-autocomplete .algolia-docsearch-suggestion.algolia-docsearch-suggestion__secondary{display:block}@media (min-width:768px){.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column{display:block}}@media (max-width:768px){.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column{display:inline-block;width:auto;float:left;padding:0;color:#02060c;font-size:.9em;font-weight:700;text-align:left;opacity:.5}.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column:before{display:none}.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column:after{content:"|"}.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--content{display:inline-block;width:auto;text-align:left;float:left;padding:0}.algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--content:before{display:none}}.algolia-autocomplete .suggestion-layout-simple.algolia-docsearch-suggestion{border-bottom:1px solid #eee;padding:8px;margin:0}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--content{width:100%;padding:0}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--content:before{display:none}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--category-header{margin:0;padding:0;display:block;width:100%;border:none}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--category-header-lvl0,.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--category-header-lvl1{opacity:.6;font-size:.85em}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--category-header-lvl1:before{background-image:url('data:image/svg+xml;utf8,');content:"";width:10px;height:10px;display:inline-block}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--wrapper{width:100%;float:left;margin:0;padding:0}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--duplicate-content,.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--subcategory-inline{display:none!important}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--title{margin:0;color:#458ee1;font-size:.9em;font-weight:400}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--title:before{content:"#";font-weight:700;color:#458ee1;display:inline-block}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--text{margin:4px 0 0;display:block;line-height:1.4em;padding:5.33333px 8px;background:#f8f8f8;font-size:.85em;opacity:.8}.algolia-autocomplete .suggestion-layout-simple .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight{color:#3f4145;font-weight:700;box-shadow:none}.algolia-autocomplete .algolia-docsearch-footer{width:134px;height:20px;z-index:2000;margin-top:10.66667px;float:right;font-size:0;line-height:0}.algolia-autocomplete .algolia-docsearch-footer--logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='168' height='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cpath d='M78.988.938h16.594a2.968 2.968 0 012.966 2.966V20.5a2.967 2.967 0 01-2.966 2.964H78.988a2.967 2.967 0 01-2.966-2.964V3.897A2.961 2.961 0 0178.988.938zm41.937 17.866c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 00-1.574-.199 5.7 5.7 0 00-.897.069 2.699 2.699 0 00-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 01-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 01-1.471-.636 3.085 3.085 0 01-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 011.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 011.82-.185 8.404 8.404 0 011.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 00-.384-.73 1.784 1.784 0 00-.724-.493 3.164 3.164 0 00-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 00-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 012.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 00-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 00-.814.24 1.46 1.46 0 00-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 01.233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 01-1.471-.635 3.085 3.085 0 01-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 012.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 00-.109-.875 1.873 1.873 0 00-.384-.731 1.784 1.784 0 00-.724-.492 3.165 3.165 0 00-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 00-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 012.073-.177zm-8.034-1.271a1.626 1.626 0 01-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 01-1.128 1.906 4.986 4.986 0 01-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 01-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 01-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 011.15-1.892 5.133 5.133 0 011.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 011.753 1.216 5.644 5.644 0 011.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 00-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 01-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 01-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 012.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17z' fill='%235468FF'/%3E%3Cpath d='M6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 00-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 01-.582-.271 13.67 13.67 0 01-.55-.287 4.275 4.275 0 01-.567-.351 6.92 6.92 0 01-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 01-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 00-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 00-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 00-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 01-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z' fill='%235D6494'/%3E%3Cpath d='M89.632 5.967v-.772a.978.978 0 00-.978-.977h-2.28a.978.978 0 00-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 011.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 00-1.382 0l-.465.465a.973.973 0 000 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 00-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 01-4.49-4.482 4.488 4.488 0 014.49-4.482 4.488 4.488 0 014.489 4.482 4.484 4.484 0 01-4.49 4.482m0-10.85a6.363 6.363 0 100 12.729 6.37 6.37 0 006.372-6.368 6.358 6.358 0 00-6.371-6.36' fill='%23FFF'/%3E%3C/g%3E%3C/svg%3E");background-repeat:no-repeat;background-position:50%;background-size:100%;overflow:hidden;text-indent:-9000px;padding:0!important;width:100%;height:100%;display:block}.dropdown-wrapper{cursor:pointer}.dropdown-wrapper .dropdown-title,.dropdown-wrapper .mobile-dropdown-title{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:#2c3e50}.dropdown-wrapper .dropdown-title:hover,.dropdown-wrapper .mobile-dropdown-title:hover{border-color:transparent}.dropdown-wrapper .dropdown-title .arrow,.dropdown-wrapper .mobile-dropdown-title .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.dropdown-wrapper .mobile-dropdown-title{display:none;font-weight:600}.dropdown-wrapper .mobile-dropdown-title font-size inherit:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item{color:inherit;line-height:1.7rem}.dropdown-wrapper .nav-dropdown .dropdown-item h4{margin:.45rem 0 0;border-top:1px solid #eee;padding:1rem 1.5rem .45rem 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper{padding:0;list-style:none}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper .dropdown-subitem{font-size:.9em}.dropdown-wrapper .nav-dropdown .dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid #3eaf7c;border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.dropdown-wrapper .nav-dropdown .dropdown-item:first-child h4{margin-top:0;padding-top:0;border-top:0}@media (max-width:719px){.dropdown-wrapper.open .dropdown-title{margin-bottom:.5rem}.dropdown-wrapper .dropdown-title{display:none}.dropdown-wrapper .mobile-dropdown-title{display:block}.dropdown-wrapper .nav-dropdown{transition:height .1s ease-out;overflow:hidden}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top:0;margin-top:0;padding-top:0}.dropdown-wrapper .nav-dropdown .dropdown-item>a,.dropdown-wrapper .nav-dropdown .dropdown-item h4{font-size:15px;line-height:2rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem{font-size:14px;padding-left:1rem}}@media (min-width:719px){.dropdown-wrapper{height:1.8rem}.dropdown-wrapper.open .nav-dropdown,.dropdown-wrapper:hover .nav-dropdown{display:block!important}.dropdown-wrapper .nav-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:#fff;padding:.6rem 0;border:1px solid;border-color:#ddd #ddd #ccc;text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}}.nav-links{display:inline-block}.nav-links a{line-height:1.4rem;color:inherit}.nav-links a.router-link-active,.nav-links a:hover{color:#3eaf7c}.nav-links .nav-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:2rem}.nav-links .nav-item:first-child{margin-left:0}.nav-links .repo-link{margin-left:1.5rem}@media (max-width:719px){.nav-links .nav-item,.nav-links .repo-link{margin-left:0}}@media (min-width:719px){.nav-links a.router-link-active,.nav-links a:hover{color:#2c3e50}.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{margin-bottom:-2px;border-bottom:2px solid #46bd87}}.navbar{padding:.7rem 1.5rem;line-height:2.2rem}.navbar a,.navbar img,.navbar span{display:inline-block}.navbar .logo{height:2.2rem;min-width:2.2rem;margin-right:.8rem;vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:#2c3e50;position:relative}.navbar .links{padding-left:1.5rem;box-sizing:border-box;background-color:#fff;white-space:nowrap;font-size:.9rem;position:absolute;right:1.5rem;top:.7rem;display:flex}.navbar .links .search-box{flex:0 0 auto;vertical-align:top}@media (max-width:719px){.navbar{padding-left:4rem}.navbar .can-hide{display:none}.navbar .links{padding-left:1.5rem}.navbar .site-name{width:calc(100vw - 9.4rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}.page-edit{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-edit{padding:2rem}}@media (max-width:419px){.page-edit{padding:1.5rem}}.page-edit{padding-top:1rem;padding-bottom:1rem;overflow:auto}.page-edit .edit-link{display:inline-block}.page-edit .edit-link a{color:#4e6e8e;margin-right:.25rem}.page-edit .last-updated{float:right;font-size:.9em}.page-edit .last-updated .prefix{font-weight:500;color:#4e6e8e}.page-edit .last-updated .time{font-weight:400;color:#767676}@media (max-width:719px){.page-edit .edit-link{margin-bottom:.5rem}.page-edit .last-updated{font-size:.8em;float:none;text-align:left}}.page-nav{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-nav{padding:2rem}}@media (max-width:419px){.page-nav{padding:1.5rem}}.page-nav{padding-top:1rem;padding-bottom:0}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid #eaecef;padding-top:1rem;overflow:auto}.page-nav .next{float:right}.page{padding-bottom:2rem;display:block}.sidebar-group .sidebar-group{padding-left:.5em}.sidebar-group:not(.collapsable) .sidebar-heading:not(.clickable){cursor:auto;color:inherit}.sidebar-group.is-sub-group{padding-left:0}.sidebar-group.is-sub-group>.sidebar-heading{font-size:.95em;line-height:1.4;font-weight:400;padding-left:2rem}.sidebar-group.is-sub-group>.sidebar-heading:not(.clickable){opacity:.5}.sidebar-group.is-sub-group>.sidebar-group-items{padding-left:1rem}.sidebar-group.is-sub-group>.sidebar-group-items>li>.sidebar-link{font-size:.95em;border-left:none}.sidebar-group.depth-2>.sidebar-heading{border-left:none}.sidebar-heading{color:#2c3e50;transition:color .15s ease;cursor:pointer;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0;border-left:.25rem solid transparent}.sidebar-heading.open,.sidebar-heading:hover{color:inherit}.sidebar-heading .arrow{position:relative;top:-.12em;left:.5em}.sidebar-heading.clickable.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-heading.clickable:hover{color:#3eaf7c}.sidebar-group-items{transition:height .1s ease-out;font-size:.95em;overflow:hidden}.sidebar .sidebar-sub-headers{padding-left:1rem;font-size:.95em}a.sidebar-link{font-size:1em;font-weight:400;display:inline-block;color:#2c3e50;border-left:.25rem solid transparent;padding:.35rem 1rem .35rem 1.25rem;line-height:1.4;width:100%;box-sizing:border-box}a.sidebar-link:hover{color:#3eaf7c}a.sidebar-link.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-group a.sidebar-link{padding-left:2rem}.sidebar-sub-headers a.sidebar-link{padding-top:.25rem;padding-bottom:.25rem;border-left:none}.sidebar-sub-headers a.sidebar-link.active{font-weight:500}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .nav-links{display:none;border-bottom:1px solid #eaecef;padding:.5rem 0 .75rem}.sidebar .nav-links a{font-weight:600}.sidebar .nav-links .nav-item,.sidebar .nav-links .repo-link{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar>.sidebar-links{padding:1.5rem 0}.sidebar>.sidebar-links>li>a.sidebar-link{font-size:1.1em;line-height:1.7;font-weight:700}.sidebar>.sidebar-links>li:not(:first-child){margin-top:.75rem}@media (max-width:719px){.sidebar .nav-links{display:block}.sidebar .nav-links .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar>.sidebar-links{padding:1rem 0}} \ No newline at end of file diff --git a/assets/fonts/MathJax_AMS-Regular.07173fb7.woff b/assets/fonts/MathJax_AMS-Regular.07173fb7.woff new file mode 100644 index 0000000..1bf198f Binary files /dev/null and b/assets/fonts/MathJax_AMS-Regular.07173fb7.woff differ diff --git a/assets/fonts/MathJax_Fraktur-Bold.bc421258.woff b/assets/fonts/MathJax_Fraktur-Bold.bc421258.woff new file mode 100644 index 0000000..f5df023 Binary files /dev/null and b/assets/fonts/MathJax_Fraktur-Bold.bc421258.woff differ diff --git a/assets/fonts/MathJax_Fraktur-Regular.b80e08d5.woff b/assets/fonts/MathJax_Fraktur-Regular.b80e08d5.woff new file mode 100644 index 0000000..175301e Binary files /dev/null and b/assets/fonts/MathJax_Fraktur-Regular.b80e08d5.woff differ diff --git a/assets/fonts/MathJax_Main-Bold.c9423d5d.woff b/assets/fonts/MathJax_Main-Bold.c9423d5d.woff new file mode 100644 index 0000000..2805af5 Binary files /dev/null and b/assets/fonts/MathJax_Main-Bold.c9423d5d.woff differ diff --git a/assets/fonts/MathJax_Main-Italic.7e83626b.woff b/assets/fonts/MathJax_Main-Italic.7e83626b.woff new file mode 100644 index 0000000..36cb2b6 Binary files /dev/null and b/assets/fonts/MathJax_Main-Italic.7e83626b.woff differ diff --git a/assets/fonts/MathJax_Main-Regular.9995de47.woff b/assets/fonts/MathJax_Main-Regular.9995de47.woff new file mode 100644 index 0000000..c28398e Binary files /dev/null and b/assets/fonts/MathJax_Main-Regular.9995de47.woff differ diff --git a/assets/fonts/MathJax_Math-BoldItalic.77dbcee3.woff b/assets/fonts/MathJax_Math-BoldItalic.77dbcee3.woff new file mode 100644 index 0000000..6496d17 Binary files /dev/null and b/assets/fonts/MathJax_Math-BoldItalic.77dbcee3.woff differ diff --git a/assets/fonts/MathJax_Math-Italic.5589d1a8.woff b/assets/fonts/MathJax_Math-Italic.5589d1a8.woff new file mode 100644 index 0000000..e62ff5f Binary files /dev/null and b/assets/fonts/MathJax_Math-Italic.5589d1a8.woff differ diff --git a/assets/fonts/MathJax_SansSerif-Bold.07281897.woff b/assets/fonts/MathJax_SansSerif-Bold.07281897.woff new file mode 100644 index 0000000..bd27726 Binary files /dev/null and b/assets/fonts/MathJax_SansSerif-Bold.07281897.woff differ diff --git a/assets/fonts/MathJax_SansSerif-Italic.3d580bd5.woff b/assets/fonts/MathJax_SansSerif-Italic.3d580bd5.woff new file mode 100644 index 0000000..22e5eff Binary files /dev/null and b/assets/fonts/MathJax_SansSerif-Italic.3d580bd5.woff differ diff --git a/assets/fonts/MathJax_SansSerif-Regular.bc3af04f.woff b/assets/fonts/MathJax_SansSerif-Regular.bc3af04f.woff new file mode 100644 index 0000000..d1ff7c6 Binary files /dev/null and b/assets/fonts/MathJax_SansSerif-Regular.bc3af04f.woff differ diff --git a/assets/fonts/MathJax_Script-Regular.4c74e33b.woff b/assets/fonts/MathJax_Script-Regular.4c74e33b.woff new file mode 100644 index 0000000..a9d1f34 Binary files /dev/null and b/assets/fonts/MathJax_Script-Regular.4c74e33b.woff differ diff --git a/assets/fonts/MathJax_Typewriter-Regular.72815766.woff b/assets/fonts/MathJax_Typewriter-Regular.72815766.woff new file mode 100644 index 0000000..510a8da Binary files /dev/null and b/assets/fonts/MathJax_Typewriter-Regular.72815766.woff differ diff --git a/assets/img/4-inputSort.a02239ea.png b/assets/img/4-inputSort.a02239ea.png new file mode 100644 index 0000000..de9df22 Binary files /dev/null and b/assets/img/4-inputSort.a02239ea.png differ diff --git a/assets/img/Arbiter.0f715328.png b/assets/img/Arbiter.0f715328.png new file mode 100644 index 0000000..a26796e Binary files /dev/null and b/assets/img/Arbiter.0f715328.png differ diff --git a/assets/img/FIR.5888a130.jpeg b/assets/img/FIR.5888a130.jpeg new file mode 100644 index 0000000..aaa77a7 Binary files /dev/null and b/assets/img/FIR.5888a130.jpeg differ diff --git a/assets/img/FSM.a8105ac5.png b/assets/img/FSM.a8105ac5.png new file mode 100644 index 0000000..bf52277 Binary files /dev/null and b/assets/img/FSM.a8105ac5.png differ diff --git a/assets/img/G4E.f2c635d7.jpeg b/assets/img/G4E.f2c635d7.jpeg new file mode 100644 index 0000000..34b40af Binary files /dev/null and b/assets/img/G4E.f2c635d7.jpeg differ diff --git a/assets/img/ShiftRegister.c44a0985.svg b/assets/img/ShiftRegister.c44a0985.svg new file mode 100644 index 0000000..a6aa73d --- /dev/null +++ b/assets/img/ShiftRegister.c44a0985.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 2 + 3 + 0 + + + + + + out[3:0] + + in + + + + + + + + + + diff --git a/assets/img/Vivado.3cc10be4.png b/assets/img/Vivado.3cc10be4.png new file mode 100644 index 0000000..d35372b Binary files /dev/null and b/assets/img/Vivado.3cc10be4.png differ diff --git a/assets/img/Vivado1.ffa29b16.png b/assets/img/Vivado1.ffa29b16.png new file mode 100644 index 0000000..4d2ff9d Binary files /dev/null and b/assets/img/Vivado1.ffa29b16.png differ diff --git a/assets/img/block.b5292fb2.png b/assets/img/block.b5292fb2.png new file mode 100644 index 0000000..64691c2 Binary files /dev/null and b/assets/img/block.b5292fb2.png differ diff --git a/assets/img/block1.bbc37b84.png b/assets/img/block1.bbc37b84.png new file mode 100644 index 0000000..67c2283 Binary files /dev/null and b/assets/img/block1.bbc37b84.png differ diff --git a/assets/img/good.png b/assets/img/good.png new file mode 100644 index 0000000..773ff54 Binary files /dev/null and b/assets/img/good.png differ diff --git a/assets/img/mpb.b14b24ec.png b/assets/img/mpb.b14b24ec.png new file mode 100644 index 0000000..864fe4d Binary files /dev/null and b/assets/img/mpb.b14b24ec.png differ diff --git a/assets/img/search.83621669.svg b/assets/img/search.83621669.svg new file mode 100644 index 0000000..03d8391 --- /dev/null +++ b/assets/img/search.83621669.svg @@ -0,0 +1 @@ + diff --git a/assets/img/wenhao.png b/assets/img/wenhao.png new file mode 100644 index 0000000..df29550 Binary files /dev/null and b/assets/img/wenhao.png differ diff --git a/assets/js/1.dfdc8902.js b/assets/js/1.dfdc8902.js new file mode 100644 index 0000000..49204ef --- /dev/null +++ b/assets/js/1.dfdc8902.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[1,12,14,19,20,23],{241:function(t,e,n){"use strict";n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return r})),n.d(e,"i",(function(){return o})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return c})),n.d(e,"b",(function(){return h})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return p})),n.d(e,"l",(function(){return d})),n.d(e,"c",(function(){return m})),n.d(e,"j",(function(){return k}));n(45);const s=/#.*$/,i=/\.(md|html)$/,r=/\/$/,o=/^[a-z]+:/i;function a(t){return decodeURI(t).replace(s,"").replace(i,"")}function l(t){return o.test(t)}function u(t){return/^mailto:/.test(t)}function c(t){return/^tel:/.test(t)}function h(t){if(l(t))return t;const e=t.match(s),n=e?e[0]:"",i=a(t);return r.test(i)?t:i+".html"+n}function f(t,e){const n=decodeURIComponent(t.hash),i=function(t){const e=t.match(s);if(e)return e[0]}(e);if(i&&n!==i)return!1;return a(t.path)===a(e)}function p(t,e,n){if(l(e))return{type:"external",path:e};n&&(e=function(t,e,n){const s=t.charAt(0);if("/"===s)return t;if("?"===s||"#"===s)return e+t;const i=e.split("/");n&&i[i.length-1]||i.pop();const r=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,s,i=1){if("string"==typeof e)return p(n,e,s);if(Array.isArray(e))return Object.assign(p(n,e[0],s),{title:e[1]});{const r=e.children||[];return 0===r.length&&e.path?Object.assign(p(n,e.path,s),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:r.map(e=>t(e,n,s,i+1)),collapsable:!1!==e.collapsable}}}(t,i,n)):[]}return[]}function g(t){const e=m(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function m(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function k(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},242:function(t,e,n){},243:function(t,e,n){"use strict";n.r(e);var s=n(241),i={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(s.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(s.g)(this.link)||Object(s.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(s.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(s.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},r=n(14),o=Object(r.a)(i,(function(){var t=this,e=t._self._c;return t.isInternal?e("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(e){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):e("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?e("OutboundLink"):t._e()],1)}),[],!1,null,null,null);e.default=o.exports},244:function(t,e,n){"use strict";n.r(e);var s={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},i=(n(245),n(14)),r=Object(i.a)(s,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=r.exports},245:function(t,e,n){"use strict";n(242)},246:function(t,e,n){},249:function(t,e,n){},253:function(t,e,n){"use strict";n(246)},256:function(t,e,n){"use strict";n.r(e);var s=n(243),i=n(244),r=n(90),o=n.n(r),a={name:"DropdownLink",components:{NavLink:s.default,DropdownTransition:i.default},props:{item:{required:!0}},data:()=>({open:!1}),computed:{dropdownAriaLabel(){return this.item.ariaLabel||this.item.text}},watch:{$route(){this.open=!1}},methods:{setOpen(t){this.open=t},isLastItemOfArray:(t,e)=>o()(e)===t,handleDropdown(){0===event.detail&&this.setOpen(!this.open)}}},l=(n(253),n(14)),u=Object(l.a)(a,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"dropdown-wrapper",class:{open:t.open}},[e("button",{staticClass:"dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:t.handleDropdown}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow down"})]),t._v(" "),e("button",{staticClass:"mobile-dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:function(e){return t.setOpen(!t.open)}}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow",class:t.open?"down":"right"})]),t._v(" "),e("DropdownTransition",[e("ul",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],staticClass:"nav-dropdown"},t._l(t.item.items,(function(n,s){return e("li",{key:n.link||s,staticClass:"dropdown-item"},["links"===n.type?e("h4",[t._v("\n "+t._s(n.text)+"\n ")]):t._e(),t._v(" "),"links"===n.type?e("ul",{staticClass:"dropdown-subitem-wrapper"},t._l(n.items,(function(s){return e("li",{key:s.link,staticClass:"dropdown-subitem"},[e("NavLink",{attrs:{item:s},on:{focusout:function(e){t.isLastItemOfArray(s,n.items)&&t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0):e("NavLink",{attrs:{item:n},on:{focusout:function(e){t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0)])],1)}),[],!1,null,null,null);e.default=u.exports},259:function(t,e,n){},260:function(t,e,n){"use strict";n(249)},267:function(t,e,n){"use strict";n.r(e);var s=n(256),i=n(241),r={name:"NavLinks",components:{NavLink:n(243).default,DropdownLink:s.default},computed:{userNav(){return this.$themeLocaleConfig.nav||this.$site.themeConfig.nav||[]},nav(){const{locales:t}=this.$site;if(t&&Object.keys(t).length>1){const e=this.$page.path,n=this.$router.options.routes,s=this.$site.themeConfig.locales||{},i={text:this.$themeLocaleConfig.selectText||"Languages",ariaLabel:this.$themeLocaleConfig.ariaLabel||"Select language",items:Object.keys(t).map(i=>{const r=t[i],o=s[i]&&s[i].label||r.lang;let a;return r.lang===this.$lang?a=e:(a=e.replace(this.$localeConfig.path,i),n.some(t=>t.path===a)||(a=i)),{text:o,link:a}})};return[...this.userNav,i]}return this.userNav},userLinks(){return(this.nav||[]).map(t=>Object.assign(Object(i.j)(t),{items:(t.items||[]).map(i.j)}))},repoLink(){const{repo:t}=this.$site.themeConfig;return t?/^https?:/.test(t)?t:"https://github.com/"+t:null},repoLabel(){if(!this.repoLink)return;if(this.$site.themeConfig.repoLabel)return this.$site.themeConfig.repoLabel;const t=this.repoLink.match(/^https?:\/\/[^/]+/)[0],e=["GitHub","GitLab","Bitbucket"];for(let n=0;n{let s=i()(e,"title","");return i()(e,"frontmatter.tags")&&(s+=" "+e.frontmatter.tags.join(" ")),n&&(s+=" "+n),o(t,s)};const o=(t,e)=>{const n=t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),s=new RegExp("[^\0-]"),i=t.split(/\s+/g).map(t=>t.trim()).filter(t=>!!t);if(s.test(t))return i.some(t=>e.toLowerCase().indexOf(t)>-1);{const s=t.endsWith(" ");return new RegExp(i.map((t,e)=>i.length!==e+1||s?`(?=.*\\b${n(t)}\\b)`:`(?=.*\\b${n(t)})`).join("")+".+","gi").test(e)}};var a={name:"SearchBox",data:()=>({query:"",focused:!1,focusIndex:0,placeholder:void 0}),computed:{showSuggestions(){return this.focused&&this.suggestions&&this.suggestions.length},suggestions(){const t=this.query.trim().toLowerCase();if(!t)return;const{pages:e}=this.$site,n=this.$site.themeConfig.searchMaxSuggestions||5,s=this.$localePath,i=[];for(let o=0;o=n);o++){const a=e[o];if(this.getPageLocalePath(a)===s&&this.isSearchable(a))if(r(t,a))i.push(a);else if(a.headers)for(let e=0;e=n);e++){const n=a.headers[e];n.title&&r(t,a,n.title)&&i.push(Object.assign({},a,{path:a.path+"#"+n.slug,header:n}))}}return i},alignRight(){return(this.$site.themeConfig.nav||[]).length+(this.$site.repo?1:0)<=2}},mounted(){this.placeholder=this.$site.themeConfig.searchPlaceholder||"",document.addEventListener("keydown",this.onHotkey)},beforeDestroy(){document.removeEventListener("keydown",this.onHotkey)},methods:{getPageLocalePath(t){for(const e in this.$site.locales||{})if("/"!==e&&0===t.path.indexOf(e))return e;return"/"},isSearchable(t){let e=null;return null===e||(e=Array.isArray(e)?e:new Array(e),e.filter(e=>t.path.match(e)).length>0)},onHotkey(t){t.srcElement===document.body&&["s","/"].includes(t.key)&&(this.$refs.input.focus(),t.preventDefault())},onUp(){this.showSuggestions&&(this.focusIndex>0?this.focusIndex--:this.focusIndex=this.suggestions.length-1)},onDown(){this.showSuggestions&&(this.focusIndex "+t._s(n.header.title))]):t._e()])])})),0):t._e()])}),[],!1,null,null,null).exports,c=n(285),h=n(267);function f(t,e){return t.ownerDocument.defaultView.getComputedStyle(t,null)[e]}var p={name:"Navbar",components:{SidebarButton:c.default,NavLinks:h.default,SearchBox:u,AlgoliaSearchBox:{}},data:()=>({linksWrapMaxWidth:null}),computed:{algolia(){return this.$themeLocaleConfig.algolia||this.$site.themeConfig.algolia||{}},isAlgoliaSearch(){return this.algolia&&this.algolia.apiKey&&this.algolia.indexName}},mounted(){const t=parseInt(f(this.$el,"paddingLeft"))+parseInt(f(this.$el,"paddingRight")),e=()=>{document.documentElement.clientWidth<719?this.linksWrapMaxWidth=null:this.linksWrapMaxWidth=this.$el.offsetWidth-t-(this.$refs.siteName&&this.$refs.siteName.offsetWidth||0)};e(),window.addEventListener("resize",e,!1)}},d=(n(292),Object(l.a)(p,(function(){var t=this,e=t._self._c;return e("header",{staticClass:"navbar"},[e("SidebarButton",{on:{"toggle-sidebar":function(e){return t.$emit("toggle-sidebar")}}}),t._v(" "),e("RouterLink",{staticClass:"home-link",attrs:{to:t.$localePath}},[t.$site.themeConfig.logo?e("img",{staticClass:"logo",attrs:{src:t.$withBase(t.$site.themeConfig.logo),alt:t.$siteTitle}}):t._e(),t._v(" "),t.$siteTitle?e("span",{ref:"siteName",staticClass:"site-name",class:{"can-hide":t.$site.themeConfig.logo}},[t._v(t._s(t.$siteTitle))]):t._e()]),t._v(" "),e("div",{staticClass:"links",style:t.linksWrapMaxWidth?{"max-width":t.linksWrapMaxWidth+"px"}:{}},[t.isAlgoliaSearch?e("AlgoliaSearchBox",{attrs:{options:t.algolia}}):!1!==t.$site.themeConfig.search&&!1!==t.$page.frontmatter.search?e("SearchBox"):t._e(),t._v(" "),e("NavLinks",{staticClass:"can-hide"})],1)],1)}),[],!1,null,null,null));e.default=d.exports}}]); \ No newline at end of file diff --git a/assets/js/10.8a55b5ae.js b/assets/js/10.8a55b5ae.js new file mode 100644 index 0000000..ad218e2 --- /dev/null +++ b/assets/js/10.8a55b5ae.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[10,3,12,14,18,19,23],{241:function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"i",(function(){return a})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return c})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return h})),n.d(e,"k",(function(){return d})),n.d(e,"l",(function(){return f})),n.d(e,"c",(function(){return m})),n.d(e,"j",(function(){return g}));n(45);const i=/#.*$/,s=/\.(md|html)$/,r=/\/$/,a=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(i,"").replace(s,"")}function l(t){return a.test(t)}function u(t){return/^mailto:/.test(t)}function c(t){return/^tel:/.test(t)}function p(t){if(l(t))return t;const e=t.match(i),n=e?e[0]:"",s=o(t);return r.test(s)?t:s+".html"+n}function h(t,e){const n=decodeURIComponent(t.hash),s=function(t){const e=t.match(i);if(e)return e[0]}(e);if(s&&n!==s)return!1;return o(t.path)===o(e)}function d(t,e,n){if(l(e))return{type:"external",path:e};n&&(e=function(t,e,n){const i=t.charAt(0);if("/"===i)return t;if("?"===i||"#"===i)return e+t;const s=e.split("/");n&&s[s.length-1]||s.pop();const r=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,i,s=1){if("string"==typeof e)return d(n,e,i);if(Array.isArray(e))return Object.assign(d(n,e[0],i),{title:e[1]});{const r=e.children||[];return 0===r.length&&e.path?Object.assign(d(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:r.map(e=>t(e,n,i,s+1)),collapsable:!1!==e.collapsable}}}(t,s,n)):[]}return[]}function b(t){const e=m(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function m(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function g(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},242:function(t,e,n){},243:function(t,e,n){"use strict";n.r(e);var i=n(241),s={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(i.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(i.g)(this.link)||Object(i.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(i.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(i.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},r=n(14),a=Object(r.a)(s,(function(){var t=this,e=t._self._c;return t.isInternal?e("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(e){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):e("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?e("OutboundLink"):t._e()],1)}),[],!1,null,null,null);e.default=a.exports},244:function(t,e,n){"use strict";n.r(e);var i={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},s=(n(245),n(14)),r=Object(s.a)(i,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=r.exports},245:function(t,e,n){"use strict";n(242)},246:function(t,e,n){},247:function(t,e,n){},249:function(t,e,n){},252:function(t,e,n){},253:function(t,e,n){"use strict";n(246)},254:function(t,e,n){"use strict";n(247)},255:function(t,e,n){"use strict";n.r(e);var i=n(268),s=n(257),r=n(241);function a(t,e){if("group"===e.type){const n=e.path&&Object(r.e)(t,e.path),i=e.children.some(e=>"group"===e.type?a(t,e):"page"===e.type&&Object(r.e)(t,e.path));return n||i}return!1}var o={name:"SidebarLinks",components:{SidebarGroup:i.default,SidebarLink:s.default},props:["items","depth","sidebarDepth","initialOpenGroupIndex"],data(){return{openGroupIndex:this.initialOpenGroupIndex||0}},watch:{$route(){this.refreshIndex()}},created(){this.refreshIndex()},methods:{refreshIndex(){const t=function(t,e){for(let n=0;n-1&&(this.openGroupIndex=t)},toggleGroup(t){this.openGroupIndex=t===this.openGroupIndex?-1:t},isActive(t){return Object(r.e)(this.$route,t.regularPath)}}},l=n(14),u=Object(l.a)(o,(function(){var t=this,e=t._self._c;return t.items.length?e("ul",{staticClass:"sidebar-links"},t._l(t.items,(function(n,i){return e("li",{key:i},["group"===n.type?e("SidebarGroup",{attrs:{item:n,open:i===t.openGroupIndex,collapsable:n.collapsable||n.collapsible,depth:t.depth},on:{toggle:function(e){return t.toggleGroup(i)}}}):e("SidebarLink",{attrs:{"sidebar-depth":t.sidebarDepth,item:n}})],1)})),0):t._e()}),[],!1,null,null,null);e.default=u.exports},256:function(t,e,n){"use strict";n.r(e);var i=n(243),s=n(244),r=n(90),a=n.n(r),o={name:"DropdownLink",components:{NavLink:i.default,DropdownTransition:s.default},props:{item:{required:!0}},data:()=>({open:!1}),computed:{dropdownAriaLabel(){return this.item.ariaLabel||this.item.text}},watch:{$route(){this.open=!1}},methods:{setOpen(t){this.open=t},isLastItemOfArray:(t,e)=>a()(e)===t,handleDropdown(){0===event.detail&&this.setOpen(!this.open)}}},l=(n(253),n(14)),u=Object(l.a)(o,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"dropdown-wrapper",class:{open:t.open}},[e("button",{staticClass:"dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:t.handleDropdown}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow down"})]),t._v(" "),e("button",{staticClass:"mobile-dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:function(e){return t.setOpen(!t.open)}}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow",class:t.open?"down":"right"})]),t._v(" "),e("DropdownTransition",[e("ul",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],staticClass:"nav-dropdown"},t._l(t.item.items,(function(n,i){return e("li",{key:n.link||i,staticClass:"dropdown-item"},["links"===n.type?e("h4",[t._v("\n "+t._s(n.text)+"\n ")]):t._e(),t._v(" "),"links"===n.type?e("ul",{staticClass:"dropdown-subitem-wrapper"},t._l(n.items,(function(i){return e("li",{key:i.link,staticClass:"dropdown-subitem"},[e("NavLink",{attrs:{item:i},on:{focusout:function(e){t.isLastItemOfArray(i,n.items)&&t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0):e("NavLink",{attrs:{item:n},on:{focusout:function(e){t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0)])],1)}),[],!1,null,null,null);e.default=u.exports},257:function(t,e,n){"use strict";n.r(e);var i=n(241);function s(t,e,n,i,s){const r={props:{to:e,activeClass:"",exactActiveClass:""},class:{active:i,"sidebar-link":!0}};return s>2&&(r.style={"padding-left":s+"rem"}),t("RouterLink",r,n)}function r(t,e,n,a,o,l=1){return!e||l>o?null:t("ul",{class:"sidebar-sub-headers"},e.map(e=>{const u=Object(i.e)(a,n+"#"+e.slug);return t("li",{class:"sidebar-sub-header"},[s(t,n+"#"+e.slug,e.title,u,e.level-1),r(t,e.children,n,a,o,l+1)])}))}var a={functional:!0,props:["item","sidebarDepth"],render(t,{parent:{$page:e,$site:n,$route:a,$themeConfig:o,$themeLocaleConfig:l},props:{item:u,sidebarDepth:c}}){const p=Object(i.e)(a,u.path),h="auto"===u.type?p||u.children.some(t=>Object(i.e)(a,u.basePath+"#"+t.slug)):p,d="external"===u.type?function(t,e,n){return t("a",{attrs:{href:e,target:"_blank",rel:"noopener noreferrer"},class:{"sidebar-link":!0}},[n,t("OutboundLink")])}(t,u.path,u.title||u.path):s(t,u.path,u.title||u.path,h),f=[e.frontmatter.sidebarDepth,c,l.sidebarDepth,o.sidebarDepth,1].find(t=>void 0!==t),b=l.displayAllHeaders||o.displayAllHeaders;if("auto"===u.type)return[d,r(t,u.children,u.basePath,a,f)];if((h||b)&&u.headers&&!i.d.test(u.path)){return[d,r(t,Object(i.c)(u.headers),u.path,a,f)]}return d}},o=(n(254),n(14)),l=Object(o.a)(a,void 0,void 0,!1,null,null,null);e.default=l.exports},260:function(t,e,n){"use strict";n(249)},265:function(t,e,n){"use strict";n(252)},266:function(t,e,n){},267:function(t,e,n){"use strict";n.r(e);var i=n(256),s=n(241),r={name:"NavLinks",components:{NavLink:n(243).default,DropdownLink:i.default},computed:{userNav(){return this.$themeLocaleConfig.nav||this.$site.themeConfig.nav||[]},nav(){const{locales:t}=this.$site;if(t&&Object.keys(t).length>1){const e=this.$page.path,n=this.$router.options.routes,i=this.$site.themeConfig.locales||{},s={text:this.$themeLocaleConfig.selectText||"Languages",ariaLabel:this.$themeLocaleConfig.ariaLabel||"Select language",items:Object.keys(t).map(s=>{const r=t[s],a=i[s]&&i[s].label||r.lang;let o;return r.lang===this.$lang?o=e:(o=e.replace(this.$localeConfig.path,s),n.some(t=>t.path===o)||(o=s)),{text:a,link:o}})};return[...this.userNav,s]}return this.userNav},userLinks(){return(this.nav||[]).map(t=>Object.assign(Object(s.j)(t),{items:(t.items||[]).map(s.j)}))},repoLink(){const{repo:t}=this.$site.themeConfig;return t?/^https?:/.test(t)?t:"https://github.com/"+t:null},repoLabel(){if(!this.repoLink)return;if(this.$site.themeConfig.repoLabel)return this.$site.themeConfig.repoLabel;const t=this.repoLink.match(/^https?:\/\/[^/]+/)[0],e=["GitHub","GitLab","Bitbucket"];for(let n=0;nfunction t(e,n,r,i=1){if("string"==typeof e)return d(n,e,r);if(Array.isArray(e))return Object.assign(d(n,e[0],r),{title:e[1]});{const a=e.children||[];return 0===a.length&&e.path?Object.assign(d(n,e.path,r),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:a.map(e=>t(e,n,r,i+1)),collapsable:!1!==e.collapsable}}}(t,i,n)):[]}return[]}function g(t){const e=v(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function v(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function m(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},248:function(t,e){t.exports=function(t){return null==t}},250:function(t,e,n){},251:function(t,e,n){},261:function(t,e,n){"use strict";n(250)},262:function(t,e,n){var r=n(11),i=n(4),a=n(10);t.exports=function(t){return"string"==typeof t||!i(t)&&a(t)&&"[object String]"==r(t)}},263:function(t,e,n){"use strict";n(251)},264:function(t,e,n){},269:function(t,e,n){"use strict";n.r(e);var r=n(248),i=n.n(r),a=n(241),s={name:"PageEdit",computed:{lastUpdated(){return this.$page.lastUpdated},lastUpdatedText(){return"string"==typeof this.$themeLocaleConfig.lastUpdated?this.$themeLocaleConfig.lastUpdated:"string"==typeof this.$site.themeConfig.lastUpdated?this.$site.themeConfig.lastUpdated:"Last Updated"},editLink(){const t=i()(this.$page.frontmatter.editLink)?this.$site.themeConfig.editLinks:this.$page.frontmatter.editLink,{repo:e,docsDir:n="",docsBranch:r="master",docsRepo:a=e}=this.$site.themeConfig;return t&&a&&this.$page.relativePath?this.createEditLink(e,a,n,r,this.$page.relativePath):null},editLinkText(){return this.$themeLocaleConfig.editLinkText||this.$site.themeConfig.editLinkText||"Edit this page"}},methods:{createEditLink(t,e,n,r,i){if(/bitbucket.org/.test(e)){return e.replace(a.a,"")+"/src"+`/${r}/`+(n?n.replace(a.a,"")+"/":"")+i+`?mode=edit&spa=0&at=${r}&fileviewer=file-view-default`}if(/gitlab.com/.test(e)){return e.replace(a.a,"")+"/-/edit"+`/${r}/`+(n?n.replace(a.a,"")+"/":"")+i}return(a.i.test(e)?e:"https://github.com/"+e).replace(a.a,"")+"/edit"+`/${r}/`+(n?n.replace(a.a,"")+"/":"")+i}}},o=(n(261),n(14)),u=Object(o.a)(s,(function(){var t=this,e=t._self._c;return e("footer",{staticClass:"page-edit"},[t.editLink?e("div",{staticClass:"edit-link"},[e("a",{attrs:{href:t.editLink,target:"_blank",rel:"noopener noreferrer"}},[t._v(t._s(t.editLinkText))]),t._v(" "),e("OutboundLink")],1):t._e(),t._v(" "),t.lastUpdated?e("div",{staticClass:"last-updated"},[e("span",{staticClass:"prefix"},[t._v(t._s(t.lastUpdatedText)+":")]),t._v(" "),e("span",{staticClass:"time"},[t._v(t._s(t.lastUpdated))])]):t._e()])}),[],!1,null,null,null);e.default=u.exports},270:function(t,e,n){"use strict";n.r(e);n(45);var r=n(241),i=n(262),a=n.n(i),s=n(248),o=n.n(s),u={name:"PageNav",props:["sidebarItems"],computed:{prev(){return l(c.PREV,this)},next(){return l(c.NEXT,this)}}};const c={NEXT:{resolveLink:function(t,e){return p(t,e,1)},getThemeLinkConfig:({nextLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.next},PREV:{resolveLink:function(t,e){return p(t,e,-1)},getThemeLinkConfig:({prevLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.prev}};function l(t,{$themeConfig:e,$page:n,$route:i,$site:s,sidebarItems:u}){const{resolveLink:c,getThemeLinkConfig:l,getPageLinkConfig:p}=t,f=l(e),d=p(n),h=o()(d)?f:d;return!1===h?void 0:a()(h)?Object(r.k)(s.pages,h,i.path):c(n,u)}function p(t,e,n){const r=[];!function t(e,n){for(let r=0,i=e.length;rfunction t(e,n,i,r=1){if("string"==typeof e)return f(n,e,i);if(Array.isArray(e))return Object.assign(f(n,e[0],i),{title:e[1]});{const s=e.children||[];return 0===s.length&&e.path?Object.assign(f(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:s.map(e=>t(e,n,i,r+1)),collapsable:!1!==e.collapsable}}}(t,r,n)):[]}return[]}function m(t){const e=b(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function b(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function g(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},242:function(t,e,n){},243:function(t,e,n){"use strict";n.r(e);var i=n(241),r={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(i.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(i.g)(this.link)||Object(i.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(i.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(i.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},s=n(14),a=Object(s.a)(r,(function(){var t=this,e=t._self._c;return t.isInternal?e("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(e){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):e("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?e("OutboundLink"):t._e()],1)}),[],!1,null,null,null);e.default=a.exports},244:function(t,e,n){"use strict";n.r(e);var i={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},r=(n(245),n(14)),s=Object(r.a)(i,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=s.exports},245:function(t,e,n){"use strict";n(242)},246:function(t,e,n){},249:function(t,e,n){},253:function(t,e,n){"use strict";n(246)},256:function(t,e,n){"use strict";n.r(e);var i=n(243),r=n(244),s=n(90),a=n.n(s),o={name:"DropdownLink",components:{NavLink:i.default,DropdownTransition:r.default},props:{item:{required:!0}},data:()=>({open:!1}),computed:{dropdownAriaLabel(){return this.item.ariaLabel||this.item.text}},watch:{$route(){this.open=!1}},methods:{setOpen(t){this.open=t},isLastItemOfArray:(t,e)=>a()(e)===t,handleDropdown(){0===event.detail&&this.setOpen(!this.open)}}},l=(n(253),n(14)),u=Object(l.a)(o,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"dropdown-wrapper",class:{open:t.open}},[e("button",{staticClass:"dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:t.handleDropdown}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow down"})]),t._v(" "),e("button",{staticClass:"mobile-dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:function(e){return t.setOpen(!t.open)}}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow",class:t.open?"down":"right"})]),t._v(" "),e("DropdownTransition",[e("ul",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],staticClass:"nav-dropdown"},t._l(t.item.items,(function(n,i){return e("li",{key:n.link||i,staticClass:"dropdown-item"},["links"===n.type?e("h4",[t._v("\n "+t._s(n.text)+"\n ")]):t._e(),t._v(" "),"links"===n.type?e("ul",{staticClass:"dropdown-subitem-wrapper"},t._l(n.items,(function(i){return e("li",{key:i.link,staticClass:"dropdown-subitem"},[e("NavLink",{attrs:{item:i},on:{focusout:function(e){t.isLastItemOfArray(i,n.items)&&t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0):e("NavLink",{attrs:{item:n},on:{focusout:function(e){t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0)])],1)}),[],!1,null,null,null);e.default=u.exports},260:function(t,e,n){"use strict";n(249)},267:function(t,e,n){"use strict";n.r(e);var i=n(256),r=n(241),s={name:"NavLinks",components:{NavLink:n(243).default,DropdownLink:i.default},computed:{userNav(){return this.$themeLocaleConfig.nav||this.$site.themeConfig.nav||[]},nav(){const{locales:t}=this.$site;if(t&&Object.keys(t).length>1){const e=this.$page.path,n=this.$router.options.routes,i=this.$site.themeConfig.locales||{},r={text:this.$themeLocaleConfig.selectText||"Languages",ariaLabel:this.$themeLocaleConfig.ariaLabel||"Select language",items:Object.keys(t).map(r=>{const s=t[r],a=i[r]&&i[r].label||s.lang;let o;return s.lang===this.$lang?o=e:(o=e.replace(this.$localeConfig.path,r),n.some(t=>t.path===o)||(o=r)),{text:a,link:o}})};return[...this.userNav,r]}return this.userNav},userLinks(){return(this.nav||[]).map(t=>Object.assign(Object(r.j)(t),{items:(t.items||[]).map(r.j)}))},repoLink(){const{repo:t}=this.$site.themeConfig;return t?/^https?:/.test(t)?t:"https://github.com/"+t:null},repoLabel(){if(!this.repoLink)return;if(this.$site.themeConfig.repoLabel)return this.$site.themeConfig.repoLabel;const t=this.repoLink.match(/^https?:\/\/[^/]+/)[0],e=["GitHub","GitLab","Bitbucket"];for(let n=0;n({placeholder:void 0}),watch:{$lang(e){this.update(this.options,e)},options(e){this.update(e,this.$lang)}},mounted(){this.initialize(this.options,this.$lang),this.placeholder=this.$site.themeConfig.searchPlaceholder||""},methods:{initialize(e,t){Promise.all([Promise.all([a.e(0),a.e(9)]).then(a.t.bind(null,308,7)),Promise.all([a.e(0),a.e(9)]).then(a.t.bind(null,309,7))]).then(([a])=>{a=a.default;const{algoliaOptions:i={}}=e;a(Object.assign({},e,{inputSelector:"#algolia-search-input",algoliaOptions:{...i,facetFilters:["lang:"+t].concat(i.facetFilters||[])},handleSelected:(e,t,a)=>{const{pathname:i,hash:n}=new URL(a.url),r=i.replace(this.$site.base,"/"),s=decodeURIComponent(n);this.$router.push(`${r}${s}`)}}))})},update(e,t){this.$el.innerHTML='',this.initialize(e,t)}}},n=(a(290),a(14)),r=Object(n.a)(i,(function(){var e=this._self._c;return e("form",{staticClass:"algolia-search-wrapper search-box",attrs:{id:"search-form",role:"search"}},[e("input",{staticClass:"search-query",attrs:{id:"algolia-search-input",placeholder:this.placeholder}})])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/14.d428a164.js b/assets/js/14.d428a164.js new file mode 100644 index 0000000..4eb73d7 --- /dev/null +++ b/assets/js/14.d428a164.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[14,19,23],{241:function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return s})),n.d(e,"i",(function(){return o})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return c})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return h})),n.d(e,"l",(function(){return d})),n.d(e,"c",(function(){return b})),n.d(e,"j",(function(){return g}));n(45);const i=/#.*$/,r=/\.(md|html)$/,s=/\/$/,o=/^[a-z]+:/i;function a(t){return decodeURI(t).replace(i,"").replace(r,"")}function l(t){return o.test(t)}function u(t){return/^mailto:/.test(t)}function c(t){return/^tel:/.test(t)}function p(t){if(l(t))return t;const e=t.match(i),n=e?e[0]:"",r=a(t);return s.test(r)?t:r+".html"+n}function f(t,e){const n=decodeURIComponent(t.hash),r=function(t){const e=t.match(i);if(e)return e[0]}(e);if(r&&n!==r)return!1;return a(t.path)===a(e)}function h(t,e,n){if(l(e))return{type:"external",path:e};n&&(e=function(t,e,n){const i=t.charAt(0);if("/"===i)return t;if("?"===i||"#"===i)return e+t;const r=e.split("/");n&&r[r.length-1]||r.pop();const s=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,i,r=1){if("string"==typeof e)return h(n,e,i);if(Array.isArray(e))return Object.assign(h(n,e[0],i),{title:e[1]});{const s=e.children||[];return 0===s.length&&e.path?Object.assign(h(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:s.map(e=>t(e,n,i,r+1)),collapsable:!1!==e.collapsable}}}(t,r,n)):[]}return[]}function m(t){const e=b(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function b(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function g(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},242:function(t,e,n){},243:function(t,e,n){"use strict";n.r(e);var i=n(241),r={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(i.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(i.g)(this.link)||Object(i.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(i.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(i.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},s=n(14),o=Object(s.a)(r,(function(){var t=this,e=t._self._c;return t.isInternal?e("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(e){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):e("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?e("OutboundLink"):t._e()],1)}),[],!1,null,null,null);e.default=o.exports},244:function(t,e,n){"use strict";n.r(e);var i={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},r=(n(245),n(14)),s=Object(r.a)(i,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=s.exports},245:function(t,e,n){"use strict";n(242)},246:function(t,e,n){},253:function(t,e,n){"use strict";n(246)},256:function(t,e,n){"use strict";n.r(e);var i=n(243),r=n(244),s=n(90),o=n.n(s),a={name:"DropdownLink",components:{NavLink:i.default,DropdownTransition:r.default},props:{item:{required:!0}},data:()=>({open:!1}),computed:{dropdownAriaLabel(){return this.item.ariaLabel||this.item.text}},watch:{$route(){this.open=!1}},methods:{setOpen(t){this.open=t},isLastItemOfArray:(t,e)=>o()(e)===t,handleDropdown(){0===event.detail&&this.setOpen(!this.open)}}},l=(n(253),n(14)),u=Object(l.a)(a,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"dropdown-wrapper",class:{open:t.open}},[e("button",{staticClass:"dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:t.handleDropdown}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow down"})]),t._v(" "),e("button",{staticClass:"mobile-dropdown-title",attrs:{type:"button","aria-label":t.dropdownAriaLabel},on:{click:function(e){return t.setOpen(!t.open)}}},[e("span",{staticClass:"title"},[t._v(t._s(t.item.text))]),t._v(" "),e("span",{staticClass:"arrow",class:t.open?"down":"right"})]),t._v(" "),e("DropdownTransition",[e("ul",{directives:[{name:"show",rawName:"v-show",value:t.open,expression:"open"}],staticClass:"nav-dropdown"},t._l(t.item.items,(function(n,i){return e("li",{key:n.link||i,staticClass:"dropdown-item"},["links"===n.type?e("h4",[t._v("\n "+t._s(n.text)+"\n ")]):t._e(),t._v(" "),"links"===n.type?e("ul",{staticClass:"dropdown-subitem-wrapper"},t._l(n.items,(function(i){return e("li",{key:i.link,staticClass:"dropdown-subitem"},[e("NavLink",{attrs:{item:i},on:{focusout:function(e){t.isLastItemOfArray(i,n.items)&&t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0):e("NavLink",{attrs:{item:n},on:{focusout:function(e){t.isLastItemOfArray(n,t.item.items)&&t.setOpen(!1)}}})],1)})),0)])],1)}),[],!1,null,null,null);e.default=u.exports}}]); \ No newline at end of file diff --git a/assets/js/15.f2b6f50f.js b/assets/js/15.f2b6f50f.js new file mode 100644 index 0000000..367d655 --- /dev/null +++ b/assets/js/15.f2b6f50f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{241:function(t,n,e){"use strict";e.d(n,"d",(function(){return r})),e.d(n,"a",(function(){return o})),e.d(n,"i",(function(){return a})),e.d(n,"f",(function(){return u})),e.d(n,"g",(function(){return c})),e.d(n,"h",(function(){return p})),e.d(n,"b",(function(){return l})),e.d(n,"e",(function(){return f})),e.d(n,"k",(function(){return h})),e.d(n,"l",(function(){return d})),e.d(n,"c",(function(){return v})),e.d(n,"j",(function(){return b}));e(45);const r=/#.*$/,i=/\.(md|html)$/,o=/\/$/,a=/^[a-z]+:/i;function s(t){return decodeURI(t).replace(r,"").replace(i,"")}function u(t){return a.test(t)}function c(t){return/^mailto:/.test(t)}function p(t){return/^tel:/.test(t)}function l(t){if(u(t))return t;const n=t.match(r),e=n?n[0]:"",i=s(t);return o.test(i)?t:i+".html"+e}function f(t,n){const e=decodeURIComponent(t.hash),i=function(t){const n=t.match(r);if(n)return n[0]}(n);if(i&&e!==i)return!1;return s(t.path)===s(n)}function h(t,n,e){if(u(n))return{type:"external",path:n};e&&(n=function(t,n,e){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return n+t;const i=n.split("/");e&&i[i.length-1]||i.pop();const o=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(n,e,r,i=1){if("string"==typeof n)return h(e,n,r);if(Array.isArray(n))return Object.assign(h(e,n[0],r),{title:n[1]});{const o=n.children||[];return 0===o.length&&n.path?Object.assign(h(e,n.path,r),{title:n.title}):{type:"group",path:n.path,title:n.title,sidebarDepth:n.sidebarDepth,initialOpenGroupIndex:n.initialOpenGroupIndex,children:o.map(n=>t(n,e,r,i+1)),collapsable:!1!==n.collapsable}}}(t,i,e)):[]}return[]}function g(t){const n=v(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:n.map(n=>({type:"auto",title:n.title,basePath:t.path,path:t.path+"#"+n.slug,children:n.children||[]}))}]}function v(t){let n;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?n=t:n&&(n.children||(n.children=[])).push(t)}),t.filter(t=>2===t.level)}function b(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},248:function(t,n){t.exports=function(t){return null==t}},251:function(t,n,e){},262:function(t,n,e){var r=e(11),i=e(4),o=e(10);t.exports=function(t){return"string"==typeof t||!i(t)&&o(t)&&"[object String]"==r(t)}},263:function(t,n,e){"use strict";e(251)},270:function(t,n,e){"use strict";e.r(n);e(45);var r=e(241),i=e(262),o=e.n(i),a=e(248),s=e.n(a),u={name:"PageNav",props:["sidebarItems"],computed:{prev(){return p(c.PREV,this)},next(){return p(c.NEXT,this)}}};const c={NEXT:{resolveLink:function(t,n){return l(t,n,1)},getThemeLinkConfig:({nextLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.next},PREV:{resolveLink:function(t,n){return l(t,n,-1)},getThemeLinkConfig:({prevLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.prev}};function p(t,{$themeConfig:n,$page:e,$route:i,$site:a,sidebarItems:u}){const{resolveLink:c,getThemeLinkConfig:p,getPageLinkConfig:l}=t,f=p(n),h=l(e),d=s()(h)?f:h;return!1===d?void 0:o()(d)?Object(r.k)(a.pages,d,i.path):c(e,u)}function l(t,n,e){const r=[];!function t(n,e){for(let r=0,i=n.length;rfunction t(e,n,i,r=1){if("string"==typeof e)return d(n,e,i);if(Array.isArray(e))return Object.assign(d(n,e[0],i),{title:e[1]});{const a=e.children||[];return 0===a.length&&e.path?Object.assign(d(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:a.map(e=>t(e,n,i,r+1)),collapsable:!1!==e.collapsable}}}(t,r,n)):[]}return[]}function m(t){const e=g(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function g(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function b(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},243:function(t,e,n){"use strict";n.r(e);var i=n(241),r={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(i.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(i.g)(this.link)||Object(i.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(i.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(i.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},a=n(14),s=Object(a.a)(r,(function(){var t=this,e=t._self._c;return t.isInternal?e("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(e){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):e("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?e("OutboundLink"):t._e()],1)}),[],!1,null,null,null);e.default=s.exports},258:function(t,e,n){},271:function(t,e,n){"use strict";n(258)},282:function(t,e,n){"use strict";n.r(e);var i={name:"Home",components:{NavLink:n(243).default},computed:{data(){return this.$page.frontmatter},actionLink(){return{link:this.data.actionLink,text:this.data.actionText}}}},r=(n(271),n(14)),a=Object(r.a)(i,(function(){var t=this,e=t._self._c;return e("main",{staticClass:"home",attrs:{"aria-labelledby":null!==t.data.heroText?"main-title":null}},[e("header",{staticClass:"hero"},[t.data.heroImage?e("img",{attrs:{src:t.$withBase(t.data.heroImage),alt:t.data.heroAlt||"hero"}}):t._e(),t._v(" "),null!==t.data.heroText?e("h1",{attrs:{id:"main-title"}},[t._v("\n "+t._s(t.data.heroText||t.$title||"Hello")+"\n ")]):t._e(),t._v(" "),null!==t.data.tagline?e("p",{staticClass:"description"},[t._v("\n "+t._s(t.data.tagline||t.$description||"Welcome to your VuePress site")+"\n ")]):t._e(),t._v(" "),t.data.actionText&&t.data.actionLink?e("p",{staticClass:"action"},[e("NavLink",{staticClass:"action-button",attrs:{item:t.actionLink}})],1):t._e()]),t._v(" "),t.data.features&&t.data.features.length?e("div",{staticClass:"features"},t._l(t.data.features,(function(n,i){return e("div",{key:i,staticClass:"feature"},[e("h2",[t._v(t._s(n.title))]),t._v(" "),e("p",[t._v(t._s(n.details))])])})),0):t._e(),t._v(" "),e("Content",{staticClass:"theme-default-content custom"}),t._v(" "),t.data.footer?e("div",{staticClass:"footer"},[t._v("\n "+t._s(t.data.footer)+"\n ")]):e("Content",{staticClass:"footer",attrs:{"slot-key":"footer"}})],1)}),[],!1,null,null,null);e.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/17.73cfca4f.js b/assets/js/17.73cfca4f.js new file mode 100644 index 0000000..8f2b8d1 --- /dev/null +++ b/assets/js/17.73cfca4f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{241:function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return a})),n.d(e,"i",(function(){return s})),n.d(e,"f",(function(){return c})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return l})),n.d(e,"b",(function(){return d})),n.d(e,"e",(function(){return p})),n.d(e,"k",(function(){return f})),n.d(e,"l",(function(){return h})),n.d(e,"c",(function(){return m})),n.d(e,"j",(function(){return b}));n(45);const i=/#.*$/,r=/\.(md|html)$/,a=/\/$/,s=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(i,"").replace(r,"")}function c(t){return s.test(t)}function u(t){return/^mailto:/.test(t)}function l(t){return/^tel:/.test(t)}function d(t){if(c(t))return t;const e=t.match(i),n=e?e[0]:"",r=o(t);return a.test(r)?t:r+".html"+n}function p(t,e){const n=decodeURIComponent(t.hash),r=function(t){const e=t.match(i);if(e)return e[0]}(e);if(r&&n!==r)return!1;return o(t.path)===o(e)}function f(t,e,n){if(c(e))return{type:"external",path:e};n&&(e=function(t,e,n){const i=t.charAt(0);if("/"===i)return t;if("?"===i||"#"===i)return e+t;const r=e.split("/");n&&r[r.length-1]||r.pop();const a=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,i,r=1){if("string"==typeof e)return f(n,e,i);if(Array.isArray(e))return Object.assign(f(n,e[0],i),{title:e[1]});{const a=e.children||[];return 0===a.length&&e.path?Object.assign(f(n,e.path,i),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:a.map(e=>t(e,n,i,r+1)),collapsable:!1!==e.collapsable}}}(t,r,n)):[]}return[]}function g(t){const e=m(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function m(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function b(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},248:function(t,e){t.exports=function(t){return null==t}},250:function(t,e,n){},261:function(t,e,n){"use strict";n(250)},269:function(t,e,n){"use strict";n.r(e);var i=n(248),r=n.n(i),a=n(241),s={name:"PageEdit",computed:{lastUpdated(){return this.$page.lastUpdated},lastUpdatedText(){return"string"==typeof this.$themeLocaleConfig.lastUpdated?this.$themeLocaleConfig.lastUpdated:"string"==typeof this.$site.themeConfig.lastUpdated?this.$site.themeConfig.lastUpdated:"Last Updated"},editLink(){const t=r()(this.$page.frontmatter.editLink)?this.$site.themeConfig.editLinks:this.$page.frontmatter.editLink,{repo:e,docsDir:n="",docsBranch:i="master",docsRepo:a=e}=this.$site.themeConfig;return t&&a&&this.$page.relativePath?this.createEditLink(e,a,n,i,this.$page.relativePath):null},editLinkText(){return this.$themeLocaleConfig.editLinkText||this.$site.themeConfig.editLinkText||"Edit this page"}},methods:{createEditLink(t,e,n,i,r){if(/bitbucket.org/.test(e)){return e.replace(a.a,"")+"/src"+`/${i}/`+(n?n.replace(a.a,"")+"/":"")+r+`?mode=edit&spa=0&at=${i}&fileviewer=file-view-default`}if(/gitlab.com/.test(e)){return e.replace(a.a,"")+"/-/edit"+`/${i}/`+(n?n.replace(a.a,"")+"/":"")+r}return(a.i.test(e)?e:"https://github.com/"+e).replace(a.a,"")+"/edit"+`/${i}/`+(n?n.replace(a.a,"")+"/":"")+r}}},o=(n(261),n(14)),c=Object(o.a)(s,(function(){var t=this,e=t._self._c;return e("footer",{staticClass:"page-edit"},[t.editLink?e("div",{staticClass:"edit-link"},[e("a",{attrs:{href:t.editLink,target:"_blank",rel:"noopener noreferrer"}},[t._v(t._s(t.editLinkText))]),t._v(" "),e("OutboundLink")],1):t._e(),t._v(" "),t.lastUpdated?e("div",{staticClass:"last-updated"},[e("span",{staticClass:"prefix"},[t._v(t._s(t.lastUpdatedText)+":")]),t._v(" "),e("span",{staticClass:"time"},[t._v(t._s(t.lastUpdated))])]):t._e()])}),[],!1,null,null,null);e.default=c.exports}}]); \ No newline at end of file diff --git a/assets/js/18.fb229398.js b/assets/js/18.fb229398.js new file mode 100644 index 0000000..ac911a2 --- /dev/null +++ b/assets/js/18.fb229398.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{241:function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return a})),n.d(e,"i",(function(){return s})),n.d(e,"f",(function(){return o})),n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return d})),n.d(e,"l",(function(){return h})),n.d(e,"c",(function(){return g})),n.d(e,"j",(function(){return m}));n(45);const r=/#.*$/,i=/\.(md|html)$/,a=/\/$/,s=/^[a-z]+:/i;function u(t){return decodeURI(t).replace(r,"").replace(i,"")}function o(t){return s.test(t)}function c(t){return/^mailto:/.test(t)}function l(t){return/^tel:/.test(t)}function p(t){if(o(t))return t;const e=t.match(r),n=e?e[0]:"",i=u(t);return a.test(i)?t:i+".html"+n}function f(t,e){const n=decodeURIComponent(t.hash),i=function(t){const e=t.match(r);if(e)return e[0]}(e);if(i&&n!==i)return!1;return u(t.path)===u(e)}function d(t,e,n){if(o(e))return{type:"external",path:e};n&&(e=function(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const i=e.split("/");n&&i[i.length-1]||i.pop();const a=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,r,i=1){if("string"==typeof e)return d(n,e,r);if(Array.isArray(e))return Object.assign(d(n,e[0],r),{title:e[1]});{const a=e.children||[];return 0===a.length&&e.path?Object.assign(d(n,e.path,r),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:a.map(e=>t(e,n,r,i+1)),collapsable:!1!==e.collapsable}}}(t,i,n)):[]}return[]}function b(t){const e=g(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function g(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function m(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},247:function(t,e,n){},254:function(t,e,n){"use strict";n(247)},257:function(t,e,n){"use strict";n.r(e);var r=n(241);function i(t,e,n,r,i){const a={props:{to:e,activeClass:"",exactActiveClass:""},class:{active:r,"sidebar-link":!0}};return i>2&&(a.style={"padding-left":i+"rem"}),t("RouterLink",a,n)}function a(t,e,n,s,u,o=1){return!e||o>u?null:t("ul",{class:"sidebar-sub-headers"},e.map(e=>{const c=Object(r.e)(s,n+"#"+e.slug);return t("li",{class:"sidebar-sub-header"},[i(t,n+"#"+e.slug,e.title,c,e.level-1),a(t,e.children,n,s,u,o+1)])}))}var s={functional:!0,props:["item","sidebarDepth"],render(t,{parent:{$page:e,$site:n,$route:s,$themeConfig:u,$themeLocaleConfig:o},props:{item:c,sidebarDepth:l}}){const p=Object(r.e)(s,c.path),f="auto"===c.type?p||c.children.some(t=>Object(r.e)(s,c.basePath+"#"+t.slug)):p,d="external"===c.type?function(t,e,n){return t("a",{attrs:{href:e,target:"_blank",rel:"noopener noreferrer"},class:{"sidebar-link":!0}},[n,t("OutboundLink")])}(t,c.path,c.title||c.path):i(t,c.path,c.title||c.path,f),h=[e.frontmatter.sidebarDepth,l,o.sidebarDepth,u.sidebarDepth,1].find(t=>void 0!==t),b=o.displayAllHeaders||u.displayAllHeaders;if("auto"===c.type)return[d,a(t,c.children,c.basePath,s,h)];if((f||b)&&c.headers&&!r.d.test(c.path)){return[d,a(t,Object(r.c)(c.headers),c.path,s,h)]}return d}},u=(n(254),n(14)),o=Object(u.a)(s,void 0,void 0,!1,null,null,null);e.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/19.9f389a20.js b/assets/js/19.9f389a20.js new file mode 100644 index 0000000..fa20f53 --- /dev/null +++ b/assets/js/19.9f389a20.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{242:function(t,e,n){},244:function(t,e,n){"use strict";n.r(e);var s={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},i=(n(245),n(14)),o=Object(i.a)(s,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=o.exports},245:function(t,e,n){"use strict";n(242)}}]); \ No newline at end of file diff --git a/assets/js/2.da747e82.js b/assets/js/2.da747e82.js new file mode 100644 index 0000000..8d278b3 --- /dev/null +++ b/assets/js/2.da747e82.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{247:function(t,e,a){},248:function(t,e){t.exports=function(t){return null==t}},250:function(t,e,a){},251:function(t,e,a){},252:function(t,e,a){},254:function(t,e,a){"use strict";a(247)},255:function(t,e,a){"use strict";a.r(e);var n=a(268),s=a(257),i=a(241);function r(t,e){if("group"===e.type){const a=e.path&&Object(i.e)(t,e.path),n=e.children.some(e=>"group"===e.type?r(t,e):"page"===e.type&&Object(i.e)(t,e.path));return a||n}return!1}var o={name:"SidebarLinks",components:{SidebarGroup:n.default,SidebarLink:s.default},props:["items","depth","sidebarDepth","initialOpenGroupIndex"],data(){return{openGroupIndex:this.initialOpenGroupIndex||0}},watch:{$route(){this.refreshIndex()}},created(){this.refreshIndex()},methods:{refreshIndex(){const t=function(t,e){for(let a=0;a-1&&(this.openGroupIndex=t)},toggleGroup(t){this.openGroupIndex=t===this.openGroupIndex?-1:t},isActive(t){return Object(i.e)(this.$route,t.regularPath)}}},l=a(14),u=Object(l.a)(o,(function(){var t=this,e=t._self._c;return t.items.length?e("ul",{staticClass:"sidebar-links"},t._l(t.items,(function(a,n){return e("li",{key:n},["group"===a.type?e("SidebarGroup",{attrs:{item:a,open:n===t.openGroupIndex,collapsable:a.collapsable||a.collapsible,depth:t.depth},on:{toggle:function(e){return t.toggleGroup(n)}}}):e("SidebarLink",{attrs:{"sidebar-depth":t.sidebarDepth,item:a}})],1)})),0):t._e()}),[],!1,null,null,null);e.default=u.exports},257:function(t,e,a){"use strict";a.r(e);var n=a(241);function s(t,e,a,n,s){const i={props:{to:e,activeClass:"",exactActiveClass:""},class:{active:n,"sidebar-link":!0}};return s>2&&(i.style={"padding-left":s+"rem"}),t("RouterLink",i,a)}function i(t,e,a,r,o,l=1){return!e||l>o?null:t("ul",{class:"sidebar-sub-headers"},e.map(e=>{const u=Object(n.e)(r,a+"#"+e.slug);return t("li",{class:"sidebar-sub-header"},[s(t,a+"#"+e.slug,e.title,u,e.level-1),i(t,e.children,a,r,o,l+1)])}))}var r={functional:!0,props:["item","sidebarDepth"],render(t,{parent:{$page:e,$site:a,$route:r,$themeConfig:o,$themeLocaleConfig:l},props:{item:u,sidebarDepth:c}}){const p=Object(n.e)(r,u.path),d="auto"===u.type?p||u.children.some(t=>Object(n.e)(r,u.basePath+"#"+t.slug)):p,h="external"===u.type?function(t,e,a){return t("a",{attrs:{href:e,target:"_blank",rel:"noopener noreferrer"},class:{"sidebar-link":!0}},[a,t("OutboundLink")])}(t,u.path,u.title||u.path):s(t,u.path,u.title||u.path,d),f=[e.frontmatter.sidebarDepth,c,l.sidebarDepth,o.sidebarDepth,1].find(t=>void 0!==t),b=l.displayAllHeaders||o.displayAllHeaders;if("auto"===u.type)return[h,i(t,u.children,u.basePath,r,f)];if((d||b)&&u.headers&&!n.d.test(u.path)){return[h,i(t,Object(n.c)(u.headers),u.path,r,f)]}return h}},o=(a(254),a(14)),l=Object(o.a)(r,void 0,void 0,!1,null,null,null);e.default=l.exports},258:function(t,e,a){},261:function(t,e,a){"use strict";a(250)},262:function(t,e,a){var n=a(11),s=a(4),i=a(10);t.exports=function(t){return"string"==typeof t||!s(t)&&i(t)&&"[object String]"==n(t)}},263:function(t,e,a){"use strict";a(251)},264:function(t,e,a){},265:function(t,e,a){"use strict";a(252)},266:function(t,e,a){},268:function(t,e,a){"use strict";a.r(e);var n=a(241),s={name:"SidebarGroup",components:{DropdownTransition:a(244).default},props:["item","open","collapsable","depth"],beforeCreate(){this.$options.components.SidebarLinks=a(255).default},methods:{isActive:n.e}},i=(a(265),a(14)),r=Object(i.a)(s,(function(){var t=this,e=t._self._c;return e("section",{staticClass:"sidebar-group",class:[{collapsable:t.collapsable,"is-sub-group":0!==t.depth},"depth-"+t.depth]},[t.item.path?e("RouterLink",{staticClass:"sidebar-heading clickable",class:{open:t.open,active:t.isActive(t.$route,t.item.path)},attrs:{to:t.item.path},nativeOn:{click:function(e){return t.$emit("toggle")}}},[e("span",[t._v(t._s(t.item.title))]),t._v(" "),t.collapsable?e("span",{staticClass:"arrow",class:t.open?"down":"right"}):t._e()]):e("p",{staticClass:"sidebar-heading",class:{open:t.open},on:{click:function(e){return t.$emit("toggle")}}},[e("span",[t._v(t._s(t.item.title))]),t._v(" "),t.collapsable?e("span",{staticClass:"arrow",class:t.open?"down":"right"}):t._e()]),t._v(" "),e("DropdownTransition",[t.open||!t.collapsable?e("SidebarLinks",{staticClass:"sidebar-group-items",attrs:{items:t.item.children,"sidebar-depth":t.item.sidebarDepth,"initial-open-group-index":t.item.initialOpenGroupIndex,depth:t.depth+1}}):t._e()],1)],1)}),[],!1,null,null,null);e.default=r.exports},269:function(t,e,a){"use strict";a.r(e);var n=a(248),s=a.n(n),i=a(241),r={name:"PageEdit",computed:{lastUpdated(){return this.$page.lastUpdated},lastUpdatedText(){return"string"==typeof this.$themeLocaleConfig.lastUpdated?this.$themeLocaleConfig.lastUpdated:"string"==typeof this.$site.themeConfig.lastUpdated?this.$site.themeConfig.lastUpdated:"Last Updated"},editLink(){const t=s()(this.$page.frontmatter.editLink)?this.$site.themeConfig.editLinks:this.$page.frontmatter.editLink,{repo:e,docsDir:a="",docsBranch:n="master",docsRepo:i=e}=this.$site.themeConfig;return t&&i&&this.$page.relativePath?this.createEditLink(e,i,a,n,this.$page.relativePath):null},editLinkText(){return this.$themeLocaleConfig.editLinkText||this.$site.themeConfig.editLinkText||"Edit this page"}},methods:{createEditLink(t,e,a,n,s){if(/bitbucket.org/.test(e)){return e.replace(i.a,"")+"/src"+`/${n}/`+(a?a.replace(i.a,"")+"/":"")+s+`?mode=edit&spa=0&at=${n}&fileviewer=file-view-default`}if(/gitlab.com/.test(e)){return e.replace(i.a,"")+"/-/edit"+`/${n}/`+(a?a.replace(i.a,"")+"/":"")+s}return(i.i.test(e)?e:"https://github.com/"+e).replace(i.a,"")+"/edit"+`/${n}/`+(a?a.replace(i.a,"")+"/":"")+s}}},o=(a(261),a(14)),l=Object(o.a)(r,(function(){var t=this,e=t._self._c;return e("footer",{staticClass:"page-edit"},[t.editLink?e("div",{staticClass:"edit-link"},[e("a",{attrs:{href:t.editLink,target:"_blank",rel:"noopener noreferrer"}},[t._v(t._s(t.editLinkText))]),t._v(" "),e("OutboundLink")],1):t._e(),t._v(" "),t.lastUpdated?e("div",{staticClass:"last-updated"},[e("span",{staticClass:"prefix"},[t._v(t._s(t.lastUpdatedText)+":")]),t._v(" "),e("span",{staticClass:"time"},[t._v(t._s(t.lastUpdated))])]):t._e()])}),[],!1,null,null,null);e.default=l.exports},270:function(t,e,a){"use strict";a.r(e);a(45);var n=a(241),s=a(262),i=a.n(s),r=a(248),o=a.n(r),l={name:"PageNav",props:["sidebarItems"],computed:{prev(){return c(u.PREV,this)},next(){return c(u.NEXT,this)}}};const u={NEXT:{resolveLink:function(t,e){return p(t,e,1)},getThemeLinkConfig:({nextLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.next},PREV:{resolveLink:function(t,e){return p(t,e,-1)},getThemeLinkConfig:({prevLinks:t})=>t,getPageLinkConfig:({frontmatter:t})=>t.prev}};function c(t,{$themeConfig:e,$page:a,$route:s,$site:r,sidebarItems:l}){const{resolveLink:u,getThemeLinkConfig:c,getPageLinkConfig:p}=t,d=c(e),h=p(a),f=o()(h)?d:h;return!1===f?void 0:i()(f)?Object(n.k)(r.pages,f,s.path):u(a,l)}function p(t,e,a){const n=[];!function t(e,a){for(let n=0,s=e.length;n({isSidebarOpen:!1}),computed:{shouldShowNavbar(){const{themeConfig:t}=this.$site,{frontmatter:e}=this.$page;return!1!==e.navbar&&!1!==t.navbar&&(this.$title||t.logo||t.repo||t.nav||this.$themeLocaleConfig.nav)},shouldShowSidebar(){const{frontmatter:t}=this.$page;return!t.home&&!1!==t.sidebar&&this.sidebarItems.length},sidebarItems(){return Object(o.l)(this.$page,this.$page.regularPath,this.$site,this.$localePath)},pageClasses(){const t=this.$page.frontmatter.pageClass;return[{"no-navbar":!this.shouldShowNavbar,"sidebar-open":this.isSidebarOpen,"no-sidebar":!this.shouldShowSidebar},t]}},mounted(){this.$router.afterEach(()=>{this.isSidebarOpen=!1})},methods:{toggleSidebar(t){this.isSidebarOpen="boolean"==typeof t?t:!this.isSidebarOpen,this.$emit("toggle-sidebar",this.isSidebarOpen)},onTouchStart(t){this.touchStart={x:t.changedTouches[0].clientX,y:t.changedTouches[0].clientY}},onTouchEnd(t){const e=t.changedTouches[0].clientX-this.touchStart.x,a=t.changedTouches[0].clientY-this.touchStart.y;Math.abs(e)>Math.abs(a)&&Math.abs(e)>40&&(e>0&&this.touchStart.x<=80?this.toggleSidebar(!0):this.toggleSidebar(!1))}}},u=a(14),c=Object(u.a)(l,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"theme-container",class:t.pageClasses,on:{touchstart:t.onTouchStart,touchend:t.onTouchEnd}},[t.shouldShowNavbar?e("Navbar",{on:{"toggle-sidebar":t.toggleSidebar}}):t._e(),t._v(" "),e("div",{staticClass:"sidebar-mask",on:{click:function(e){return t.toggleSidebar(!1)}}}),t._v(" "),e("Sidebar",{attrs:{items:t.sidebarItems},on:{"toggle-sidebar":t.toggleSidebar},scopedSlots:t._u([{key:"top",fn:function(){return[t._t("sidebar-top")]},proxy:!0},{key:"bottom",fn:function(){return[t._t("sidebar-bottom")]},proxy:!0}],null,!0)}),t._v(" "),t.$page.frontmatter.home?e("Home"):e("Page",{attrs:{"sidebar-items":t.sidebarItems},scopedSlots:t._u([{key:"top",fn:function(){return[t._t("page-top")]},proxy:!0},{key:"bottom",fn:function(){return[t._t("page-bottom")]},proxy:!0}],null,!0)})],1)}),[],!1,null,null,null);e.default=c.exports}}]); \ No newline at end of file diff --git a/assets/js/20.39d588d5.js b/assets/js/20.39d588d5.js new file mode 100644 index 0000000..135ea0b --- /dev/null +++ b/assets/js/20.39d588d5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{259:function(t,c,n){},272:function(t,c,n){"use strict";n(259)},285:function(t,c,n){"use strict";n.r(c);n(272);var i=n(14),s=Object(i.a)({},(function(){var t=this,c=t._self._c;return c("div",{staticClass:"sidebar-button",on:{click:function(c){return t.$emit("toggle-sidebar")}}},[c("svg",{staticClass:"icon",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",viewBox:"0 0 448 512"}},[c("path",{attrs:{fill:"currentColor",d:"M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"}})])])}),[],!1,null,null,null);c.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/21.733adc4d.js b/assets/js/21.733adc4d.js new file mode 100644 index 0000000..5589ed0 --- /dev/null +++ b/assets/js/21.733adc4d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{296:function(l,v,_){l.exports=_.p+"assets/img/Vivado.3cc10be4.png"},297:function(l,v,_){l.exports=_.p+"assets/img/Vivado1.ffa29b16.png"},321:function(l,v,_){"use strict";_.r(v);var i=_(14),s=Object(i.a)({},(function(){var l=this,v=l._self._c;return v("ContentSlotsDistributor",{attrs:{"slot-key":l.$parent.slotKey}},[v("h1",{attrs:{id:"_2023-11-15-vivado"}},[v("a",{staticClass:"header-anchor",attrs:{href:"#_2023-11-15-vivado"}},[l._v("#")]),l._v(" 2023.11.15-Vivado")]),l._v(" "),v("h2",{attrs:{id:"_1-rtl-schematic-synthesis-schematic"}},[v("a",{staticClass:"header-anchor",attrs:{href:"#_1-rtl-schematic-synthesis-schematic"}},[l._v("#")]),l._v(" 1. RTL Schematic & Synthesis Schematic")]),l._v(" "),v("p",[l._v("在 Vivado 或类似的 FPGA 开发环境中,您会遇到 RTL (Register Transfer Level) 分析中的 Schematic 和 Synthesis 过程中的 Schematic。它们虽然看起来相似,但代表了不同阶段的电路设计和功能。")]),l._v(" "),v("ol",[v("li",[v("p",[l._v("RTL Analysis Schematic:")]),l._v(" "),v("ul",[v("li",[l._v("这个 Schematic 是您用硬件描述语言(如 Verilog)编写的代码的直接可视化表示。")]),l._v(" "),v("li",[l._v("它展示了代码中定义的模块、它们的互联以及信号流。")]),l._v(" "),v("li",[l._v("RTL Schematic 重点在于逻辑功能的实现,而不是实际硬件如何实现这些功能。它更多地表示逻辑结构而非物理结构。")]),l._v(" "),v("li",[l._v("这是设计验证的早期阶段,您可以在这里检查逻辑错误或结构问题。")])]),l._v(" "),v("p",[v("img",{attrs:{src:_(296),alt:"Untitled"}})])]),l._v(" "),v("li",[v("p",[l._v("Synthesis Schematic:")]),l._v(" "),v("ul",[v("li",[l._v("经过综合后的 Schematic 是将 RTL 设计转换为实际 FPGA 内部资源(如查找表(LUTs)、寄存器和逻辑单元)的表示。")]),l._v(" "),v("li",[l._v("这个过程涉及优化、逻辑最小化、资源分配和时序分析。")]),l._v(" "),v("li",[l._v("Synthesis Schematic 展示了设计如何映射到 FPGA 的实际硬件上,包括使用的具体资源和连接。")]),l._v(" "),v("li",[l._v("这是设计流程的后期阶段,您可以在这里优化性能、资源使用和满足时序要求。")])]),l._v(" "),v("p",[v("img",{attrs:{src:_(297),alt:"Untitled"}})])])]),l._v(" "),v("p",[l._v("总结来说,RTL Schematic 关注于逻辑设计的表示,而 Synthesis Schematic 则关注于该设计在 FPGA 上的物理实现。理解两者的区别对于 FPGA 开发至关重要,因为这影响着您如何优化设计以及解决可能出现的问题。")]),l._v(" "),v("h2",{attrs:{id:"_2-project-汇总中的-lut-ff-io-bufg"}},[v("a",{staticClass:"header-anchor",attrs:{href:"#_2-project-汇总中的-lut-ff-io-bufg"}},[l._v("#")]),l._v(" 2. Project 汇总中的 LUT,FF,IO,BUFG")]),l._v(" "),v("p",[l._v("在 Vivado 或类似的 FPGA 设计项目中,您会遇到几个关键的资源指标,如 LUT、FF、IO 和 BUFG。这些指标是 FPGA 设计和资源利用的重要部分。下面是每个术语的简要解释:")]),l._v(" "),v("ol",[v("li",[l._v("LUT (Look-Up Table):\n"),v("ul",[v("li",[l._v("LUT 是 FPGA 中实现逻辑功能的基本单元。")]),l._v(" "),v("li",[l._v("它本质上是一个可编程的真值表,可以配置为执行各种逻辑操作(如 AND、OR、NOT、XOR 等)。")]),l._v(" "),v("li",[l._v("LUT 的大小和数量是 FPGA 性能和复杂性的关键决定因素。在设计中,LUT 的使用量通常是衡量设计复杂度的一个重要指标。")])])]),l._v(" "),v("li",[l._v("FF (Flip-Flop):\n"),v("ul",[v("li",[l._v("FF 是用于存储数据的基本存储元件,通常用于实现寄存器、计数器等。")]),l._v(" "),v("li",[l._v("在 FPGA 中,FF 通常与 LUT 配对使用,以实现存储和逻辑功能的组合。")]),l._v(" "),v("li",[l._v("FF 的数量通常表明了设计中的数据存储需求和时序复杂度。")])])]),l._v(" "),v("li",[l._v("IO (Input/Output Ports):\n"),v("ul",[v("li",[l._v("这些是 FPGA 与外界通信的端口,包括输入端口和输出端口。")]),l._v(" "),v("li",[l._v("IO 的数量和类型(如单端或差分)取决于 FPGA 的物理特性和您的设计需求。")]),l._v(" "),v("li",[l._v("在设计中,您需要确保 FPGA 有足够的 IO 端口来满足您的外部连接需求。")])])]),l._v(" "),v("li",[l._v("BUFG (Buffered Global Clock):\n"),v("ul",[v("li",[l._v("BUFG 是一种专用的时钟缓冲器,用于分配全局时钟信号。")]),l._v(" "),v("li",[l._v("在复杂的 FPGA 设计中,确保时钟信号的稳定和同步是非常重要的。BUFG 能够在整个芯片上稳定地分配时钟信号。")]),l._v(" "),v("li",[l._v("BUFG 的使用和配置对于实现有效的时钟管理和避免时钟偏移非常关键。")])])])]),l._v(" "),v("p",[l._v("理解这些资源对于 FPGA 设计至关重要,因为它们直接影响您的设计能否在特定的 FPGA 上实现,以及该设计的性能和效率。在 Vivado 的项目汇总中,这些参数帮助您评估设计对 FPGA 资源的利用情况。")]),l._v(" "),v("h2",{attrs:{id:"_3-fpga-的组成构造"}},[v("a",{staticClass:"header-anchor",attrs:{href:"#_3-fpga-的组成构造"}},[l._v("#")]),l._v(" 3. FPGA 的组成构造")]),l._v(" "),v("p",[l._v("FPGA (Field-Programmable Gate Array) 是一种高度灵活的可编程硬件,它由多个不同的元件构成,共同实现复杂的数字逻辑功能。以下是 FPGA 内部主要组成部分的概述:")]),l._v(" "),v("ol",[v("li",[l._v("查找表 (LUTs):\n"),v("ul",[v("li",[l._v("如您所述,LUTs 是 FPGA 的核心,用于实现基本的逻辑功能。它们通过存储预定义的输出值来模拟逻辑门的行为。")]),l._v(" "),v("li",[l._v("LUTs 可以通过编程来实现简单的逻辑操作(如 AND、OR、NOT)或更复杂的组合逻辑。")])])]),l._v(" "),v("li",[l._v("多路选择器 (MUXes):\n"),v("ul",[v("li",[l._v("虽然在传统的逻辑电路中,MUXes 是通过逻辑门实现的,但在 FPGA 中,它们通常与 LUTs 结合或独立实现。")]),l._v(" "),v("li",[l._v("MUXes 在 FPGA 设计中用于根据控制信号选择不同的输入路径,这对于创建复杂的数据路径和逻辑结构至关重要。")])])]),l._v(" "),v("li",[l._v("触发器 (Flip-Flops):\n"),v("ul",[v("li",[l._v("Flip-Flops 用于存储信息,是实现时序逻辑的关键元件。它们通常与 LUTs 配对,以构成可存储状态的逻辑单元。")])])]),l._v(" "),v("li",[l._v("编程互联资源 (Programmable Interconnects):\n"),v("ul",[v("li",[l._v("这些是连接 FPGA 内部不同部件的路径。它们可以被编程以形成任何所需的逻辑网络,从而将 LUTs、Flip-Flops 和其他资源连接起来。")])])]),l._v(" "),v("li",[l._v("输入/输出块 (I/O Blocks):\n"),v("ul",[v("li",[l._v("这些块连接 FPGA 和外部世界,提供数据输入和输出功能。它们可以配置为不同类型的接口(如单端或差分)。")])])]),l._v(" "),v("li",[l._v("专用硬件资源:\n"),v("ul",[v("li",[l._v("许多 FPGA 还包含专用的硬件资源,如 DSP (数字信号处理) 块、内存控制器、时钟管理模块(如 PLLs 和 BUFGs),以及其他特定功能块。")])])]),l._v(" "),v("li",[l._v("存储资源:\n"),v("ul",[v("li",[l._v("包括 RAM 块 (Block RAM) 或更小的存储单元,用于数据存储和缓冲。")])])])]),l._v(" "),v("p",[l._v("FPGA 的关键优势在于其高度可编程性和灵活性。设计师可以通过编程定义 LUTs、MUXes、Flip-Flops 以及互连的配置和组合方式,从而在没有物理改动硬件的情况下实现几乎任何数字逻辑设计。这种灵活性使得 FPGA 在快速原型制作、定制硬件加速和可重配置系统中非常有价值。")]),l._v(" "),v("p",[l._v("FPGA (Field-Programmable Gate Array) 是一种高度灵活的可编程硬件,它由多个不同的元件构成,共同实现复杂的数字逻辑功能。以下是 FPGA 内部主要组成部分的概述:")]),l._v(" "),v("ol",[v("li",[l._v("查找表 (LUTs):\n"),v("ul",[v("li",[l._v("如您所述,LUTs 是 FPGA 的核心,用于实现基本的逻辑功能。它们通过存储预定义的输出值来模拟逻辑门的行为。")]),l._v(" "),v("li",[l._v("LUTs 可以通过编程来实现简单的逻辑操作(如 AND、OR、NOT)或更复杂的组合逻辑。")])])]),l._v(" "),v("li",[l._v("多路选择器 (MUXes):\n"),v("ul",[v("li",[l._v("虽然在传统的逻辑电路中,MUXes 是通过逻辑门实现的,但在 FPGA 中,它们通常与 LUTs 结合或独立实现。")]),l._v(" "),v("li",[l._v("MUXes 在 FPGA 设计中用于根据控制信号选择不同的输入路径,这对于创建复杂的数据路径和逻辑结构至关重要。")])])]),l._v(" "),v("li",[l._v("触发器 (Flip-Flops):\n"),v("ul",[v("li",[l._v("Flip-Flops 用于存储信息,是实现时序逻辑的关键元件。它们通常与 LUTs 配对,以构成可存储状态的逻辑单元。")])])]),l._v(" "),v("li",[l._v("编程互联资源 (Programmable Interconnects):\n"),v("ul",[v("li",[l._v("这些是连接 FPGA 内部不同部件的路径。它们可以被编程以形成任何所需的逻辑网络,从而将 LUTs、Flip-Flops 和其他资源连接起来。")])])]),l._v(" "),v("li",[l._v("输入/输出块 (I/O Blocks):\n"),v("ul",[v("li",[l._v("这些块连接 FPGA 和外部世界,提供数据输入和输出功能。它们可以配置为不同类型的接口(如单端或差分)。")])])]),l._v(" "),v("li",[l._v("专用硬件资源:\n"),v("ul",[v("li",[l._v("许多 FPGA 还包含专用的硬件资源,如 DSP (数字信号处理) 块、内存控制器、时钟管理模块(如 PLLs 和 BUFGs),以及其他特定功能块。")])])]),l._v(" "),v("li",[l._v("存储资源:\n"),v("ul",[v("li",[l._v("包括 RAM 块 (Block RAM) 或更小的存储单元,用于数据存储和缓冲。")])])])]),l._v(" "),v("p",[l._v("FPGA 的关键优势在于其高度可编程性和灵活性。设计师可以通过编程定义 LUTs、MUXes、Flip-Flops 以及互连的配置和组合方式,从而在没有物理改动硬件的情况下实现几乎任何数字逻辑设计。这种灵活性使得 FPGA 在快速原型制作、定制硬件加速和可重配置系统中非常有价值。")])])}),[],!1,null,null,null);v.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/22.592ec894.js b/assets/js/22.592ec894.js new file mode 100644 index 0000000..0b2b5bc --- /dev/null +++ b/assets/js/22.592ec894.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{298:function(t,s,a){t.exports=a.p+"assets/img/block.b5292fb2.png"},299:function(t,s,a){t.exports=a.p+"assets/img/block1.bbc37b84.png"},322:function(t,s,a){"use strict";a.r(s);var n=a(14),v=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2023-11-16-阻塞与非阻塞赋值"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2023-11-16-阻塞与非阻塞赋值"}},[t._v("#")]),t._v(" 2023.11.16-阻塞与非阻塞赋值")]),t._v(" "),s("p",[s("img",{attrs:{src:a(298),alt:"Untitled"}})]),t._v(" "),s("p",[s("img",{attrs:{src:a(299),alt:"Untitled"}})]),t._v(" "),s("p",[t._v("组合逻辑电路使用阻塞赋值")]),t._v(" "),s("p",[t._v("时序逻辑电路使用非阻塞赋值")]),t._v(" "),s("p",[t._v("在 Verilog 中,阻塞赋值(Blocking Assignment)和非阻塞赋值(Non-Blocking Assignment)是两种不同的信号赋值方法,它们在时序逻辑的模拟和硬件描述语言(HDL)代码的编写中有着重要的区别。")]),t._v(" "),s("h3",{attrs:{id:"阻塞赋值-blocking-assignment"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#阻塞赋值-blocking-assignment"}},[t._v("#")]),t._v(" 阻塞赋值(Blocking Assignment)")]),t._v(" "),s("ul",[s("li",[t._v("使用符号 "),s("code",[t._v("=")]),t._v(" 进行赋值。")]),t._v(" "),s("li",[t._v("阻塞赋值在执行时会“阻塞”代码的进一步执行,直到赋值完成。")]),t._v(" "),s("li",[t._v("在执行下一条语句之前,当前语句必须完成其操作。")]),t._v(" "),s("li",[t._v("在组合逻辑设计中常用,但在时序逻辑中使用可能会导致问题,因为它们可能会引起模拟时序和硬件时序的不一致。")])]),t._v(" "),s("p",[t._v("举例:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("在这个例子中,"),s("code",[t._v("c = a;")]),t._v(" 会等待 "),s("code",[t._v("a = b;")]),t._v(" 完成后才执行。")]),t._v(" "),s("h3",{attrs:{id:"非阻塞赋值-non-blocking-assignment"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#非阻塞赋值-non-blocking-assignment"}},[t._v("#")]),t._v(" 非阻塞赋值(Non-Blocking Assignment)")]),t._v(" "),s("ul",[s("li",[t._v("使用符号 "),s("code",[t._v("<=")]),t._v(" 进行赋值。")]),t._v(" "),s("li",[t._v("非阻塞赋值允许代码的后续部分在赋值完成之前继续执行。")]),t._v(" "),s("li",[t._v("这意味着所有非阻塞赋值都是并行发生的(或看起来如此),这更接近于硬件的实际行为。")]),t._v(" "),s("li",[t._v("在时序逻辑,特别是在描述触发器(如寄存器)的行为时非常重要和常用。")])]),t._v(" "),s("p",[t._v("举例:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("在这个例子中,"),s("code",[t._v("c <= a;")]),t._v(" 不会等待 "),s("code",[t._v("a <= b;")]),t._v(" 的完成。"),s("code",[t._v("a")]),t._v(" 和 "),s("code",[t._v("c")]),t._v(" 的赋值看似同时发生。")]),t._v(" "),s("p",[t._v("在一个 always 块中,不同地方对同一个变量的赋值会被同时执行,最终结果是变量变成最后一次赋值的结果(前面的操作被覆盖)")])])}),[],!1,null,null,null);s.default=v.exports}}]); \ No newline at end of file diff --git a/assets/js/23.f89040fd.js b/assets/js/23.f89040fd.js new file mode 100644 index 0000000..0eaffdb --- /dev/null +++ b/assets/js/23.f89040fd.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{241:function(t,n,e){"use strict";e.d(n,"d",(function(){return r})),e.d(n,"a",(function(){return s})),e.d(n,"i",(function(){return u})),e.d(n,"f",(function(){return a})),e.d(n,"g",(function(){return l})),e.d(n,"h",(function(){return c})),e.d(n,"b",(function(){return f})),e.d(n,"e",(function(){return h})),e.d(n,"k",(function(){return p})),e.d(n,"l",(function(){return d})),e.d(n,"c",(function(){return b})),e.d(n,"j",(function(){return m}));e(45);const r=/#.*$/,i=/\.(md|html)$/,s=/\/$/,u=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(r,"").replace(i,"")}function a(t){return u.test(t)}function l(t){return/^mailto:/.test(t)}function c(t){return/^tel:/.test(t)}function f(t){if(a(t))return t;const n=t.match(r),e=n?n[0]:"",i=o(t);return s.test(i)?t:i+".html"+e}function h(t,n){const e=decodeURIComponent(t.hash),i=function(t){const n=t.match(r);if(n)return n[0]}(n);if(i&&e!==i)return!1;return o(t.path)===o(n)}function p(t,n,e){if(a(n))return{type:"external",path:n};e&&(n=function(t,n,e){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return n+t;const i=n.split("/");e&&i[i.length-1]||i.pop();const s=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(n,e,r,i=1){if("string"==typeof n)return p(e,n,r);if(Array.isArray(n))return Object.assign(p(e,n[0],r),{title:n[1]});{const s=n.children||[];return 0===s.length&&n.path?Object.assign(p(e,n.path,r),{title:n.title}):{type:"group",path:n.path,title:n.title,sidebarDepth:n.sidebarDepth,initialOpenGroupIndex:n.initialOpenGroupIndex,children:s.map(n=>t(n,e,r,i+1)),collapsable:!1!==n.collapsable}}}(t,i,e)):[]}return[]}function g(t){const n=b(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:n.map(n=>({type:"auto",title:n.title,basePath:t.path,path:t.path+"#"+n.slug,children:n.children||[]}))}]}function b(t){let n;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?n=t:n&&(n.children||(n.children=[])).push(t)}),t.filter(t=>2===t.level)}function m(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},243:function(t,n,e){"use strict";e.r(n);var r=e(241),i={name:"NavLink",props:{item:{required:!0}},computed:{link(){return Object(r.b)(this.item.link)},exact(){return this.$site.locales?Object.keys(this.$site.locales).some(t=>t===this.link):"/"===this.link},isNonHttpURI(){return Object(r.g)(this.link)||Object(r.h)(this.link)},isBlankTarget(){return"_blank"===this.target},isInternal(){return!Object(r.f)(this.link)&&!this.isBlankTarget},target(){return this.isNonHttpURI?null:this.item.target?this.item.target:Object(r.f)(this.link)?"_blank":""},rel(){return this.isNonHttpURI||!1===this.item.rel?null:this.item.rel?this.item.rel:this.isBlankTarget?"noopener noreferrer":null}},methods:{focusoutAction(){this.$emit("focusout")}}},s=e(14),u=Object(s.a)(i,(function(){var t=this,n=t._self._c;return t.isInternal?n("RouterLink",{staticClass:"nav-link",attrs:{to:t.link,exact:t.exact},nativeOn:{focusout:function(n){return t.focusoutAction.apply(null,arguments)}}},[t._v("\n "+t._s(t.item.text)+"\n")]):n("a",{staticClass:"nav-link external",attrs:{href:t.link,target:t.target,rel:t.rel},on:{focusout:t.focusoutAction}},[t._v("\n "+t._s(t.item.text)+"\n "),t.isBlankTarget?n("OutboundLink"):t._e()],1)}),[],!1,null,null,null);n.default=u.exports}}]); \ No newline at end of file diff --git a/assets/js/24.de4f222a.js b/assets/js/24.de4f222a.js new file mode 100644 index 0000000..a8bf5c2 --- /dev/null +++ b/assets/js/24.de4f222a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{300:function(t,s,a){t.exports=a.p+"assets/img/mpb.b14b24ec.png"},324:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_10-verilog-多路分支语句"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_10-verilog-多路分支语句"}},[t._v("#")]),t._v(" 10. Verilog 多路分支语句")]),t._v(" "),s("h3",{attrs:{id:"关键词-case-选择器"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#关键词-case-选择器"}},[t._v("#")]),t._v(" 关键词:case,选择器")]),t._v(" "),s("p",[t._v("case 语句是一种多路条件分支的形式,可以解决 if 语句中有多个条件选项时使用不方便的问题。")]),t._v(" "),s("h2",{attrs:{id:"case-语句"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#case-语句"}},[t._v("#")]),t._v(" case 语句")]),t._v(" "),s("p",[t._v("case 语句格式如下:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("case")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("case_expr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n condition1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" true_statement1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n condition2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" true_statement2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n ……\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" default_statement "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("endcase")]),t._v("\n")])])]),s("p",[t._v("case 语句执行时,如果 condition1 为真,则执行 true_statement1 ; 如果 condition1 为假,condition2 为真,则执行 true_statement2;依次类推。如果各个 condition 都不为真,则执行 default_statement 语句。")]),t._v(" "),s("p",[t._v("default 语句是可选的,且在一个 case 语句中不能有多个 default 语句。")]),t._v(" "),s("p",[t._v("条件选项可以有多个,不仅限于 condition1、condition2 等,而且这些条件选项不要求互斥。虽然这些条件选项是并发比较的,但执行效果是谁在前且条件为真谁被执行。")]),t._v(" "),s("p",[t._v("ture_statement1 等执行语句可以是一条语句,也可以是多条。如果是多条执行语句,则需要用 begin 与 end 关键字进行说明。")]),t._v(" "),s("h3",{attrs:{id:"case-语句支持嵌套使用。"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#case-语句支持嵌套使用。"}},[t._v("#")]),t._v(" case 语句支持嵌套使用。")]),t._v(" "),s("p",[t._v("下面用 case 语句代替 if 语句实现了一个 4 路选择器的功能。仿真结果与 testbench 可参考"),s("a",{attrs:{href:"https://www.runoob.com/w3cnote/verilog-condition-statement.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("条件语句"),s("OutboundLink")],1),t._v("一章,两者完全一致。")]),t._v(" "),s("h3",{attrs:{id:"实例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("module")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mux4to1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" sel "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" p0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" p1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" p2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" p3 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("output")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" sout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token important"}},[t._v("always @")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("case")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b00")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v(" \n sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b01")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p3 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("endcase")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" sout "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("endmodule")]),t._v("\n")])])]),s("p",[t._v("case 语句中的条件选项表单式不必都是常量,也可以是 x 值或 z 值。")]),t._v(" "),s("p",[t._v("当多个条件选项下需要执行相同的语句时,多个条件选项可以用逗号分开,放在同一个语句块的候选项中。")]),t._v(" "),s("h3",{attrs:{id:"例如-对-4-路选择器的-case-语句进行扩展-举例如下"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#例如-对-4-路选择器的-case-语句进行扩展-举例如下"}},[t._v("#")]),t._v(" 例如,对 4 路选择器的 case 语句进行扩展,举例如下:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("case")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b00")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b01")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b11")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p3 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bx0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bx1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bxz")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bxx")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b0x")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b1x")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bzx")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bxx")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bz0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bz1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bzz")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b0z")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b1z")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'bzz")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token kernel-function property"}},[t._v("$display")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Unexpected input control!!!"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("endcase")]),t._v("\n")])])]),s("h2",{attrs:{id:"casex-casez-语句"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#casex-casez-语句"}},[t._v("#")]),t._v(" "),s("code",[t._v("casex")]),t._v("/"),s("code",[t._v("casez")]),t._v(" 语句")]),t._v(" "),s("p",[t._v("casex、 casez 语句是 case 语句的变形,用来表示条件选项中的无关项。")]),t._v(" "),s("p",[t._v('casex 用 "x" 来表示无关值,casez 用问号 "?" 来表示无关值。')]),t._v(" "),s("p",[t._v("两者的实现的功能是完全一致的,语法与 case 语句也完全一致。")]),t._v(" "),s("ol",[s("li",[t._v("在 case 语句中,敏感表达式中与各项值之间的比较是一种全等比较,每一位都相同才认为匹配。")]),t._v(" "),s("li",[t._v("在 casez 语句中,如果分支表达式某些位的值为高阻 z,那么对这些位的比较就会忽略,不予考虑,而只关注其他位的比较结果。")]),t._v(" "),s("li",[t._v("在 casex 语句中,则把这种处理方式进一步扩展到对 x 的处理,即如果比较双方有一方的某些位的值是 z 或 x,那么这些位的比较就不予考虑。")])]),t._v(" "),s("p",[s("img",{attrs:{src:a(300),alt:"Untitled"}})]),t._v(" "),s("h3",{attrs:{id:"例如用-casez-语句来实现一个-4bit-控制端的-4-路选择选择器。"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#例如用-casez-语句来实现一个-4bit-控制端的-4-路选择选择器。"}},[t._v("#")]),t._v(" 例如用 casez 语句来实现一个 4bit 控制端的 4 路选择选择器。")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("module")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mux4to1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" sel "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" p0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" p1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" p2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" p3 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("output")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" sout"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token important"}},[t._v("always @")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("casez")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b???1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p0 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b??1?")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b?1??")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b1???")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" p3 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" \n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("default")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("endcase")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" sout "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sout_t "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("endmodule")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/25.44159699.js b/assets/js/25.44159699.js new file mode 100644 index 0000000..b48ba59 --- /dev/null +++ b/assets/js/25.44159699.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{301:function(t,a,s){t.exports=s.p+"assets/img/Arbiter.0f715328.png"},328:function(t,a,s){"use strict";s.r(a);var n=s(14),p=Object(n.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"_2024-02-24-2-2-combinational-logic"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-24-2-2-combinational-logic"}},[t._v("#")]),t._v(" 2024.02.24-2.2 Combinational Logic")]),t._v(" "),a("h2",{attrs:{id:"common-operators"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#common-operators"}},[t._v("#")]),t._v(" Common Operators")]),t._v(" "),a("div",{staticClass:"language-scala extra-class"},[a("pre",{pre:!0,attrs:{class:"language-scala"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MyModule "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Scala expression")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" two "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n println"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("two"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Chisel expression")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" utwo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U\n println"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("utwo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// incorrect")]),t._v("\n\t"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" twotwo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"language-scala extra-class"},[a("pre",{pre:!0,attrs:{class:"language-scala"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MyOperators "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out_add "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out_sub "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out_mul "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_add "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("U\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_sub "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_mul "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("U "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 没有参数时可以省略小括号")]),t._v("\ntest"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" MyOperators"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("c "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_add"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_sub"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_mul"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"mux-and-concatenation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mux-and-concatenation"}},[t._v("#")]),t._v(" Mux and Concatenation")]),t._v(" "),a("div",{staticClass:"language-scala extra-class"},[a("pre",{pre:!0,attrs:{class:"language-scala"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MyOperatorsTwo "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out_mux "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out_cat "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" s "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_mux "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Mux"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// should return 3.U, since s is true")]),t._v("\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_cat "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Cat"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// concatenates 2 (b10) with 1 (b1) to give 5 (101)")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nprintln"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getVerilog"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" MyOperatorsTwo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\ntest"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" MyOperatorsTwo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_mux"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out_cat"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("The "),a("code",[t._v("Mux")]),t._v(" operates like a traditional ternary operator, with the order (select, value if true, value if false)")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("Cat")]),t._v(" ordering is MSB then LSB (where B refers to bit or bits), and only takes two arguments.")]),t._v(" "),a("h2",{attrs:{id:"mac-multiply-accumulate-function"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#mac-multiply-accumulate-function"}},[t._v("#")]),t._v(" MAC: multiply accumulate function")]),t._v(" "),a("div",{staticClass:"language-scala extra-class"},[a("pre",{pre:!0,attrs:{class:"language-scala"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MAC "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_b "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_c "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_c\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ntest"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" MAC"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" cycles "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("scala"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("Random\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until cycles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Random"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_b "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Random"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_c "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Random"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in_c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" in_b "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" in_c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"arbiter"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#arbiter"}},[t._v("#")]),t._v(" Arbiter")]),t._v(" "),a("p",[t._v("The following circuit arbitrates data coming from a FIFO into two parallel processing units. The FIFO and processing elements (PEs) communicate with ready-valid interfaces. Construct the arbiter to send data to whichever PE is ready to receive data, prioritizing PE0 if both are ready to receive data. Remember that the arbiter should tell the FIFO that it's ready to receive data when at least one of the PEs can receive data. Also, wait for a PE to assert that it's ready before asserting that the data are valid. You will likely need binary operators to complete this exercise.")]),t._v(" "),a("p",[a("img",{attrs:{src:s(301),alt:"Untitled"}})]),t._v(" "),a("div",{staticClass:"language-scala extra-class"},[a("pre",{pre:!0,attrs:{class:"language-scala"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" Arbiter "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// FIFO")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" fifo_valid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" fifo_ready "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" fifo_data "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// PE0")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" pe0_valid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" pe0_ready "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" pe0_data "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// PE1")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" pe1_valid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" pe1_ready "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" pe1_data "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fifo_ready "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe0_ready "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe1_ready\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe0_valid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fifo_valid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe0_ready\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe1_valid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fifo_valid "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe0_ready "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe1_ready\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe0_data "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fifo_data\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe1_data "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fifo_data\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ntest"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Arbiter"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("scala"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("Random\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" data "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Random"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("65536")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fifo_data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fifo_valid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe0_ready"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe1_ready"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fifo_ready"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe0_valid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe1_valid"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe0_data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pe1_data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nprintln"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUCCESS!!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),a("p",[t._v("数据线(如"),a("code",[t._v("io.pe0_data")]),t._v(" 和 "),a("code",[t._v("io.pe1_data")]),t._v(")通常会持续地带有它们可能需要使用的数据信号(本例中为"),a("code",[t._v("io.fifo_data")]),t._v(")。但是,这些数据是否被“接收”或“采用”通常由"),a("code",[t._v("valid")]),t._v("信号来控制。")]),t._v(" "),a("p",[t._v("测试代码设计用来验证"),a("code",[t._v("Arbiter")]),t._v("模块的行为。测试通过随机生成一个数据,然后使用不同的组合的"),a("code",[t._v("fifo_valid")]),t._v(","),a("code",[t._v("pe0_ready")]),t._v("和"),a("code",[t._v("pe1_ready")]),t._v("信号来模拟不同的工作情况。")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("c.io.fifo_data.poke(data.U)")]),t._v("模拟从 FIFO 发送的数据。")]),t._v(" "),a("li",[t._v("循环"),a("code",[t._v("for (i <- 0 until 8)")]),t._v("遍历 8 种不同的信号组合状态。")]),t._v(" "),a("li",[a("code",[t._v("c.io.fifo_valid.poke")]),t._v(","),a("code",[t._v("c.io.pe0_ready.poke")]),t._v("和"),a("code",[t._v("c.io.pe1_ready.poke")]),t._v("根据"),a("code",[t._v("i")]),t._v("的不同值模拟不同的信号状态,使用位操作来确定每个信号是否应该被激活。")]),t._v(" "),a("li",[a("code",[t._v("c.io.fifo_ready.expect")]),t._v(","),a("code",[t._v("c.io.pe0_valid.expect")]),t._v("和"),a("code",[t._v("c.io.pe1_valid.expect")]),t._v("是对仲裁器预期行为的断言检查。")]),t._v(" "),a("li",[t._v("如果"),a("code",[t._v("i")]),t._v("的值表示 PE0 或 PE1 应该接收数据(如"),a("code",[t._v("i == 3 || i == 7")]),t._v("是 PE0,"),a("code",[t._v("i == 5")]),t._v("是 PE1),则使用"),a("code",[t._v("expect")]),t._v("断言来检查"),a("code",[t._v("io.pe0_data")]),t._v("或"),a("code",[t._v("io.pe1_data")]),t._v("与 FIFO 的数据相同。")])]),t._v(" "),a("h2",{attrs:{id:"parameterized-adder"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameterized-adder"}},[t._v("#")]),t._v(" Parameterized Adder")]),t._v(" "),a("div",{staticClass:"language-scala extra-class"},[a("pre",{pre:!0,attrs:{class:"language-scala"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" ParameterizedAdder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("saturate"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_b "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" sum "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_b\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("saturate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Mux"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sum"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("sum"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sum\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("saturate "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" Seq"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n test"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ParameterizedAdder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("saturate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 100 random tests")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" cycles "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("scala"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("Random\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("scala"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("math"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("min")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until cycles"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Random"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_b "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Random"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextInt"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("saturate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("min"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" in_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in_a "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" in_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ensure we test saturation vs. truncation")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_a"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_b"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("saturate"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("15.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("14.")]),t._v("U"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nprintln"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUCCESS!!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),a("p",[t._v("在 Chisel 中,"),a("code",[t._v("+&")]),t._v("是一个用于加法的运算符,它会考虑输入的进位,得到一个比最大输入位宽更宽的结果。如果输入是 4 位"),a("code",[t._v("UInt")]),t._v(",标准加法结果"),a("code",[t._v("io.in_a + io.in_b")]),t._v("会是 4 位,可能会截断超出的位。而"),a("code",[t._v("+&")]),t._v("加法会产生一个 5 位的结果,这可以用于在必要时实现饱和加法逻辑。连接一个 4 位的"),a("code",[t._v("UInt")]),t._v("线到一个 5 位的"),a("code",[t._v("UInt")]),t._v("线(一个 4.W 的量等于 5.W 的量),默认会截断最高位(MSB)。这样,你可以用这个方法来轻松实现非饱和加法器,只保留 5 位和的低 4 位。")])])}),[],!1,null,null,null);a.default=p.exports}}]); \ No newline at end of file diff --git a/assets/js/26.66515fc4.js b/assets/js/26.66515fc4.js new file mode 100644 index 0000000..e22cb7d --- /dev/null +++ b/assets/js/26.66515fc4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{304:function(t,s,a){t.exports=a.p+"assets/img/FSM.a8105ac5.png"},332:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-02-25-2-3-control-flow"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-25-2-3-control-flow"}},[t._v("#")]),t._v(" 2024.02.25-2.3 Control Flow")]),t._v(" "),s("h2",{attrs:{id:"last-connect-semantics"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#last-connect-semantics"}},[t._v("#")]),t._v(" Last Connect Semantics")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" LastConnect "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.")]),t._v("U\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("U\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Test LastConnect")]),t._v("\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" LastConnect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("当有多个值被赋值给一个量时,最后的那个生效")]),t._v(" "),s("h2",{attrs:{id:"when-elsewhen-and-otherwise"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#when-elsewhen-and-otherwise"}},[t._v("#")]),t._v(" "),s("code",[t._v("when")]),t._v(", "),s("code",[t._v("elsewhen")]),t._v(", and "),s("code",[t._v("otherwise")])]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("someBooleanCondition"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// things to do when true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("elsewhen"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("someOtherBooleanCondition"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// things to do on this condition")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// things to do if none of th boolean conditions are true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("code",[t._v("when")]),t._v("是一种特殊的构造,它用于硬件生成。它类似于软件编程中的"),s("code",[t._v("if")]),t._v("语句,但是在硬件描述中,"),s("code",[t._v("when")]),t._v("会生成实际的硬件逻辑,如多路复用器。而标准的"),s("code",[t._v("if")]),t._v("语句通常用于生成时(编译时)的控制流,并不直接生成硬件。"),s("code",[t._v("if")]),t._v("语句在 Scala(因此在 Chisel 的生成时)可以有返回值,可以用于赋值或者作为表达式的一部分。相比之下,"),s("code",[t._v("when")]),t._v("是一种专门为硬件设计提供的控制结构,用于生成条件硬件逻辑,如多路复用器或条件赋值,但它不返回值。因此,当你需要根据输入信号在运行时动态地选择硬件行为时,你会使用"),s("code",[t._v("when")]),t._v("。而当你在编译时根据某些条件生成不同的硬件模块时,你会使用"),s("code",[t._v("if")]),t._v("。")]),t._v(" "),s("p",[t._v("在 Scala 中,"),s("code",[t._v("==")]),t._v("用于基本类型和对象的相等性比较,而在 Chisel 中(一个建立在 Scala 之上的硬件构建语言),"),s("code",[t._v("===")]),t._v("用于硬件信号之间的相等性比较。这是因为 Chisel 需要区分硬件操作和 Scala 的软件操作,"),s("code",[t._v("===")]),t._v("在 Chisel 中被定义为生成硬件电路中的等于比较逻辑。而在 Scala 的"),s("code",[t._v("if")]),t._v("语句中,"),s("code",[t._v("==")]),t._v("仍然用于比较两个值是否相等。这种区分确保了代码的清晰性,以及硬件设计中逻辑正确性的维护。因此,在"),s("code",[t._v("when")]),t._v("中使用"),s("code",[t._v("===")]),t._v("来生成判断相等的硬件电路")]),t._v(" "),s("h2",{attrs:{id:"the-wire-construct"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#the-wire-construct"}},[t._v("#")]),t._v(" The "),s("code",[t._v("Wire")]),t._v(" Construct")]),t._v(" "),s("p",[s("code",[t._v("Wire")]),t._v("是一种基本的硬件构造类型,用于创建一个可以在模块内部读取和写入的信号。它主要用于表示组合逻辑或暂存数据,允许在硬件描述中定义中间变量或内部连接。使用"),s("code",[t._v("Wire")]),t._v("时,需要指定信号的数据类型,如"),s("code",[t._v("UInt")]),t._v("或"),s("code",[t._v("SInt")]),t._v("等。"),s("code",[t._v("Wire")]),t._v("类型的变量在定义时不持有初始值,需要在逻辑中显式赋值。在使用过程中,可以根据需要多次对其赋值,但在每个时钟周期结束时,"),s("code",[t._v("Wire")]),t._v("仅保留最后一次赋值的结果。"),s("code",[t._v("val myWire = Wire(UInt(32.W))")])]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("permutations"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("foreach "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" i0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" i1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" i2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" i3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" Nil "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Sorting ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i0")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i1")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i2")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i3")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("permutations"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("foreach "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" i0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" i1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" i2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" _ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" Nil "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Sorting ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i0")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i1")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i2")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("使用 Scala 的集合和模式匹配功能来遍历"),s("code",[t._v("List(1, 2, 3, 4)")]),t._v("的所有排列组合。"),s("code",[t._v("List(1, 2, 3, 4).permutations")]),t._v("生成一个包含所有可能排列的列表的迭代器。"),s("code",[t._v("foreach")]),t._v("循环遍历这些排列。")]),t._v(" "),s("p",[t._v("在"),s("code",[t._v("foreach")]),t._v("的代码块中,"),s("code",[t._v("case i0 :: i1 :: i2 :: i3 :: Nil =>")]),t._v("是一个模式匹配表达式,用于解构每个排列列表。这个表达式匹配一个包含四个元素的列表,将这四个元素分别绑定到变量"),s("code",[t._v("i0")]),t._v("、"),s("code",[t._v("i1")]),t._v("、"),s("code",[t._v("i2")]),t._v("、"),s("code",[t._v("i3")]),t._v("。"),s("code",[t._v("Nil")]),t._v("在这里表示列表的末尾,确保列表只有这四个元素。这种方式允许直接访问每个排列中的元素,然后可以将它们打印出来或用于其他逻辑操作。")]),t._v(" "),s("h3",{attrs:{id:"exercise-polynomial"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#exercise-polynomial"}},[t._v("#")]),t._v(" Exercise: Polynomial")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" Polynomial "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" select "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("SInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" fOfX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("SInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" result "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("SInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" square "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("SInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n square "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("x\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("select "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n result "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" square "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("S "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("S\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("elsewhen"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("select "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n result "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("S "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" square "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6.")]),t._v("S "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.")]),t._v("S\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n result "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("S "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" square "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("S "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.")]),t._v("S\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fOfX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" result\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Test Polynomial")]),t._v("\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Polynomial"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" to "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("select "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" to "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("select"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("select"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("S"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fOfX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("poly"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("select"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("S"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"exercise-finite-state-machine"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#exercise-finite-state-machine"}},[t._v("#")]),t._v(" Exercise: Finite State Machine")]),t._v(" "),s("p",[t._v("Grad students pass through four states in their career: Idle, Coding, Writing, and Graduating. These states transition based off three inputs: Coffee, Ideas they come up with, and Pressure from their advisor to make progress. Once they Graduate, they return to the Idle state. The FSM diagram below shows these states and transitions. Any unlabelled transition (i.e. when there are no inputs) returns a grad student to the Idle state instead of staying in the current state. The input precedence is coffee > idea > pressure, so when in the Idle state and receiving both coffee and pressure, a graduate student will move to the Coding state.")]),t._v(" "),s("p",[s("img",{attrs:{src:a(304),alt:"Untitled"}})]),t._v(" "),s("p",[t._v("检查逻辑:")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// state map")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" states "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coding"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"grad"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// life is full of question marks")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" gradLife "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" coffee"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" idea"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" pressure"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("coffee"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coding"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("idea"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coding"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("coffee"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coding"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("idea"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("coffee"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("idea"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"grad"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n nextState\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// some sanity checks")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("foreach"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" state "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" assert"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("gradLife"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nassert"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("gradLife"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"writing"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nassert"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("gradLife"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"coding"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nassert"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("gradLife"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nassert"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("gradLife"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"grad"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" states"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"idle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("Chisel:")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" GradLife "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" coffee "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" idea "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" pressure "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" idle "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" coding "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" writing "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" grad "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" Nil "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Enum"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" idle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("coffee"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" coding"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("elsewhen"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("idea"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" idle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("elsewhen"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" writing"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" idle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("elsewhen "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" coding"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n when "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("coffee"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" coding "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("elsewhen "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("idea "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" writing "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" idle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("elsewhen "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" writing"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n when "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("coffee "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("idea"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" writing "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("elsewhen "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" grad "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" idle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" idle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Test")]),t._v("\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" GradLife"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// verify that the hardware matches the golden model")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" to "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("coffee "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("idea "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("pressure "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("state"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("coffee"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("coffee"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("idea"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("idea"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextState"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("gradLife"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" coffee"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" idea"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" pressure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/27.bacb5b20.js b/assets/js/27.bacb5b20.js new file mode 100644 index 0000000..a7ef8eb --- /dev/null +++ b/assets/js/27.bacb5b20.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{302:function(t,s,a){t.exports=a.p+"assets/img/ShiftRegister.c44a0985.svg"},329:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-02-26-2-4-sequential-logic"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-26-2-4-sequential-logic"}},[t._v("#")]),t._v(" 2024.02.26-2.4 Sequential Logic")]),t._v(" "),s("h2",{attrs:{id:"registers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#registers"}},[t._v("#")]),t._v(" Registers")]),t._v(" "),s("p",[t._v("A "),s("code",[t._v("Reg")]),t._v(" holds its output value until the rising edge of its clock, at which time it takes on the value of its input.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" RegisterModule "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// val register : UInt = Reg(UInt(12.W))")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" register "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Reg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n register "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" register\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" RegisterModule"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUCCESS!!"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("Notice: One important note is that Chisel distinguishes between types (like "),s("code",[t._v("UInt")]),t._v(") and hardware nodes (like the literal "),s("code",[t._v("2.U")]),t._v(", or the output of "),s("code",[t._v("myReg")]),t._v(").")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// legal because a Reg needs a data type as a model")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" myReg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Reg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// error because `2.U` is already a hardware node and can't be used as a model")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" myReg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Reg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h3",{attrs:{id:"reginit"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#reginit"}},[t._v("#")]),t._v(" "),s("code",[t._v("RegInit")])]),t._v(" "),s("p",[t._v("The register in "),s("code",[t._v("RegisterModule")]),t._v(" was initialized to random data for simulation. Unless otherwised specified, registers do not have a reset value (or a reset). The way to create a register that resets to a given value is with "),s("code",[t._v("RegInit")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// The first argument is a type node that specified the datatype and its width.")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// The second argument is a hardware node that specified the reset value, in this case 0.")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" myReg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// It is a hardware node that specifies the reset value, but normally `0.U`.")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" myReg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[s("code",[t._v("RegInit")]),t._v(" 不仅初始化,也创建了这个 reg,因此不需要先创建再 init")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" RegInitModule "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" register "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n register "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" register\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"regnext"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#regnext"}},[t._v("#")]),t._v(" "),s("code",[t._v("RegNext")])]),t._v(" "),s("p",[s("code",[t._v("RegNext")]),t._v(" 在 Chisel 中是一个用于创建寄存器并在下一个时钟周期将输入信号的值传递给该寄存器的便捷方法。它简化了寄存器的声明和初始化,使得您可以轻松地创建一个将当前输入信号的值保存到下一个时钟周期的寄存器。使用"),s("code",[t._v("RegNext")]),t._v("时,可以指定一个初始值,如果不指定,则寄存器在复位时的值是未定义的")]),t._v(" "),s("p",[t._v("在 Chisel 中使用 "),s("code",[t._v("RegNext")]),t._v(" 的基本语法如下:")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" myReg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegNext"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("inputSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" initValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("ul",[s("li",[s("code",[t._v("inputSignal")]),t._v(" 是你希望在下一个时钟周期传递给寄存器的信号。")]),t._v(" "),s("li",[s("code",[t._v("initValue")]),t._v(" 是可选参数,用于指定寄存器在复位时的初始值。如果不提供初始值,寄存器在复位时的值是未定义的。")])]),t._v(" "),s("h2",{attrs:{id:"shift-register"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#shift-register"}},[t._v("#")]),t._v(" Shift Register")]),t._v(" "),s("p",[s("img",{attrs:{src:a(302),alt:"Untitled"}})]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MyShiftRegister"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" init"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" init"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" stateTemp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("asUInt\n state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" stateTemp\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" state\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" MyShiftRegister"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("init\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// poke in LSB of i (i % 2)")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// update expected state")]),t._v("\n state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0xf")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUCCESS!!"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h3",{attrs:{id:"parameterized-shift-register"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#parameterized-shift-register"}},[t._v("#")]),t._v(" Parameterized Shift Register")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// n is the output width (number of delays - 1)")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// init state to init")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MyOptionalShiftRegister"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" init"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" BigInt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" en "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("init"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("en"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" state\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// test different depths")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("65")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Testing n=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" MyOptionalShiftRegister"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" inSeq "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("init\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("en"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// poke in repeated inSeq")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" toPoke "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" inSeq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("%")]),t._v(" inSeq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("toPoke "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// update expected state")]),t._v("\n state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" toPoke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" BigInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("state"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUCCESS!!"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("Notice: Chisel 中变量被声明为常量"),s("code",[t._v("val")]),t._v(",因此一个变量只能被赋值一次,因为这表示硬件电路连接,但是会根据输入等的不同而具有不同的值。因此不能多次给一个变量赋值,如果需要,可以把中间值重新命名为一个"),s("code",[t._v("val")]),t._v("来调用")]),t._v(" "),s("h2",{attrs:{id:"appendix-explicit-clock-and-reset"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#appendix-explicit-clock-and-reset"}},[t._v("#")]),t._v(" Appendix: Explicit clock and reset")]),t._v(" "),s("p",[t._v("Chisel 模块默认使用隐式的时钟和复位信号,每个内部创建的寄存器都会使用这些默认信号。在某些情况下,你可能需要覆盖这种默认行为,比如使用生成时钟或复位信号的黑盒,或者设计多时钟系统。Chisel 提供了"),s("code",[t._v("withClock() {}")]),t._v("、"),s("code",[t._v("withReset() {}")]),t._v("和"),s("code",[t._v("withClockAndReset() {}")]),t._v("等构造来处理这些情况,允许分别或同时覆盖时钟和复位。需要注意的是,至本教程编写时,复位信号总是同步的并且是"),s("code",[t._v("Bool")]),t._v("类型。时钟在 Chisel 中有其自身的类型("),s("code",[t._v("Clock")]),t._v("),并且应该相应声明。"),s("code",[t._v("Bool")]),t._v("类型可以通过调用"),s("code",[t._v("asClock()")]),t._v("转换为"),s("code",[t._v("Clock")]),t._v("类型,但需要确保这样做是合理的。同时,"),s("code",[t._v("chisel-testers")]),t._v("目前对多时钟设计的支持并不完全。")]),t._v(" "),s("h3",{attrs:{id:"example-multi-clock-module"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-multi-clock-module"}},[t._v("#")]),t._v(" Example: Multi-Clock Module")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// we need to import multi-clock features")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("chisel3"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("experimental"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("withClock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" withReset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" withClockAndReset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" ClockExamples "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" alternateReset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" alternateClock "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" outImplicit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" outAlternateReset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" outAlternateClock "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" outAlternateBoth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" imp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n imp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("outImplicit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" imp\n\n withReset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("alternateReset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// everything in this scope with have alternateReset as the reset")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" altRst "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n altRst "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("outAlternateReset "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" altRst\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n withClock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("alternateClock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" altClk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n altClk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("outAlternateClock "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" altClk\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n withClockAndReset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("alternateClock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("alternateReset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" alt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n alt "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("outAlternateBoth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" alt\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getVerilog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ClockExamples"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("通过"),s("code",[t._v("import chisel3.experimental.{withClock, withReset, withClockAndReset}")]),t._v("引入了多时钟特性。"),s("code",[t._v("ClockExamples")]),t._v("模块定义了一个 10 位宽的输入"),s("code",[t._v("io.in")]),t._v(",以及替代的复位和时钟信号"),s("code",[t._v("io.alternateReset")]),t._v("和"),s("code",[t._v("io.alternateClock")]),t._v("。模块输出了四种不同情况下的寄存器值:使用默认时钟和复位、只替换复位、只替换时钟、同时替换时钟和复位。")]),t._v(" "),s("ol",[s("li",[s("code",[t._v("withReset(io.alternateReset) {...}")]),t._v("块定义了一个新的作用域,其中所有寄存器的复位信号被替换为"),s("code",[t._v("io.alternateReset")]),t._v("。在这个作用域内,"),s("code",[t._v("altRst")]),t._v("寄存器在被替代复位信号复位时初始化为 0,并在每个时钟周期将"),s("code",[t._v("io.in")]),t._v("的值赋给它。")]),t._v(" "),s("li",[s("code",[t._v("withClock(io.alternateClock) {...}")]),t._v("块定义了另一个作用域,其中所有寄存器的时钟信号被替换为"),s("code",[t._v("io.alternateClock")]),t._v("。在这个作用域内,"),s("code",[t._v("altClk")]),t._v("寄存器在被替代时钟信号驱动时初始化为 0,并在每个时钟周期将"),s("code",[t._v("io.in")]),t._v("的值赋给它。")]),t._v(" "),s("li",[s("code",[t._v("withClockAndReset(io.alternateClock, io.alternateReset) {...}")]),t._v("块同时替换了寄存器的时钟和复位信号为"),s("code",[t._v("io.alternateClock")]),t._v("和"),s("code",[t._v("io.alternateReset")]),t._v("。在这个作用域内,"),s("code",[t._v("alt")]),t._v("寄存器同时被替代的时钟和复位信号控制,初始化为 0,并在每个时钟周期将"),s("code",[t._v("io.in")]),t._v("的值赋给它。")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/28.a73d14ca.js b/assets/js/28.a73d14ca.js new file mode 100644 index 0000000..8901f2f --- /dev/null +++ b/assets/js/28.a73d14ca.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{303:function(t,s,a){t.exports=a.p+"assets/img/FIR.5888a130.jpeg"},330:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-02-28-2-5-fir-filter"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-28-2-5-fir-filter"}},[t._v("#")]),t._v(" 2024.02.28-2.5 FIR Filter")]),t._v(" "),s("p",[s("img",{attrs:{src:a(303),alt:"Untitled"}})]),t._v(" "),s("p"),s("p",[s("mjx-container",{staticClass:"MathJax",attrs:{jax:"CHTML",display:"true"}},[s("mjx-math",{staticClass:"MJX-TEX",attrs:{display:"true"}},[s("mjx-mi",{staticClass:"mjx-i"},[s("mjx-c",{attrs:{c:"y"}})],1),s("mjx-mo",{staticClass:"mjx-n"},[s("mjx-c",{attrs:{c:"["}})],1),s("mjx-mi",{staticClass:"mjx-i"},[s("mjx-c",{attrs:{c:"n"}})],1),s("mjx-mo",{staticClass:"mjx-n"},[s("mjx-c",{attrs:{c:"]"}})],1),s("mjx-mo",{staticClass:"mjx-n",attrs:{space:"4"}},[s("mjx-c",{attrs:{c:"="}})],1),s("mjx-msub",{attrs:{space:"4"}},[s("mjx-mi",{staticClass:"mjx-i",attrs:{noIC:"true"}},[s("mjx-c",{attrs:{c:"b"}})],1),s("mjx-script",{staticStyle:{"vertical-align":"-0.15em"}},[s("mjx-mn",{staticClass:"mjx-n",attrs:{size:"s"}},[s("mjx-c",{attrs:{c:"0"}})],1)],1)],1),s("mjx-mi",{staticClass:"mjx-i"},[s("mjx-c",{attrs:{c:"x"}})],1),s("mjx-mo",{staticClass:"mjx-n"},[s("mjx-c",{attrs:{c:"["}})],1),s("mjx-mi",{staticClass:"mjx-i"},[s("mjx-c",{attrs:{c:"n"}})],1),s("mjx-mo",{staticClass:"mjx-n"},[s("mjx-c",{attrs:{c:"]"}})],1),s("mjx-mo",{staticClass:"mjx-n",attrs:{space:"3"}},[s("mjx-c",{attrs:{c:"+"}})],1),s("mjx-msub",{attrs:{space:"3"}},[s("mjx-mi",{staticClass:"mjx-i",attrs:{noIC:"true"}},[s("mjx-c",{attrs:{c:"b"}})],1),s("mjx-script",{staticStyle:{"vertical-align":"-0.15em"}},[s("mjx-mn",{staticClass:"mjx-n",attrs:{size:"s"}},[s("mjx-c",{attrs:{c:"1"}})],1)],1)],1),s("mjx-mi",{staticClass:"mjx-i"},[s("mjx-c",{attrs:{c:"x"}})],1),s("mjx-mo",{staticClass:"mjx-n"},[s("mjx-c",{attrs:{c:"["}})],1),s("mjx-mi",{staticClass:"mjx-i"},[s("mjx-c",{attrs:{c:"n"}})],1),s("mjx-mo",{staticClass:"mjx-n",attrs:{space:"3"}},[s("mjx-c",{attrs:{c:"2212"}})],1),s("mjx-mn",{staticClass:"mjx-n",attrs:{space:"3"}},[s("mjx-c",{attrs:{c:"1"}})],1),s("mjx-mo",{staticClass:"mjx-n"},[s("mjx-c",{attrs:{c:"]"}})],1),s("mjx-mo",{staticClass:"mjx-n",attrs:{space:"3"}},[s("mjx-c",{attrs:{c:"+"}})],1),s("mjx-msub",{attrs:{space:"3"}},[s("mjx-mi",{staticClass:"mjx-i",attrs:{noIC:"true"}},[s("mjx-c",{attrs:{c:"b"}})],1),s("mjx-script",{staticStyle:{"vertical-align":"-0.15em"}},[s("mjx-mn",{staticClass:"mjx-n",attrs:{size:"s"}},[s("mjx-c",{attrs:{c:"2"}})],1)],1)],1),s("mjx-mi",{staticClass:"mjx-i"},[s("mjx-c",{attrs:{c:"x"}})],1),s("mjx-mo",{staticClass:"mjx-n"},[s("mjx-c",{attrs:{c:"["}})],1),s("mjx-mi",{staticClass:"mjx-i"},[s("mjx-c",{attrs:{c:"n"}})],1),s("mjx-mo",{staticClass:"mjx-n",attrs:{space:"3"}},[s("mjx-c",{attrs:{c:"2212"}})],1),s("mjx-mn",{staticClass:"mjx-n",attrs:{space:"3"}},[s("mjx-c",{attrs:{c:"2"}})],1),s("mjx-mo",{staticClass:"mjx-n"},[s("mjx-c",{attrs:{c:"]"}})],1),s("mjx-mo",{staticClass:"mjx-n",attrs:{space:"3"}},[s("mjx-c",{attrs:{c:"+"}})],1),s("mjx-mo",{staticClass:"mjx-n",attrs:{space:"3"}},[s("mjx-c",{attrs:{c:"22EF"}})],1)],1)],1)],1),s("p"),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" My4ElementFir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("b0"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b2"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b3"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg_1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg_2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg_3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n reg_1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n reg_2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" reg_1\n reg_3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" reg_2\n\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 或者使用RegNext来一并定义初始化及赋值")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg_1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegNext"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg_2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegNext"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reg_1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg_3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegNext"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("reg_2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" b0"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" b1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" reg_1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" b2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" reg_2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" b3"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" reg_3\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"fir-filter-generator"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#fir-filter-generator"}},[t._v("#")]),t._v(" FIR Filter Generator")]),t._v(" "),s("p",[t._v("一个有限脉冲响应(FIR)滤波器生成器。生成器的"),s("code",[t._v("length")]),t._v("参数决定了滤波器的抽头数目,即滤波器的长度。这个生成器有三个输入:"),s("code",[t._v("in")]),t._v("(滤波器的输入信号)、"),s("code",[t._v("valid")]),t._v("(一个布尔值,表示输入是否有效)和"),s("code",[t._v("consts")]),t._v("(一个向量,包含所有抽头的系数)。还有一个输出"),s("code",[t._v("out")]),t._v(",即滤波器的输出。")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("taps")]),t._v("是一个序列,包含输入和一系列寄存器,用于实现滤波器的延迟线。")]),t._v(" "),s("li",[t._v("当"),s("code",[t._v("valid")]),t._v("信号为真时,序列中的每个元素(除了第一个)被更新为前一个元素的值。")]),t._v(" "),s("li",[t._v("输出"),s("code",[t._v("out")]),t._v("是抽头值和对应系数乘积之和。")])]),t._v(" "),s("p",[t._v("这个结构允许滤波器动态处理不同长度的输入,通过改变"),s("code",[t._v("consts")]),t._v("向量的内容来改变滤波器的特性。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MyManyDynamicElementVecFir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" valid "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" consts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Such concision! You'll learn what all this means later.")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" taps "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fill"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("zip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tail"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("foreach "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" when "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" b "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" a "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("zip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" b "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("reduce"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nvisualize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" MyManyDynamicElementVecFir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("ol",[s("li",[s("p",[s("code",[t._v("val io = IO(new Bundle {...})")]),t._v("定义了模块的接口,包括 8 位宽的输入"),s("code",[t._v("in")]),t._v(",一个有效信号"),s("code",[t._v("valid")]),t._v(",8 位宽输出"),s("code",[t._v("out")]),t._v(",和长度为"),s("code",[t._v("length")]),t._v("的系数向量"),s("code",[t._v("consts")]),t._v("。")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("val taps = Seq(io.in) ++ Seq.fill(io.consts.length - 1)(RegInit(0.U(8.W)))")]),t._v("这行代码在 FIR 滤波器实现中创建了一个名为"),s("code",[t._v("taps")]),t._v("的序列,用于存储当前和之前的输入值,从而实现数据的时间序列延迟。首先,它将输入信号"),s("code",[t._v("io.in")]),t._v("作为序列的第一个元素。随后,使用"),s("code",[t._v("++")]),t._v("操作符将"),s("code",[t._v("io.in")]),t._v("与一个新的序列连接起来,后者通过"),s("code",[t._v("Seq.fill(io.consts.length - 1)(RegInit(0.U(8.W)))")]),t._v("创建,其中包含"),s("code",[t._v("length - 1")]),t._v("个初始化为 0 的 8 位寄存器。这样,"),s("code",[t._v("taps")]),t._v("序列就包含了一个输入信号和"),s("code",[t._v("length - 1")]),t._v("个延迟寄存器,总共"),s("code",[t._v("length")]),t._v("个元素,每个元素对应滤波器的一个抽头。在 Chisel 中,虽然"),s("code",[t._v("io.in")]),t._v("不是寄存器,但"),s("code",[t._v("taps")]),t._v("序列可以包含不同类型的元素,因为在 Chisel 里,所有这些都被视为"),s("code",[t._v("Data")]),t._v("类型的子类,可以被综合为硬件。在这个上下文中,"),s("code",[t._v("io.in")]),t._v("是直接的输入信号,而后续元素是寄存器类型,但它们共同构成了一个序列,用于表示滤波器的不同时间点上的信号值。这种混合类型的序列是可行的,并可以在 Chisel 生成的硬件中正确表达相应的逻辑。")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("taps.zip(taps.tail).foreach { case (a, b) => when (io.valid) { b := a } }")]),t._v("在输入"),s("code",[t._v("valid")]),t._v("为真时,将"),s("code",[t._v("taps")]),t._v("序列中每个元素的值传递到下一个元素,实现数据在寄存器间的移动。")]),t._v(" "),s("p",[s("code",[t._v("zip")]),t._v("是一个方法,它将两个集合中对应位置的元素组成一对,生成一个新的集合。在这里,"),s("code",[t._v("taps.zip(taps.tail)")]),t._v("的作用是将"),s("code",[t._v("taps")]),t._v("列表中的每个元素与其后面的元素配对。"),s("code",[t._v("tail")]),t._v("是一个方法,返回除第一个元素外的列表所有元素。例如,如果"),s("code",[t._v("taps")]),t._v("是"),s("code",[t._v("[in, reg1, reg2, reg3]")]),t._v(",那么"),s("code",[t._v("taps.tail")]),t._v("就是"),s("code",[t._v("[reg1, reg2, reg3]")]),t._v("。"),s("code",[t._v("taps.zip(taps.tail)")]),t._v("的结果将是"),s("code",[t._v("[(in, reg1), (reg1, reg2), (reg2, reg3)]")]),t._v("。这样,"),s("code",[t._v("foreach")]),t._v("就可以遍历这些配对,根据"),s("code",[t._v("valid")]),t._v("信号更新寄存器的值,实现数据的逐级传递。")]),t._v(" "),s("p",[s("code",[t._v("case (a, b) =>")]),t._v("是模式匹配的语法,用于解构元组,将"),s("code",[t._v("zip")]),t._v("操作生成的元素对分别赋值给"),s("code",[t._v("a")]),t._v("(当前元素)和"),s("code",[t._v("b")]),t._v("(下一个元素)。")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("io.out := taps.zip(io.consts).map { case (a, b) => a * b }.reduce(_ + _)")]),t._v("计算输出"),s("code",[t._v("out")]),t._v(",即将每个延迟元素与其对应的系数相乘,并将所有乘积求和得到最终结果。")]),t._v(" "),s("p",[t._v("在这段代码中,"),s("code",[t._v("map")]),t._v("和"),s("code",[t._v("reduce")]),t._v("是 Scala 中的集合操作方法:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("map")]),t._v(":对集合中的每个元素应用一个函数。这里"),s("code",[t._v("map { case (a, b) => a * b }")]),t._v("对每对"),s("code",[t._v("(a, b)")]),t._v("应用乘法操作,"),s("code",[t._v("a")]),t._v("来自"),s("code",[t._v("taps")]),t._v(","),s("code",[t._v("b")]),t._v("来自"),s("code",[t._v("io.consts")]),t._v(",分别代表寄存器中的数据和滤波器的系数。")]),t._v(" "),s("li",[s("code",[t._v("reduce")]),t._v(":对集合中的元素应用一个二元操作,逐步将集合减少为单一结果。这里的"),s("code",[t._v("reduce(_ + _)")]),t._v("将所有乘法结果相加,得到最终的滤波输出。")])]),t._v(" "),s("p",[t._v("不使用"),s("code",[t._v("foreach")]),t._v("是因为"),s("code",[t._v("foreach")]),t._v("仅用于执行操作而不返回结果,而这里的目的是计算经过滤波器后的输出值,需要通过"),s("code",[t._v("map")]),t._v("和"),s("code",[t._v("reduce")]),t._v("聚合计算结果。")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/29.dc4cc635.js b/assets/js/29.dc4cc635.js new file mode 100644 index 0000000..c4769a3 --- /dev/null +++ b/assets/js/29.dc4cc635.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{305:function(t,s,a){t.exports=a.p+"assets/img/4-inputSort.a02239ea.png"},333:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-03-01-3-1-generators-parameters"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-01-3-1-generators-parameters"}},[t._v("#")]),t._v(" 2024.03.01-3.1 Generators: Parameters")]),t._v(" "),s("h2",{attrs:{id:"parameter-passing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#parameter-passing"}},[t._v("#")]),t._v(" Parameter Passing")]),t._v(" "),s("h3",{attrs:{id:"example-parameterized-scala-object"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-parameterized-scala-object"}},[t._v("#")]),t._v(" Example: Parameterized Scala Object")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" ParameterizedScalaObject"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("param1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" param2"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"I have parameters: param1 = ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("param1")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" and param2 = ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("param2")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" obj1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ParameterizedScalaObject"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Hello"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" obj2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ParameterizedScalaObject"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"World"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h3",{attrs:{id:"example-parameterized-chisel-object"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-parameterized-chisel-object"}},[t._v("#")]),t._v(" Example: Parameterized Chisel Object")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" ParameterizedWidthAdder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in0Width"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" in1Width"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" sumWidth"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n require"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in0Width "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n require"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in1Width "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n require"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sumWidth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in0Width"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in1Width"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" sum "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sumWidth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// a +& b includes the carry, a + b does not")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sum "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in1\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getVerilog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ParameterizedWidthAdder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("The above code block has some "),s("code",[t._v("require(...)")]),t._v(" statements. These are pre-elaboration assertions, which are useful when your generator only works with certain parameterizations or when some parameterizations are mutually exclusive or nonsensical. The above code block checks that widths are non-negative.")]),t._v(" "),s("h3",{attrs:{id:"example-parameterized-4-input-sort"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-parameterized-4-input-sort"}},[t._v("#")]),t._v(" Example: Parameterized 4-input Sort")]),t._v(" "),s("p",[s("img",{attrs:{src:a(305),alt:"Untitled"}})]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" Sort4 sorts its "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v(" inputs to "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("its")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v(" outputs "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" Sort4"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ascending"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// this comparison funtion decides < or > based on the module's parameterization")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" comp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("l"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" r"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Bool "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ascending"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n l "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" r\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n l "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" r\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" row10 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" row11 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" row12 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" row13 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("comp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in0"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n row10 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in0 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// preserve first two elements")]),t._v("\n row11 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in1\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n row10 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in1 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// swap first two elements")]),t._v("\n row11 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in0\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("comp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in3"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n row12 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in2 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// preserve last two elements")]),t._v("\n row13 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in3\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n row12 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in3 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// swap last two elements")]),t._v("\n row13 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in2\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" row21 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" row22 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("comp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("row11"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" row12"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n row21 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row11 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// preserve middle 2 elements")]),t._v("\n row22 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row12\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n row21 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row12 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// swap middle two elements")]),t._v("\n row22 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row11\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" row20 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" row23 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("comp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("row10"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" row13"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n row20 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row10 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// preserve the first and the forth elements")]),t._v("\n row23 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row13\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n row20 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row13 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// swap the first and the forth elements")]),t._v("\n row23 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row10\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("comp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("row20"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" row21"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row20 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// preserve first two elements")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row21\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row21 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// swap first two elements")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row20\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("comp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("row22"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" row23"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row22 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// preserve first two elements")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row23\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row23 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// swap first two elements")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" row22\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"option-and-defualt-arguments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#option-and-defualt-arguments"}},[t._v("#")]),t._v(" Option and Defualt Arguments")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" map "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("get"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" b "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("get"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("在 Scala 中,"),s("code",[t._v("Map.get(key)")]),t._v("方法返回一个"),s("code",[t._v("Option")]),t._v("类型:如果键存在,则返回"),s("code",[t._v("Some(value)")]),t._v(";如果键不存在,则返回"),s("code",[t._v("None")]),t._v("。在您的例子中,"),s("code",[t._v('map.get("a")')]),t._v("返回"),s("code",[t._v("Some(1)")]),t._v(',因为"a"是映射中的一个键,值为 1。然而,'),s("code",[t._v('map.get("b")')]),t._v("返回"),s("code",[t._v("None")]),t._v(',因为"b"不是映射中的键。'),s("code",[t._v("Some")]),t._v("和"),s("code",[t._v("None")]),t._v("用于 Scala 中以安全且表达性的方式处理值的存在或缺失,避免空指针异常。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" some "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Some"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" none "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" None\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("some"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("get"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Returns 1")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// println(none.get) // Errors!")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("some"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("getOrElse"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Returns 1")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("none"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("getOrElse"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Returns 2")]),t._v("\n")])])]),s("p",[s("code",[t._v("getOrElse")]),t._v("是一个常用于"),s("code",[t._v("Option")]),t._v("类型的方法,它允许你为"),s("code",[t._v("Option")]),t._v("可能不包含值(即为"),s("code",[t._v("None")]),t._v(")的情况提供一个默认值。"),s("code",[t._v("getOrElse")]),t._v("接受一个参数,这个参数是当"),s("code",[t._v("Option")]),t._v("为"),s("code",[t._v("None")]),t._v("时将返回的值。如果"),s("code",[t._v("Option")]),t._v("是"),s("code",[t._v("Some")]),t._v(",则"),s("code",[t._v("getOrElse")]),t._v("会返回包裹在"),s("code",[t._v("Some")]),t._v("中的值。")]),t._v(" "),s("h3",{attrs:{id:"options-for-parameters-with-defaults"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#options-for-parameters-with-defaults"}},[t._v("#")]),t._v(" Options for Parameters with Defaults")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" DelayBy1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("resetValue"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Option"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" None"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("resetValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("isDefined"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// resetValue = Some(number)")]),t._v("\n RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("resetValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("get"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//resetValue = None")]),t._v("\n Reg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n reg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" reg\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getVerilog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" DelayBy1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getVerilog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" DelayBy1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Some"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("将 "),s("code",[t._v("resetValue")]),t._v(" 默认初始化为 "),s("code",[t._v("Option[UInt] = None")]),t._v(","),s("code",[t._v("Reg(UInt())")]),t._v(" 可以从上下文中自动推断,不过最好还是指定位宽")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 还可以用match来实现ifelse")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" DelayBy1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("resetValue"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Option"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" None"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" resetValue "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" Some"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("r"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("r"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" None "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" Reg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n reg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" reg\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"match-case-statements"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#match-case-statements"}},[t._v("#")]),t._v(" Match/Case Statements")]),t._v(" "),s("p",[t._v("Scala 中的匹配概念在 Chisel 中被广泛使用,是每个 Chisel 程序员必须理解的基础知识。Scala 提供的 match 操作符支持以下功能:")]),t._v(" "),s("ul",[s("li",[t._v("用于检测多种情况的简单测试,类似于 C 语言中的 switch 语句。")]),t._v(" "),s("li",[t._v("对值的复杂组合进行测试。")]),t._v(" "),s("li",[t._v("根据变量的类型采取行动,当变量类型未知或未完全指定时,例如:\n"),s("ul",[s("li",[t._v("从异构列表中取变量,如"),s("code",[t._v('val mixedList = List(1, "string", false)')]),t._v("。")]),t._v(" "),s("li",[t._v("变量已知属于一个超类,但不确定是哪个具体的子类。")])])]),t._v(" "),s("li",[t._v("使用正则表达式提取字符串的子串。")])]),t._v(" "),s("h3",{attrs:{id:"example-value-matching"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-value-matching"}},[t._v("#")]),t._v(" Example: Value Matching")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// y is an integer variable defined somewhere else in the code")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" y "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/// ...")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" y "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"zero"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// One common syntax, preferred if fits in one line")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Another common syntax, preferred if does not fit in one line.")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"one"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Note the code block continues until the next case")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Another syntax, but curly braces are not required")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"two"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" _ "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"many"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// _ is a wildcard that matches all values")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"y is "')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// out: y is many")]),t._v("\n")])])]),s("p",[t._v("y 为 7,不匹配,因此采用默认值")]),t._v(" "),s("ul",[s("li",[t._v("每个跟在"),s("code",[t._v("=>")]),t._v("操作符后面的代码块都会继续执行,直到它到达"),s("code",[t._v("match")]),t._v("的结束大括号或下一个"),s("code",[t._v("case")]),t._v("语句。")]),t._v(" "),s("li",[s("code",[t._v("match")]),t._v("会按照"),s("code",[t._v("case")]),t._v("语句的顺序进行搜索,一旦匹配到一个"),s("code",[t._v("case")]),t._v("语句,就不会再对其他"),s("code",[t._v("case")]),t._v("语句进行检查。")]),t._v(" "),s("li",[t._v("使用下划线"),s("code",[t._v("_")]),t._v("作为通配符,来处理任何未找到匹配的值。")])]),t._v(" "),s("h3",{attrs:{id:"example-multiple-value-matching"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-multiple-value-matching"}},[t._v("#")]),t._v(" Example: Multiple Value Matching")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" animalType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("biggerThanBreadBox"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" meanAsCanBe"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("biggerThanBreadBox"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" meanAsCanBe"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"wolverine"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"elephant"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"shrew"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"puppy"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("animalType"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// wolverine")]),t._v("\n")])])]),s("h3",{attrs:{id:"example-type-matching"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-type-matching"}},[t._v("#")]),t._v(" Example: Type Matching")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" sequence "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nsequence"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("foreach "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n x "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is a String"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is an Int"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Double")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is a Double"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" _ "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is an unknown type!"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("code",[t._v("Seq")]),t._v("是 Scala 集合中的一个接口,它代表序列,而"),s("code",[t._v("List")]),t._v("是"),s("code",[t._v("Seq")]),t._v("的一个具体实现。在这个例子中,可以直接用"),s("code",[t._v('List("a", 1, 0.0)')]),t._v("来代替"),s("code",[t._v('Seq("a", 1, 0.0)')]),t._v(",而不会影响"),s("code",[t._v("foreach")]),t._v("和"),s("code",[t._v("match")]),t._v("语句的行为。")]),t._v(" "),s("h3",{attrs:{id:"example-multiple-type-matching"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-multiple-type-matching"}},[t._v("#")]),t._v(" Example: Multiple Type Matching")]),t._v(" "),s("p",[t._v("If you want to match on whether a value has one of many types, use the following syntax. Note that you must use an "),s("code",[t._v("_")]),t._v(" when matching.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" sequence "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nsequence"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("foreach "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n x "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Double")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is a number!"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" _ "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is an unknown type!"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"example-type-matching-and-erasure"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-type-matching-and-erasure"}},[t._v("#")]),t._v(" Example: Type Matching and Erasure")]),t._v(" "),s("p",[t._v("类型匹配在 Scala 中有一些限制。由于 Scala 运行在 JVM 上,而 JVM 不保持多态类型信息,因此你不能在运行时基于它们进行匹配(因为这些类型信息已被擦除)。注意下面的例子始终匹配第一个 case 语句,因为"),s("code",[t._v("[String]")]),t._v("、"),s("code",[t._v("[Int]")]),t._v("、"),s("code",[t._v("[Double]")]),t._v("这些多态类型在运行时被擦除了,case 语句实际上只是在匹配"),s("code",[t._v("Seq")]),t._v("。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" sequence "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nsequence"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("foreach "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n x "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is a String"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is an Int"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Double")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("x")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' is a Double"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("在 Scala 中,类型擦除指的是 JVM 在运行时不保留泛型的具体类型信息。因此,当你对"),s("code",[t._v("Seq[String]")]),t._v("、"),s("code",[t._v("Seq[Int]")]),t._v("或"),s("code",[t._v("Seq[Double]")]),t._v("进行模式匹配时,JVM 实际上无法区分这些"),s("code",[t._v("Seq")]),t._v("的元素类型,因为泛型信息"),s("code",[t._v("[String]")]),t._v("、"),s("code",[t._v("[Int]")]),t._v("、"),s("code",[t._v("[Double]")]),t._v("已经被擦除,只留下了基础的"),s("code",[t._v("Seq")]),t._v("类型。所以,这些 case 语句在运行时都被视为对"),s("code",[t._v("Seq")]),t._v("类型的匹配,而无法区分具体是哪种"),s("code",[t._v("Seq")]),t._v("。因此,匹配总是成功于第一个 case,无论其实际参数是什么类型的"),s("code",[t._v("Seq")]),t._v("。这就是为什么在运行时你看到的行为似乎是它总是匹配"),s("code",[t._v("Seq")]),t._v("的原因。")]),t._v(" "),s("h2",{attrs:{id:"ios-with-optional-fields"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ios-with-optional-fields"}},[t._v("#")]),t._v(" IOs with Optional Fields")]),t._v(" "),s("p",[t._v("有时我们希望 IO 端口能够根据需要选择性地包含或排除。例如,在调试时可能需要查看一些内部状态,但在生成器用于系统时希望将其隐藏。或者,你的生成器可能有一些输入在某些情况下不需要连接,因为存在合理的默认值。")]),t._v(" "),s("h3",{attrs:{id:"example-optional-io-with-option"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-optional-io-with-option"}},[t._v("#")]),t._v(" Example: Optional IO with Option")]),t._v(" "),s("p",[t._v("示例中展示了一个可选地接收进位信号的一位加法器。如果包含进位,"),s("code",[t._v("io.carryIn")]),t._v("将是"),s("code",[t._v("Some[UInt]")]),t._v("类型并包含在 IO 束中;如果不包含进位,"),s("code",[t._v("io.carryIn")]),t._v("将是"),s("code",[t._v("None")]),t._v("类型并从 IO 束中排除。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" HalfFullAdder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" hasCarry"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" b "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" carryIn "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hasCarry"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" Some"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" None\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" carryOut "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" sum "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("b "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("carryIn"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("getOrElse"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sum"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("carryOut "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sum"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"example-optional-io-with-zero-width-wires"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-optional-io-with-zero-width-wires"}},[t._v("#")]),t._v(" Example: Optional IO with Zero-Width Wires")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" HalfFullAdder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" hasCarry"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" b "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" carryIn "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("hasCarry"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" carryOut "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" sum "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("b "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("carryIn\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sum"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("carryOut "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" sum"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("也可以用一个 0 宽度的 wire 来代替 None。An IO with width zero is pruned from the emitted Verilog, and anything that tries to use the value of a zero-width wire gets a constant zero.")]),t._v(" "),s("h2",{attrs:{id:"implicits"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implicits"}},[t._v("#")]),t._v(" Implicits")]),t._v(" "),s("p",[t._v("为了减少大量重复的模板代码,Scala 引入了*隐式(implicits)*的概念,允许编译器为你自动进行一些语法简化。由于很多操作是在背后进行,隐式使用可能显得很神奇。")]),t._v(" "),s("h3",{attrs:{id:"implicit-arguments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implicit-arguments"}},[t._v("#")]),t._v(" Implicit Arguments")]),t._v(" "),s("p",[t._v("隐式参数的一个常见用途是当你的代码在深层的函数调用中需要访问某个顶层变量时,可以使用隐式参数自动传递这个变量,而不是手动在每个函数调用中传递它。")]),t._v(" "),s("h3",{attrs:{id:"example-implicit-cats"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-implicit-cats"}},[t._v("#")]),t._v(" Example: Implicit Cats")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("object")]),t._v(" CatDog "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implicit")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" numberOfCats"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//implicit val numberOfDogs: Int = 5")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" tooManyCats"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("nDogs"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implicit")]),t._v(" nCats"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" nCats "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" nDogs\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" imp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tooManyCats"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Argument passed implicitly!")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" exp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tooManyCats"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Argument passed explicitly!")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nCatDog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("imp\nCatDog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("exp\n")])])]),s("p",[t._v("首先,我们定义了一个隐式值"),s("code",[t._v("numberOfCats")]),t._v("。在给定的作用域中,同一类型的隐式值只能有一个。然后,我们定义了一个函数,它接受两个参数列表;第一个是任何显式参数,第二个是任何隐式参数。当我们调用"),s("code",[t._v("tooManyCats")]),t._v("时,我们可以省略第二个隐式参数列表(让编译器为我们找到它),或者显式提供一个参数(这个参数可以与隐式值不同)。")]),t._v(" "),s("p",[t._v("隐式参数可能失败的情况包括:")]),t._v(" "),s("ul",[s("li",[t._v("在一个作用域中定义了给定类型的两个或多个隐式值")]),t._v(" "),s("li",[t._v("如果编译器找不到调用函数所需的隐式值")])]),t._v(" "),s("p",[s("code",[t._v("object")]),t._v("定义了一个单例对象,它是一个类的单一实例。与"),s("code",[t._v("class")]),t._v("不同,当你定义一个"),s("code",[t._v("object")]),t._v("时,Scala 会自动为你创建这个类的一个实例。你不需要使用"),s("code",[t._v("new")]),t._v("关键字来创建它的实例。在这个例子中,"),s("code",[t._v("CatDog")]),t._v("是一个单例对象,可以直接访问其成员,无需创建实例。这在定义工具方法或当你需要一个全局唯一的实体时非常有用,比如这里的"),s("code",[t._v("numberOfCats")]),t._v("隐式值和"),s("code",[t._v("tooManyCats")]),t._v("方法。")]),t._v(" "),s("h3",{attrs:{id:"example-implicit-logging"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-implicit-logging"}},[t._v("#")]),t._v(" Example: Implicit Logging")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("sealed")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("trait")]),t._v(" Verbosity\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implicit")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("object")]),t._v(" Silent "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Verbosity\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("object")]),t._v(" Verbose "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Verbosity\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" ParameterizedWidthAdder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in0Width"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" in1Width"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" sumWidth"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implicit")]),t._v(" verbosity"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Verbosity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" log"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("msg"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Unit")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" verbosity "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("match")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" Silent "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" Verbose "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("msg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n require"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in0Width "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n log"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in0Width of ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("in0Width")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' OK"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n require"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in1Width "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n log"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in1Width of ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("in1Width")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' OK"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n require"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sumWidth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n log"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sumWidth of ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("sumWidth")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(' OK"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in0Width"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in1Width"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" sum "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("sumWidth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n log"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Made IO"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 对于结果位宽自然容纳进位的情况,直接使用+也是可行的。")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sum "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in0 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in1\n log"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Assigned output"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getVerilog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ParameterizedWidthAdder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getVerilog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ParameterizedWidthAdder"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Verbose"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("ol",[s("li",[t._v("定义了一个名为"),s("code",[t._v("Verbosity")]),t._v("的密封特质("),s("code",[t._v("sealed trait")]),t._v(")和两个实现这个特质的对象。"),s("code",[t._v("sealed trait Verbosity")]),t._v("表示"),s("code",[t._v("Verbosity")]),t._v("是一个可以被继承的类型,但所有继承它的类必须定义在同一个文件中,这有助于实现模式匹配的完整性检查。"),s("code",[t._v("implicit case object Silent extends Verbosity")]),t._v("定义了一个隐式的单例对象"),s("code",[t._v("Silent")]),t._v(",它是"),s("code",[t._v("Verbosity")]),t._v("的一个实现,可以在需要"),s("code",[t._v("Verbosity")]),t._v("类型的隐式参数时自动使用。"),s("code",[t._v("case object Verbose extends Verbosity")]),t._v("定义了另一个名为"),s("code",[t._v("Verbose")]),t._v("的单例对象,也是"),s("code",[t._v("Verbosity")]),t._v("的实现。"),s("code",[t._v("case object")]),t._v("通常用于代表不可变、无状态的值或单例定义.")]),t._v(" "),s("li",[s("code",[t._v("msg: => String")]),t._v("这样的参数定义使用了名为“call-by-name”的参数传递机制。这种机制意味着,只有在函数内部实际使用到"),s("code",[t._v("msg")]),t._v("时,传入的字符串表达式才会被计算。这对于条件日志记录来说非常有用,因为它允许延迟计算日志消息直到确实需要打印消息时。例如,如果"),s("code",[t._v("verbosity")]),t._v("是"),s("code",[t._v("Silent")]),t._v(",则"),s("code",[t._v("msg")]),t._v("根本不会被计算,这样就避免了不必要的性能开销。")])]),t._v(" "),s("h3",{attrs:{id:"implicit-conversions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#implicit-conversions"}},[t._v("#")]),t._v(" Implicit Conversions")]),t._v(" "),s("p",[t._v("隐式函数(也称为隐式转换)用于减少模板代码。更具体地说,它们用于自动将一个 Scala 对象转换为另一个对象。")]),t._v(" "),s("h3",{attrs:{id:"example-implicit-conversion"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-implicit-conversion"}},[t._v("#")]),t._v(" Example: Implicit Conversion")]),t._v(" "),s("p",[t._v("在下面的例子中,我们有两个类,"),s("code",[t._v("Animal")]),t._v("和"),s("code",[t._v("Human")]),t._v("。"),s("code",[t._v("Animal")]),t._v("有一个"),s("code",[t._v("species")]),t._v("字段,但"),s("code",[t._v("Human")]),t._v("没有。然而,通过实现一个隐式转换,我们可以在"),s("code",[t._v("Human")]),t._v("上调用"),s("code",[t._v("species")]),t._v("方法。这意味着即使"),s("code",[t._v("Human")]),t._v("类原本不包含"),s("code",[t._v("species")]),t._v("字段,通过隐式转换,我们也可以像访问自己的属性一样访问"),s("code",[t._v("species")]),t._v(",就好像这个属性是"),s("code",[t._v("Human")]),t._v("类的一部分一样。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" Animal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" species"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" Human"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("implicit")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" human2animal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("h"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Human"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Animal "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Animal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("h"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Homo sapiens"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" me "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Human"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Adam"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("me"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("species"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/3.34faa58e.js b/assets/js/3.34faa58e.js new file mode 100644 index 0000000..a31541f --- /dev/null +++ b/assets/js/3.34faa58e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[3,18,19],{241:function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return s})),n.d(e,"i",(function(){return a})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return u})),n.d(e,"h",(function(){return c})),n.d(e,"b",(function(){return p})),n.d(e,"e",(function(){return d})),n.d(e,"k",(function(){return h})),n.d(e,"l",(function(){return f})),n.d(e,"c",(function(){return g})),n.d(e,"j",(function(){return m}));n(45);const r=/#.*$/,i=/\.(md|html)$/,s=/\/$/,a=/^[a-z]+:/i;function o(t){return decodeURI(t).replace(r,"").replace(i,"")}function l(t){return a.test(t)}function u(t){return/^mailto:/.test(t)}function c(t){return/^tel:/.test(t)}function p(t){if(l(t))return t;const e=t.match(r),n=e?e[0]:"",i=o(t);return s.test(i)?t:i+".html"+n}function d(t,e){const n=decodeURIComponent(t.hash),i=function(t){const e=t.match(r);if(e)return e[0]}(e);if(i&&n!==i)return!1;return o(t.path)===o(e)}function h(t,e,n){if(l(e))return{type:"external",path:e};n&&(e=function(t,e,n){const r=t.charAt(0);if("/"===r)return t;if("?"===r||"#"===r)return e+t;const i=e.split("/");n&&i[i.length-1]||i.pop();const s=t.replace(/^\//,"").split("/");for(let t=0;tfunction t(e,n,r,i=1){if("string"==typeof e)return h(n,e,r);if(Array.isArray(e))return Object.assign(h(n,e[0],r),{title:e[1]});{const s=e.children||[];return 0===s.length&&e.path?Object.assign(h(n,e.path,r),{title:e.title}):{type:"group",path:e.path,title:e.title,sidebarDepth:e.sidebarDepth,initialOpenGroupIndex:e.initialOpenGroupIndex,children:s.map(e=>t(e,n,r,i+1)),collapsable:!1!==e.collapsable}}}(t,i,n)):[]}return[]}function b(t){const e=g(t.headers||[]);return[{type:"group",collapsable:!1,title:t.title,path:null,children:e.map(e=>({type:"auto",title:e.title,basePath:t.path,path:t.path+"#"+e.slug,children:e.children||[]}))}]}function g(t){let e;return(t=t.map(t=>Object.assign({},t))).forEach(t=>{2===t.level?e=t:e&&(e.children||(e.children=[])).push(t)}),t.filter(t=>2===t.level)}function m(t){return Object.assign(t,{type:t.items&&t.items.length?"links":"link"})}},242:function(t,e,n){},244:function(t,e,n){"use strict";n.r(e);var r={name:"DropdownTransition",methods:{setHeight(t){t.style.height=t.scrollHeight+"px"},unsetHeight(t){t.style.height=""}}},i=(n(245),n(14)),s=Object(i.a)(r,(function(){return(0,this._self._c)("transition",{attrs:{name:"dropdown"},on:{enter:this.setHeight,"after-enter":this.unsetHeight,"before-leave":this.setHeight}},[this._t("default")],2)}),[],!1,null,null,null);e.default=s.exports},245:function(t,e,n){"use strict";n(242)},247:function(t,e,n){},252:function(t,e,n){},254:function(t,e,n){"use strict";n(247)},255:function(t,e,n){"use strict";n.r(e);var r=n(268),i=n(257),s=n(241);function a(t,e){if("group"===e.type){const n=e.path&&Object(s.e)(t,e.path),r=e.children.some(e=>"group"===e.type?a(t,e):"page"===e.type&&Object(s.e)(t,e.path));return n||r}return!1}var o={name:"SidebarLinks",components:{SidebarGroup:r.default,SidebarLink:i.default},props:["items","depth","sidebarDepth","initialOpenGroupIndex"],data(){return{openGroupIndex:this.initialOpenGroupIndex||0}},watch:{$route(){this.refreshIndex()}},created(){this.refreshIndex()},methods:{refreshIndex(){const t=function(t,e){for(let n=0;n-1&&(this.openGroupIndex=t)},toggleGroup(t){this.openGroupIndex=t===this.openGroupIndex?-1:t},isActive(t){return Object(s.e)(this.$route,t.regularPath)}}},l=n(14),u=Object(l.a)(o,(function(){var t=this,e=t._self._c;return t.items.length?e("ul",{staticClass:"sidebar-links"},t._l(t.items,(function(n,r){return e("li",{key:r},["group"===n.type?e("SidebarGroup",{attrs:{item:n,open:r===t.openGroupIndex,collapsable:n.collapsable||n.collapsible,depth:t.depth},on:{toggle:function(e){return t.toggleGroup(r)}}}):e("SidebarLink",{attrs:{"sidebar-depth":t.sidebarDepth,item:n}})],1)})),0):t._e()}),[],!1,null,null,null);e.default=u.exports},257:function(t,e,n){"use strict";n.r(e);var r=n(241);function i(t,e,n,r,i){const s={props:{to:e,activeClass:"",exactActiveClass:""},class:{active:r,"sidebar-link":!0}};return i>2&&(s.style={"padding-left":i+"rem"}),t("RouterLink",s,n)}function s(t,e,n,a,o,l=1){return!e||l>o?null:t("ul",{class:"sidebar-sub-headers"},e.map(e=>{const u=Object(r.e)(a,n+"#"+e.slug);return t("li",{class:"sidebar-sub-header"},[i(t,n+"#"+e.slug,e.title,u,e.level-1),s(t,e.children,n,a,o,l+1)])}))}var a={functional:!0,props:["item","sidebarDepth"],render(t,{parent:{$page:e,$site:n,$route:a,$themeConfig:o,$themeLocaleConfig:l},props:{item:u,sidebarDepth:c}}){const p=Object(r.e)(a,u.path),d="auto"===u.type?p||u.children.some(t=>Object(r.e)(a,u.basePath+"#"+t.slug)):p,h="external"===u.type?function(t,e,n){return t("a",{attrs:{href:e,target:"_blank",rel:"noopener noreferrer"},class:{"sidebar-link":!0}},[n,t("OutboundLink")])}(t,u.path,u.title||u.path):i(t,u.path,u.title||u.path,d),f=[e.frontmatter.sidebarDepth,c,l.sidebarDepth,o.sidebarDepth,1].find(t=>void 0!==t),b=l.displayAllHeaders||o.displayAllHeaders;if("auto"===u.type)return[h,s(t,u.children,u.basePath,a,f)];if((d||b)&&u.headers&&!r.d.test(u.path)){return[h,s(t,Object(r.c)(u.headers),u.path,a,f)]}return h}},o=(n(254),n(14)),l=Object(o.a)(a,void 0,void 0,!1,null,null,null);e.default=l.exports},265:function(t,e,n){"use strict";n(252)},268:function(t,e,n){"use strict";n.r(e);var r=n(241),i={name:"SidebarGroup",components:{DropdownTransition:n(244).default},props:["item","open","collapsable","depth"],beforeCreate(){this.$options.components.SidebarLinks=n(255).default},methods:{isActive:r.e}},s=(n(265),n(14)),a=Object(s.a)(i,(function(){var t=this,e=t._self._c;return e("section",{staticClass:"sidebar-group",class:[{collapsable:t.collapsable,"is-sub-group":0!==t.depth},"depth-"+t.depth]},[t.item.path?e("RouterLink",{staticClass:"sidebar-heading clickable",class:{open:t.open,active:t.isActive(t.$route,t.item.path)},attrs:{to:t.item.path},nativeOn:{click:function(e){return t.$emit("toggle")}}},[e("span",[t._v(t._s(t.item.title))]),t._v(" "),t.collapsable?e("span",{staticClass:"arrow",class:t.open?"down":"right"}):t._e()]):e("p",{staticClass:"sidebar-heading",class:{open:t.open},on:{click:function(e){return t.$emit("toggle")}}},[e("span",[t._v(t._s(t.item.title))]),t._v(" "),t.collapsable?e("span",{staticClass:"arrow",class:t.open?"down":"right"}):t._e()]),t._v(" "),e("DropdownTransition",[t.open||!t.collapsable?e("SidebarLinks",{staticClass:"sidebar-group-items",attrs:{items:t.item.children,"sidebar-depth":t.item.sidebarDepth,"initial-open-group-index":t.item.initialOpenGroupIndex,depth:t.depth+1}}):t._e()],1)],1)}),[],!1,null,null,null);e.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/30.8a4d1c46.js b/assets/js/30.8a4d1c46.js new file mode 100644 index 0000000..c7ef93f --- /dev/null +++ b/assets/js/30.8a4d1c46.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{306:function(a,s,t){a.exports=t.p+"assets/img/G4E.f2c635d7.jpeg"},348:function(a,s,t){"use strict";t.r(s);var e=t(14),n=Object(e.a)({},(function(){var a=this,s=a._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[s("h1",{attrs:{id:"_2023-02-13-在超算上搭建singularity环境并配置geant4"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2023-02-13-在超算上搭建singularity环境并配置geant4"}},[a._v("#")]),a._v(" 2023.02.13-在超算上搭建Singularity环境并配置Geant4")]),a._v(" "),s("h2",{attrs:{id:"i-制作singularity包"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#i-制作singularity包"}},[a._v("#")]),a._v(" I. 制作singularity包")]),a._v(" "),s("h3",{attrs:{id:"_1-进入fakeroot节点"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-进入fakeroot节点"}},[a._v("#")]),a._v(" 1. 进入fakeroot节点")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("ssh")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("user_id"),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v("@162.105.133.209\n")])])]),s("h3",{attrs:{id:"_2-制作并进入sandbox镜像"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-制作并进入sandbox镜像"}},[a._v("#")]),a._v(" 2. 制作并进入sandbox镜像")]),a._v(" "),s("ol",[s("li",[s("p",[a._v("搭建ubuntu")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("singularity build "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--fakeroot")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--sandbox")]),a._v(" Geant4 docker://ubuntu:22.04\n")])])])]),a._v(" "),s("li",[s("p",[a._v("进入Geant4环境(sandbox)")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("singularity shell "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--fakeroot")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" Geant4\n")])])])])]),a._v(" "),s("h3",{attrs:{id:"_3-配置geant4环境"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-配置geant4环境"}},[a._v("#")]),a._v(" 3. 配置geant4环境")]),a._v(" "),s("ol",[s("li",[s("p",[a._v("安装基本环境")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" build-essential\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("wget")]),a._v("\n")])])])]),a._v(" "),s("li",[s("p",[a._v("下载geant4")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("mkdir")]),a._v(" geant4\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("wget")]),a._v(" https://geant4-data.web.cern.ch/releases/geant4-v11.1.0.tar.gz\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tar")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-xzvf")]),a._v(" geant4-v11.1.0.tar.gz\n")])])])]),a._v(" "),s("li",[s("p",[a._v("安装依赖包(若报错,则分别单独安装)")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-y")]),a._v(" cmake libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev libhdf5-serial-dev hdf5-tools\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-y")]),a._v(" libexpat1-dev\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-y")]),a._v(" qt5*\n")])])])]),a._v(" "),s("li",[s("p",[a._v("编译安装")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("mkdir")]),a._v(" build\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("cd")]),a._v(" build\ncmake "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DCMAKE_INSTALL_PREFIX")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("/root/Geant4/home/geant4 /root/Geant4/home/geant4-v11.1.0\ncmake "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_INSTALL_DATA")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(".")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("make")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-jN")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# N表示处理器数量,需修改为实际值")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("make")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v("\n")])])])]),a._v(" "),s("li",[s("p",[a._v("配置环境变量")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("cd")]),a._v(" /root/Geant4/etc/skel/\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("vim")]),a._v(" .bashrc\n")])])]),s("p",[a._v("将下列内容添加到 "),s("code",[a._v(".bashrc")])]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("source")]),a._v(" /root/Geant4/home/geant4/bin/geant4.sh\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("source")]),a._v(" /root/Geant4/home/geant4/share/Geant4/geant4make/geant4make.sh\n")])])]),s("p",[a._v("配置")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("cp")]),a._v(" /root/Geant4/etc/skel/.bashrc /root/Geant4/home\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("cd")]),a._v(" /root/Geant4/home\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("source")]),a._v(" .bashrc\n")])])])]),a._v(" "),s("li",[s("p",[a._v("检验geant4是否配置成功")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("cd")]),a._v(" /root/Geant4/home/geant4/share/Geant4/examples/basic/B1\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("mkdir")]),a._v(" build "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("&&")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("cd")]),a._v(" build\ncmake "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[a._v("..")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("make")]),a._v("\n./exampleB1 run1.mac\n")])])]),s("p",[a._v("若无报错则配置成功")])]),a._v(" "),s("li",[s("p",[a._v("退出")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exit")]),a._v("\n")])])])])]),a._v(" "),s("h3",{attrs:{id:"_4-打包"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-打包"}},[a._v("#")]),a._v(" 4. 打包")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("singularity build "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--fakeroot")]),a._v(" s-Geant4.sif Geant4/\n")])])]),s("hr"),a._v(" "),s("h2",{attrs:{id:"ii-配置go-singularity"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ii-配置go-singularity"}},[a._v("#")]),a._v(" II. 配置go&singularity")]),a._v(" "),s("h3",{attrs:{id:"_1-配置go环境"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-配置go环境"}},[a._v("#")]),a._v(" 1. 配置go环境")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 超算Data节点")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("VERSION")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[a._v("1.17")]),a._v(".2 "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("OS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("linux "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[a._v("ARCH")]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("amd64\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("wget")]),a._v(" https://dl.google.com/go/go"),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$VERSION")]),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(".")]),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$OS")]),a._v("-"),s("span",{pre:!0,attrs:{class:"token variable"}},[a._v("$ARCH")]),a._v(".tar.gz\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("tar")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-xzvf")]),a._v(" go1.17.2.linux-amd64.tar.gz\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("rm")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-f")]),a._v(" go1.17.2.linux-amd64.tar.gz\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("export")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[s("span",{pre:!0,attrs:{class:"token environment constant"}},[a._v("PATH")])]),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("/lustre/home/"),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("user_id"),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v("/go/bin:"),s("span",{pre:!0,attrs:{class:"token environment constant"}},[a._v("$PATH")]),a._v("\n")])])]),s("h3",{attrs:{id:"_2-安装singularity"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-安装singularity"}},[a._v("#")]),a._v(" 2. 安装singularity")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("module load singularity/3.11.3\n")])])]),s("h3",{attrs:{id:"_3-环境变量"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-环境变量"}},[a._v("#")]),a._v(" 3. 环境变量")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("cd")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token environment constant"}},[a._v("$HOME")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("vim")]),a._v(" .bashrc\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 将下列语句添加到.bashrc中")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# export PATH=/lustre/home//go/bin:$PATH")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("source")]),a._v(" .bashrc\n")])])]),s("hr"),a._v(" "),s("h2",{attrs:{id:"iii-启用singularity"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#iii-启用singularity"}},[a._v("#")]),a._v(" III. 启用singularity")]),a._v(" "),s("h3",{attrs:{id:"_1-将sif镜像下载到常规节点"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-将sif镜像下载到常规节点"}},[a._v("#")]),a._v(" 1. 将SIF镜像下载到常规节点")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[a._v("scp")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-r")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("user_id"),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v("@162.105.133.209:/home/"),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("user_id"),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v("/s-Geant4.sif /gpfs/share/home/"),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v("<")]),a._v("user_id"),s("span",{pre:!0,attrs:{class:"token operator"}},[a._v(">")]),a._v("/\n")])])]),s("h3",{attrs:{id:"_2-转换成sandbox镜像并启用"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-转换成sandbox镜像并启用"}},[a._v("#")]),a._v(" 2. 转换成sandbox镜像并启用")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[a._v("singularity build "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--sandbox")]),a._v(" Geant4 s-Geant4.sif\nsingularity shell "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" Geant4\n")])])]),s("h3",{attrs:{id:"_3-配置环境变量"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-配置环境变量"}},[a._v("#")]),a._v(" 3. 配置环境变量")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("cd")]),a._v(" Geant4/home\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("vim")]),a._v(" .bashrc\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 将下列语句添加到文件末尾")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# source /lustre/home/2201210084/singularity/Geant4/home/geant4/bin/geant4.sh")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# source /lustre/home/2201210084/singularity/Geant4/home/geant4/share/Geant4/geant4make/geant4make.sh")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("source")]),a._v(" .bashrc\n")])])]),s("p",[a._v("看见如下字样表示成功")]),a._v(" "),s("p",[s("img",{attrs:{src:t(306),alt:"Untitled"}})]),a._v(" "),s("h2",{attrs:{id:"iv-附录"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#iv-附录"}},[a._v("#")]),a._v(" IV. 附录")]),a._v(" "),s("h3",{attrs:{id:"_1-sif容器与sandbox相互转换"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-sif容器与sandbox相互转换"}},[a._v("#")]),a._v(" 1. SIF容器与sandbox相互转换")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 1. 将SIF格式的容器转换成sandbox;")]),a._v("\nsingularity build "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--sandbox")]),a._v(" XXX XXX.sif\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 2. 将sandbox容器镜像转化成SIF格式;")]),a._v("\nsingularity build XXX.sif XXX\n")])])]),s("h3",{attrs:{id:"_2-在fakeroot节点上删除sandbox镜像"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-在fakeroot节点上删除sandbox镜像"}},[a._v("#")]),a._v(" 2. 在fakeroot节点上删除sandbox镜像")]),a._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 假设要删除的为文件夹名为molspin的sandbox镜像")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 首先,以可读的模式进入要删除的镜像")]),a._v("\nsingularity shell "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("--fakeroot")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-w")]),a._v(" molspin\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 删除掉容器中,基于fakeroot创建的所有文件")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("rm")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-rf")]),a._v(" /* "),s("span",{pre:!0,attrs:{class:"token operator"}},[s("span",{pre:!0,attrs:{class:"token file-descriptor important"}},[a._v("1")]),a._v(">")]),a._v("/dev/null "),s("span",{pre:!0,attrs:{class:"token operator"}},[s("span",{pre:!0,attrs:{class:"token file-descriptor important"}},[a._v("2")]),a._v(">")]),s("span",{pre:!0,attrs:{class:"token file-descriptor important"}},[a._v("&1")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 退出镜像")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("exit")]),a._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 将创建好的软件镜像上传到高性能计算集群,加载singularity软件环境")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[a._v("# 删除掉剩下的")]),a._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[a._v("rm")]),a._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-rf")]),a._v(" molspin\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/31.395eb503.js b/assets/js/31.395eb503.js new file mode 100644 index 0000000..52f5ba6 --- /dev/null +++ b/assets/js/31.395eb503.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{316:function(t,s,a){"use strict";a.r(s);var r=a(14),i=Object(r.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"_1-一生一芯计划"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-一生一芯计划"}},[this._v("#")]),this._v(" 1. 一生一芯计划")]),this._v(" "),t("h2",{attrs:{id:"预学习阶段"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#预学习阶段"}},[this._v("#")]),this._v(" "),t("RouterLink",{attrs:{to:"/Chip/Chip/一生一芯计划/预学习阶段.html"}},[this._v("预学习阶段")])],1)])}),[],!1,null,null,null);s.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/32.ac2f260b.js b/assets/js/32.ac2f260b.js new file mode 100644 index 0000000..cbec395 --- /dev/null +++ b/assets/js/32.ac2f260b.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{317:function(t,s,i){"use strict";i.r(s);var h=i(14),e=Object(h.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"_2-2024-02-21-chisel"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-2024-02-21-chisel"}},[this._v("#")]),this._v(" 2. 2024.02.21-Chisel")]),this._v(" "),t("h2",{attrs:{id:"_2024-02-21-chisel-bootcamp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-21-chisel-bootcamp"}},[this._v("#")]),this._v(" "),t("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.html"}},[this._v("2024.02.21-Chisel Bootcamp")])],1)])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/33.f32226a3.js b/assets/js/33.f32226a3.js new file mode 100644 index 0000000..36fa5c8 --- /dev/null +++ b/assets/js/33.f32226a3.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{319:function(t,s,a){"use strict";a.r(s);var r=a(14),e=Object(r.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_1-verilog-基础语法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-verilog-基础语法"}},[t._v("#")]),t._v(" 1. Verilog 基础语法")]),t._v(" "),s("h2",{attrs:{id:"格式"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#格式"}},[t._v("#")]),t._v(" 格式")]),t._v(" "),s("p",[t._v("Verilog 是区分大小写的。")]),t._v(" "),s("p",[t._v("格式自由,可以在一行内编写,也可跨多行编写。")]),t._v(" "),s("p",[t._v("每个语句必须以分号为结束符。空白符(换行、制表、空格)都没有实际的意义,在编译阶段可忽略。例如下面两中编程方式都是等效的。")]),t._v(" "),s("h3",{attrs:{id:"不换行-不推荐"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#不换行-不推荐"}},[t._v("#")]),t._v(" 不换行(不推荐)")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" results "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" results "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b01")]),t._v(" : "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("b"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b10")]),t._v(" : "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b11")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"换行-推荐"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#换行-推荐"}},[t._v("#")]),t._v(" 换行(推荐)")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" results "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" results "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b01")]),t._v(" :"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("b"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b10")]),t._v(" :"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b11")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"注释"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#注释"}},[t._v("#")]),t._v(" 注释")]),t._v(" "),s("p",[t._v("Verilog 中有 2 种注释方式:")]),t._v(" "),s("p",[t._v("用  "),s("code",[t._v("//")]),t._v("  进行单行注释:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" counter "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// A definition of counter register")]),t._v("\n")])])]),s("p",[t._v("用"),s("code",[t._v("/* */")]),t._v("进行跨行注释:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" addr "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\nNext are notes with multiple lines.\nCodes here cannot be compiled.\n*/")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" addr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12'b0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"标识符与关键字"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#标识符与关键字"}},[t._v("#")]),t._v(" 标识符与关键字")]),t._v(" "),s("p",[t._v("标识符(identifier)可以是任意一组字母、数字、$  符号和  _(下划线)符号的合,但标识符的第一个字符必须是字母或者下划线,不能以数字或者美元符开始。")]),t._v(" "),s("p",[t._v("另外,标识符是区分大小写的。")]),t._v(" "),s("p",[t._v("关键字是 Verilog 中预留的用于定义语言结构的特殊标识符。")]),t._v(" "),s("p",[t._v("Verilog 中关键字全部为小写。")]),t._v(" "),s("h3",{attrs:{id:"实例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" counter "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//reg 为关键字, counter 为标识符*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" clk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//input 为关键字,clk 为标识符*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" CLK"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//CLK 与 clk是 2 个不同的标识符*")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/34.959b7a44.js b/assets/js/34.959b7a44.js new file mode 100644 index 0000000..e2ea67f --- /dev/null +++ b/assets/js/34.959b7a44.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{318:function(s,a,t){"use strict";t.r(a);var r=t(14),e=Object(r.a)({},(function(){var s=this,a=s._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[a("h1",{attrs:{id:"_2-verilog-数值表示"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-verilog-数值表示"}},[s._v("#")]),s._v(" 2. Verilog 数值表示")]),s._v(" "),a("h2",{attrs:{id:"数值种类"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#数值种类"}},[s._v("#")]),s._v(" 数值种类")]),s._v(" "),a("p",[s._v("Verilog HDL 有下列四种基本的值来表示硬件电路中的电平逻辑:")]),s._v(" "),a("ul",[a("li",[s._v('0:逻辑 0 或 "假"')]),s._v(" "),a("li",[s._v('1:逻辑 1 或 "真"')]),s._v(" "),a("li",[s._v("x 或 X:未知")]),s._v(" "),a("li",[s._v("z 或 Z:高阻")])]),s._v(" "),a("p",[a("code",[s._v("x")]),s._v("  意味着信号数值的不确定,即在实际电路里,信号可能为 1,也可能为 0。")]),s._v(" "),a("p",[a("code",[s._v("z")]),s._v("  意味着信号处于高阻状态,常见于信号(input, reg)没有驱动时的逻辑结果。例如一个 pad 的 input 呈现高阻状态时,其逻辑值和上下拉的状态有关系。上拉则逻辑值为 1,下拉则为 0 。")]),s._v(" "),a("h2",{attrs:{id:"整数数值表示方法"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#整数数值表示方法"}},[s._v("#")]),s._v(" 整数数值表示方法")]),s._v(" "),a("p",[s._v("数字声明时,合法的基数格式有 4 中,包括:十进制('d 或 'D),十六进制('h 或 'H),二进制('b 或 'B),八进制('o 或 'O)。数值可指明位宽,也可不指明位宽。")]),s._v(" "),a("h3",{attrs:{id:"指明位宽"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#指明位宽"}},[s._v("#")]),s._v(" 指明位宽:")]),s._v(" "),a("div",{staticClass:"language-verilog extra-class"},[a("pre",{pre:!0,attrs:{class:"language-verilog"}},[a("code",[a("span",{pre:!0,attrs:{class:"token number"}},[s._v("4'b1011")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 4bit 数值*")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("32'h3022_c0de")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 32bit 的数值 一个16进制的数需要4bit来表示*")]),s._v("\n")])])]),a("p",[s._v("其中,下划线  "),a("code",[s._v("_")]),s._v("  是为了增强代码的可读性。")]),s._v(" "),a("h3",{attrs:{id:"不指明位宽"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#不指明位宽"}},[s._v("#")]),s._v(" 不指明位宽:")]),s._v(" "),a("p",[s._v("一般直接写数字时,默认为十进制表示,例如下面的 3 种写法是等效的:")]),s._v(" "),a("div",{staticClass:"language-verilog extra-class"},[a("pre",{pre:!0,attrs:{class:"language-verilog"}},[a("code",[s._v("counter "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("'d100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//一般会根据编译器自动分频位宽,常见的为32bit*")]),s._v("\ncounter "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("100")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\ncounter "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("32'h64")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n")])])]),a("h3",{attrs:{id:"负数表示"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#负数表示"}},[s._v("#")]),s._v(" 负数表示")]),s._v(" "),a("p",[s._v("通常在表示位宽的数字前面加一个减号来表示负数。例如:")]),s._v(" "),a("div",{staticClass:"language-verilog extra-class"},[a("pre",{pre:!0,attrs:{class:"language-verilog"}},[a("code",[a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("6'd15")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("15")]),s._v("\n")])])]),a("ul",[a("li",[s._v("15 在 5 位二进制中的形式为 5'b10001, 在 6 位二进制中的形式为 6'b11_0001。")])]),s._v(" "),a("p",[s._v("需要注意的是,减号放在基数和数字之间是非法的,例如下面的表示方法是错误的:")]),s._v(" "),a("div",{staticClass:"language-verilog extra-class"},[a("pre",{pre:!0,attrs:{class:"language-verilog"}},[a("code",[a("span",{pre:!0,attrs:{class:"token number"}},[s._v("4")]),s._v("'d"),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("2")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//非法说明")]),s._v("\n")])])]),a("h2",{attrs:{id:"实数表示方法"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#实数表示方法"}},[s._v("#")]),s._v(" 实数表示方法")]),s._v(" "),a("p",[s._v("实数表示方法主要有两种方式:")]),s._v(" "),a("h3",{attrs:{id:"十进制"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#十进制"}},[s._v("#")]),s._v(" 十进制:")]),s._v(" "),a("div",{staticClass:"language-verilog extra-class"},[a("pre",{pre:!0,attrs:{class:"language-verilog"}},[a("code",[a("span",{pre:!0,attrs:{class:"token number"}},[s._v("30.123")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("6.0")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("3.0")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("0.001")]),s._v("\n")])])]),a("h3",{attrs:{id:"科学计数法"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#科学计数法"}},[s._v("#")]),s._v(" 科学计数法:")]),s._v(" "),a("div",{staticClass:"language-verilog extra-class"},[a("pre",{pre:!0,attrs:{class:"language-verilog"}},[a("code",[a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1.2e4")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//大小为12000")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1_0001e4")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//大小为100010000")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1E-3")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[s._v("//大小为0.001")]),s._v("\n")])])]),a("h2",{attrs:{id:"字符串表示方法"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#字符串表示方法"}},[s._v("#")]),s._v(" 字符串表示方法")]),s._v(" "),a("p",[s._v('字符串是由双引号包起来的字符队列。字符串不能多行书写,即字符串中不能包含回车符。Verilog 将字符串当做一系列的单字节 ASCII 字符队列。例如,为存储字符串 "www.runoob.com", 需要 14*8bit 的存储单元。例如:')]),s._v(" "),a("div",{staticClass:"language-verilog extra-class"},[a("pre",{pre:!0,attrs:{class:"language-verilog"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("reg")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("14")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("*")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("8")]),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("-")]),a("span",{pre:!0,attrs:{class:"token number"}},[s._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),s._v(" str "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("initial")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("begin")]),s._v(" \n\t\t\tstr "),a("span",{pre:!0,attrs:{class:"token operator"}},[s._v("=")]),s._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[s._v('"www.runoob.com"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("end")]),s._v("\n")])])])])}),[],!1,null,null,null);a.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/35.2524bc91.js b/assets/js/35.2524bc91.js new file mode 100644 index 0000000..1e43f4c --- /dev/null +++ b/assets/js/35.2524bc91.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{325:function(t,s,a){"use strict";a.r(s);var n=a(14),r=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_3-verilog-数据类型"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-verilog-数据类型"}},[t._v("#")]),t._v(" 3. Verilog 数据类型")]),t._v(" "),s("p",[t._v("Verilog 最常用的 2 种数据类型就是线网(wire)与寄存器(reg),其余类型可以理解为这两种数据类型的扩展或辅助。")]),t._v(" "),s("h2",{attrs:{id:"线网-wire"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#线网-wire"}},[t._v("#")]),t._v(" 线网(wire)")]),t._v(" "),s("p",[t._v('wire 类型表示硬件单元之间的物理连线,由其连接的器件输出端连续驱动。如果没有驱动元件连接到 wire 型变量,缺省值一般为 "Z"。举例如下:')]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" interrupt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" flag1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" flag2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" gnd "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("线网型还有其他数据类型,包括 "),s("code",[t._v("wand,wor,wri,triand,trior,trireg")]),t._v(" 等。这些数据类型用的频率不是很高,这里不做介绍。")]),t._v(" "),s("h2",{attrs:{id:"寄存器-reg"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#寄存器-reg"}},[t._v("#")]),t._v(" 寄存器(reg)")]),t._v(" "),s("p",[t._v("寄存器(reg)用来表示存储单元,它会保持数据原有的值,直到被改写。声明举例如下:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" clk_temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" flag1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" flag2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("例如在 always 块中,寄存器可能被综合成边沿触发器,在组合逻辑中可能被综合成 wire 型变量。寄存器不需要驱动源,也不一定需要时钟信号。在仿真时,寄存器的值可在任意时刻通过赋值操作进行改写。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" rstn "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("initial")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v(" \n\t\trstn "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("#100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n rstn "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n")])])]),s("h2",{attrs:{id:"向量"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#向量"}},[t._v("#")]),t._v(" 向量")]),t._v(" "),s("p",[t._v("当位宽大于 1 时,wire 或 reg 即可声明为向量的形式。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" counter "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//声明4bit位宽的寄存器counter*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" gpio_data"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//声明32bit位宽的线型变量gpio_data*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" addr "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//声明7bit位宽的线型变量addr,位宽范围为8:2*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" data "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//声明32bit位宽的寄存器变量data, 最高有效位为0*")]),t._v("\n")])])]),s("p",[t._v("对于上面的向量,我们可以指定某一位或若干相邻位,作为其他逻辑使用。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" data_low "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("addr_temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Verilog 支持可变的向量域选择,例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" data1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" byte1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("integer")]),t._v(" j "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token important"}},[t._v("always@")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n byte1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//把data1[7:0]…data1[31:24]依次赋值给byte1[0][7:0]…byte[3][7:0]*")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n")])])]),s("p",[t._v("Verilog 还支持指定 bit 位后固定位宽的向量域选择访问。")]),t._v(" "),s("ul",[s("li",[t._v("[bit+: width] : 从起始 bit 位开始递增,位宽为 width。")]),t._v(" "),s("li",[t._v("[bit-: width] : 从起始 bit 位开始递减,位宽为 width。")])]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//下面 2 种赋值是等效的*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//下面 2 种赋值是等效的*")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("对信号重新进行组合成新的向量时,需要借助大括号。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" temp1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" temp2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" temp1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),t._v("byte1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" data1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//数据拼接*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" temp2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("}}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//赋值32位的数值0*")]),t._v("\n")])])]),s("h2",{attrs:{id:"整数-实数-时间寄存器变量"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#整数-实数-时间寄存器变量"}},[t._v("#")]),t._v(" 整数,实数,时间寄存器变量")]),t._v(" "),s("p",[t._v("整数,实数,时间等数据类型实际也属于寄存器类型。")]),t._v(" "),s("h3",{attrs:{id:"整数-integer"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#整数-integer"}},[t._v("#")]),t._v(" 整数(integer)")]),t._v(" "),s("p",[t._v("整数类型用关键字 integer 来声明。声明时不用指明位宽,位宽和编译器有关,一般为 32 bit。reg 型变量为无符号数,而 integer 型变量为有符号数。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" data1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" byte1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//数组变量,后续介绍*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("integer")]),t._v(" j "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//整型变量,用来辅助生成数字电路*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token important"}},[t._v("always@")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n byte1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//把data1[7:0]…data1[31:24]依次赋值给byte1[0][7:0]…byte[3][7:0]*")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n")])])]),s("p",[t._v("此例中,integer 信号 j 作为辅助信号,将 data1 的数据依次赋值给数组 byte1。综合后实际电路里并没有 j 这个信号,j 只是辅助生成相应的硬件电路。")]),t._v(" "),s("h3",{attrs:{id:"实数-real"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实数-real"}},[t._v("#")]),t._v(" 实数(real)")]),t._v(" "),s("p",[t._v("实数用关键字 real 来声明,可用十进制或科学计数法来表示。实数声明不能带有范围,默认值为 0。如果将一个实数赋值给一个整数,则只有实数的整数部分会赋值给整数。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("real")]),t._v(" data1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("integer")]),t._v(" temp "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("initial")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n data1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2e3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n data1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.75")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("initial")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n temp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//temp 值的大小为3*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n")])])]),s("h3",{attrs:{id:"时间-time"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#时间-time"}},[t._v("#")]),t._v(" 时间(time)")]),t._v(" "),s("p",[t._v("Verilog 使用特殊的时间寄存器 time 型变量,对仿真时间进行保存。其宽度一般为 64 bit,通过调用系统函数 $time 获取当前仿真时间。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("time")]),t._v(" current_time "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("initial")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("#100")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n current_time "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token kernel-function property"}},[t._v("$time")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//current_time 的大小为 100*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n")])])]),s("h3",{attrs:{id:"数组"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#数组"}},[t._v("#")]),t._v(" 数组")]),t._v(" "),s("p",[t._v("在 Verilog 中允许声明 "),s("code",[t._v("reg, wire, integer, time, real")]),t._v(" 及其向量类型的数组。")]),t._v(" "),s("p",[t._v("数组维数没有限制。线网数组也可以用于连接实例模块的端口。数组中的每个元素都可以作为一个标量或者向量,以同样的方式来使用,形如:数组名[下标]。对于多维数组来讲,用户需要说明其每一维的索引。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("integer")]),t._v(" flag "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//8个整数组成的数组*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" counter "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//由4个4bit计数器组成的数组*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" addr_bus "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//由4个8bit wire型变量组成的数组*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" data_bit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//声明1bit wire型变量的二维数组*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("31")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" data_4d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//声明4维的32bit数据变量数组*")]),t._v("\n")])])]),s("p",[t._v("下面显示了对数组元素的赋值操作:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("flag "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32'd0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将flag数组中第二个元素赋值为32bit的0值*")]),t._v("\ncounter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'hF")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将数组counter中第4个元素的值赋值为4bit 十六进制数F,等效于counter[3][3:0] = 4'hF,即可省略宽度;*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" addr_bus"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8'b0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将数组addr_bus中第一个元素的值赋值为0*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" data_bit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将数组data_bit的第1行第2列的元素赋值为1,这里不能省略第二个访问标号,即 assign data_bit[0] = 1'b1; 是非法的。*")]),t._v("\ndata_4d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15'd3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//将数组data_4d中标号为[0][0][0][0]的寄存器单元的15~0bit赋值为3*")]),t._v("\n")])])]),s("p",[t._v("虽然数组与向量的访问方式在一定程度上类似,但不要将向量和数组混淆。向量是一个单独的元件,位宽为 n;数组由多个元件组成,其中每个元件的位宽为 n 或 1。它们在结构的定义上就有所区别。")]),t._v(" "),s("h2",{attrs:{id:"存储器"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#存储器"}},[t._v("#")]),t._v(" 存储器")]),t._v(" "),s("p",[t._v("存储器变量就是一种寄存器数组,可用来描述 RAM 或 ROM 的行为。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" membit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("255")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//256bit的1bit存储器*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" mem"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1023")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//1Kbyte存储器,位宽8bit*")]),t._v("\nmem"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("511")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8'b0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//令第512个8bit的存储单元值为0*")]),t._v("\n")])])]),s("h2",{attrs:{id:"参数"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#参数"}},[t._v("#")]),t._v(" 参数")]),t._v(" "),s("p",[t._v("参数用来表示常量,用关键字 parameter 声明,只能赋值一次。例如:")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("parameter")]),t._v(" data_width "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10'd32")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("parameter")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" k"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("parameter")]),t._v(" mem_size "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" data_width "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("但是,通过实例化的方式,可以更改参数在模块中的值。此部分以后会介绍。")]),t._v(" "),s("p",[t._v("局部参数用 localparam 来声明,其作用和用法与 parameter 相同,区别在于它的值不能被改变。所以当参数只在本模块中调用时,可用 localparam 来说明。")]),t._v(" "),s("h2",{attrs:{id:"字符串"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#字符串"}},[t._v("#")]),t._v(" 字符串")]),t._v(" "),s("p",[t._v("字符串保存在 reg 类型的变量中,每个字符占用一个字节(8bit)。因此寄存器变量的宽度应该足够大,以保证不会溢出。")]),t._v(" "),s("p",[t._v('字符串不能多行书写,即字符串中不能包含回车符。如果寄存器变量的宽度大于字符串的大小,则使用 0 来填充左边的空余位;如果寄存器变量的宽度小于字符串大小,则会截去字符串左边多余的数据。例如,为存储字符串 "run.runoob.com", 需要 14*8bit 的存储单元:')]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" str "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("initial")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"run.runoob.com"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n")])])]),s("p",[t._v("有一些特殊字符在显示字符串中有特殊意义,例如换行符,制表符等。如果需要在字符串中显示这些特殊的字符,则需要在前面加前缀转义字符  \\ 。例如下表所示:")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("转义字符")]),t._v(" "),s("th",[t._v("显示字符")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("\\n")]),t._v(" "),s("td",[t._v("换行")])]),t._v(" "),s("tr",[s("td",[t._v("\\t")]),t._v(" "),s("td",[t._v("制表符")])]),t._v(" "),s("tr",[s("td",[t._v("%%")]),t._v(" "),s("td",[t._v("%")])]),t._v(" "),s("tr",[s("td",[t._v("\\")]),t._v(" "),s("td",[t._v("\\")])]),t._v(" "),s("tr",[s("td",[t._v('"')]),t._v(" "),s("td",[t._v('"')])]),t._v(" "),s("tr",[s("td",[t._v("\\ooo")]),t._v(" "),s("td",[t._v("1 到 3 个 8 进制数字字符")])])])]),t._v(" "),s("p",[t._v("其实,在 SystemVerilog(主要用于 Verilog 仿真的编程语言)语言中,已经可以直接用关键字 string 来表示字符串变量类型,这为 Verilog 的仿真带来了极大的便利。有兴趣的学者可以简单学习下 SystemVerilog。")])])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/36.abec5f79.js b/assets/js/36.abec5f79.js new file mode 100644 index 0000000..c5c9571 --- /dev/null +++ b/assets/js/36.abec5f79.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{320:function(t,s,a){"use strict";a.r(s);var r=a(14),n=Object(r.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_4-verilog-表达式"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-verilog-表达式"}},[t._v("#")]),t._v(" 4. Verilog 表达式")]),t._v(" "),s("h3",{attrs:{id:"表达式"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#表达式"}},[t._v("#")]),t._v(" 表达式")]),t._v(" "),s("p",[t._v("表达式由操作符和操作数构成,其目的是根据操作符的意义得到一个计算结果。表达式可以在出现数值的任何地方使用。例如:")]),t._v(" "),s("h2",{attrs:{id:"实例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("b "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//a与b进行异或操作*")]),t._v("\naddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10'b1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//地址累加*")]),t._v("\nflag1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" flag2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//逻辑与操作*")]),t._v("\n")])])]),s("h3",{attrs:{id:"操作数"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#操作数"}},[t._v("#")]),t._v(" 操作数")]),t._v(" "),s("p",[t._v("操作数可以是任意的数据类型,只是某些特定的语法结构要求使用特定类型的操作数。")]),t._v(" "),s("p",[t._v("操作数可以为常数,整数,实数,线网,寄存器,时间,位选,域选,存储器及函数调用等。")]),t._v(" "),s("h2",{attrs:{id:"实例-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-2"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("module")]),t._v(" test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//实数*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("real")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" b "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//寄存器*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" cprmu_1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cprmu_2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token important"}},[t._v("always @")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("posedge")]),t._v(" clk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n cprmu_2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" cprmu_1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v(" cprmu_2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n \n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//函数*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" flag1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nflag "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("calculate_result")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("A"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//非法操作数*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("wire")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token important"}},[t._v("always@")]),t._v(" ("),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(")"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("begin")]),t._v("\n res "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" cprmu_2 – cprmu_1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//temp = cprmu_2 – cprmu_1 ; //不合法,always块里赋值对象不能是wire型*")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("end")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("endmodule")]),t._v("\n")])])]),s("h3",{attrs:{id:"操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#操作符"}},[t._v("#")]),t._v(" 操作符")]),t._v(" "),s("p",[t._v("Verilog 中提供了大约 9 种操作符,分别是算术、关系、等价、逻辑、按位、归约、移位、拼接、条件操作符。")]),t._v(" "),s("p",[t._v("大部分操作符与 C 语言中类似。同类型操作符之间,除条件操作符从右往左关联,其余操作符都是自左向右关联。圆括号内表达式优先执行。例如下面每组的 2 种写法都是等价的。")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//自右向左关联,两种写法等价")]),t._v("\nA"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("C "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("A"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("B)"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("C "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//自右向左关联,两种写法等价,结果为 B、D 或 F")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" D "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" F "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" D "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" F"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//自右向左关联,两种写法不等价")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" C"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" D "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" F "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果 D 或 F")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" D "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" F "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 B、D 或 F")]),t._v("\n")])])]),s("p",[t._v("不同操作符之间,优先级是不同的。下表列出了操作符优先级从高至低的排列顺序。当没有圆括号时,Verilog 会根据操作符优先级对表达式进行计算。为了避免由操作符优先级导致的计算混乱,在不确定优先级时,建议用圆括号将表达式区分开来。")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("操作符")]),t._v(" "),s("th",[t._v("操作符号")]),t._v(" "),s("th",[t._v("优先级")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("单目运算")]),t._v(" "),s("td",[t._v("+ - ! ~")]),t._v(" "),s("td",[t._v("最高")])]),t._v(" "),s("tr",[s("td",[t._v("乘、除、取模")]),t._v(" "),s("td",[t._v("* / %")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[t._v("加减")]),t._v(" "),s("td",[t._v("+ -")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[t._v("移位")]),t._v(" "),s("td",[t._v("<<  >>")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[t._v("关系")]),t._v(" "),s("td",[t._v("<  <=  >  >=")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[t._v("等价")]),t._v(" "),s("td",[t._v("==  !=  ===  !===")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[t._v("归约")]),t._v(" "),s("td",[t._v("& ~&")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td"),t._v(" "),s("td",[t._v("^ ~^")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td"),t._v(" "),s("td"),t._v(" "),s("td",[t._v("~")])]),t._v(" "),s("tr",[s("td",[t._v("逻辑")]),t._v(" "),s("td",[t._v("&&")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td"),t._v(" "),s("td"),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[t._v("条件")]),t._v(" "),s("td",[t._v("?:")]),t._v(" "),s("td",[t._v("最低")])])])]),t._v(" "),s("h3",{attrs:{id:"算术操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#算术操作符"}},[t._v("#")]),t._v(" 算术操作符")]),t._v(" "),s("p",[t._v("算术操作符包括单目操作符和双目操作符。")]),t._v(" "),s("p",[t._v("双目操作符对 2 个操作数进行算术运算,包括乘(*)、除(/)、加(+)、减(-)、求幂()、取模(%)。")]),t._v(" "),s("h2",{attrs:{id:"实例-3"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-3"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\na "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b0010")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nb "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b1001")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为c=b'b1011*")]),t._v("\nc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为c=4,取整*")]),t._v("\n")])])]),s("p",[t._v("如果操作数某一位为 X,则计算结果也会全部出现 X。例如:")]),t._v(" "),s("h2",{attrs:{id:"实例-4"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-4"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("b "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b100x")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("b "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为c=4'bxxxx*")]),t._v("\n")])])]),s("p",[t._v("对变量进行声明时,要根据变量的操作符对变量的位宽进行合理声明,不要让结果溢出。上述例子中,相加的 2 个变量位宽为 4bit,那么结果寄存器变量位宽最少为 5bit。否则,高位将被截断,导致结果高位丢失。无符号数乘法时,结果变量位宽应该为 2 个操作数位宽之和。")]),t._v(" "),s("h2",{attrs:{id:"实例-5"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-5"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" mula "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" mulb"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("reg")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" res "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmula "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'he")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmulb "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'h3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nres "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mula "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" mulb "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为res=6'h2a, 数据结果没有丢失位数*")]),t._v("\n")])])]),s("ul",[s("li",[t._v("和 - 也可以作为单目操作符来使用,表示操作数的正负性。此类操作符优先级最高。")])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("-4 //表示负4\n+3 //表示正3\n")])])]),s("p",[t._v("负数表示时,可以直接在十进制数字前面增加一个减号 -,也可以指定位宽。因为负数使用二进制补码来表示,不指定位宽来表示负数,编译器在转换时,会自动分配位宽,从而导致意想不到的结果。例如:")]),t._v(" "),s("h2",{attrs:{id:"实例-6"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-6"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("mula "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'd4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nmulb "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nres "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mula "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" mulb "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//计算结果为res=-6'd8, 即res=6'h38,正常*")]),t._v("\nres "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mula "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("'d4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//(4的32次幂-4) * 2, 结果异常*")]),t._v("\n")])])]),s("h3",{attrs:{id:"关系操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#关系操作符"}},[t._v("#")]),t._v(" 关系操作符")]),t._v(" "),s("p",[t._v("关系操作符有大于(>),小于(<),大于等于(>=),小于等于(<=)。")]),t._v(" "),s("p",[t._v("关系操作符的正常结果有 2 种,真(1)或假(0)。")]),t._v(" "),s("p",[t._v("如果操作数中有一位为 x 或 z,则关系表达式的结果为 x。")]),t._v(" "),s("h2",{attrs:{id:"实例-7"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-7"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3'b1xx")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//为真*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//为假*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" Z "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//为X,不确定*")]),t._v("\n")])])]),s("h3",{attrs:{id:"等价操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#等价操作符"}},[t._v("#")]),t._v(" 等价操作符")]),t._v(" "),s("p",[t._v("等价操作符包括逻辑相等(==),逻辑不等(!=),全等(===),非全等(!==)。")]),t._v(" "),s("p",[t._v("等价操作符的正常结果有 2 种:为真(1)或假(0)。")]),t._v(" "),s("p",[t._v("逻辑相等/不等操作符不能比较 x 或 z,当操作数包含一个 x 或 z,则结果为不确定值。")]),t._v(" "),s("p",[t._v("全等比较时,如果按位比较有相同的 x 或 z,返回结果也可以为 1,即全等比较可比较 x 或 z。所以,全等比较的结果一定不包含 x。举例如下:")]),t._v(" "),s("h2",{attrs:{id:"实例-8"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-8"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8'h04")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'bxxxx")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nD "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'hx")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//为真*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//为假*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//为X,不确定*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//为假,返回值为0*")]),t._v("\nC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" D "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//为真,返回值为1*")]),t._v("\n")])])]),s("h3",{attrs:{id:"逻辑操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#逻辑操作符"}},[t._v("#")]),t._v(" 逻辑操作符")]),t._v(" "),s("p",[t._v("逻辑操作符主要有 3 个:&&(逻辑与), ||(逻辑或),!(逻辑非)。")]),t._v(" "),s("p",[t._v("逻辑操作符的计算结果是一个 1 bit 的值,0 表示假,1 表示真,x 表示不确定。")]),t._v(" "),s("p",[t._v("如果一个操作数不为 0,它等价于逻辑 1;如果一个操作数等于 0,它等价于逻辑 0。如果它任意一位为 x 或 z,它等价于 x。")]),t._v(" "),s("p",[t._v("如果任意一个操作数包含 x,逻辑操作符运算结果不一定为 x。")]),t._v(" "),s("p",[t._v("逻辑操作符的操作数可以为变量,也可以为表达式。例如:")]),t._v(" "),s("h2",{attrs:{id:"实例-9"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-9"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b1x")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 为假*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 为真*! A *// 为假*! B *// 为真*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 为X,不确定*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 为真,因为A为真*(A==2) && (! B) *//为真,此时第一个操作数为表达式*")]),t._v("\n")])])]),s("h3",{attrs:{id:"按位操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#按位操作符"}},[t._v("#")]),t._v(" 按位操作符")]),t._v(" "),s("p",[t._v("按位操作符包括:取反(~),与(&),或(|),异或(^),同或(~^)。")]),t._v(" "),s("p",[t._v("按位操作符对 2 个操作数的每 1 bit 数据进行按位操作。")]),t._v(" "),s("p",[t._v("如果 2 个操作数位宽不相等,则用 0 向左扩展补充较短的操作数。")]),t._v(" "),s("p",[t._v("取反操作符只有一个操作数,它对操作数的每 1 bit 数据进行取反操作。")]),t._v(" "),s("p",[t._v("下图给出了按位操作符的逻辑规则。")]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("&(与)")]),t._v(" "),s("th",[t._v("0")]),t._v(" "),s("th",[t._v("1")]),t._v(" "),s("th",[t._v("x")]),t._v(" "),s("th"),t._v(" "),s("th"),t._v(" "),s("th",[t._v("(或)")]),t._v(" "),s("th",[t._v("0")]),t._v(" "),s("th",[t._v("1")]),t._v(" "),s("th",[t._v("x")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td"),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td"),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td")]),t._v(" "),s("tr",[s("td",[t._v("x")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td"),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td")])])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("^(异或)")]),t._v(" "),s("th",[t._v("0")]),t._v(" "),s("th",[t._v("1")]),t._v(" "),s("th",[t._v("x")]),t._v(" "),s("th"),t._v(" "),s("th",[t._v("~^(同或)")]),t._v(" "),s("th",[t._v("0")]),t._v(" "),s("th",[t._v("1")]),t._v(" "),s("th",[t._v("x")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[t._v("0")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td"),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("x")])]),t._v(" "),s("tr",[s("td",[t._v("1")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td"),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("0")]),t._v(" "),s("td",[t._v("1")]),t._v(" "),s("td",[t._v("x")])]),t._v(" "),s("tr",[s("td",[t._v("x")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td"),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td",[t._v("x")]),t._v(" "),s("td",[t._v("x")])])])]),t._v(" "),s("h2",{attrs:{id:"实例-10"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-10"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b0101")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b1001")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'bx010")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("~")]),t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//4'b1010*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//4'b0001*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//4'b1101*")]),t._v("\nA"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//4'b1100*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("~^")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//4'b0011*")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("|")]),t._v(" C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//4'b1011*")]),t._v("\nB"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("C "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//4'bx000*")]),t._v("\n")])])]),s("h3",{attrs:{id:"归约操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#归约操作符"}},[t._v("#")]),t._v(" 归约操作符")]),t._v(" "),s("p",[t._v("归约操作符包括:归约与(&),归约与非(~&),归约或(|),归约或非(~|),归约异或(^),归约同或(~^)。")]),t._v(" "),s("p",[t._v("归约操作符只有一个操作数,它对这个向量操作数逐位进行操作,最终产生一个 1bit 结果。")]),t._v(" "),s("p",[t._v("逻辑操作符、按位操作符和归约操作符都使用相同的符号表示,因此有时候容易混淆。区分这些操作符的关键是分清操作数的数目,和计算结果的规则。")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b1010")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("A "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 1 & 0 & 1 & 0 = 1'b0,可用来判断变量A是否全1")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("~|")]),t._v("A "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 ~(1 | 0 | 1 | 0) = 1'b0, 可用来判断变量A是否为全0")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("^")]),t._v("A "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 1 ^ 0 ^ 1 ^ 0 = 1'b0")]),t._v("\n")])])]),s("h3",{attrs:{id:"移位操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#移位操作符"}},[t._v("#")]),t._v(" 移位操作符")]),t._v(" "),s("p",[t._v("移位操作符包括左移(<<),右移(>>),算术左移(<<<),算术右移(>>>)。")]),t._v(" "),s("p",[t._v("移位操作符是双目操作符,两个操作数分别表示要进行移位的向量信号(操作符左侧)与移动的位数(操作符右侧)。")]),t._v(" "),s("p",[t._v("算术左移和逻辑左移时,右边低位会补 0。")]),t._v(" "),s("p",[t._v("逻辑右移时,左边高位会补 0;而算术右移时,左边高位会补充符号位,以保证数据缩小后值的正确性。")]),t._v(" "),s("h2",{attrs:{id:"实例-11"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-11"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b1100")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b0010")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 4'b0011*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 4'b1000*")]),t._v("\nA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 4'b1000*")]),t._v("\nC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("A"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">>>")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 2 + (-4/4) = 1, 4'b0001*")]),t._v("\n")])])]),s("h3",{attrs:{id:"拼接操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#拼接操作符"}},[t._v("#")]),t._v(" 拼接操作符")]),t._v(" "),s("p",[t._v("拼接操作符用大括号 {,} 来表示,用于将多个操作数(向量)拼接成新的操作数(向量),信号间用逗号隔开。")]),t._v(" "),s("p",[t._v("拼接符操作数必须指定位宽,常数的话也需要指定位宽。例如:")]),t._v(" "),s("h2",{attrs:{id:"实例-12"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-12"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("A "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'b1010")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nY1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" A"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" A"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4'h3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为Y1='b1100_0011*")]),t._v("\nY2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3'd4")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 Y2=7'b111_1100*")]),t._v("\nY3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1'b0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("}}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//结果为 Y3=32h0,常用作寄存器初始化时匹配位宽的赋初值*")]),t._v("\n")])])]),s("h3",{attrs:{id:"条件操作符"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#条件操作符"}},[t._v("#")]),t._v(" 条件操作符")]),t._v(" "),s("p",[t._v("条件表达式有 3 个操作符,结构描述如下:")]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("condition_expression ? true_expression : false_expression\n")])])]),s("p",[t._v("计算时,如果 condition_expression 为真(逻辑值为 1),则运算结果为 true_expression;如果 condition_expression 为假(逻辑值为 0),则计算结果为 false_expression。")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" hsel "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hsel_p1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" hsel_p2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//当信号 addr 高 2bit 为 0 时,hsel 赋值为 hsel_p1; 否则,将 hsel_p2 赋值给 hsel。")]),t._v("\n")])])]),s("p",[t._v("其实,条件表达式类似于 2 路(或多路)选择器,其描述方式完全可以用 if-else 语句代替。")]),t._v(" "),s("p",[t._v("当然条件操作符也能进行嵌套,完成一个多次选择的逻辑。例如:")]),t._v(" "),s("h2",{attrs:{id:"实例-13"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#实例-13"}},[t._v("#")]),t._v(" 实例")]),t._v(" "),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" hsel "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b00")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hsel_p1 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b01")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hsel_p2 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hsel_p3 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("addr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2'b11")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" hsel_p4 "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/37.8dfc883c.js b/assets/js/37.8dfc883c.js new file mode 100644 index 0000000..e039e19 --- /dev/null +++ b/assets/js/37.8dfc883c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{323:function(t,r,e){"use strict";e.r(r);var i=e(14),s=Object(i.a)({},(function(){var t=this,r=t._self._c;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"_2024-02-21-chisel-bootcamp"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-21-chisel-bootcamp"}},[t._v("#")]),t._v(" 2024.02.21-Chisel BootCamp")]),t._v(" "),r("h2",{attrs:{id:"_2024-02-21-1-introduction-to-scala"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-21-1-introduction-to-scala"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1 Introduction to Scala.html"}},[t._v("2024.02.21-1. Introduction to Scala")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-02-23-2-1-first-chisel-module"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-23-2-1-first-chisel-module"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1 First Chisel Module.html"}},[t._v("2024.02.23-2.1 First Chisel Module")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-02-24-2-2-combinational-logic"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-24-2-2-combinational-logic"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2 Combinational Logic.html"}},[t._v("2024.02.24-2.2 Combinational Logic")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-02-25-2-3-control-flow"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-25-2-3-control-flow"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3 Control Flow.html"}},[t._v("2024.02.25-2.3 Control Flow")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-02-26-2-4-sequential-logic"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-26-2-4-sequential-logic"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4 Sequential Logic.html"}},[t._v("2024.02.26-2.4 Sequential Logic")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-02-28-2-5-fir-filter"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-28-2-5-fir-filter"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5 FIR Filter.html"}},[t._v("2024.02.28-2.5 FIR Filter")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-02-29-2-6-more-on-chiseltest"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-29-2-6-more-on-chiseltest"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6 More on ChiselTest.html"}},[t._v("2024.02.29-2.6 More on ChiselTest")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-03-01-3-1-generators-parameters"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-01-3-1-generators-parameters"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1 Generators Parameters.html"}},[t._v("2024.03.01-3.1 Generators: Parameters")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-03-03-3-2-generators-collections"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-03-3-2-generators-collections"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2 Generators Collections.html"}},[t._v("2024.03.03-3.2 Generators: Collections")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-03-04-3-3-interlude-chisel-standard-library"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-04-3-3-interlude-chisel-standard-library"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3 Interlude Chisel Standard Library.html"}},[t._v("2024.03.04-3.3 Interlude: Chisel Standard Library")])],1),t._v(" "),r("h2",{attrs:{id:"_2024-03-05-3-4-higher-order-functions"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-05-3-4-higher-order-functions"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4 Higher-Order Functions.html"}},[t._v("2024.03.05-3.4 Higher-Order Functions")])],1)])}),[],!1,null,null,null);r.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/38.0b923555.js b/assets/js/38.0b923555.js new file mode 100644 index 0000000..dc82efd --- /dev/null +++ b/assets/js/38.0b923555.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{326:function(t,s,a){"use strict";a.r(s);var e=a(14),n=Object(e.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-02-21-1-introduction-to-scala"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-21-1-introduction-to-scala"}},[t._v("#")]),t._v(" 2024.02.21-1. Introduction to Scala")]),t._v(" "),s("h2",{attrs:{id:"variables-and-constants-var-and-val"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#variables-and-constants-var-and-val"}},[t._v("#")]),t._v(" Variables and Constants - "),s("code",[t._v("var")]),t._v(" and "),s("code",[t._v("val")])]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" numberOfKittens "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" kittensPerHouse "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("101")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" alphabet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"abcdefghijklmnopqrstuvwxyz"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" done "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('/*\nnumberOfKittens: Int = 6\nkittensPerHouse: Int = 101\nalphabet: String = "abcdefghijklmnopqrstuvwxyz"\ndone: Boolean = false\n*/')]),t._v("\n")])])]),s("p",[t._v("变量使用"),s("code",[t._v("var")]),t._v("声明,常量则使用"),s("code",[t._v("val")])]),t._v(" "),s("h2",{attrs:{id:"conditionals"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#conditionals"}},[t._v("#")]),t._v(" Conditionals")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("done"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"we are done"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("numberOfKittens "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" kittensPerHouse"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"more kittens!"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n numberOfKittens "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n done "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("类似于 C++,如果只有一行,可以省略大括号")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" likelyCharactersSet "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("alphabet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("26")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"english"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"not english"')]),t._v("\n\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("likelyCharactersSet"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// likelyCharactersSet: String = "english"')]),t._v("\n")])])]),s("p",[s("code",[t._v("if")]),t._v("这一串的返回值又所选择的分支的最后一行确定")]),t._v(" "),s("h2",{attrs:{id:"methods-functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#methods-functions"}},[t._v("#")]),t._v(" Methods (Functions)")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Simple scaling function with an input argument, e.g., times2(3) returns 6")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Curly braces can be omitted for short one-line functions.")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" times2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" x\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// More complicated function")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" distance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" y"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" returnPositive"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" xy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" y\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("returnPositive"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" xy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("xy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("abs\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"overloading-functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#overloading-functions"}},[t._v("#")]),t._v(" Overloading Functions")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Overloaded function")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" times2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" x\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" times2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt\n\ntimes2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 10")]),t._v("\ntimes2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"7"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 14")]),t._v("\n")])])]),s("h3",{attrs:{id:"recursive-and-nested-functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#recursive-and-nested-functions"}},[t._v("#")]),t._v(" Recursive and Nested Functions")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" asciiTriangle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rows"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// This is cute: multiplying "X" makes a string with many copies of "X"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Unit means no return value")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" printRow"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("columns"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Unit")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"X"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" columns"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rows "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n printRow"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rows"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n asciiTriangle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("rows "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Here is the recursive call")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// printRow(1) // This would not work, since we're calling printRow outside its scope")]),t._v("\nasciiTriangle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Output:")]),t._v("\nXXXXXX\nXXXXX\nXXXX\nXXX\nXX\nX\n")])])]),s("h3",{attrs:{id:"named-parameters-and-parameter-defaults"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#named-parameters-and-parameter-defaults"}},[t._v("#")]),t._v(" Named Parameters and Parameter Defaults")]),t._v(" "),s("p",[t._v("Consider the following method definition.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" myMethod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("count"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wrap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Boolean")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wrapValue"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Unit")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("When calling the method, you will often see the parameter names along with the passed-in values.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("myMethod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("count"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wrap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wrapValue"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("23")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("Using named parameters, you can even call the function with a different ordering.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("myMethod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrapValue"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("23")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" wrap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("For frequently called methods, the parameter ordering may be obvious. But for less common methods and, in particular, boolean arguments, including the names with calls can make your code a lot more readable. If methods have a long list of arguments of the same type, using names also decreases the chance of error. Parameters to class definitions also use this named argument scheme (they are actually just the parameters to the constructor method for the class).")]),t._v(" "),s("p",[t._v("When certain parameters have default values (that don't need to be overridden), callers only have to pass (by name) specific arguments that do not use defaults. Notice that the parameter  "),s("code",[t._v("wrapValue")]),t._v(" has a default value of 24. Therefore, this will work as if 24 had been passed in.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("myMethod"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("wrap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" count"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h2",{attrs:{id:"lists"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#lists"}},[t._v("#")]),t._v(" Lists")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" y "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" list1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" list2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" y "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" y "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" Nil "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// An alternate notation for assembling a list")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Nil就是一个空的List[Nothing],即一个可以封装任何类型元素但又没有元素的容器")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" list3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" list1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),t._v(" list2 "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Appends the second list to the first list")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" m "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" list2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" list2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" headOfList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" list1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("head "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Gets the first element of the list")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" restOfList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" list1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tail "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get a new list with first element removed")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" third "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" list1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Gets the third element of a list (0-indexed)")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Output:")]),t._v("\nx"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\ny"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),t._v("\nlist1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nlist2"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nlist3"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nm"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\ns"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\nheadOfList"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\nrestOfList"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nthird"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\n")])])]),s("h2",{attrs:{id:"for-statement"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#for-statement"}},[t._v("#")]),t._v(" "),s("code",[t._v("for")]),t._v(" Statement")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" to "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" print"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('" "')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// include 7")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\ni "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// exclude 7")]),t._v("\ni "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" to "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v(" by "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("\n")])])]),s("p",[s("code",[t._v("print")]),t._v(" 用于连续输出不换行,而 "),s("code",[t._v("println")]),t._v(" 用于输出后换行。")]),t._v(" "),s("p",[s("code",[t._v("<-")]),t._v(" 是用在 for 循环构造中的一个操作符,表示从一个集合中逐一取出元素")]),t._v(" "),s("h2",{attrs:{id:"packages-and-imports"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#packages-and-imports"}},[t._v("#")]),t._v(" Packages and Imports")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("package")]),t._v(" 用于定义一个命名空间,它可以包含类、对象和特质(traits),以及其他包。包主要用于组织和管理代码,防止命名冲突,并提供访问控制。")]),t._v(" "),s("li",[s("code",[t._v("class")]),t._v(" 是定义数据结构及其行为的蓝图。它可以包含数据成员(属性)和方法。类用于实例化对象,每个对象都可以拥有不同的属性值。")])]),t._v(" "),s("p",[s("code",[t._v("import")]),t._v("语句可以用来引入包、类、对象,甚至是特定的方法或属性。这意味着你可以使用"),s("code",[t._v("import")]),t._v("来引用几乎任何你需要的代码实体。以下是一些例子:")]),t._v(" "),s("ul",[s("li",[t._v("引入一个包中的所有成员:"),s("code",[t._v("import scala.collection.mutable._")]),t._v(",这里的"),s("code",[t._v("_")]),t._v("相当于 Java 中的``,表示引入"),s("code",[t._v("mutable")]),t._v("包下的所有成员。")]),t._v(" "),s("li",[t._v("引入一个特定的类:"),s("code",[t._v("import scala.collection.mutable.ListBuffer")]),t._v(",这表示只引入"),s("code",[t._v("ListBuffer")]),t._v("类。")]),t._v(" "),s("li",[t._v("引入一个包中的多个类:"),s("code",[t._v("import scala.collection.mutable.{ArrayBuffer, LinkedList}")]),t._v(",这表示同时引入"),s("code",[t._v("ArrayBuffer")]),t._v("和"),s("code",[t._v("LinkedList")]),t._v("两个类。")]),t._v(" "),s("li",[t._v("引入一个对象中的特定成员:"),s("code",[t._v("import java.lang.System.{out => stdout}")]),t._v(",这里还演示了将"),s("code",[t._v("System.out")]),t._v("重命名为"),s("code",[t._v("stdout")]),t._v(",以便在代码中使用简化的名称。")])]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 从chisel3.iotesters包中引入特定的几个类:ChiselFlatSpec、Driver、和PeekPokeTester")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("chisel3"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iotesters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ChiselFlatSpec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Driver"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" PeekPokeTester"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"class"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#class"}},[t._v("#")]),t._v(" Class")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// WrapCounter counts up to a max value based on a bit size")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" WrapCounter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("counterBits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" max"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Long")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<<")]),t._v(" counterBits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" counter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0L")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" inc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Long")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n counter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" counter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("counter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" max"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n counter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n counter\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"counter created with max value ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("max")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ul",[s("li",[s("code",[t._v("class WrapCounter")]),t._v(" -- This is the definition of WrapCounter.")]),t._v(" "),s("li",[s("code",[t._v("(counterBits: Int)")]),t._v(" -- Creating a WrapCounter requires an integer parameter, nicely named to suggest it is the bit width of the counter.")]),t._v(" "),s("li",[t._v("Braces ({}) delimit a block of code. Most classes use a code block to define variables, constants, and methods (functions).")]),t._v(" "),s("li",[s("code",[t._v("val max: Long =")]),t._v(" -- the class contains a member variable max, declared as type "),s("code",[t._v("Long")]),t._v(" and initialized as the class is created.")]),t._v(" "),s("li",[s("code",[t._v("(1 << counterBits) - 1")]),t._v(" computes the maximum value that can be contained in counterBits bits. Since max was created with "),s("code",[t._v("val")]),t._v(" it cannot be changed.")]),t._v(" "),s("li",[t._v("A variable counter is created and initialized to 0L. The L says that 0 is a long value; thus, counter is inferred to be Long.")]),t._v(" "),s("li",[t._v("max and counter are commonly called "),s("em",[t._v("member variables")]),t._v(" of the class.")]),t._v(" "),s("li",[t._v("A class method inc is defined which takes no arguments and returns a Long value.")]),t._v(" "),s("li",[t._v("The body of the method inc is a code block that has:\n"),s("ul",[s("li",[s("code",[t._v("counter = counter + 1")]),t._v(" increments counter.")]),t._v(" "),s("li",[s("code",[t._v("if (counter > max) { counter = 0 }")]),t._v(" tests if the counter is greater than the max value and sets it back to zero if it is.")]),t._v(" "),s("li",[s("code",[t._v("counter")]),t._v(" -- The last line of the code block is important.\n"),s("ul",[s("li",[t._v("Any value expressed as the last line of a code block is considered to be the return value of that code block. The return value can be used or ignored by the calling statement.")]),t._v(" "),s("li",[t._v("This applies quite generally; for example, since an "),s("code",[t._v("if")]),t._v(" then "),s("code",[t._v("else")]),t._v(" statement defines its true and false clauses with code blocks, it can return a value i.e., "),s("code",[t._v('val result = if (10 * 10 > 90) "greater" else "lesser"')]),t._v(" would create a "),s("code",[t._v("val")]),t._v(' with the value "greater".')])])]),t._v(" "),s("li",[t._v("So in this case the function inc returns the value of counter.")])])]),t._v(" "),s("li",[s("code",[t._v('println(s"counter created with max value $max")')]),t._v(" prints a string to standard output. Because the println is directly in the defining code block, it is part of the class initialization code and is run, i.e. prints out the string, every time an instance of this class is created.")]),t._v(" "),s("li",[t._v("The string printed in this case is an "),s("em",[t._v("interpolated")]),t._v(" string.\n"),s("ul",[s("li",[t._v("The leading s in front of the first double quote identifies this as an interpolated string.")]),t._v(" "),s("li",[t._v("An interpolated string is processed at run time.")]),t._v(" "),s("li",[t._v("The $max is replaced with the value of max.")]),t._v(" "),s("li",[t._v("If the $ is followed by a code block, arbitrary Scala can be in that code block.\n"),s("ul",[s("li",[t._v("For example, "),s("code",[t._v('println(s"doubled max is ${max + max}")')]),t._v(".")]),t._v(" "),s("li",[t._v("The return value of this code block will be inserted in place of "),s("code",[t._v("${...}")]),t._v(".")]),t._v(" "),s("li",[t._v("If the return value is not a string, it will be converted to one; virtually every class or type in scala has an implicit conversion to a string defined).")])])]),t._v(" "),s("li",[t._v("You should generally avoid printing something every time an instance of a class is created to avoid flooding standard output, unless you're debugging.")])]),t._v(" "),s("h3",{attrs:{id:"creating-an-instance-of-a-class"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#creating-an-instance-of-a-class"}},[t._v("#")]),t._v(" Creating an Instance of a Class")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" WrapCounter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nx"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("inc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Increments the counter")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Member variables of the instance x are visible to the outside, unless they are declared private")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("counter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("max"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"counter is about to wrap"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nx inc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Scala allows the dots to be omitted; this can be useful for making embedded DSL's look more natural")]),t._v("\n")])])]),t._v("有时候实例化类时不需要使用"),s("code",[t._v("new")]),t._v("关键字,这通常是因为该类定义了一个或多个"),s("code",[t._v("apply")]),t._v("方法。"),s("code",[t._v("apply")]),t._v("方法可以在类的伴生对象(companion object)中定义,允许你直接通过类名加括号的方式创建类的实例,而不需要显式地使用"),s("code",[t._v("new")]),t._v("关键字。这种方式提供了一种更简洁的语法来创建对象,同时也可以在"),s("code",[t._v("apply")]),t._v("方法内部执行初始化操作或参数处理,为对象创建提供更多的灵活性和控制。\n例如,假设有一个名为"),s("code",[t._v("Person")]),t._v("的类及其伴生对象,伴生对象中定义了"),s("code",[t._v("apply")]),t._v("方法:"),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" Person"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("object")]),t._v(" Person "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" apply"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Person "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Person"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),t._v("在这个例子中,可以通过调用"),s("code",[t._v("Person")]),t._v("伴生对象的"),s("code",[t._v("apply")]),t._v("方法来创建"),s("code",[t._v("Person")]),t._v("类的实例,而不需要使用"),s("code",[t._v("new")]),t._v("关键字:"),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" person "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Person"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Alice"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('// 相当于调用 Person.apply("Alice")')]),t._v("\n")])])]),t._v("这里,"),s("code",[t._v('Person("Alice")')]),t._v("实际上调用的是伴生对象中的"),s("code",[t._v("apply")]),t._v("方法,该方法内部使用"),s("code",[t._v("new")]),t._v("关键字创建了"),s("code",[t._v("Person")]),t._v("类的实例。这种方式使得代码看起来更简洁,同时保留了通过构造函数创建对象的灵活性。")])]),t._v(" "),s("h2",{attrs:{id:"code-blocks"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#code-blocks"}},[t._v("#")]),t._v(" Code Blocks")]),t._v(" "),s("p",[t._v("Code blocks are delimited by braces. A block can contain zero or more lines of Scala code. The last line of Scala code becomes the return value (which may be ignored) of the code block. A code block with no lines would return a special null-like object called "),s("code",[t._v("Unit")]),t._v(". Code blocks are used throughout Scala: they are the bodies of class definitions, they form function and method definitions, they are the clauses of "),s("code",[t._v("if")]),t._v(" statements, and they are the bodies of "),s("code",[t._v("for")]),t._v(" and many other Scala operators.")]),t._v(" "),s("h3",{attrs:{id:"parameterized-code-blocks"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#parameterized-code-blocks"}},[t._v("#")]),t._v(" Parameterized Code Blocks")]),t._v(" "),s("p",[t._v("Code blocks can take parameters. In the case of class and method definitions, these parameters look like those in most conventional programming languages. In the example below, "),s("code",[t._v("c")]),t._v(" and "),s("code",[t._v("s")]),t._v(" are parameters of the code blocks.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// A one-line code block doesn't need to be enclosed in {}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" add1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" RepeatString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("String")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" repeatedString "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" s "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" s\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("IMPORTANT: There is another way in which code blocks may be parameterized. Here is an example.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" intList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" stringList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" intList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toString\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("使用"),s("code",[t._v("map")]),t._v("方法对"),s("code",[t._v("intList")]),t._v("中的每个元素应用一个函数,该函数将整数转换为其对应的字符串表示。具体来说,"),s("code",[t._v("map")]),t._v("方法遍历"),s("code",[t._v("intList")]),t._v("中的每个元素(用"),s("code",[t._v("i")]),t._v("表示),并对每个元素执行"),s("code",[t._v("i.toString")]),t._v("操作,将其转换为字符串。This type of code block is called an anonymous function, and more details on anonymous functions are provided in a later module.")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/39.22285f4f.js b/assets/js/39.22285f4f.js new file mode 100644 index 0000000..f3e2f1b --- /dev/null +++ b/assets/js/39.22285f4f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{327:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-02-23-2-1-first-chisel-module"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-23-2-1-first-chisel-module"}},[t._v("#")]),t._v(" 2024.02.23-2.1 First Chisel Module")]),t._v(" "),s("h2",{attrs:{id:"setup"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setup"}},[t._v("#")]),t._v(" Setup")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" path "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" System"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("getProperty"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"user.dir"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/source/load-ivy.sc"')]),t._v("\ninterp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("load"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("module"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ammonite"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ops"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("java"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("FileSystems"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("getDefault"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("getPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("chisel3"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("_\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("chisel3"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("_\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("chisel3"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tester"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("_\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("chisel3"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tester"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("RawTester"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("test\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("dotvisualizer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")])]),t._v("_\n")])])]),s("p",[t._v("这两句代码在使用 Chisel(一种硬件描述语言)时,涉及到 Ammonite 脚本的动态加载。第一句定义了一个"),s("code",[t._v("path")]),t._v("变量,它通过获取系统属性"),s("code",[t._v('"user.dir"')]),t._v("(当前用户目录)并附加上"),s("code",[t._v('"/source/load-ivy.sc"')]),t._v("路径,用于指定一个 Scala 脚本文件的位置。第二句使用 Ammonite 的"),s("code",[t._v("interp.load.module")]),t._v("方法动态加载这个指定路径下的 Scala 脚本文件。")]),t._v(" "),s("p",[t._v("动态加载脚本在使用 Chisel 编写代码时可以有多个用途,如:")]),t._v(" "),s("ol",[s("li",[t._v("引入依赖:动态加载"),s("code",[t._v("load-ivy.sc")]),t._v("脚本可以用来引入或更新 Ammonite 会话中的 Ivy 依赖,确保代码运行时有必要的库支持。")]),t._v(" "),s("li",[t._v("执行初始化代码:可以在脚本中执行必要的初始化操作,为后续的 Chisel 硬件设计代码执行设置适当的环境或参数。")]),t._v(" "),s("li",[t._v("灵活性和模块化:通过动态加载脚本,可以根据需要灵活地加载和卸载模块,使代码结构更加模块化,便于管理和维护。")])]),t._v(" "),s("ul",[s("li",[s("code",[t._v("import chisel3._")]),t._v(":基础的 Chisel 功能,包括定义硬件组件的基本构建块。")]),t._v(" "),s("li",[s("code",[t._v("import chisel3.util._")]),t._v(":提供了一些实用工具和额外的硬件构建块,比如计数器、移位寄存器等。")]),t._v(" "),s("li",[s("code",[t._v("import chisel3.tester._")]),t._v(":提供了测试 Chisel 硬件设计的工具和框架。")]),t._v(" "),s("li",[s("code",[t._v("import chisel3.tester.RawTester.test")]),t._v(":是"),s("code",[t._v("chisel3.tester")]),t._v("中的一个具体的测试功能,用于执行硬件测试。")])]),t._v(" "),s("h2",{attrs:{id:"example-module"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-module"}},[t._v("#")]),t._v(" Example Module")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" Passthrough "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// with parameter")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" PassthroughGenerator"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("width"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("width"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("width"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" Passthrough "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n")])])]),s("p",[t._v("我们声明一个叫做"),s("code",[t._v("Passthrough")]),t._v("的新模块。"),s("code",[t._v("Module")]),t._v("是 Chisel 内置的一个类,所有硬件模块都必须扩展它")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("我们在一个特殊的"),s("code",[t._v("io")]),t._v("变量中声明所有的输入和输出端口。它必须被命名为"),s("code",[t._v("io")]),t._v(",并且是一个"),s("code",[t._v("IO")]),t._v("对象或实例,这需要形如"),s("code",[t._v("IO(_instantiated_bundle_)")]),t._v("的东西")]),t._v(" "),s("p",[t._v("在 Chisel 中,"),s("code",[t._v("io")]),t._v("、"),s("code",[t._v("in")]),t._v("和"),s("code",[t._v("out")]),t._v("被声明为"),s("code",[t._v("val")]),t._v("(不可变引用)而不是"),s("code",[t._v("var")]),t._v("(可变引用),因为它们代表硬件模块的接口。在硬件设计中,接口的结构(例如信号的数量、类型和方向)在编译时确定且不会改变。虽然信号的值在模拟过程中会变化,但信号的定义(即接口)是固定的。使用"),s("code",[t._v("val")]),t._v("声明这些接口强调了它们是不变的结构,而信号值的变化则通过信号之间的连接和赋值来体现,这与软件编程中变量的概念有所不同。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("我们声明了一个新的硬件结构类型(Bundle),它包含了一些命名的信号"),s("code",[t._v("in")]),t._v("和"),s("code",[t._v("out")]),t._v(",分别具有输入和输出的方向。")]),t._v(" "),s("p",[t._v("在 Chisel 中,"),s("code",[t._v("Bundle")]),t._v("是一种用于定义一组相关信号的类,类似于 Verilog 中的"),s("code",[t._v("module")]),t._v("内部信号或 VHDL 中的"),s("code",[t._v("record")]),t._v("。它允许开发者将多个信号组合成一个单一的复合类型,这样可以更方便地管理和传递数据结构。每个"),s("code",[t._v("Bundle")]),t._v("内的信号可以有不同的类型和方向(如输入"),s("code",[t._v("Input")]),t._v("、输出"),s("code",[t._v("Output")]),t._v("),使其成为定义模块接口和内部数据结构的强大工具。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("我们声明了信号的硬件类型。在这个案例中,它是宽度为 4 的无符号整数。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n")])])]),s("p",[t._v("我们将我们的输入端口连接到我们的输出端口,这样"),s("code",[t._v("io.in")]),s("em",[t._v("驱动")]),s("code",[t._v("io.out")]),t._v("。注意,"),s("code",[t._v(":=")]),t._v("操作符是一个"),s("em",[t._v("Chisel")]),t._v("操作符,它表示右手边的信号驱动左手边的信号。它是一个有方向的操作符。")]),t._v(" "),s("p",[t._v("硬件构建语言(HCLs)的一个整洁之处在于我们可以使用底层的编程语言作为脚本语言。例如,在声明我们的 Chisel 模块之后,我们接着使用 Scala 调用 Chisel 编译器将 Chisel 的"),s("code",[t._v("Passthrough")]),t._v("翻译成 Verilog 的"),s("code",[t._v("Passthrough")]),t._v("。这个过程被称为"),s("em",[t._v("精炼")]),t._v("。")]),t._v(" "),s("h3",{attrs:{id:"generate-verilog"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#generate-verilog"}},[t._v("#")]),t._v(" Generate Verilog")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getVerilog"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Passthrough"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("module")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("Passthrough")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" reset"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" io_in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("output")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" io_out\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("assign")]),t._v(" io_out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io_in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// @[cmd2.sc 6:10]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("endmodule")]),t._v("\n")])])]),s("h3",{attrs:{id:"generate-firrtl"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#generate-firrtl"}},[t._v("#")]),t._v(" Generate Firrtl")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("getFirrtl"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Passthrough"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("div",{staticClass:"language-verilog extra-class"},[s("pre",{pre:!0,attrs:{class:"language-verilog"}},[s("code",[t._v("circuit Passthrough "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("module")]),t._v(" Passthrough "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" clock "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" Clock\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("input")]),t._v(" reset "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("output")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("{")]),t._v(" flip in "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">}")]),t._v("\n\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in @"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("cmd2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("sc "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),s("h2",{attrs:{id:"example-tester"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-tester"}},[t._v("#")]),t._v(" Example Tester")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Scala Code: `test` runs the unit test.")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// test takes a user Module and has a code block that applies pokes and expects to the")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// circuit under test (c)")]),t._v("\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Passthrough"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set our input to value 0")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Assert that the output correctly has 0")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set our input to value 1")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Assert that the output correctly has 1")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set our input to value 2")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Assert that the output correctly has 2")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"SUCCESS!!"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Scala Code: if we get here, our tests passed!")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Test with width 10")]),t._v("\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" PassthroughGenerator"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set our input to value 0")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Assert that the output correctly has 0")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set our input to value 1")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Assert that the output correctly has 1")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Set our input to value 2")]),t._v("\n\t\tc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Assert that the output correctly has 2")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ul",[s("li",[s("code",[t._v("c.io.in.poke(0.U)")]),t._v(":设置模块的输入"),s("code",[t._v("in")]),t._v("为 0。")]),t._v(" "),s("li",[s("code",[t._v("c.io.out.expect(0.U)")]),t._v(":检查模块的输出"),s("code",[t._v("out")]),t._v("是否为 0,确保电路按预期工作。")]),t._v(" "),s("li",[t._v("接下来,代码以相同的方式测试输入值 1 和 2,分别使用"),s("code",[t._v("poke")]),t._v("方法设置输入值,并用"),s("code",[t._v("expect")]),t._v("方法验证输出值。")])]),t._v(" "),s("p",[t._v("在 Scala 中,可以直接在函数调用后跟一个代码块,这是因为 Scala 支持高阶函数,即可以接受函数作为参数的函数。在这个例子中,"),s("code",[t._v("test")]),t._v("函数接受两个参数:一个是"),s("code",[t._v("Passthrough")]),t._v("模块的实例,另一个是一个匿名函数(或称为代码块),这个匿名函数以"),s("code",[t._v("c")]),t._v("作为参数进行操作。这种语法使得代码更加简洁易读,允许直接在调用函数时定义行为逻辑,非常适合进行单元测试等场景。当一个函数的最后一个参数是函数类型时,可以使用特殊的语法糖允许将这个函数参数写在方法调用的外部。这种语法不仅使得代码更加清晰,而且在使用匿名函数或代码块作为参数时尤其有用,因为它允许代码块在视觉上更为突出,从而提高了代码的可读性。这就是为什么"),s("code",[t._v("test(new Passthrough())")]),t._v("后面可以直接跟一个代码块的原因。")]),t._v(" "),s("p",[s("code",[t._v("c =>")]),t._v("是一个函数字面量(匿名函数)的语法,用于定义一个函数。这里,"),s("code",[t._v("c")]),t._v("是函数的参数,"),s("code",[t._v("=>")]),t._v("后面跟着的是函数体。在这个上下文中,"),s("code",[t._v("c")]),t._v("代表传递给测试代码块的模块实例(如"),s("code",[t._v("Passthrough")]),t._v("模块实例),然后在代码块内部,你可以使用"),s("code",[t._v("c")]),t._v("来访问和操作这个实例的输入和输出端口。在 Scala 的函数字面量中,参数类型通常是通过上下文推断出来的,不需要显式声明。在"),s("code",[t._v("test(new Passthrough()) { c => ... }")]),t._v("这段代码中,"),s("code",[t._v("c")]),t._v("是由"),s("code",[t._v("test")]),t._v("函数根据其参数类型推断出的"),s("code",[t._v("Passthrough")]),t._v("模块实例。也就是说,当你写"),s("code",[t._v("c =>")]),t._v("时,"),s("code",[t._v("c")]),t._v("的类型(在这个例子中是"),s("code",[t._v("Passthrough")]),t._v("模块实例)是由"),s("code",[t._v("test")]),t._v("函数的定义确定的,根据这个函数期望的参数类型。这就是为什么可以直接使用"),s("code",[t._v("c")]),t._v("来访问"),s("code",[t._v("Passthrough")]),t._v("实例的成员,如"),s("code",[t._v("c.io.in")]),t._v("和"),s("code",[t._v("c.io.out")]),t._v(",而不需要额外的类型声明。")]),t._v(" "),s("div",{staticClass:"language-markdown extra-class"},[s("pre",{pre:!0,attrs:{class:"language-markdown"}},[s("code",[t._v("Note that the "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`poke`")]),t._v(" and "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`expect`")]),t._v(" use chisel hardware literal notation. Both operations expect literals of the correct type.\nIf "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`poke`")]),t._v("ing a "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`UInt()`")]),t._v(" you must supply a "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`UInt`")]),t._v(" literal (example: "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`c.io.in.poke(10.U)`")]),t._v(", likewise if the input is a "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`Bool()`")]),t._v(" the "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`poke`")]),t._v(" would expect either "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`true.B`")]),t._v(" or "),s("span",{pre:!0,attrs:{class:"token code-snippet code keyword"}},[t._v("`false.B`")]),t._v(".\n")])])]),s("h2",{attrs:{id:"appendix-a-note-on-printf-debugging"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#appendix-a-note-on-printf-debugging"}},[t._v("#")]),t._v(' Appendix: A Note on "printf" Debugging')]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" PrintingModule "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n\n printf"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Print during simulation: Input is %d\\n"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// chisel printf has its own string interpolator too")]),t._v("\n printf"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("p")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Print during simulation: IO is ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("io")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('\\n"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Print during generation: Input is ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// s用于一般的Scala字符串插值,而p专门为Chisel设计,用于更方便地在仿真中打印硬件信号和对象")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" PrintingModule "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// circuit will print")]),t._v("\n\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Print during testing: Input is ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("Elaborating design"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\nPrint during generation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Input is UInt"),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("4"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IO in unelaborated PrintingModule"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nDone elaborating"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Input is "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" IO is AnonymousBundle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Input is "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" IO is AnonymousBundle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Input is "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" IO is AnonymousBundle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Input is "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" IO is AnonymousBundle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Input is "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" IO is AnonymousBundle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nPrint during testing"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Input is UInt"),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("4"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Input is "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\nPrint during simulation"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" IO is AnonymousBundle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ntest PrintingModule Success"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" tests passed in "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v(" cycles in "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.003471")]),t._v(" seconds "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2016.88")]),t._v(" Hz\n")])])]),s("p",[t._v("这段代码定义了一个"),s("code",[t._v("PrintingModule")]),t._v("类,它扩展了 Chisel 的"),s("code",[t._v("Module")]),t._v(",用于演示在不同阶段打印信息:")]),t._v(" "),s("ol",[s("li",[t._v("模块定义中的"),s("code",[t._v("printf")]),t._v("语句:这些在仿真时每个时钟周期都会打印。"),s("code",[t._v('printf("Print during simulation: Input is %d\\n", io.in)')]),t._v("会打印输入信号的值,而"),s("code",[t._v('printf(p"Print during simulation: IO is $io\\n")')]),t._v("会打印"),s("code",[t._v("io")]),t._v("对象的信息。这些仅在仿真(运行时)生效。")]),t._v(" "),s("li",[t._v("模块定义中的"),s("code",[t._v("println")]),t._v("语句:这句话在模块的"),s("em",[t._v("生成")]),t._v("阶段打印,即代码编译时,打印到终端或控制台。它不会在仿真时打印,因为它是 Scala 的打印语句,不是 Chisel 的。")]),t._v(" "),s("li",[t._v("测试块中的"),s("code",[t._v("println")]),t._v("语句:这在 Scala 测试环境中执行,用于打印测试时的信息。如"),s("code",[t._v('println(s"Print during testing: Input is ${c.io.in.peek()}")')]),t._v("将在测试过程中打印输入信号的当前值。")])]),t._v(" "),s("ul",[s("li",[s("code",[t._v("c.io.in.poke(3.U)")]),t._v("设置输入为 3。")]),t._v(" "),s("li",[s("code",[t._v("c.io.out.expect(3.U)")]),t._v("期望输出为 3,这个测试会通过,因为输出应该与输入相同。")]),t._v(" "),s("li",[s("code",[t._v("c.clock.step(5)")]),t._v("推进仿真时钟 5 个周期,这期间"),s("code",[t._v("printf")]),t._v("语句会打印信息。")])]),t._v(" "),s("ol",[s("li",[t._v("最后的"),s("code",[t._v("Print during simulation: Input is 0")]),t._v(" 是因为被重置回到默认状态")]),t._v(" "),s("li",[t._v("7 周期则是因为测试中执行了"),s("code",[t._v("c.clock.step(5)")]),t._v(",推进了 5 个时钟周期,加上测试开始前后的各 1 个周期")])]),t._v(" "),s("p",[t._v("综上,"),s("code",[t._v("println")]),t._v("用于代码生成阶段和测试代码中,打印到 Scala 的执行环境;"),s("code",[t._v("printf")]),t._v("用于仿真阶段,打印到仿真的输出中。")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/4.f2e84893.js b/assets/js/4.f2e84893.js new file mode 100644 index 0000000..6bbf3cf --- /dev/null +++ b/assets/js/4.f2e84893.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{279:function(t,e,n){},293:function(t,e,n){"use strict";n(279)},315:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:(t,{props:e,slots:n})=>t("span",{class:["badge",e.type],style:{verticalAlign:e.vertical}},e.text||n().default)},p=(n(293),n(14)),l=Object(p.a)(i,void 0,void 0,!1,null,"15b7b770",null);e.default=l.exports}}]); \ No newline at end of file diff --git a/assets/js/40.59d5c9c9.js b/assets/js/40.59d5c9c9.js new file mode 100644 index 0000000..4375393 --- /dev/null +++ b/assets/js/40.59d5c9c9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{331:function(t,e,s){"use strict";s.r(e);var a=s(14),n=Object(a.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"_2024-02-29-2-6-more-on-chiseltest"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-29-2-6-more-on-chiseltest"}},[t._v("#")]),t._v(" 2024.02.29-2.6 More on ChiselTest")]),t._v(" "),e("table",[e("thead",[e("tr",[e("th"),t._v(" "),e("th",[t._v("iotesters")]),t._v(" "),e("th",[t._v("ChiselTest")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[t._v("poke")]),t._v(" "),e("td",[t._v("poke(c.io.in1, 6)")]),t._v(" "),e("td",[t._v("c.io.in1.poke(6.U)")])]),t._v(" "),e("tr",[e("td",[t._v("peek")]),t._v(" "),e("td",[t._v("peek(c.io.out1)")]),t._v(" "),e("td",[t._v("c.io.out1.peek()")])]),t._v(" "),e("tr",[e("td",[t._v("expect")]),t._v(" "),e("td",[t._v("expect(c.io.out1, 6)")]),t._v(" "),e("td",[t._v("c.io.out1.expect(6.U)")])]),t._v(" "),e("tr",[e("td",[t._v("step")]),t._v(" "),e("td",[t._v("step(1)")]),t._v(" "),e("td",[t._v("c.clock.step(1)")])]),t._v(" "),e("tr",[e("td",[t._v("initiate")]),t._v(" "),e("td",[t._v("Driver.execute(...) { c =>")]),t._v(" "),e("td",[t._v("test(...) { c =>")])])])]),t._v(" "),e("h2",{attrs:{id:"modules-with-decoupled-interfaces"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#modules-with-decoupled-interfaces"}},[t._v("#")]),t._v(" Modules with Decoupled Interfaces")]),t._v(" "),e("div",{staticClass:"language-scala extra-class"},[e("pre",{pre:!0,attrs:{class:"language-scala"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" QueueModule"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("T "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Data"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ioType"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" T"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" entries"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" MultiIOModule "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Flipped"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Decoupled"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ioType"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Decoupled"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ioType"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n out "),e("span",{pre:!0,attrs:{class:"token generics"}},[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" Queue"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" entries"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ol",[e("li",[e("code",[t._v("class QueueModule[T <: Data](ioType: T, entries: Int) extends MultiIOModule")]),t._v(" 定义了一个泛型队列模块,其中"),e("code",[t._v("T <: Data")]),t._v("表示"),e("code",[t._v("T")]),t._v("是"),e("code",[t._v("Data")]),t._v("类型或其子类型。"),e("code",[t._v("ioType")]),t._v("是队列中数据的类型,"),e("code",[t._v("entries")]),t._v("是队列的大小。")]),t._v(" "),e("li",[e("code",[t._v("Decoupled(ioType)")]),t._v("是一个 Chisel 提供的高级接口,自动包含了"),e("code",[t._v("valid")]),t._v("、"),e("code",[t._v("bits")]),t._v("和"),e("code",[t._v("ready")]),t._v("信号。"),e("code",[t._v("valid")]),t._v("和"),e("code",[t._v("bits")]),t._v("组合用于传输有效数据,而"),e("code",[t._v("ready")]),t._v("信号用于流量控制。当你声明一个"),e("code",[t._v("Decoupled")]),t._v("接口时,这些信号都会被自动创建。")]),t._v(" "),e("li",[e("code",[t._v("IO(Flipped(Decoupled(ioType)))")]),t._v(" 创建了一个输入端口,"),e("code",[t._v("Flipped")]),t._v("意味着通常的输入输出方向被反转(即原本是输出的"),e("code",[t._v("valid")]),t._v("和"),e("code",[t._v("bits")]),t._v("成为输入,原本是输入的"),e("code",[t._v("ready")]),t._v("成为输出),"),e("code",[t._v("Decoupled")]),t._v("表示它是一个可以被反压的接口。")]),t._v(" "),e("li",[e("code",[t._v("out <> Queue(in, entries)")]),t._v(" 将输出端口"),e("code",[t._v("out")]),t._v("连接到一个新建的"),e("code",[t._v("Queue")]),t._v("实例,"),e("code",[t._v("Queue(in, entries)")]),t._v("创建了一个队列,其中"),e("code",[t._v("in")]),t._v("是输入端口,"),e("code",[t._v("entries")]),t._v("是队列大小。"),e("code",[t._v("<>")]),t._v("是连接操作符,表示双向连接。确保了数据可以从"),e("code",[t._v("in")]),t._v("流向队列,经过处理后,再从队列流向"),e("code",[t._v("out")]),t._v("。")])]),t._v(" "),e("h3",{attrs:{id:"enqueuenow-and-expectdequeuenow"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#enqueuenow-and-expectdequeuenow"}},[t._v("#")]),t._v(" EnqueueNow and expectDequeueNow")]),t._v(" "),e("p",[e("code",[t._v("EnqueueNow")]),t._v("和"),e("code",[t._v("expectDequeueNow")]),t._v("是用于测试队列行为的方法。"),e("code",[t._v("EnqueueNow")]),t._v("用于立即将数据入队,而不需要等待队列准备好。"),e("code",[t._v("expectDequeueNow")]),t._v("用于立即从队列中出队数据,并验证其值是否符合预期。这两个方法都是在基于队列的测试中非常有用,使得测试代码可以直接控制和验证队列中数据的流动。这样,测试者可以确保队列正确地处理了入队和出队操作,并且数据的传输符合设计的预期。")]),t._v(" "),e("div",{staticClass:"language-scala extra-class"},[e("pre",{pre:!0,attrs:{class:"language-scala"}},[e("code",[t._v("test"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" QueueModule"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("9.")]),t._v("W"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" entries "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example testsequence showing the use and behavior of Queue")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("initSource"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("setSourceClock"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("initSink"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("setSinkClock"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" testVector "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Seq"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tabulate"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" i "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" i"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n testVector"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("zip"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("testVector"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("foreach "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enqueueNow"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expectDequeueNow"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("out"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("There is some required boiler plate "),e("code",[t._v("initSource")]),t._v(", "),e("code",[t._v("setSourceClock")]),t._v(", etc that is necessary to ensure that the "),e("code",[t._v("ready")]),t._v(" and "),e("code",[t._v("valid")]),t._v(" fields are all initialized correctly at the beginning of the test.")]),t._v(" "),e("h3",{attrs:{id:"enqueueseq-and-dequeueseq"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#enqueueseq-and-dequeueseq"}},[t._v("#")]),t._v(" EnqueueSeq and DequeueSeq")]),t._v(" "),e("p",[e("code",[t._v("EnqueueSeq")]),t._v(" 允许你一次性将一个序列的元素批量入队,这对于测试需要连续多个数据处理的场景特别有用。"),e("code",[t._v("DequeueSeq")]),t._v(", 相应地,用于一次性从队列中出队多个元素,并验证这些元素是否符合预期的序列。"),e("code",[t._v("enqueueSeq")]),t._v(" must finish before the "),e("code",[t._v("expectDequeueSeq")]),t._v(" can begin. This example would fail if the "),e("code",[t._v("testVector")]),t._v("'s size is made larger than the queue depth, because the queue would fill up and not be able to complete the "),e("code",[t._v("enqueueSeq")]),t._v(".")]),t._v(" "),e("h2",{attrs:{id:"fork-and-join"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#fork-and-join"}},[t._v("#")]),t._v(" Fork and Join")]),t._v(" "),e("p",[e("code",[t._v("fork")]),t._v("和"),e("code",[t._v("join")]),t._v("用于创建并发测试,允许同时执行多个操作或测试场景。使用"),e("code",[t._v("fork")]),t._v("可以启动一个并发的测试过程,这个过程可以与主测试流程同时运行。可以在"),e("code",[t._v("fork")]),t._v("后使用多个测试命令定义并发执行的操作。随后,"),e("code",[t._v("join")]),t._v("用于等待所有并发启动的测试过程完成。这样,你可以在一个测试中执行多个并行操作,例如同时对多个模块输入不同的信号,或者同时观察多个输出。这在需要模拟复杂交互或并行处理时特别有用。")]),t._v(" "),e("div",{staticClass:"language-scala extra-class"},[e("pre",{pre:!0,attrs:{class:"language-scala"}},[e("code",[t._v("test"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" QueueModule"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("9.")]),t._v("W"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" entries "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("200")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example testsequence showing the use and behavior of Queue")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("initSource"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("setSourceClock"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("initSink"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("setSinkClock"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" testVector "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Seq"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tabulate"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("300")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" i "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" i"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n fork "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("enqueueSeq"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("testVector"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fork "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n c"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expectDequeueSeq"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("testVector"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("join"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("虽然"),e("code",[t._v("fork")]),t._v("启动了两个并发过程,似乎表明"),e("code",[t._v("c.in.enqueueSeq(testVector)")]),t._v("和"),e("code",[t._v("c.out.expectDequeueSeq(testVector)")]),t._v("应该同时执行,但实际上,它们在逻辑上是有先后顺序的。"),e("code",[t._v("enqueueSeq")]),t._v("首先向队列中填充数据,而"),e("code",[t._v("expectDequeueSeq")]),t._v("则等待这些数据从队列中出现并验证它们。在 ChiselTest 中,"),e("code",[t._v("fork")]),t._v("创建的并发线程会同时开始执行,但是"),e("code",[t._v("expectDequeueSeq")]),t._v("自然会在等待有数据可以出队之后才开始验证,确保了数据的正确流向和测试的逻辑顺序。")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/41.f1eaf84d.js b/assets/js/41.f1eaf84d.js new file mode 100644 index 0000000..dc63d41 --- /dev/null +++ b/assets/js/41.f1eaf84d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{335:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-03-03-3-2-generators-collections"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-03-3-2-generators-collections"}},[t._v("#")]),t._v(" 2024.03.03-3.2 Generators: Collections")]),t._v(" "),s("h2",{attrs:{id:"generators-and-collections"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#generators-and-collections"}},[t._v("#")]),t._v(" Generators and Collections")]),t._v(" "),s("h3",{attrs:{id:"fir-golden-model"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#fir-golden-model"}},[t._v("#")]),t._v(" FIR Golden Model")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" A naive implementation of an FIR filter "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("with")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("an")]),t._v(" arbitrary number of taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" ScalaFirFilter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" pseudoRegisters "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fill"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pseudoRegisters "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" value "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("::")]),t._v(" pseudoRegisters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("take"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("var")]),t._v(" accumulator "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("indices"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n accumulator "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" pseudoRegisters"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n accumulator\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"seq"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#seq"}},[t._v("#")]),t._v(" Seq")]),t._v(" "),s("p",[t._v("当"),s("code",[t._v("taps")]),t._v("变为"),s("code",[t._v("Seq[Int]")]),t._v("时,意味着类的用户可以在构造类时传递任意长度的"),s("code",[t._v("Int")]),t._v("序列。")]),t._v(" "),s("h3",{attrs:{id:"寄存器"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#寄存器"}},[t._v("#")]),t._v(" 寄存器")]),t._v(" "),s("p",[t._v("使用"),s("code",[t._v("var pseudoRegisters = List.fill(taps.length)(0)")]),t._v("创建了一个"),s("code",[t._v("List")]),t._v(",用于存储前几个周期的值。选择"),s("code",[t._v("List")]),t._v("是因为其添加元素到头部和移除最后一个元素的语法非常简单。理论上可以使用 Scala 集合家族中的任何成员。这个列表被初始化为全零。")]),t._v(" "),s("h3",{attrs:{id:"poke"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#poke"}},[t._v("#")]),t._v(" Poke")]),t._v(" "),s("p",[t._v("我们的类添加了一个 poke 函数/方法,模拟将新输入放入过滤器并循环时钟。")]),t._v(" "),s("h3",{attrs:{id:"更新寄存器"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#更新寄存器"}},[t._v("#")]),t._v(" 更新寄存器")]),t._v(" "),s("p",[s("code",[t._v("pseudoRegisters = value :: pseudoRegisters.take(taps.length - 1)")]),t._v("首先使用列表的"),s("code",[t._v("take")]),t._v("方法保留除最后一个元素外的所有元素,然后使用"),s("code",[t._v("::")]),t._v("列表连接操作符将"),s("code",[t._v("value")]),t._v("添加到缩减版列表的头部。")]),t._v(" "),s("h3",{attrs:{id:"计算输出"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#计算输出"}},[t._v("#")]),t._v(" 计算输出")]),t._v(" "),s("p",[t._v("一个简单的 for 循环和累加器用于求和列表中每个元素与其对应抽头系数的乘积。仅含"),s("code",[t._v("accumulator")]),t._v("的行将该值作为函数结果返回。")]),t._v(" "),s("h3",{attrs:{id:"test-circuit-using-the-golden-model"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#test-circuit-using-the-golden-model"}},[t._v("#")]),t._v(" Test circuit using the golden model")]),t._v(" "),s("p",[t._v("为了避免使用繁杂的手动验证,这里使用 Golden Model 来生成期望的值,并与 Chisel 的结果对比")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" goldenModel "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ScalaFirFilter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\ntest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" My4ElementFir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" input "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" scala"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Random"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" goldenModelResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" goldenModel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("goldenModelResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"i ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", input ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("input")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", gm ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("goldenModelResult")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("注意:这里软件上的 Golden Model 没有考虑位宽,而硬件则与位宽有很大关系。这里只考虑了 8 以内,即 3bit 的数,因此不存在这个问题")]),t._v(" "),s("h3",{attrs:{id:"example-parameterized-fir-generator"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-parameterized-fir-generator"}},[t._v("#")]),t._v(" Example: Parameterized FIR Generator")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MyManyElementFir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("consts"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bitWidth"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("bitWidth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("bitWidth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" regs "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mutable"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ArrayBuffer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" regs "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" regs "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" RegNext"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("regs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" muls "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mutable"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ArrayBuffer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n muls "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" regs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" scan "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" mutable"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ArrayBuffer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" scan "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" scan "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+=")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("last\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ol",[s("li",[s("code",[t._v("val regs = mutable.ArrayBuffer[UInt]()")]),t._v("声明了一个名为"),s("code",[t._v("regs")]),t._v("的不可变变量,它被初始化为一个可变的"),s("code",[t._v("ArrayBuffer")]),t._v(",其中包含"),s("code",[t._v("UInt")]),t._v("类型的元素。"),s("code",[t._v("ArrayBuffer")]),t._v("是一个可变的序列,允许在序列两端高效地添加或删除元素,适用于需要动态修改元素的场景。在这里,"),s("code",[t._v("regs")]),t._v("可以被用来存储和更新"),s("code",[t._v("UInt")]),t._v("类型的数据,但由于使用了"),s("code",[t._v("val")]),t._v(","),s("code",[t._v("regs")]),t._v("本身的引用是不可变的,尽管它指向的"),s("code",[t._v("ArrayBuffer")]),t._v("内容是可变的。")]),t._v(" "),s("li",[s("code",[t._v("regs += io.in")]),t._v("这行代码的意思是将"),s("code",[t._v("io.in")]),t._v("这个"),s("code",[t._v("UInt")]),t._v("信号添加到"),s("code",[t._v("regs")]),t._v("这个"),s("code",[t._v("ArrayBuffer")]),t._v("中。这里没有直接的数值相加操作,而是将"),s("code",[t._v("io.in")]),t._v("这个元素添加(追加)到"),s("code",[t._v("regs")]),t._v("这个列表的末尾。"),s("code",[t._v("regs")]),t._v("是一个容器,可以逐个添加元素,即使一开始"),s("code",[t._v("regs")]),t._v("是空的。这行代码的作用是初始化"),s("code",[t._v("regs")]),t._v("列表的第一个元素,后续元素则在循环中通过"),s("code",[t._v("RegNext")]),t._v("添加。")]),t._v(" "),s("li",[s("code",[t._v("regs")]),t._v("作为一个"),s("code",[t._v("ArrayBuffer")]),t._v(",可以包含不同类型的"),s("code",[t._v("UInt")]),t._v("元素。在这种情况下,"),s("code",[t._v("io.in")]),t._v("是一个"),s("code",[t._v("Input(UInt)")]),t._v("类型,而"),s("code",[t._v("RegNext(regs(i - 1), 0.U)")]),t._v("生成的是一个"),s("code",[t._v("Reg(UInt)")]),t._v("类型。尽管"),s("code",[t._v("io.in")]),t._v("和通过"),s("code",[t._v("RegNext")]),t._v("创建的寄存器在硬件层面扮演不同的角色(一个是输入信号,另一个是寄存器),但它们都是"),s("code",[t._v("UInt")]),t._v("类型,可以存储在同一个"),s("code",[t._v("ArrayBuffer")]),t._v("中。在 Chisel 生成的硬件逻辑中,这将创建一个信号和寄存器链,其中信号和寄存器可以互相连接。")]),t._v(" "),s("li",[t._v("使用"),s("code",[t._v("scan")]),t._v("数组缓存逐步累加的结果而不是直接对"),s("code",[t._v("muls")]),t._v("求和,是为了展示在每一步如何逐渐累积计算的中间值。这种方法在某些复杂的 FIR 滤波器设计中可以提供更多的灵活性,比如在需要逐个访问累加过程中的中间结果时。尽管在这个特定例子中,只需要最终的累加结果,直接对"),s("code",[t._v("muls")]),t._v("求和看似更直接,但展开累加过程可以帮助理解和调试滤波器的行为,尤其是在更复杂或参数化的设计中。然而,如果目标只是获取最终的累加和,直接使用"),s("code",[t._v("muls.reduce(_ + _)")]),t._v("确实会更简洁高效。")])]),t._v(" "),s("h3",{attrs:{id:"test-a-bunch-of-different-sized-fir-filters"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#test-a-bunch-of-different-sized-fir-filters"}},[t._v("#")]),t._v(" Test a bunch of different sized FIR filters")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" r"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n scala"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("util"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("Random"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("nextInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1024")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" run a test comparing software and hardware filters\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" run "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" at least twice as many samples as taps\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" runOneTest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" goldenModel "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" ScalaFirFilter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" MyManyElementFir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" input "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" r"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" goldenModelResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" goldenModel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("expect"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("goldenModelResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"i ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("i")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", input ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("input")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", gm ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("goldenModelResult")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tapSize "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v(" by "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" taps "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fill"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tapSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("r"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a sequence of random coefficients")]),t._v("\n\n runOneTest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ol",[s("li",[t._v("在 Chisel 测试中,"),s("code",[t._v("c.clock.step(1)")]),t._v("通常放在对输出进行期望检查("),s("code",[t._v("expect")]),t._v(")之后,因为我们希望在提供输入后推进仿真一个时钟周期,然后在下一个时钟边沿检查输出。这样可以确保寄存器已经更新到了因输入变化而触发的新状态。")]),t._v(" "),s("li",[t._v("字符串"),s("code",[t._v('s"i $i, input $input, gm $goldenModelResult, ${c.io.out.peek().litValue}"')]),t._v("是 Scala 的字符串插值,用于构造包含变量值的字符串。这里它构建了一个描述当前测试状态的字符串,包括迭代次数"),s("code",[t._v("i")]),t._v(",当前输入"),s("code",[t._v("input")]),t._v(",金标准模型"),s("code",[t._v("goldenModel")]),t._v("的结果"),s("code",[t._v("goldenModelResult")]),t._v(",以及从待测试模块的输出"),s("code",[t._v("c.io.out")]),t._v("中提取的值。这对于调试和理解测试失败的上下文非常有用。")])]),t._v(" "),s("h2",{attrs:{id:"hardware-collections"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#hardware-collections"}},[t._v("#")]),t._v(" Hardware Collections")]),t._v(" "),s("h3",{attrs:{id:"example-add-run-time-configurable-taps-to-our-fir"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-add-run-time-configurable-taps-to-our-fir"}},[t._v("#")]),t._v(" Example: Add run-time configurable taps to our FIR")]),t._v(" "),s("p",[t._v("在 FIR 生成器的 IO 中添加了一个额外的"),s("code",[t._v("consts")]),t._v("向量,允许在电路生成后从外部改变系数。这是通过 Chisel 集合类型"),s("code",[t._v("Vec")]),t._v("实现的。"),s("code",[t._v("Vec")]),t._v("支持许多 Scala 集合方法,但只能包含 Chisel 硬件元素。仅在普通 Scala 集合无法满足需求的情况下使用"),s("code",[t._v("Vec")]),t._v(",主要是以下两种情况:"),s("em",[t._v("1.")]),t._v(" 在 Bundle 中需要元素集合,通常是作为 IO 使用的 Bundle。"),s("em",[t._v("2.")]),t._v(" 需要通过硬件部分的索引访问集合(如寄存器文件)。")]),t._v(" "),s("p",[t._v("原因在于"),s("code",[t._v("Vec")]),t._v("能够创建一组硬件元素的集合,而这些硬件元素可以在生成的硬件电路中被索引和操作。相反,普通的 Scala 集合,如"),s("code",[t._v("List")]),t._v("或"),s("code",[t._v("Seq")]),t._v(",仅仅在 Scala 软件环境中存在,它们不能直接映射到硬件电路中。因此,当定义硬件模块的 IO 接口或需要在硬件级别按索引访问元素时,应该使用"),s("code",[t._v("Vec")]),t._v("。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" MyManyDynamicElementVecFir"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" consts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Reference solution")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" regs "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("VecInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fill"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" regs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" regs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" regs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" muls "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" regs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" scan "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ol",[s("li",[s("p",[s("code",[t._v("VecInit")]),t._v("用于创建一个"),s("code",[t._v("Vec")]),t._v(",这是 Chisel 中的一种集合类型,专门用于存储硬件元素。"),s("code",[t._v("Seq.fill(length - 1)(0.U(8.W))")]),t._v("生成一个长度为"),s("code",[t._v("length - 1")]),t._v(",每个元素初始化为 8 位宽的 0 的序列。"),s("code",[t._v("VecInit")]),t._v("将这个序列转换成一个"),s("code",[t._v("Vec")]),t._v(",以便在硬件设计中使用。"),s("code",[t._v("RegInit")]),t._v("则将这个"),s("code",[t._v("Vec")]),t._v("初始化为寄存器,使得其值在复位时为指定的初始值。这种方式常用于定义具有多个初始相同值的寄存器数组。")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("Wire(Vec(length, UInt(8.W)))")]),t._v(" 用于创建一个具有 "),s("code",[t._v("length")]),t._v(" 元素的向量,每个元素是 8 位无符号整数。这是在硬件描述语言中创建信号数组的标准方法,允许这些信号在生成的硬件电路中被实例化。")]),t._v(" "),s("p",[t._v("相比之下,"),s("code",[t._v("mutable.ArrayBuffer[UInt]()")]),t._v(" 是 Scala 的一个集合类型,主要用于软件程序中的数据存储和处理。在 Chisel 的上下文中,你不能直接将 "),s("code",[t._v("ArrayBuffer")]),t._v(" 用作硬件信号的容器,因为 "),s("code",[t._v("ArrayBuffer")]),t._v(" 是一个可变的、仅在 Scala 软件执行环境中存在的数据结构,它不会被合成到硬件中。")]),t._v(" "),s("p",[t._v("简单来说:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("Wire(Vec(length, UInt(8.W)))")]),t._v(" 在 Chisel 中创建一个硬件向量,这个向量可以在生成的硬件电路中存在并携带信号。")]),t._v(" "),s("li",[s("code",[t._v("mutable.ArrayBuffer[UInt]()")]),t._v(" 创建一个仅在 Scala 软件执行时存在的内存数组,它不能直接用于硬件设计。")])]),t._v(" "),s("p",[t._v("所以,在你的代码中使用 "),s("code",[t._v("Wire(Vec(length, UInt(8.W)))")]),t._v(" 是为了定义一个可以在硬件层面操作和传递信号的向量,这对于硬件设计至关重要。")]),t._v(" "),s("h3",{attrs:{id:"example-32-bit-risc-v-processor"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-32-bit-risc-v-processor"}},[t._v("#")]),t._v(" Example: 32-bit RISC-V Processor")]),t._v(" "),s("p",[t._v("Register file: An array of registers that can be read from or written to via a number of read or write ports. Each port consists of an address and data field.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" RegisterFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("readPorts"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("extends")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n require"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("readPorts "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" wen "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" waddr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" wdata "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" raddr "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("readPorts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" rdata "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("readPorts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// A Register of a vector of UInts")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" reg "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RegInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("VecInit"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Seq"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fill"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wen"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n reg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("waddr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wdata\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until readPorts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("raddr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("rdata"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("otherwise"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("rdata"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" reg"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("raddr"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[s("code",[t._v("readPorts")]),t._v(" 表示寄存器文件的读端口数量。这个数量决定了在任何给定的时钟周期内,可以同时读取多少个独立寄存器的数据。每个读端口由其自己的读取地址("),s("code",[t._v("raddr")]),t._v(")和读取数据("),s("code",[t._v("rdata")]),t._v(")组成。在这种设置中,你可以在一个时钟周期内并行读取多个寄存器的值,而不是一次只能读取一个,这对于增加处理器的数据吞吐量非常有用。")]),t._v(" "),s("p",[t._v("具体到代码:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("readPorts")]),t._v(":定义了有多少个并行的读端口可用于同时读取寄存器文件中的数据。")]),t._v(" "),s("li",[s("code",[t._v("io.raddr")]),t._v(":一个向量,包含了每个读端口对应的读取地址。每个读端口都可以独立地从寄存器文件中选择一个寄存器进行读取。")]),t._v(" "),s("li",[s("code",[t._v("io.rdata")]),t._v(":一个向量,用于输出每个读端口读取到的寄存器值。每个端口根据对应的"),s("code",[t._v("raddr")]),t._v("读取寄存器文件中的数据,并将其放置在"),s("code",[t._v("rdata")]),t._v("的相应位置。")])])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/42.dfab6a46.js b/assets/js/42.dfab6a46.js new file mode 100644 index 0000000..7a9dcf5 --- /dev/null +++ b/assets/js/42.dfab6a46.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{342:function(t,s,a){"use strict";a.r(s);var n=a(14),p=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-03-04-3-3-interlude-chisel-standard-library"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-04-3-3-interlude-chisel-standard-library"}},[t._v("#")]),t._v(" 2024.03.04-3.3 Interlude: Chisel Standard Library")]),t._v(" "),s("h2",{attrs:{id:"decoupled-a-standard-ready-valid-interface"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#decoupled-a-standard-ready-valid-interface"}},[t._v("#")]),t._v(" Decoupled: A Standard Ready-Valid Interface")]),t._v(" "),s("p",[t._v("在 Chisel 中,"),s("code",[t._v("DecoupledIO")]),t._v(" 是一种标准的准备就绪(ready-valid)接口,广泛用于不同模块间的数据传输,提供了一种带有流控制的通信机制。使用 "),s("code",[t._v("DecoupledIO")]),t._v(" 可以有效地处理数据传输的同步问题,特别是在生产者(source)和消费者(sink)速率不匹配时,确保数据的正确传输与接收。")]),t._v(" "),s("h3",{attrs:{id:"组件"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#组件"}},[t._v("#")]),t._v(" 组件")]),t._v(" "),s("p",[s("code",[t._v("DecoupledIO")]),t._v(" 接口由以下三个主要部分组成:")]),t._v(" "),s("ol",[s("li",[t._v("valid(有效) - 这是一个输出信号(从数据源角度看),用于表明当前的数据是有效的,可以被读取。当数据源有数据准备好发送时,它会将 "),s("code",[t._v("valid")]),t._v(" 信号置为高电平。")]),t._v(" "),s("li",[t._v("ready(准备就绪) - 这是一个输入信号(从数据源角度看),用于表明目标模块(接收端)准备好接收数据。当接收端可以接收新的数据时,它会将 "),s("code",[t._v("ready")]),t._v(" 信号置为高电平。")]),t._v(" "),s("li",[t._v("bits(数据位) - 这个信号承载了要传输的实际数据。数据的宽度和类型可以是任意的,从简单的 "),s("code",[t._v("UInt")]),t._v(" 或 "),s("code",[t._v("Bool")]),t._v(" 到复杂的用户定义 "),s("code",[t._v("Bundle")]),t._v("。")])]),t._v(" "),s("h3",{attrs:{id:"数据传输"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#数据传输"}},[t._v("#")]),t._v(" 数据传输")]),t._v(" "),s("p",[t._v("在 "),s("code",[t._v("DecoupledIO")]),t._v(" 接口中,数据传输在以下条件下发生:")]),t._v(" "),s("ul",[s("li",[t._v("数据源设置 "),s("code",[t._v("valid")]),t._v(" 为高电平,表示其有数据要发送。")]),t._v(" "),s("li",[t._v("接收端设置 "),s("code",[t._v("ready")]),t._v(" 为高电平,表示其准备好接收数据。")])]),t._v(" "),s("p",[t._v("当且仅当同一时钟周期内 "),s("code",[t._v("valid")]),t._v(" 和 "),s("code",[t._v("ready")]),t._v(" 同时为高电平时,数据才会被传输。这允许在接收端或发送端任一端控制数据流,实现背压(backpressure)机制:")]),t._v(" "),s("ul",[s("li",[t._v("如果接收端未准备好接收("),s("code",[t._v("ready")]),t._v(" 为低),即使发送端有数据发送("),s("code",[t._v("valid")]),t._v(" 为高),数据也不会被传输。")]),t._v(" "),s("li",[t._v("如果发送端没有数据要发送("),s("code",[t._v("valid")]),t._v(" 为低),即使接收端准备好了("),s("code",[t._v("ready")]),t._v(" 为高),也不会有数据传输。")])]),t._v(" "),s("h3",{attrs:{id:"使用场景"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用场景"}},[t._v("#")]),t._v(" 使用场景")]),t._v(" "),s("p",[s("code",[t._v("DecoupledIO")]),t._v(" 非常适用于生产者和消费者速率不一致的情况,如:")]),t._v(" "),s("ul",[s("li",[t._v("在 FIFO 队列的实现中,确保数据不会在缓冲区满时被写入,或在缓冲区空时被读出。")]),t._v(" "),s("li",[t._v("在处理器设计中,用于不同执行单元间的数据传输,确保在数据未准备好或处理单元未准备好时不发生数据传输。")])]),t._v(" "),s("h3",{attrs:{id:"代码示例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#代码示例"}},[t._v("#")]),t._v(" 代码示例")]),t._v(" "),s("p",[t._v("以下是如何在 Chisel 中创建一个 "),s("code",[t._v("DecoupledIO")]),t._v(" 接口的简单示例:")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" data "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 定义数据宽度")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" decoupledData "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Decoupled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("data"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 创建 DecoupledIO 接口")]),t._v("\n")])])]),s("p",[t._v("这里,"),s("code",[t._v("decoupledData")]),t._v(" 将是一个拥有 "),s("code",[t._v("valid")]),t._v("、"),s("code",[t._v("ready")]),t._v(" 和 "),s("code",[t._v("bits")]),t._v(" 字段的 "),s("code",[t._v("DecoupledIO")]),t._v(" Bundle,可用于模块间的数据传输。")]),t._v(" "),s("h2",{attrs:{id:"queue"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#queue"}},[t._v("#")]),t._v(" Queue")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit using a Queue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Flipped"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Decoupled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Decoupled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" queue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Queue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 2-element queue")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" queue\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Enqueue an element")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("42.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Starting:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.in: ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.out: valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Enqueue another element")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("43.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// What do you think io.out.valid and io.out.bits will be?")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"After first enqueue:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.in: ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.out: valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Read a element, attempt to enqueue")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("44.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// What do you think io.in.ready will be, and will this enqueue succeed, and what will be read?")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"On first read:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.in: ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.out: valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Read elements out")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// What do you think will be read here?")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"On second read:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.in: ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.out: valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Will a third read produce anything?")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"On third read:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.in: ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tio.out: valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("Starting"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\nAfter first enqueue"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),t._v("\nOn first read"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),t._v("\nOn second read"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("43")]),t._v("\nOn third read"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n\tio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),t._v("\n")])])]),s("ol",[s("li",[s("p",[s("code",[t._v("val in = Flipped(Decoupled(UInt(8.W)))")]),t._v(" 这里的"),s("code",[t._v("Flipped")]),t._v("表示是"),s("code",[t._v("Input")]),t._v(",因为"),s("code",[t._v("Decoupled")]),t._v("默认是"),s("code",[t._v("Output")])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("val queue = Queue(io.in, 2)")]),t._v(" 连接 "),s("code",[t._v("io.in")]),t._v(" 到队列的输入端: 这意味着 "),s("code",[t._v("io.in")]),t._v(" 上发生的任何事情(比如信号变化)都会直接影响到队列。具体来说,当您在测试代码中设置 "),s("code",[t._v("io.in.valid")]),t._v(" 和 "),s("code",[t._v("io.in.bits")]),t._v(",您实际上是在向队列的入队端提供数据。")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("io.out <> queue")]),t._v(" 时,你实际上是在将模块的输出接口 "),s("code",[t._v("io.out")]),t._v(" 和队列 "),s("code",[t._v("queue")]),t._v(" 的出队接口双向连接。")]),t._v(" "),s("p",[t._v("具体来说,对于 "),s("code",[t._v("DecoupledIO")]),t._v(" 接口:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("io.out.valid")]),t._v(" 会连接到 "),s("code",[t._v("queue.io.deq.valid")]),t._v("。")]),t._v(" "),s("li",[s("code",[t._v("io.out.bits")]),t._v(" 会连接到 "),s("code",[t._v("queue.io.deq.bits")]),t._v("。")]),t._v(" "),s("li",[s("code",[t._v("queue.io.deq.ready")]),t._v(" 会连接到 "),s("code",[t._v("io.out.ready")]),t._v("。")])]),t._v(" "),s("p",[t._v("这种连接方式确保了数据可以从 "),s("code",[t._v("queue")]),t._v(" 的出队端传输到模块的输出 "),s("code",[t._v("io.out")]),t._v(",同时允许 "),s("code",[t._v("io.out")]),t._v(" 控制背压(通过 "),s("code",[t._v("ready")]),t._v(" 信号)以及 "),s("code",[t._v("queue")]),t._v(" 报告其状态(通过 "),s("code",[t._v("valid")]),t._v(" 信号)。")])])]),t._v(" "),s("ul",[s("li",[t._v("开始时:\n"),s("ul",[s("li",[t._v("首先,输出端 "),s("code",[t._v("io.out.ready")]),t._v(" 被设为 "),s("code",[t._v("false")]),t._v(",表示消费者还没准备好接收数据。")]),t._v(" "),s("li",[t._v("输入端 "),s("code",[t._v("io.in.valid")]),t._v(" 被设为 "),s("code",[t._v("true")]),t._v(",并通过 "),s("code",[t._v("io.in.bits")]),t._v(" 提供了值 42,尝试将其入队。")]),t._v(" "),s("li",[t._v("打印的输出显示,初始时,"),s("code",[t._v("io.in.ready")]),t._v(" 应该为 "),s("code",[t._v("true")]),t._v("(队列未满,可以接收数据),而 "),s("code",[t._v("io.out.valid")]),t._v(" 应该为 "),s("code",[t._v("false")]),t._v("(数据尚未出队到输出端)。")])])]),t._v(" "),s("li",[t._v("首次入队后:\n"),s("ul",[s("li",[t._v("程序尝试将另一个值 43 入队,并再次检查状态。")]),t._v(" "),s("li",[t._v("由于队列不满,第二个值应该成功入队。"),s("code",[t._v("io.in.ready")]),t._v(" 仍然为 "),s("code",[t._v("true")]),t._v(",表明还可以接收更多数据。")]),t._v(" "),s("li",[s("code",[t._v("io.out.valid")]),t._v(" 被设置为 "),s("code",[t._v("true")]),t._v(" 并且 "),s("code",[t._v("io.out.bits")]),t._v(" 被更新为 42,因为队列内部确实有一个元素(42)准备好了并且尝试发送。即使 "),s("code",[t._v("io.out.ready")]),t._v(" 是 "),s("code",[t._v("false")]),t._v(","),s("code",[t._v("io.out.valid")]),t._v(" 和 "),s("code",[t._v("io.out.bits")]),t._v(" 仍然会反映队列出口处的数据状态。")]),t._v(" "),s("li",[t._v("尽管 "),s("code",[t._v("io.out.valid")]),t._v(" 为 "),s("code",[t._v("true")]),t._v(" 并且 "),s("code",[t._v("io.out.bits")]),t._v(" 显示了数据(42),但由于 "),s("code",[t._v("io.out.ready")]),t._v(" 为 "),s("code",[t._v("false")]),t._v(',这次数据传输并不会真正完成。换句话说,42 在逻辑上是"准备发送"的,但由于缺乏接收准备就绪的确认(即 '),s("code",[t._v("io.out.ready")]),t._v(" 为 "),s("code",[t._v("false")]),t._v('),它实际上并没有"被接收"。')])])]),t._v(" "),s("li",[t._v("首次读取尝试:\n"),s("ul",[s("li",[t._v("程序尝试同时进行读取(将 "),s("code",[t._v("io.out.ready")]),t._v(" 设为 "),s("code",[t._v("true")]),t._v(")和入队(值 44)。")]),t._v(" "),s("li",[t._v("由于此时输出准备好接收数据,第一个入队的值(42)应该会被传递到 "),s("code",[t._v("io.out")]),t._v(","),s("code",[t._v("io.out.valid")]),t._v(" 应变为 "),s("code",[t._v("true")]),t._v(","),s("code",[t._v("io.out.bits")]),t._v(" 应显示 42。")]),t._v(" "),s("li",[s("code",[t._v("io.in.ready")]),t._v(" 为 "),s("code",[t._v("0")]),t._v("。这是因为队列("),s("code",[t._v("queue")]),t._v(")此时已经满了。")])])]),t._v(" "),s("li",[t._v("第二次读取:\n"),s("ul",[s("li",[t._v("这时不再有新数据入队,但 "),s("code",[t._v("io.out")]),t._v(" 准备好读取数据。")]),t._v(" "),s("li",[t._v("应该能读取到之前入队的第二个值 43,"),s("code",[t._v("io.out.valid")]),t._v(" 应为 "),s("code",[t._v("true")]),t._v(","),s("code",[t._v("io.out.bits")]),t._v(" 应显示 43。")])])]),t._v(" "),s("li",[t._v("第三次读取尝试:\n"),s("ul",[s("li",[t._v("在这一步,尽管 "),s("code",[t._v("io.out")]),t._v(" 依然准备好接收数据,但队列应该已经空了。")]),t._v(" "),s("li",[t._v("因此,"),s("code",[t._v("io.out.valid")]),t._v(" 应该变回 "),s("code",[t._v("false")]),t._v(",表示没有更多数据可读。")]),t._v(" "),s("li",[t._v("不过为什么是 42?\n注:")])]),t._v(" "),s("ol",[s("li",[s("code",[t._v("peek()")]),t._v(" 函数用于查看信号的当前值,而 "),s("code",[t._v(".litValue")]),t._v(" 用于获取这个值作为一个 Scala 的字面量(literal)。因此,"),s("code",[t._v("c.io.in.ready.peek().litValue")]),t._v(" 表示查看 "),s("code",[t._v("c.io.in.ready")]),t._v(" 信号的当前值,并获取其字面量值。")]),t._v(" "),s("li",[t._v("必须要"),s("code",[t._v("c.clock.step(1)")]),t._v("以后才会有输出")])])])]),t._v(" "),s("h2",{attrs:{id:"arbiter"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#arbiter"}},[t._v("#")]),t._v(" Arbiter")]),t._v(" "),s("p",[t._v("一个 Arbiter 是用于解决多个请求源争用单一资源的组件。它的基本功能是在多个输入信号中选择一个进行输出,基于某种特定的优先级或策略。在处理多个并发请求访问同一资源(例如,总线或共享内存)时,仲裁器确保每个时刻只有一个选定的请求被服务,同时遵循公平性或优先级规则,避免资源冲突或死锁。")]),t._v(" "),s("ol",[s("li",[s("p",[s("code",[t._v("Arbiter")]),t._v(":这是一个静态优先级仲裁器,它总是优先选择索引较低的生产者。如果有多个请求同时到达,"),s("code",[t._v("Arbiter")]),t._v(" 会根据请求信号的索引顺序来决定优先权,索引较小的请求者会获得优先服务。这意味着如果较低索引的请求者持续有请求,它将持续获得资源,而更高索引的请求者则需要等待。")]),t._v(" "),s("p",[t._v("示例代码如下:")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit using a priority arbiter")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Flipped"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Decoupled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Decoupled"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Arbiter doesn't have a convenience constructor, so it's built like any Module")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" arbiter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Module"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Arbiter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 2 to 1 Priority Arbiter")]),t._v("\n arbiter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" arbiter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Start:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tin(0).ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", in(1).ready=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tout.valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out.bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Valid input 1")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("42.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// What do you think the output will be?")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"valid input 1:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tin(0).ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", in(1).ready=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tout.valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out.bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Valid inputs 0 and 1")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("43.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// What do you think the output will be? Which inputs will be ready?")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"valid inputs 0 and 1:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tin(0).ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", in(1).ready=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tout.valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out.bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Valid input 0")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// What do you think the output will be?")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"valid input 0:"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tin(0).ready=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", in(1).ready=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\tout.valid=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out.bits=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("Start"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\nvalid input "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),t._v("\nvalid inputs "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" and "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("43")]),t._v("\nvalid input "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ready"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\n out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("valid"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("bits"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("43")]),t._v("\n")])])]),s("ol",[s("li",[s("p",[t._v("初始状态检查:")]),t._v(" "),s("ul",[s("li",[t._v("首先,测试确认在没有任何有效输入 ("),s("code",[t._v("io.in(0).valid")]),t._v(" 和 "),s("code",[t._v("io.in(1).valid")]),t._v(" 都为 "),s("code",[t._v("false")]),t._v(") 时,输出 ("),s("code",[t._v("io.out.valid")]),t._v(") 也应为 "),s("code",[t._v("false")]),t._v(",表示没有数据通过仲裁器。")])])]),t._v(" "),s("li",[s("p",[t._v("激活第二个输入:")]),t._v(" "),s("ul",[s("li",[t._v("然后,测试激活 "),s("code",[t._v("io.in(1)")]),t._v("(即索引为 1 的输入),同时保持 "),s("code",[t._v("io.out.ready")]),t._v(" 为 "),s("code",[t._v("true")]),t._v(",这模拟了接收端准备好接收数据的情况。预期 "),s("code",[t._v("io.in(1)")]),t._v(" 的数据应该通过到 "),s("code",[t._v("io.out")]),t._v("。")]),t._v(" "),s("li",[t._v("两个输入的 "),s("code",[t._v("ready")]),t._v(" 信号都是 "),s("code",[t._v("1")]),t._v("。这是因为 "),s("code",[t._v("Arbiter")]),t._v(" 的行为是基于它可以传递数据的能力。让我们分解这个情况:\n当只有 "),s("code",[t._v("io.in(1)")]),t._v(" 有效时:\n"),s("ul",[s("li",[s("code",[t._v("in(0).ready=1")]),t._v(":这意味着 "),s("code",[t._v("Arbiter")]),t._v(" 仲裁器准备好从 "),s("code",[t._v("io.in(0)")]),t._v(" 接收数据,尽管此时 "),s("code",[t._v("io.in(0)")]),t._v(" 没有数据(不是有效的)。"),s("code",[t._v("ready")]),t._v(" 信号为 "),s("code",[t._v("1")]),t._v(" 表示如果 "),s("code",[t._v("io.in(0)")]),t._v(" 有数据,"),s("code",[t._v("Arbiter")]),t._v(" 准备好接收它。")]),t._v(" "),s("li",[s("code",[t._v("in(1).ready=1")]),t._v(":同时,"),s("code",[t._v("Arbiter")]),t._v(" 也表示准备好接收 "),s("code",[t._v("io.in(1)")]),t._v(" 的数据,因为它是有效的。在这种情况下,由于 "),s("code",[t._v("io.out.ready")]),t._v(" 被设置为 "),s("code",[t._v("true")]),t._v(","),s("code",[t._v("Arbiter")]),t._v(" 知道输出端已经准备好接收数据,所以它将 "),s("code",[t._v("io.in(1)")]),t._v(" 的 "),s("code",[t._v("ready")]),t._v(" 也置为 "),s("code",[t._v("1")]),t._v("。")])])])]),t._v(" "),s("p",[t._v("这里的关键是 "),s("code",[t._v("ready")]),t._v(" 信号表示的是接收能力而非当前的数据有效性。即使 "),s("code",[t._v("io.in(0)")]),t._v(" 当前没有标记为有效,"),s("code",[t._v("Arbiter")]),t._v(" 也表明它准备好从该输入接收数据,这就是为什么在 "),s("code",[t._v("io.in(1)")]),t._v(" 有效时,"),s("code",[t._v("io.in(0).ready")]),t._v(" 也会是 "),s("code",[t._v("1")]),t._v("。")])]),t._v(" "),s("li",[s("p",[t._v("同时激活两个输入:")]),t._v(" "),s("ul",[s("li",[t._v("接下来,测试同时激活两个输入,即 "),s("code",[t._v("io.in(0)")]),t._v(" 和 "),s("code",[t._v("io.in(1)")]),t._v(" 都设置为有效。由于 "),s("code",[t._v("Arbiter")]),t._v(" 的静态优先级策略,预期 "),s("code",[t._v("io.in(0)")]),t._v(" 的数据(即优先级更高的输入)会被传递到 "),s("code",[t._v("io.out")]),t._v("。")]),t._v(" "),s("li",[t._v("当两个输入 "),s("code",[t._v("io.in(0)")]),t._v(" 和 "),s("code",[t._v("io.in(1)")]),t._v(" 都被设置为有效时,"),s("code",[t._v("Arbiter")]),t._v(" 会根据其内部逻辑来选择一个输入。对于普通的 "),s("code",[t._v("Arbiter")]),t._v(",它将优先选择索引较低的输入,即 "),s("code",[t._v("io.in(0)")]),t._v("。")]),t._v(" "),s("li",[t._v("由于 "),s("code",[t._v("io.in(0)")]),t._v(" 被选中,"),s("code",[t._v("io.in(1)")]),t._v(" 的 "),s("code",[t._v("ready")]),t._v(" 信号将会被置为 "),s("code",[t._v("false")]),t._v(",而 "),s("code",[t._v("io.in(0).ready")]),t._v(" 会是 "),s("code",[t._v("true")]),t._v(",表示 "),s("code",[t._v("Arbiter")]),t._v(" 准备接受 "),s("code",[t._v("io.in(0)")]),t._v(" 的数据。")]),t._v(" "),s("li",[t._v("在此情况下,即使您设置了 "),s("code",[t._v("io.in(1).bits")]),t._v(",这个数据也不会被 "),s("code",[t._v("Arbiter")]),t._v(" 选择,因为 "),s("code",[t._v("io.in(0)")]),t._v(" 有更高的优先级。")])])]),t._v(" "),s("li",[s("p",[t._v("只激活第一个输入:")]),t._v(" "),s("ul",[s("li",[t._v("最后,测试只激活 "),s("code",[t._v("io.in(0)")]),t._v("。即使之前 "),s("code",[t._v("io.in(1)")]),t._v(" 被激活过,在这一步中只有 "),s("code",[t._v("io.in(0)")]),t._v(" 有效,所以只有它的数据应该被传递到 "),s("code",[t._v("io.out")]),t._v("。")])])])])]),t._v(" "),s("li",[s("p",[s("code",[t._v("RRArbiter")]),t._v(":这是一个循环(round-robin)仲裁器,它按照循环的顺序为请求者提供服务,确保了长期的公平性。当一个请求被服务后,"),s("code",[t._v("RRArbiter")]),t._v(" 会记住最后被服务的请求,并在下一个服务周期中优先考虑下一个请求者。这样可以确保即使在高负载下,所有请求者也能获得均等的服务机会。")]),t._v(" "),s("p",[t._v("示例代码如下:")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" rrArbiter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Module"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" RRArbiter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nrrArbiter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" producer0\nrrArbiter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" producer1\nconsumer "),s("span",{pre:!0,attrs:{class:"token generics"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),t._v(" rrArbiter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out\n")])])])])]),t._v(" "),s("p",[t._v("注:Ariter 是组合电路,不需要 step(1)")]),t._v(" "),s("h2",{attrs:{id:"misc-function-blocks"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#misc-function-blocks"}},[t._v("#")]),t._v(" Misc Function Blocks")]),t._v(" "),s("h3",{attrs:{id:"bitwise-utilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bitwise-utilities"}},[t._v("#")]),t._v(" Bitwise Utilities")]),t._v(" "),s("h3",{attrs:{id:"popcount"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#popcount"}},[t._v("#")]),t._v(" PopCount")]),t._v(" "),s("p",[t._v("PopCount returns the number of high (1) bits in the input as a "),s("code",[t._v("UInt")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit using PopCount")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" PopCount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Integer.parseInt is used create an Integer from a binary specification")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00000000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00001111"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"11001010"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"11111111"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("in"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b0"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1111"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v("\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b11001010"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v("\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b11111111"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),t._v("\n")])])]),s("h3",{attrs:{id:"reverse"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#reverse"}},[t._v("#")]),t._v(" Reverse")]),t._v(" "),s("p",[t._v("Reverse returns the bit-reversed input")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit using Reverse")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Reverse"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Integer.parseInt is used create an Integer from a binary specification")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"01010101"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=0b")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"00001111"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=0b")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"11110000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=0b")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"11001010"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=0b")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("in"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1010101"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b10101010\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1111"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b11110000\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b11110000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1111\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b11001010"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1010011\n")])])]),s("h3",{attrs:{id:"onehot-encoding-utilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#onehot-encoding-utilities"}},[t._v("#")]),t._v(" OneHot encoding utilities")]),t._v(" "),s("h3",{attrs:{id:"uinttooh"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#uinttooh"}},[t._v("#")]),t._v(" "),s("code",[t._v("UIntToOH")])]),t._v(" "),s("p",[t._v("UInt to OneHot")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit using UIntToOH")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" UIntToOH"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=0b")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=0b")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=0b")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=0b")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b10\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b100000000\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1000000000000000\n")])])]),s("h3",{attrs:{id:"ohtouint"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ohtouint"}},[t._v("#")]),t._v(" "),s("code",[t._v("OHToUInt")])]),t._v(" "),s("p",[t._v("OneHot to UInt")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit using OHToUInt")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" OHToUInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0000 0000 0000 0001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("replace"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('" "')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0000 0000 1000 0000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("replace"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('" "')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1000 0000 0000 0001"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("replace"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('" "')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Some invalid inputs:")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// None high")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0000 0000 0000 0000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("replace"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('" "')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Multiple high")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Integer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("parseInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0001 0100 0010 0000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("replace"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('" "')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in=0b')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toBinaryString")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b10000000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1000000000000001"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),t._v("\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b0"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\nin"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("b1010000100000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),t._v("\n")])])]),s("h3",{attrs:{id:"mux"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mux"}},[t._v("#")]),t._v(" MUX")]),t._v(" "),s("h3",{attrs:{id:"prioritymux"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#prioritymux"}},[t._v("#")]),t._v(" "),s("code",[t._v("PriorityMux")])]),t._v(" "),s("p",[t._v("Outputs the value associated with the lowest-index asserted select signal.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit using PriorityMux")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_sels "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_bits "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" PriorityMux"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Select higher index only")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in_sels=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Select both - arbitration needed")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in_sels=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Select lower index only")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in_sels=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nin_sels"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),t._v("\nin_sels"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\nin_sels"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n")])])]),s("p",[s("code",[t._v("PriorityMux")]),t._v(" 会根据 "),s("code",[t._v("in_sels")]),t._v(" 中的布尔值,从左到右(即从索引 0 开始)检查哪个输入是选中的,并输出第一个选中输入对应的 "),s("code",[t._v("in_bits")]),t._v(" 值。因此,同时使 "),s("code",[t._v("in_sels(0)")]),t._v(" 和 "),s("code",[t._v("in_sels(1)")]),t._v(" 为 "),s("code",[t._v("true")]),t._v(" 时,由于 "),s("code",[t._v("in_sels(0)")]),t._v(" 的优先级更高,"),s("code",[t._v("io.out")]),t._v(" 应该输出 "),s("code",[t._v("in_bits(0)")]),t._v(" 的值,即 "),s("code",[t._v("10.U")]),t._v("。")]),t._v(" "),s("h3",{attrs:{id:"onehot-mux-mux1h"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#onehot-mux-mux1h"}},[t._v("#")]),t._v(" OneHot Mux: "),s("code",[t._v("Mux1H")])]),t._v(" "),s("p",[t._v("An "),s("code",[t._v("Mux1H")]),t._v(" provides an efficient implementation when it is guaranteed that exactly one of the select signals will be high. Behavior is undefined if the assumption is not true.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit using Mux1H")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_sels "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" in_bits "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Mux1H"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_bits"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20.")]),t._v("U"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Select index 1")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in_sels=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Select index 0")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in_sels=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Select none (invalid)")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in_sels=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Select both (invalid)")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"in_sels=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in_sels"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", out=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nin_sels"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),t._v("\nin_sels"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\nin_sels"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\nin_sels"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" out"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("30")]),t._v("\n")])])]),s("h3",{attrs:{id:"counter"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#counter"}},[t._v("#")]),t._v(" "),s("code",[t._v("Counter")])]),t._v(" "),s("p",[t._v("A counter that can be incremented once every cycle, up to some specified limit, at which point it overflows. Note that it is not a Module, and its value is accessible.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("test"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Module "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Example circuit with two counters")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" io "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" Bundle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" count "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Input"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Bool"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" totalCycles "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Output"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Assuming 32-bit is enough for cycle count")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Counter for controlled increments")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" controlledCounter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Counter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 3-count Counter (outputs range [0...2])")]),t._v("\n when"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n controlledCounter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("inc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" controlledCounter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Counter for total cycles, counting up to (2^32)-1")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" totalCycleCounter "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Counter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("math"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pow"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n totalCycleCounter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("inc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Increment every cycle")]),t._v("\n io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("totalCycles "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" totalCycleCounter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("value\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" c "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"start: controlled counter value=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", total cycles=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("totalCycles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"step 1: controlled counter value=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", total cycles=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("totalCycles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"step 2: controlled counter value=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", total cycles=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("totalCycles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"step without increment: controlled counter value=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", total cycles=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("totalCycles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("count"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("poke"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("clock"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token id function"}},[t._v("s")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"step again: controlled counter value=')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(", total cycles=")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("${")]),s("span",{pre:!0,attrs:{class:"token expression"}},[t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("totalCycles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("peek"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("litValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nstart"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" controlled counter value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" total cycles"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("\nstep "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" controlled counter value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" total cycles"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\nstep "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" controlled counter value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" total cycles"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("\nstep without increment"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" controlled counter value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" total cycles"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("\nstep again"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" controlled counter value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" total cycles"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v("\n")])])]),s("p",[t._v("在 Chisel 中创建一个计数器时,如果您传递的参数是 "),s("code",[t._v("n")]),t._v(",那么计数器能够表示的计数范围是从 0 到 n-1。所以,当您使用 "),s("code",[t._v("Counter(n)")]),t._v(" 时,计数器的实际最大计数值是 n-1。")])])}),[],!1,null,null,null);s.default=p.exports}}]); \ No newline at end of file diff --git a/assets/js/43.bb8dbce2.js b/assets/js/43.bb8dbce2.js new file mode 100644 index 0000000..c10aeaa --- /dev/null +++ b/assets/js/43.bb8dbce2.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{334:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-03-05-3-4-higher-order-functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-05-3-4-higher-order-functions"}},[t._v("#")]),t._v(" 2024.03.05-3.4 Higher-Order Functions")]),t._v(" "),s("h2",{attrs:{id:"a-tale-of-two-firs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#a-tale-of-two-firs"}},[t._v("#")]),t._v(" A Tale of Two FIRs")]),t._v(" "),s("p",[t._v("From the last module, we had the convolution part of the FIR filter written like this:")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" muls "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("in "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" regs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" scan "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Wire"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Vec"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" UInt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8.")]),t._v("W"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("<-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until length"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" muls"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\nio"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" scan"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("length "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("As a recap, the idea is to multiply each element of "),s("code",[t._v("io.in")]),t._v(" with the corresponding element of "),s("code",[t._v("io.consts")]),t._v(", and store it in "),s("code",[t._v("muls")]),t._v(". Then, the elements in "),s("code",[t._v("muls")]),t._v(" are accumulated into "),s("code",[t._v("scan")]),t._v(", with "),s("code",[t._v("scan(0) = muls(0)")]),t._v(", "),s("code",[t._v("scan(1) = scan(0) + muls(1) = muls(0) + muls(1)")]),t._v(", and in general "),s("code",[t._v("scan(n) = scan(n-1) + muls(n) = muls(0) + ... + muls(n-1) + muls(n)")]),t._v(". The last element in "),s("code",[t._v("scan")]),t._v(" (equal to the sum of all "),s("code",[t._v("muls")]),t._v(") is assigned to "),s("code",[t._v("io.out")]),t._v(".")]),t._v(" "),s("p",[t._v("However, it's very verbose for what might be considered quite a simple operation. In fact, all that could be written in one line:")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("out "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("taps zip io"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("consts"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" b "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("reduce"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("ul",[s("li",[t._v("假设 "),s("code",[t._v("taps")]),t._v(" 是所有样本的列表,其中 "),s("code",[t._v("taps(0) = io.in")]),t._v(","),s("code",[t._v("taps(1) = regs(0)")]),t._v(" 等等。")]),t._v(" "),s("li",[s("code",[t._v("(taps zip io.consts)")]),t._v(" 将两个列表 "),s("code",[t._v("taps")]),t._v(" 和 "),s("code",[t._v("io.consts")]),t._v(" 合并成一个列表,其中每个元素是一个元组,这个元组包含了在相应位置的输入元素。具体来说,它的值将是 "),s("code",[t._v("[(taps(0), io.consts(0)), (taps(1), io.consts(1)), ..., (taps(n), io.consts(n))]")]),t._v("。记住,在 Scala 中点号是可选的,所以这等同于 "),s("code",[t._v("(taps.zip(io.consts))")]),t._v("。")]),t._v(" "),s("li",[s("code",[t._v(".map { case (a, b) => a * b }")]),t._v(" 对列表中的元素应用一个匿名函数(接收两个元素的元组并返回它们的乘积),并返回结果。在这个情况下,结果等价于在冗长示例中的 "),s("code",[t._v("muls")]),t._v(",其值为 "),s("code",[t._v("[taps(0) * io.consts(0), taps(1) * io.consts(1), ..., taps(n) * io.consts(n)]")]),t._v("。")]),t._v(" "),s("li",[t._v("最后,"),s("code",[t._v(".reduce(_ + _)")]),t._v(" 同样应用一个函数(元素的加法)到列表的元素上。然而,它接收两个参数:第一个是当前的累加值,第二个是列表元素(在第一次迭代中,它只是将前两个元素相加)。这些由括号中的两个下划线表示。那么结果,假设是从左到右的遍历,将会是 "),s("code",[t._v("(((muls(0) + muls(1)) + muls(2)) + ...) + muls(n)")]),t._v(",更深层次括号内的结果先被计算。这就是卷积的输出结果。")])]),t._v(" "),s("h2",{attrs:{id:"functions-as-arguments"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions-as-arguments"}},[t._v("#")]),t._v(" Functions as Arguments")]),t._v(" "),s("p",[t._v("Formally, functions like "),s("code",[t._v("map")]),t._v(" and "),s("code",[t._v("reduce")]),t._v(" are called "),s("em",[t._v("higher-order functions")]),t._v(" : they are functions that take functions as arguments. As it turns out (and hopefully, as you can see from the above example), these are very powerful constructs that encapsulate a general computational pattern, allowing you to concentrate on the application logic instead of flow control, and resulting in very concise code.")]),t._v(" "),s("ul",[s("li",[t._v("对于每个参数只引用一次的函数,您"),s("em",[t._v("可以")]),t._v("使用下划线("),s("code",[t._v("_")]),t._v(")来引用每个参数。在上面的例子中,"),s("code",[t._v("reduce")]),t._v(" 函数接受两个参数,可以被指定为 "),s("code",[t._v("_ + _")]),t._v("。虽然这很方便,但它受制于一组额外的复杂规则,所以如果不起作用,您可以尝试:")]),t._v(" "),s("li",[t._v("明确指定输入参数列表。"),s("code",[t._v("reduce")]),t._v(" 可以被明确写成 "),s("code",[t._v("(a, b) => a + b")]),t._v(",通用形式是把参数列表放在括号里,后面跟着 "),s("code",[t._v("=>")]),t._v(",然后是引用这些参数的函数体。")]),t._v(" "),s("li",[t._v("当需要解包元组时,使用 "),s("code",[t._v("case")]),t._v(" 语句,如 "),s("code",[t._v("case (a, b) => a * b")]),t._v("。这接收一个参数,一个两个元素的元组,并将其解包到变量 "),s("code",[t._v("a")]),t._v(" 和 "),s("code",[t._v("b")]),t._v(" 中,然后可以在函数体中使用它们。")])]),t._v(" "),s("h3",{attrs:{id:"practice-in-scala"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#practice-in-scala"}},[t._v("#")]),t._v(" Practice in Scala")]),t._v(" "),s("p",[t._v("Scala 集合 API 中的主要类,如"),s("code",[t._v("List")]),t._v("。这些高阶函数是这些 API 的一部分。实际上,上面的示例使用了"),s("code",[t._v("List")]),t._v("上的"),s("code",[t._v("map")]),t._v("和"),s("code",[t._v("reduce")]),t._v(" API。在这一节中,我们将通过示例和练习熟悉这些方法。在这些示例中,我们将对 Scala 数字("),s("code",[t._v("Int")]),t._v(")操作,以简化和明确表示,但因为 Chisel 运算符的行为类似,所以这些概念应该是通用的。")]),t._v(" "),s("h3",{attrs:{id:"example-map"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-map"}},[t._v("#")]),t._v(" Example: map")]),t._v(" "),s("p",[s("code",[t._v("List[A].map")]),t._v(" 有类型签名 "),s("code",[t._v("map[B](f: (A) ⇒ B): List[B]")]),t._v("。现在,将类型 A 和 B 视为 "),s("code",[t._v("Int")]),t._v(" 或 "),s("code",[t._v("UInt")]),t._v(",意味着它们可以是软件或硬件类型。它接受一个类型为 "),s("code",[t._v("(f: (A) ⇒ B)")]),t._v(" 的参数,或者一个接受类型为 A(与输入列表的元素类型相同)的一个参数并返回类型为 B 的值的函数。"),s("code",[t._v("map")]),t._v(" 然后返回一个新的类型为 B(参数函数的返回类型)的列表。")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" x "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// explicit argument list in function")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// equivalent to the above, but implicit arguments")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("toString "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the output element type can be different from the input element type")]),t._v("\n\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("case")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" y"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("y "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// this unpacks a tuple, note use of curly braces")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Related: Scala has a syntax for constructing lists of sequential numbers")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" to "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// to is inclusive , the end point is part of the result")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// until is exclusive at the end, the end point is not part of the result")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Those largely behave like lists, and can be useful for generating indices:")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("val")]),t._v(" myList "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"c"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("myList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// output:")]),t._v("\nList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("21")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("32")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nRange "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" to "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\nRange "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v(" until "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\nVector"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h3",{attrs:{id:"example-zipwithindex"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-zipwithindex"}},[t._v("#")]),t._v(" Example: "),s("code",[t._v("zipWithIndex")])]),t._v(" "),s("p",[s("code",[t._v("List.zipWithIndex")]),t._v(" has type signature "),s("code",[t._v("zipWithIndex: List[(A, Int)]")]),t._v(". It takes no arguments, but returns a list where each element is a tuple of the original elements, and the index (with the first one being zero). So "),s("code",[t._v('List("a", "b", "c", "d").zipWithIndex')]),t._v(" would return "),s("code",[t._v('List(("a", 0), ("b", 1), ("c", 2), ("d", 3))')])]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("zipWithIndex"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// note indices start at zero")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"c"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("zipWithIndex"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"a"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"b"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"c"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"d"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"e"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"g"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"h"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("zipWithIndex"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// tuples nest")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// output:")]),t._v("\nList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nList"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("c"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("d"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("e"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("f"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("g"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("h"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h3",{attrs:{id:"example-reduce"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-reduce"}},[t._v("#")]),t._v(" Example: "),s("code",[t._v("reduce")])]),t._v(" "),s("p",[s("code",[t._v("List[A].map")]),t._v(" has type signature similar to "),s("code",[t._v("reduce(op: (A, A) ⇒ A): A")]),t._v(". (it's actually more lenient, "),s("code",[t._v("A")]),t._v(" only has to be a supertype of the List type, but we're not going to deal with that syntax here)")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("reduce"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("a"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("=>")]),t._v(" a "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns the sum of all the elements")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("reduce"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns the product of all the elements")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("reduce"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you can chain reduce onto the result of a map")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("map"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("reduce"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns the product of the double of the elements of the input list.")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// output:")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("24")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("384")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Important note: reduce will fail with an empty list")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("reduce"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h3",{attrs:{id:"example-fold"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example-fold"}},[t._v("#")]),t._v(" Example: "),s("code",[t._v("fold")])]),t._v(" "),s("p",[s("code",[t._v("List[A].fold")]),t._v(" is very similar to reduce, except that you can specify the initial accumulation value. It has type signature similar to "),s("code",[t._v("fold(z: A)(op: (A, A) ⇒ A): A")]),t._v(". (like "),s("code",[t._v("reduce")]),t._v(", the type of "),s("code",[t._v("A")]),t._v(" is also more lenient). Notably, it takes two argument lists, the first ("),s("code",[t._v("z")]),t._v(") is the initial value, and the second is the accumulation function. Unlike "),s("code",[t._v("reduce")]),t._v(", it will not fail with an empty list, instead returning the initial value directly.")]),t._v(" "),s("div",{staticClass:"language-scala extra-class"},[s("pre",{pre:!0,attrs:{class:"language-scala"}},[s("code",[t._v("println"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fold"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// equivalent to the sum using reduce")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fold"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// like above, but accumulation starts at 1")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fold"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" _"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// unlike reduce, does not fail on an empty input")]),t._v("\nprintln"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("List"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("fold"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("_"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns the double the product of the elements of the input list")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// output:")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("48")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/44.90481eeb.js b/assets/js/44.90481eeb.js new file mode 100644 index 0000000..c53fc25 --- /dev/null +++ b/assets/js/44.90481eeb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{337:function(t,r,i){"use strict";i.r(r);var a=i(14),e=Object(a.a)({},(function(){var t=this,r=t._self._c;return r("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[r("h1",{attrs:{id:"_3-2023-11-07-verilog语法"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_3-2023-11-07-verilog语法"}},[t._v("#")]),t._v(" 3. 2023.11.07-Verilog语法")]),t._v(" "),r("h2",{attrs:{id:"_01-verilog-基础语法"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_01-verilog-基础语法"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2023.11.07-Verilog语法/01.Verilog 基础语法.html"}},[t._v("01. Verilog 基础语法")])],1),t._v(" "),r("h2",{attrs:{id:"_02-verilog-数值表示"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_02-verilog-数值表示"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2023.11.07-Verilog语法/02.Verilog 数值表示.html"}},[t._v("02. Verilog 数值表示")])],1),t._v(" "),r("h2",{attrs:{id:"_03-verilog-数据类型"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_03-verilog-数据类型"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2023.11.07-Verilog语法/03.Verilog 数据类型.html"}},[t._v("03. Verilog 数据类型")])],1),t._v(" "),r("h2",{attrs:{id:"_04-verilog-表达式"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_04-verilog-表达式"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2023.11.07-Verilog语法/04.Verilog 表达式.html"}},[t._v("04. Verilog 表达式")])],1),t._v(" "),r("h2",{attrs:{id:"_10-verilog-多路分支语句"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_10-verilog-多路分支语句"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2023.11.07-Verilog语法/10.Verilog 多路分支语句.html"}},[t._v("10. Verilog 多路分支语句")])],1),t._v(" "),r("h2",{attrs:{id:"_2023-11-15-vivado"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2023-11-15-vivado"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2023.11.07-Verilog语法/2023.11.15-Vivado.html"}},[t._v("2023.11.15-Vivado")])],1),t._v(" "),r("h2",{attrs:{id:"_2023-11-16-阻塞与非阻塞赋值"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#_2023-11-16-阻塞与非阻塞赋值"}},[t._v("#")]),t._v(" "),r("RouterLink",{attrs:{to:"/Chip/Chip/2023.11.07-Verilog语法/2023.11.16-阻塞与非阻塞赋值.html"}},[t._v("2023.11.16-阻塞与非阻塞赋值")])],1)])}),[],!1,null,null,null);r.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/45.4a66ab2e.js b/assets/js/45.4a66ab2e.js new file mode 100644 index 0000000..3149292 --- /dev/null +++ b/assets/js/45.4a66ab2e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{336:function(t,s,n){"use strict";n.r(s);var r=n(14),a=Object(r.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"预学习阶段"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#预学习阶段"}},[this._v("#")]),this._v(" 预学习阶段")])])}),[],!1,null,null,null);s.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/46.7ace2f0e.js b/assets/js/46.7ace2f0e.js new file mode 100644 index 0000000..68f8aa3 --- /dev/null +++ b/assets/js/46.7ace2f0e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{338:function(t,s,r){"use strict";r.r(s);var a=r(14),e=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"soc-design"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#soc-design"}},[t._v("#")]),t._v(" SoC Design")]),t._v(" "),s("h2",{attrs:{id:"_1-一生一芯计划"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-一生一芯计划"}},[t._v("#")]),t._v(" "),s("RouterLink",{attrs:{to:"/Chip/Chip/1. 一生一芯计划.html"}},[t._v("1. 一生一芯计划")])],1),t._v(" "),s("h2",{attrs:{id:"_2-2024-02-21-chisel"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-2024-02-21-chisel"}},[t._v("#")]),t._v(" "),s("RouterLink",{attrs:{to:"/Chip/Chip/2. 2024.02.21-Chisel.html"}},[t._v("2. 2024.02.21-Chisel")])],1),t._v(" "),s("h2",{attrs:{id:"_3-2023-11-07-verilog语法"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2023-11-07-verilog语法"}},[t._v("#")]),t._v(" "),s("RouterLink",{attrs:{to:"/Chip/Chip/3. 2023.11.07-Verilog语法.html"}},[t._v("3. 2023.11.07-Verilog语法")])],1)])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/47.7472e80f.js b/assets/js/47.7472e80f.js new file mode 100644 index 0000000..4be533a --- /dev/null +++ b/assets/js/47.7472e80f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{339:function(t,s,e){"use strict";e.r(s);var a=e(14),r=Object(a.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"_2024-02-22-bfs"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-22-bfs"}},[this._v("#")]),this._v(" 2024.02.22-BFS")]),this._v(" "),t("h2",{attrs:{id:"_2024-02-22-752-打开转盘锁-bfs"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-22-752-打开转盘锁-bfs"}},[this._v("#")]),this._v(" "),t("RouterLink",{attrs:{to:"/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752 打开转盘锁(BFS).html"}},[this._v("2024.02.22-752.打开转盘锁(BFS)")])],1)])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/48.58395c50.js b/assets/js/48.58395c50.js new file mode 100644 index 0000000..fef6903 --- /dev/null +++ b/assets/js/48.58395c50.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{340:function(t,s,n){"use strict";n.r(s);var a=n(14),p=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-02-22-752-打开转盘锁-bfs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-22-752-打开转盘锁-bfs"}},[t._v("#")]),t._v(" 2024.02.22-752.打开转盘锁(BFS)")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v('/*\n * @lc app=leetcode.cn id=752 lang=cpp\n *\n * [752] 打开转盘锁\n *\n * https://leetcode.cn/problems/open-the-lock/description/\n *\n * algorithms\n * Medium (52.77%)\n * Likes: 653\n * Dislikes: 0\n * Total Accepted: 128.3K\n * Total Submissions: 243.1K\n * Testcase Example: \'["0201","0101","0102","1212","2002"]\\n"0202"\'\n *\n * 你有一个带有四个圆形拨轮的转盘锁。每个拨轮都有10个数字: \'0\', \'1\', \'2\', \'3\', \'4\', \'5\', \'6\', \'7\', \'8\',\n * \'9\' 。每个拨轮可以自由旋转:例如把 \'9\' 变为 \'0\',\'0\' 变为 \'9\' 。每次旋转都只能旋转一个拨轮的一位数字。\n *\n * 锁的初始数字为 \'0000\' ,一个代表四个拨轮的数字的字符串。\n *\n * 列表 deadends 包含了一组死亡数字,一旦拨轮的数字和列表里的任何一个元素相同,这个锁将会被永久锁定,无法再被旋转。\n *\n * 字符串 target 代表可以解锁的数字,你需要给出解锁需要的最小旋转次数,如果无论如何不能解锁,返回 -1 。\n *\n *\n *\n * 示例 1:\n *\n *\n * 输入:deadends = ["0201","0101","0102","1212","2002"], target = "0202"\n * 输出:6\n * 解释:\n * 可能的移动序列为 "0000" -> "1000" -> "1100" -> "1200" -> "1201" -> "1202" -> "0202"。\n * 注意 "0000" -> "0001" -> "0002" -> "0102" -> "0202" 这样的序列是不能解锁的,\n * 因为当拨动到 "0102" 时这个锁就会被锁定。\n *\n *\n * 示例 2:\n *\n *\n * 输入: deadends = ["8888"], target = "0009"\n * 输出:1\n * 解释:把最后一位反向旋转一次即可 "0000" -> "0009"。\n *\n *\n * 示例 3:\n *\n *\n * 输入: deadends = ["8887","8889","8878","8898","8788","8988","7888","9888"],\n * target = "8888"\n * 输出:-1\n * 解释:无法旋转到目标数字且不被锁定。\n *\n *\n *\n *\n * 提示:\n *\n *\n * 1 <= deadends.length <= 500\n * deadends[i].length == 4\n * target.length == 4\n * target 不在 deadends 之中\n * target 和 deadends[i] 仅由若干位数字组成\n *\n *\n */')]),t._v("\n")])])]),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Solution")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("openLock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("vector"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("string"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("deadends"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" string target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" num "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n queue"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("string"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n set"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("string"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("visited")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("deadends"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("begin")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" deadends"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("insert")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("empty")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" ssize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("size")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" ssize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" i"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n string str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("front")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pop")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// if (visited.find(str) != visited.end())")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// continue;")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" num"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" j "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" j "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n string up "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("turnUp")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n string down "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("turnDown")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("up"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("up"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("insert")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("up"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("down"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("push")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("down"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n visited"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("insert")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("down"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n num"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n string "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("turnUp")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("string str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("char")]),t._v(" old "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("char")]),t._v(" nnew "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("old "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token char"}},[t._v("'9'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("old "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token char"}},[t._v("'0'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n string newString "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n newString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" nnew"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" newString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n string "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("turnDown")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("string str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("char")]),t._v(" old "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("char")]),t._v(" nnew "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("old "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token char"}},[t._v("'0'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("?")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("old "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token char"}},[t._v("'9'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n string newString "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n newString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("index"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" nnew"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" newString"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"hint"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#hint"}},[t._v("#")]),t._v(" Hint:")]),t._v(" "),s("ol",[s("li",[t._v("修改"),s("code",[t._v("string")]),t._v("的某一个字符直接使用"),s("code",[t._v("[]")]),t._v("索引修改即可")]),t._v(" "),s("li",[t._v("字符’0‘到’1‘直接加一")]),t._v(" "),s("li",[s("code",[t._v("deadends")]),t._v("中的字符串以及已经访问过的字符串应该在尝试加入队列之前就被过滤掉,以防止它们被进一步处理。而不是从队列中拿出来的时候检查是不是在"),s("code",[t._v("visited")]),t._v("中")]),t._v(" "),s("li",[t._v("起始的"),s("code",[t._v("“0000”")]),t._v("也要检查")]),t._v(" "),s("li",[t._v("使用双向 BFS 可以加快速度,但是 queue 修改为 set,如下:")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("openLock")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("vector"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("string"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("deadends"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" string target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n unordered_set"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("string"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("dead")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("deadends"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("begin")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" deadends"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n unordered_set"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("string"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" begin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" end"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("set1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("set2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("||")]),t._v(" dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" step "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n begin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("insert")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n end"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("insert")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("target"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("begin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("empty")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!")]),t._v("end"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("empty")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 优化搜索,总是从较小的集合开始扩展")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("begin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("size")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" end"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("size")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n set1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("end"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n set2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("begin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n set1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("begin"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n set2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("end"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n unordered_set"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("string"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("auto")]),t._v(" it "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" set1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("begin")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" it "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" set1"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),t._v("it"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n string str "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("it"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("set2"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" set2"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("insert")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 标记为已访问")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" j "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" j "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n string up "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("turnUp")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n string down "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("turnDown")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("str"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("up"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("insert")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("up"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("find")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("down"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" dead"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("end")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("insert")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("down"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n step"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("set1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 更新当前正在扩展的集合")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 如果没有找到有效路径")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ol",[s("li",[t._v("创建一个临时集合("),s("code",[t._v("temp")]),t._v(")的原因是在每一轮搜索中,我们需要更新当前层次的节点。由于在遍历当前层次的节点时不能直接修改正在遍历的集合(这会影响迭代器的有效性),因此我们先将新发现的节点存储在一个临时集合中。在当前层次的所有节点都遍历完毕后,我们再用这个临时集合来更新主集合,为下一轮搜索做准备。")])])])}),[],!1,null,null,null);s.default=p.exports}}]); \ No newline at end of file diff --git a/assets/js/49.5a10af76.js b/assets/js/49.5a10af76.js new file mode 100644 index 0000000..6d88fe0 --- /dev/null +++ b/assets/js/49.5a10af76.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{341:function(t,e,a){"use strict";a.r(e);var r=a(14),s=Object(r.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"_2024-03-05-二叉树"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-05-二叉树"}},[t._v("#")]),t._v(" 2024.03.05-二叉树")]),t._v(" "),e("h2",{attrs:{id:"_2024-03-05-104-二叉树的最大深度"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-05-104-二叉树的最大深度"}},[t._v("#")]),t._v(" "),e("RouterLink",{attrs:{to:"/LeetCode/LeetCode/2024.03.05-二叉树/2024 03 05-104 二叉树的最大深度 c6649929175d46038db921b552f2a235.html"}},[t._v("2024.03.05-104.二叉树的最大深度")])],1),t._v(" "),e("h2",{attrs:{id:"_2024-03-05-543-二叉树的直径"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-05-543-二叉树的直径"}},[t._v("#")]),t._v(" "),e("RouterLink",{attrs:{to:"/LeetCode/LeetCode/2024.03.05-二叉树/2024 03 05-543 二叉树的直径 9db6d046b0954b45b96ca749922a2ece.html"}},[t._v("2024.03.05-543.二叉树的直径")])],1)])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/5.febb63fa.js b/assets/js/5.febb63fa.js new file mode 100644 index 0000000..ba5d60c --- /dev/null +++ b/assets/js/5.febb63fa.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{280:function(t,e,a){},294:function(t,e,a){"use strict";a(280)},311:function(t,e,a){"use strict";a.r(e);var s={name:"CodeBlock",props:{title:{type:String,required:!0},active:{type:Boolean,default:!1}},mounted(){this.$parent&&this.$parent.loadTabs&&this.$parent.loadTabs()}},i=(a(294),a(14)),n=Object(i.a)(s,(function(){return(0,this._self._c)("div",{staticClass:"theme-code-block",class:{"theme-code-block__active":this.active}},[this._t("default")],2)}),[],!1,null,"759a7d02",null);e.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/50.75aa2867.js b/assets/js/50.75aa2867.js new file mode 100644 index 0000000..2b68217 --- /dev/null +++ b/assets/js/50.75aa2867.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{343:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-03-05-104-二叉树的最大深度"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-05-104-二叉树的最大深度"}},[t._v("#")]),t._v(" 2024.03.05-104.二叉树的最大深度")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n * @lc app=leetcode.cn id=104 lang=cpp\n *\n * [104] 二叉树的最大深度\n *\n * https://leetcode.cn/problems/maximum-depth-of-binary-tree/description/\n *\n * algorithms\n * Easy (77.10%)\n * Likes: 1786\n * Dislikes: 0\n * Total Accepted: 1.2M\n * Total Submissions: 1.6M\n * Testcase Example: '[3,9,20,null,null,15,7]'\n *\n * 给定一个二叉树 root ,返回其最大深度。\n *\n * 二叉树的 最大深度 是指从根节点到最远叶子节点的最长路径上的节点数。\n *\n *\n *\n * 示例 1:\n *\n *\n *\n *\n *\n *\n * 输入:root = [3,9,20,null,null,15,7]\n * 输出:3\n *\n *\n * 示例 2:\n *\n *\n * 输入:root = [1,null,2]\n * 输出:2\n *\n *\n *\n *\n * 提示:\n *\n *\n * 树中节点的数量在 [0, 10^4] 区间内。\n * -100 <= Node.val <= 100\n *\n *\n */")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// @lc code=start")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" Definition "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" a binary tree node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TreeNode")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" val"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("TreeNode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("val")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("left")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("right")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("TreeNode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("val")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("left")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("right")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("TreeNode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("val")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("left")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("right")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// @lc code=end")]),t._v("\n")])])]),s("ol",[s("li",[t._v("递归:分解成左右子树")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Solution")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("maxDepth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("root"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("root "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" tempLeft "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("maxDepth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("root"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" tempRight "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("maxDepth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("root"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" res "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("max")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tempLeft"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" tempRight"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("ol",[s("li",[t._v("遍历:进入节点(前序)加深度,离开节点(后序)减深度,叶子结点处更新结果")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Solution")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("maxDepth")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("TreeNode"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" root"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("traverse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("root"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("private")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("traverse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("TreeNode"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("node "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n res "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("max")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("temp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n temp"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("traverse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("node"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("traverse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("node"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n temp"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("--")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/51.02e67c88.js b/assets/js/51.02e67c88.js new file mode 100644 index 0000000..d07248e --- /dev/null +++ b/assets/js/51.02e67c88.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{349:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2024-03-05-543-二叉树的直径"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-05-543-二叉树的直径"}},[t._v("#")]),t._v(" 2024.03.05-543.二叉树的直径")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*\n * @lc app=leetcode.cn id=543 lang=cpp\n *\n * [543] 二叉树的直径\n *\n * https://leetcode.cn/problems/diameter-of-binary-tree/description/\n *\n * algorithms\n * Easy (59.72%)\n * Likes: 1495\n * Dislikes: 0\n * Total Accepted: 387.9K\n * Total Submissions: 649.5K\n * Testcase Example: '[1,2,3,4,5]'\n *\n * 给你一棵二叉树的根节点,返回该树的 直径 。\n *\n * 二叉树的 直径 是指树中任意两个节点之间最长路径的 长度 。这条路径可能经过也可能不经过根节点 root 。\n *\n * 两节点之间路径的 长度 由它们之间边数表示。\n *\n *\n *\n * 示例 1:\n *\n *\n * 输入:root = [1,2,3,4,5]\n * 输出:3\n * 解释:3 ,取路径 [4,2,1,3] 或 [5,2,1,3] 的长度。\n *\n *\n * 示例 2:\n *\n *\n * 输入:root = [1,2]\n * 输出:1\n *\n *\n *\n *\n * 提示:\n *\n *\n * 树中节点数目在范围 [1, 10^4] 内\n * -100 <= Node.val <= 100\n *\n *\n */")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// @lc code=start")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" Definition "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" a binary tree node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("struct")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TreeNode")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" val"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("TreeNode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("val")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("left")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("right")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("TreeNode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("val")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("left")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("right")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("TreeNode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" TreeNode "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("val")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("x"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("left")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("right")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Solution")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" res "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("diameterOfBinaryTree")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("TreeNode"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" root"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("traverse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("root"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cal the maxDepth")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("traverse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("TreeNode"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" node"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("node "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("nullptr")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" leftMax "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("traverse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("node"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v("left"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" rightMax "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("traverse")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("node"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),t._v("right"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" nodeMax "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("max")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("leftMax"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("rightMax"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n res "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("max")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("res"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("leftMax"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v("rightMax"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" nodeMax"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// @lc code=end")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/52.c3574880.js b/assets/js/52.c3574880.js new file mode 100644 index 0000000..bfc061b --- /dev/null +++ b/assets/js/52.c3574880.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{346:function(t,s,n){"use strict";n.r(s);var r=n(14),a=Object(r.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"_2024-03-10-滑动窗口"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-10-滑动窗口"}},[this._v("#")]),this._v(" 2024.03.10-滑动窗口")])])}),[],!1,null,null,null);s.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/53.7eb9877d.js b/assets/js/53.7eb9877d.js new file mode 100644 index 0000000..72dd562 --- /dev/null +++ b/assets/js/53.7eb9877d.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{351:function(t,e,a){"use strict";a.r(e);var s=a(14),r=Object(s.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"leetcode"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#leetcode"}},[t._v("#")]),t._v(" LeetCode")]),t._v(" "),e("h2",{attrs:{id:"_2024-02-22-bfs"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2024-02-22-bfs"}},[t._v("#")]),t._v(" "),e("RouterLink",{attrs:{to:"/LeetCode/LeetCode/2024.02.22-BFS.html"}},[t._v("2024.02.22-BFS")])],1),t._v(" "),e("h2",{attrs:{id:"_2024-03-05-二叉树"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-05-二叉树"}},[t._v("#")]),t._v(" "),e("RouterLink",{attrs:{to:"/LeetCode/LeetCode/2024.03.05-二叉树.html"}},[t._v("2024.03.05-二叉树")])],1),t._v(" "),e("h2",{attrs:{id:"_2024-03-10-滑动窗口"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2024-03-10-滑动窗口"}},[t._v("#")]),t._v(" "),e("RouterLink",{attrs:{to:"/LeetCode/LeetCode/2024.03.10-滑动窗口.html"}},[t._v("2024.03.10-滑动窗口")])],1)])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/54.c61ea9c4.js b/assets/js/54.c61ea9c4.js new file mode 100644 index 0000000..6bae45d --- /dev/null +++ b/assets/js/54.c61ea9c4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{344:function(t,n,s){"use strict";s.r(n);var e=s(14),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/55.75579078.js b/assets/js/55.75579078.js new file mode 100644 index 0000000..e716aef --- /dev/null +++ b/assets/js/55.75579078.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{345:function(e,t,a){"use strict";a.r(t);var r=a(14),f=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"research"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#research"}},[e._v("#")]),e._v(" Research")]),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023-Geant4 945b483bffdc4c51beb68f87b0cd2434.html"}},[e._v("2023-Geant4")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 02 14-HPC Usage(以未名一号为例) 43e9534849b24815beecbb4fc013abd4.html"}},[e._v("2023.02.14-HPC Usage(以未名一号为例)")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 22-Git的使用 d310b2bc534b493caf8d7e181ae3cd6d.html"}},[e._v("2023.08.22-Git的使用")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 23-Linux基本命令 9965ddff4081441ab5cd153f8eb38627.html"}},[e._v("2023.08.23-Linux基本命令")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 24-Linux用户和权限 a14c965dd7644069b674289740142cb1.html"}},[e._v("2023.08.24-Linux用户和权限")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 24-Linux常用工具 fc65197d16aa4a6bbb52357bdf370287.html"}},[e._v("2023.08.24-Linux常用工具")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 24-Vim 73603861053040d68dbffaeeb72b943f.html"}},[e._v("2023.08.24-Vim")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 25-Linux中的C语言编译器GCC 4a7355e74306484393407ebdeb191492.html"}},[e._v("2023.08.25-Linux中的C语言编译器GCC")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 25-Linux中调试程序 0cf6ed4636c0413aa44e5fb934668354.html"}},[e._v("2023.08.25-Linux中调试程序")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 25-make工具 c1605b8f5e2747ef977111ca447ebe70.html"}},[e._v("2023.08.25-make工具")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 08 25-CMakeLists txt 语法 f8bb0481f6764595a1d03cf5863a08d0.html"}},[e._v("2023.08.25-CMakeLists.txt 语法")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 09 04-GCC基本使用 b03830c10a5f4bf3855a46a0c956178c.html"}},[e._v("2023.09.04-GCC基本使用")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 15-Transformer 22da59aa72344dc786793967f054180c.html"}},[e._v("2023.10.15-Transformer")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 24-numpy c1dfa01a93134c1bb0b9453dc24698c3.html"}},[e._v("2023.10.24-numpy")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 24-Tensor与Autograd ecc0ab96c5ee4d0f99834cf14f0951cb.html"}},[e._v("2023.10.24-Tensor与Autograd")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 24-Pandas f6e050e8b22e4062a22316c2ef598fae.html"}},[e._v("2023.10.24-Pandas")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 25-深度学习模型的构建框架 af92295e6c144f89b34bf7ea4d5a83a9.html"}},[e._v("2023.10.25-深度学习模型的构建框架")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 26-Pytorch实现线性回归 dc0e9bffdb3b4370b80fc3cdb772a5a6.html"}},[e._v("2023.10.26-Pytorch实现线性回归")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 26-torch nn Module bc73b61cb24e44829553a4d7c7cbafdb.html"}},[e._v("2023.10.26-torch.nn.Module")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 26-Jupyter Notebook 4004412fe7034eb5bb267574cf732a16.html"}},[e._v("2023.10.26-Jupyter Notebook")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 10 30-Pytorch面试例题 fcf6c0ea64764770ba4fbc4a3f501804.html"}},[e._v("2023.10.30-Pytorch面试例题")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 11 01-图神经网络(GNN)模型 dc23395e26614dc49de7f8712a9750e4.html"}},[e._v("2023.11.01-图神经网络(GNN)模型")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 11 01-AI4Science面试准备 dc353f520cbc43b38a33df3eee83b79b.html"}},[e._v("2023.11.01-AI4Science面试准备")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 11 29-正则表达式 d7e945b2e7d34d06acbfc6e51922861f.html"}},[e._v("2023.11.29-正则表达式")])],1),e._v(" "),t("p",[t("RouterLink",{attrs:{to:"/Research/Research 55793f133d904f8298fb3e4b1227d790/2023 12 12-Docker 6fc5ec79556c4d79960776b3a8f83968.html"}},[e._v("2023.12.12-Docker")])],1)])}),[],!1,null,null,null);t.default=f.exports}}]); \ No newline at end of file diff --git a/assets/js/56.151daaaf.js b/assets/js/56.151daaaf.js new file mode 100644 index 0000000..2e98b12 --- /dev/null +++ b/assets/js/56.151daaaf.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{347:function(t,a,e){"use strict";e.r(a);var r=e(14),s=Object(r.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"_2023-geant4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-geant4"}},[t._v("#")]),t._v(" 2023-Geant4")]),t._v(" "),a("h2",{attrs:{id:"_2023-02-13-在超算上搭建singularity环境并配置geant4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-02-13-在超算上搭建singularity环境并配置geant4"}},[t._v("#")]),t._v(" "),a("RouterLink",{attrs:{to:"/Research/Research/2023-Geant4/2023.02.13-在超算上搭建Singularity环境并配置Geant4.html"}},[t._v("2023.02.13-在超算上搭建Singularity环境并配置Geant4")])],1),t._v(" "),a("h2",{attrs:{id:"_2023-06-14-geant4各版本的安装"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-06-14-geant4各版本的安装"}},[t._v("#")]),t._v(" "),a("RouterLink",{attrs:{to:"/Research/Research/2023-Geant4/2023.06.14-Geant4各版本的安装.html"}},[t._v("2023.06.14-Geant4各版本的安装")])],1),t._v(" "),a("h2",{attrs:{id:"_2023-02-27-处理geant4获取的数据"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-02-27-处理geant4获取的数据"}},[t._v("#")]),t._v(" "),a("RouterLink",{attrs:{to:"/Research/Research/2023-Geant4/2023.02.27-处理Geant4获取的数据.html"}},[t._v("2023.02.27-处理Geant4获取的数据")])],1),t._v(" "),a("h2",{attrs:{id:"_2023-05-23-geant4多粒子源设置"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-05-23-geant4多粒子源设置"}},[t._v("#")]),t._v(" "),a("RouterLink",{attrs:{to:"/Research/Research/2023-Geant4/2023.05.23-Geant4多粒子源设置.html"}},[t._v("2023.05.23-Geant4多粒子源设置")])],1),t._v(" "),a("h2",{attrs:{id:"_2023-03-12-pka数据处理"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-03-12-pka数据处理"}},[t._v("#")]),t._v(" "),a("RouterLink",{attrs:{to:"/Research/Research/2023-Geant4/2023.03.12-PKA数据处理.html"}},[t._v("2023.03.12-PKA数据处理")])],1),t._v(" "),a("h2",{attrs:{id:"_2023-08-28-geant4自定义physicslist"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-08-28-geant4自定义physicslist"}},[t._v("#")]),t._v(" "),a("RouterLink",{attrs:{to:"/Research/Research/2023-Geant4/2023.08.28-Geant4自定义PhysicsList.html"}},[t._v("2023.08.28-Geant4自定义PhysicsList")])],1),t._v(" "),a("h2",{attrs:{id:"_2023-09-05-c-trim程序"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-09-05-c-trim程序"}},[t._v("#")]),t._v(" "),a("RouterLink",{attrs:{to:"/Research/Research/2023-Geant4/2023.09.05-C++ Trim程序.html"}},[t._v("2023.09.05-C++ Trim程序")])],1),t._v(" "),a("h2",{attrs:{id:"_2023-12-18-geant4自动化"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2023-12-18-geant4自动化"}},[t._v("#")]),t._v(" "),a("RouterLink",{attrs:{to:"/Research/Research/2023-Geant4/2023.12.18-Geant4自动化.html"}},[t._v("2023.12.18-Geant4自动化")])],1)])}),[],!1,null,null,null);a.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/57.7a29fcee.js b/assets/js/57.7a29fcee.js new file mode 100644 index 0000000..5319dd2 --- /dev/null +++ b/assets/js/57.7a29fcee.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{350:function(t,s,a){"use strict";a.r(s);var n=a(14),p=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2023-02-27-处理geant4获取的数据"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2023-02-27-处理geant4获取的数据"}},[t._v("#")]),t._v(" 2023.02.27-处理Geant4获取的数据")]),t._v(" "),s("h2",{attrs:{id:"直方图-histogram"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#直方图-histogram"}},[t._v("#")]),t._v(" 直方图 Histogram")]),t._v(" "),s("div",{staticClass:"language-python extra-class"},[s("pre",{pre:!0,attrs:{class:"language-python"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" copy\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" os\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" sys\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" pandas "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" pd\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" numpy "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" np\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" matplotlib"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pyplot "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" plt\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Path of the file to read")]),t._v("\npath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../output_below.csv"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# open the csv file")]),t._v("\ndf "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" pd"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("read_csv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# columns of the csv file")]),t._v("\nparticleName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\neventID "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ntrackID "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreVolumeName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreZ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreKE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreProcessName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostProcessName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostVolumeName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostZ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostKE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nstepLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ntrackLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# get the energy density")]),t._v("\nunit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MeV*cm^2/g'")]),t._v("\ndensitySiC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.217")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" 1e"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("3import os\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" sys\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" pandas "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" pd\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" numpy "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" np\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" matplotlib"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pyplot "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" plt\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Path of the file to read")]),t._v("\npath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../output_below.csv"')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# open the csv file")]),t._v("\ndf "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" pd"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("read_csv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# columns of the csv file")]),t._v("\nparticleName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\neventID "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ntrackID "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreVolumeName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreZ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreKE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreProcessName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostProcessName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostVolumeName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostZ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostKE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nstepLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ntrackLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# get the energy density")]),t._v("\nunit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MeV*cm^2/g'")]),t._v("\ndensitySiC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.217")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndensityAl "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.6989")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndensitySi "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.3296")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndensitySiO2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndepositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" np"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("array"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nstepLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" np"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("array"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("stepLength"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergyDensity "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" stepLength\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V1'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySi\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V2'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySiO2\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Vs1'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("or")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Vs2'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("or")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'VD'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densityAl\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySiC\ndepositEnergyDensity "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergyDensity250000 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\npreX_250000"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\npreZ_250000"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("250000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n preX_250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n preZ_250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preZ"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# draw the heatmap according to the coordinates and the energy deposit")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# the energy deposit is the color of the heatmap")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# the coordinates are the x and y axis of the heatmap")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# the z axis is the energy deposit")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# the colorbar is the energy deposit")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# draw the heatmap")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("scatter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" preZ"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("depositEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cmap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'jet'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("marker"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preX"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preZ"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_total"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("colorbar"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_total.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("scatter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" preZ"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cmap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'jet'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("marker"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preX"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preZ"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_total"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("colorbar"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_density_total.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("scatter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preX_250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" preZ_250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("depositEnergyDensity250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cmap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'jet'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("marker"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preX"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preZ"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_<250000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("colorbar"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_density_2500000.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\ndensityAl "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.6989")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndensitySi "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.3296")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndensitySiO2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndepositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" np"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("array"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nstepLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" np"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("array"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("stepLength"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergyDensity "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" stepLength\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V1'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySi\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V2'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySiO2\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Vs1'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("or")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Vs2'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("or")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'VD'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densityAl\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySiC\ndepositEnergyDensity "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergyDensity250000 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("250000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n \n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# draw the histogram of the energy deposit")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bins"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" facecolor"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n edgecolor"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" alpha"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# plt.yscale('log')")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergy(MeV)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Number"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergy_total"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergy_total.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# draw the histogram of the energy deposit density")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bins"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" facecolor"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n edgecolor"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" alpha"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("yscale"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'log'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergyDensity(MeV*cm^2/g)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Number"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergyDensity_total"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergyDensity_total.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# make a dictionary of the columns")]),t._v("\nnames "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V1'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V2'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V31'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V32'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V51'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V52'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V66'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'VD'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Vs1'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Vs2'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V7'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\ndict_dp "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("dict")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("names"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndict_dpd "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" copy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("deepcopy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dict_dp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# extract the keys of the dictionary to a list")]),t._v("\nvolumeNames "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("list")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dict_dp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("keys"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# for every column, determine the preVolumeName and fill the dictionary")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" j "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" volumeNames"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n dict_dp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n dict_dpd"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("j"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("break")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# draw the histogram of the energy deposit for each volume and merge in one page")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("figure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("figsize"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("volumeNames"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("subplot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dict_dp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("volumeNames"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bins"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n facecolor"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" edgecolor"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" alpha"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# plt.yscale('log')")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergy(MeV)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Number"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("volumeNames"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergy_each.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# draw the histogram of the energy deposit density for each volume and merge in one page")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("figure"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("figsize"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("volumeNames"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("subplot"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("hist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("dict_dpd"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("volumeNames"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" bins"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n facecolor"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" edgecolor"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" alpha"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# plt.yscale('log')")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergyDensity(MeV*cm^2/g)"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Number"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n plt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("volumeNames"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"depositEnergyDensity_each.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("hr"),t._v(" "),s("h2",{attrs:{id:"热力图-heatmap"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#热力图-heatmap"}},[t._v("#")]),t._v(" 热力图 Heatmap")]),t._v(" "),s("div",{staticClass:"language-python extra-class"},[s("pre",{pre:!0,attrs:{class:"language-python"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" os\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" sys\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" pandas "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" pd\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" numpy "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" np\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" matplotlib"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pyplot "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" plt\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Path of the file to read")]),t._v("\npath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../output_below.csv"')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# open the csv file")]),t._v("\ndf "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" pd"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("read_csv"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# columns of the csv file")]),t._v("\nparticleName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\neventID "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ntrackID "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreVolumeName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreZ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreKE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npreProcessName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostProcessName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostVolumeName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("11")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("12")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostZ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\npostKE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("15")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nstepLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("16")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ntrackLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" df"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("iloc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("17")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("values"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# get the energy density")]),t._v("\nunit "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MeV*cm^2/g'")]),t._v("\ndensitySiC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.217")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndensityAl "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.6989")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndensitySi "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.3296")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndensitySiO2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.2")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1e-3")]),t._v("\ndepositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" np"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("array"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nstepLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" np"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("array"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("stepLength"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergyDensity "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" stepLength\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V1'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySi\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'V2'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySiO2\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Vs1'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("or")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Vs2'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("or")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preVolumeName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("strip"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'VD'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densityAl\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("continue")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" densitySiC\ndepositEnergyDensity "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("tolist"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\ndepositEnergyDensity250000 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\npreX_250000"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\npreZ_250000"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" i "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("range")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("len")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("250000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n depositEnergyDensity250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n preX_250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n preZ_250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("append"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preZ"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("i"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# draw the heatmap according to the coordinates and the energy deposit")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# the energy deposit is the color of the heatmap")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# the coordinates are the x and y axis of the heatmap")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# the z axis is the energy deposit")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# the colorbar is the energy deposit")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# draw the heatmap")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("scatter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" preZ"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("depositEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cmap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'jet'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("marker"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preX"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preZ"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_total"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("colorbar"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_total.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("scatter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" preZ"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("depositEnergyDensity"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cmap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'jet'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("marker"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preX"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preZ"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_total"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("colorbar"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_density_total.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("scatter"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("preX_250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" preZ_250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("depositEnergyDensity250000"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" s"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" cmap"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'jet'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("marker"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'.'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("xlabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preX"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("ylabel"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"preZ"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("title"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_<250000"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("colorbar"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("savefig"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"heatmap_density_2500000.png"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dpi"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\nplt"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("show"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=p.exports}}]); \ No newline at end of file diff --git a/assets/js/58.8f91e1ff.js b/assets/js/58.8f91e1ff.js new file mode 100644 index 0000000..795f3c4 --- /dev/null +++ b/assets/js/58.8f91e1ff.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{352:function(t,a,s){"use strict";s.r(a);var e=s(14),n=Object(e.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"_2023-03-12-pka数据处理"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2023-03-12-pka数据处理"}},[this._v("#")]),this._v(" 2023.03.12-PKA数据处理")]),this._v(" "),t("p",[t("a",{attrs:{href:"./Geant4_PKA_Data.pdf"}},[this._v("23-03-12_Geant4_PKA_Data.pdf")])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/59.710654b8.js b/assets/js/59.710654b8.js new file mode 100644 index 0000000..3236f0a --- /dev/null +++ b/assets/js/59.710654b8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{353:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2023-05-23-geant4多粒子源设置"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2023-05-23-geant4多粒子源设置"}},[t._v("#")]),t._v(" 2023.05.23-Geant4多粒子源设置")]),t._v(" "),s("p",[t._v("源代码:")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create particle source")]),t._v("\nG4GeneralParticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" particleSource "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("G4GeneralParticleSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// First particle source")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetCurrentSourceto")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("particleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetNumberofSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetPosDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetCentreCoords")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("G4ThreeVector")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("cm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetAngDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetAngDistType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"iso"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetEneDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetEnergyDisType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Mono"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetEneDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetMonoEnergy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("MeV"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetParticleDefinition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4Neutron")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("NeutronDefinition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Point source")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetPosDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetPosDisType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Point"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Second particle source")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("AddaSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetCurrentSourceto")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("particleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetNumberofSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetPosDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetCentreCoords")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("G4ThreeVector")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5.0")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("cm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetAngDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetAngDistType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"iso"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetEneDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetEnergyDisType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Mono"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetEneDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetMonoEnergy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("MeV"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetParticleDefinition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4Proton")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ProtonDefinition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Plane source")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetPosDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetPosDisType")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Plane"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetPosDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetPosDisShape")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Circle"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\nparticleSource"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetCurrentSource")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetPosDist")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetRadius")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("cm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("mac文件内:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("/gps/source/0/intensity "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("500")]),t._v("\n/gps/source/1/intensity "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1000")]),t._v("\n")])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/6.af44fe9c.js b/assets/js/6.af44fe9c.js new file mode 100644 index 0000000..a9feb79 --- /dev/null +++ b/assets/js/6.af44fe9c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{281:function(e,t,a){},295:function(e,t,a){"use strict";a(281)},312:function(e,t,a){"use strict";a.r(t);var o={name:"CodeGroup",data:()=>({codeTabs:[],activeCodeTabIndex:-1}),watch:{activeCodeTabIndex(e){this.activateCodeTab(e)}},mounted(){this.loadTabs()},methods:{changeCodeTab(e){this.activeCodeTabIndex=e},loadTabs(){this.codeTabs=(this.$slots.default||[]).filter(e=>Boolean(e.componentOptions)).map((e,t)=>(""===e.componentOptions.propsData.active&&(this.activeCodeTabIndex=t),{title:e.componentOptions.propsData.title,elm:e.elm})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0),this.activateCodeTab(0)},activateCodeTab(e){this.codeTabs.forEach(e=>{e.elm&&e.elm.classList.remove("theme-code-block__active")}),this.codeTabs[e].elm&&this.codeTabs[e].elm.classList.add("theme-code-block__active")}}},s=(a(295),a(14)),c=Object(s.a)(o,(function(){var e=this,t=e._self._c;return t("ClientOnly",[t("div",{staticClass:"theme-code-group"},[t("div",{staticClass:"theme-code-group__nav"},[t("ul",{staticClass:"theme-code-group__ul"},e._l(e.codeTabs,(function(a,o){return t("li",{key:a.title,staticClass:"theme-code-group__li"},[t("button",{staticClass:"theme-code-group__nav-tab",class:{"theme-code-group__nav-tab-active":o===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(o)}}},[e._v("\n "+e._s(a.title)+"\n ")])])})),0)]),e._v(" "),e._t("default"),e._v(" "),e.codeTabs.length<1?t("pre",{staticClass:"pre-blank"},[e._v("// Make sure to add code blocks to your code group")]):e._e()],2)])}),[],!1,null,"deefee04",null);t.default=c.exports}}]); \ No newline at end of file diff --git a/assets/js/60.bb9a5ee5.js b/assets/js/60.bb9a5ee5.js new file mode 100644 index 0000000..13ddaf0 --- /dev/null +++ b/assets/js/60.bb9a5ee5.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{354:function(a,t,s){"use strict";s.r(t);var e=s(14),n=Object(e.a)({},(function(){var a=this,t=a._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"_2023-06-14-geant4各版本的安装"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2023-06-14-geant4各版本的安装"}},[a._v("#")]),a._v(" 2023.06.14-Geant4各版本的安装")]),a._v(" "),t("h2",{attrs:{id:"安装依赖"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#安装依赖"}},[a._v("#")]),a._v(" 安装依赖")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-y")]),a._v(" build-essential\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-y")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("wget")]),a._v("\n// "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-y")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("aptitude")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-y")]),a._v(" cmake libx11-dev libxext-dev libxtst-dev libxrender-dev libxmu-dev libxmuu-dev libhdf5-serial-dev hdf5-tools\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt-get")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-y")]),a._v(" libexpat1-dev libxerces-c-dev libxt-dev libmotif-dev\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("sudo")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("apt")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v(" qt5* qt6* libqt5opengl5-dev\n")])])]),t("h2",{attrs:{id:"下载安装geant4"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#下载安装geant4"}},[a._v("#")]),a._v(" 下载安装Geant4")]),a._v(" "),t("div",{staticClass:"language-bash extra-class"},[t("pre",{pre:!0,attrs:{class:"language-bash"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[a._v("mkdir")]),a._v(" Geant4_11.1.1\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("wget")]),a._v(" https://geant4-data.web.cern.ch/releases/geant4-v11.1.1.tar.gz\n// https://gitlab.cern.ch/geant4/geant4/-/archive/v10.5.1/geant4-v10.5.1.tar.gz\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("tar")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-xzvf")]),a._v(" geant4-v11.1.1.tar.gz\n\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("mkdir")]),a._v(" build\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("cd")]),a._v(" build\ncmake "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DCMAKE_INSTALL_PREFIX")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("/home/tiancheng/Geant4_11.1.1 /home/tiancheng/geant4-v11.1.1\ncmake "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_INSTALL_DATA")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_BUILD_MULTITHREADED")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_USE_GDML")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_USE_QT")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_USE_OPENGL_X11")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_USE_RAYTRACER_X11")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_USE_NETWORKDAWN")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_USE_XM")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-DGEANT4_USE_NETWORKVRML")]),t("span",{pre:!0,attrs:{class:"token operator"}},[a._v("=")]),a._v("ON "),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v(".")]),a._v("\n\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("make")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[a._v("-jN")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("make")]),a._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[a._v("install")]),a._v("\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("source")]),a._v(" /root/Geant4/home/geant4/bin/geant4.sh\n"),t("span",{pre:!0,attrs:{class:"token builtin class-name"}},[a._v("source")]),a._v(" /root/Geant4/home/geant4/share/Geant4/geant4make/geant4make.sh\n")])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/61.7848b707.js b/assets/js/61.7848b707.js new file mode 100644 index 0000000..6ea0816 --- /dev/null +++ b/assets/js/61.7848b707.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{355:function(t,s,a){"use strict";a.r(s);var n=a(14),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2023-08-28-geant4-自定义-physicslist"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2023-08-28-geant4-自定义-physicslist"}},[t._v("#")]),t._v(" 2023.08.28-Geant4 自定义 PhysicsList")]),t._v(" "),s("h2",{attrs:{id:"一个最简单的例子"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一个最简单的例子"}},[t._v("#")]),t._v(" 一个最简单的例子")]),t._v(" "),s("h3",{attrs:{id:"main"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#main"}},[t._v("#")]),t._v(" "),s("code",[t._v("main")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4RunManager.hh"')])]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("main")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 初始化 run manager")]),t._v("\n G4RunManager runManager"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 设置物理列表")]),t._v("\n runManager"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SetUserInitialization")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SimplePhysicsList")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... 其他初始化和设置")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 开始模拟")]),t._v("\n runManager"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("BeamOn")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"自定义物理列表类"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#自定义物理列表类"}},[t._v("#")]),t._v(" 自定义物理列表类:")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4VModularPhysicsList.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4ParticleDefinition.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4ProcessManager.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4Proton.hh"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 或其他你关心的粒子")])]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimplePhysicsList")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token base-clause"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4VModularPhysicsList")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ConstructParticle")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 创建或获取粒子类型")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4Proton")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ProtonDefinition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... 其他粒子")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ConstructProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 获取粒子的过程管理器")]),t._v("\n G4ProcessManager"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" pManager "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4Proton")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("Proton")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetProcessManager")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 添加自定义的碰撞过程")]),t._v("\n pManager"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("AddDiscreteProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SimpleCollisionProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("YourCustomPhysicsList")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ConstructProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... other processes")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("auto")]),t._v(" particleIterator "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetParticleIterator")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n particleIterator"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("reset")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("particleIterator"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n G4ParticleDefinition"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" particle "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" particleIterator"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("value")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n G4ProcessManager"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" pmanager "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" particle"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetProcessManager")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("YourCustomProcess")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("IsApplicable")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v("particle"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n pmanager"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("AddDiscreteProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("YourCustomProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"自定义碰撞过程类"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#自定义碰撞过程类"}},[t._v("#")]),t._v(" 自定义碰撞过程类:")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4VDiscreteProcess.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4Step.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4VParticleChange.hh"')])]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleCollisionProcess")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token base-clause"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4VDiscreteProcess")])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n G4VParticleChange"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PostStepDoIt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Track"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" track"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Step"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*step*/")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 这里执行碰撞后的粒子状态更改")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 例如,改变动量、能量等")]),t._v("\n\n aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("Initialize")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("track"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// aParticleChange.SetXXX(...); // 设置粒子状态")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n G4double "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetMeanFreePath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Track"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*track*/")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" G4double "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*previousStepSize*/")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" G4ForceCondition"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/*condition*/")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 返回这个过程的平均自由路径")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 这里只返回一个固定的值作为示例")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" cm"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"_1-关于必须重新定义的函数"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-关于必须重新定义的函数"}},[t._v("#")]),t._v(" 1. 关于必须重新定义的函数:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("PostStepDoIt")]),t._v(": 这个函数用于描述在一步运动后粒子的状态如何改变。这通常是必须要重写的。")]),t._v(" "),s("li",[s("code",[t._v("GetMeanFreePath")]),t._v(": 这个函数返回给定粒子在特定条件下的平均自由路径。这通常也需要重写以适应你的模型。")])]),t._v(" "),s("p",[t._v("这两个函数通常是最主要需要重写的。然而,根据你的具体需求,有时还可能需要重写其他函数,比如:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("AlongStepDoIt")]),t._v(": 如果你从 "),s("code",[t._v("G4VContinuousProcess")]),t._v(" 继承,这个函数用于描述粒子在一步中如何连续地改变。")]),t._v(" "),s("li",[s("code",[t._v("IsApplicable")]),t._v(": 这个函数决定这个过程是否应用于某个粒子。")]),t._v(" "),s("li",[s("code",[t._v("AtRestDoIt")]),t._v(": 用于描述一个静止粒子如何起始一个新的过程(如果适用)。")]),t._v(" "),s("li",[s("code",[t._v("StartTracking")]),t._v("、"),s("code",[t._v("EndTracking")]),t._v(": 这些是在粒子轨迹开始和结束时被调用的。")])]),t._v(" "),s("h2",{attrs:{id:"_2-关于-aparticlechange"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-关于-aparticlechange"}},[t._v("#")]),t._v(" 2. 关于 "),s("code",[t._v("aParticleChange")]),t._v(":")]),t._v(" "),s("p",[s("code",[t._v("aParticleChange")]),t._v(" 是一个 "),s("code",[t._v("G4VParticleChange")]),t._v(" 对象,它用于保存由这个过程产生的粒子状态改变。当 "),s("code",[t._v("PostStepDoIt")]),t._v(" 被调用时,你需要用它来设置新的粒子状态(如位置、动量、能量等)。这个对象通常是 "),s("code",[t._v("G4VDiscreteProcess")]),t._v(" 或 "),s("code",[t._v("G4VContinuousProcess")]),t._v(" 的成员变量,由基类初始化。")]),t._v(" "),s("p",[t._v("例如,你可以这样设置新的动量方向:")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[t._v("aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ProposeMomentumDirection")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("newDirection"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("或者,设置新的能量:")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[t._v("aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ProposeEnergy")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("newEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("p",[t._v("这样,在 "),s("code",[t._v("PostStepDoIt")]),t._v(" 函数返回后,Geant4 会用 "),s("code",[t._v("aParticleChange")]),t._v(" 中的信息来更新粒子状态。")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("aParticleChange.Initialize(track)")])])]),t._v(" "),s("p",[t._v("这个函数初始化 "),s("code",[t._v("aParticleChange")]),t._v(" 对象,使其包含给定轨迹("),s("code",[t._v("track")]),t._v(")的当前状态。这通常是你开始修改粒子状态之前的第一步。")]),t._v(" "),s("h2",{attrs:{id:"_3-getmeanfreepath-的作用"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-getmeanfreepath-的作用"}},[t._v("#")]),t._v(" 3. "),s("code",[t._v("GetMeanFreePath")]),t._v(" 的作用")]),t._v(" "),s("p",[s("code",[t._v("GetMeanFreePath")]),t._v(" 函数是用来告知 Geant4 在多长的距离后应该调用 "),s("code",[t._v("PostStepDoIt")]),t._v(' 函数的。简单地说,这个函数决定了一个物理过程发生的"频率"或者概率。在每一步结束后,Geant4 会评估所有的离散过程来看哪一个将被下一个执行,这一决定是基于每个过程的平均自由路径和其他概率性因素来的。')]),t._v(" "),s("p",[t._v("比如说,如果 "),s("code",[t._v("GetMeanFreePath")]),t._v(" 返回了一个很小的数值,这表示该过程非常可能在下一步就会发生。相反地,一个大的返回值意味着该过程相对较不可能发生。")]),t._v(" "),s("h2",{attrs:{id:"_4-多物理过程情形"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-多物理过程情形"}},[t._v("#")]),t._v(" 4. 多物理过程情形")]),t._v(" "),s("h3",{attrs:{id:"说明"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#说明"}},[t._v("#")]),t._v(" 说明:")]),t._v(" "),s("p",[t._v('在 Geant4 中,一粒子的轨迹(track)被分解为多个连续的 "步"(steps)。在每一步结束时,Geant4 会评估所有应用于该粒子类型的离散物理过程(例如电离、散射等)。这个评估的目的是为了决定下一步应该执行哪个过程。')]),t._v(" "),s("p",[t._v("假设我们有三个不同的物理过程 A、B 和 C。每一个都有自己的 "),s("code",[t._v("GetMeanFreePath")]),t._v(" 函数,这个函数返回一个距离值,该值表示粒子在该距离后大概会经历该过程。")]),t._v(" "),s("ol",[s("li",[t._v("计算平均自由路径: 在每一步的结束,Geant4 会调用所有过程的 "),s("code",[t._v("GetMeanFreePath")]),t._v(" 函数,获得 A、B、C 的平均自由路径,分别记作"),s("em",[t._v("λA")]),t._v(","),s("em",[t._v("λB")]),t._v(","),s("em",[t._v("λC")]),t._v("。")]),t._v(" "),s("li",[t._v("概率性决策: 基于这些平均自由路径和其他概率性因素,Geant4 会计算哪一个过程应该下一个被执行。一种简单的方式是,选择平均自由路径最小的那个过程,因为它更可能发生。但实际的算法可能更加复杂,并考虑其他因素。")]),t._v(" "),s("li",[t._v("执行过程: 选定了要执行的过程(比如说是过程 A)后,Geant4 就会调用 A 的 "),s("code",[t._v("PostStepDoIt")]),t._v(" 函数来实际模拟该过程,更新粒子的状态。")]),t._v(" "),s("li",[t._v("进入下一步: 根据 "),s("code",[t._v("PostStepDoIt")]),t._v(" 的结果,粒子的状态被更新,然后开始下一步的模拟。")])]),t._v(" "),s("p",[t._v("这样,通过在每一步结束时动态评估哪一个过程应该被执行,Geant4 能够模拟一个粒子轨迹中多种物理过程的竞争和相互作用。这是为什么需要定义 "),s("code",[t._v("GetMeanFreePath")]),t._v(" 的原因:它为这个概率性决策提供了必要的信息。")]),t._v(" "),s("h3",{attrs:{id:"示例"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#示例"}},[t._v("#")]),t._v(" 示例:")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4VDiscreteProcess.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4Step.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4ParticleChange.hh"')])]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SimpleElasticScattering")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token base-clause"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4VDiscreteProcess")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... Constructors, destructor, etc.")]),t._v("\n\n G4VParticleChange"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PostStepDoIt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Track"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" track"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Step"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("Initialize")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("track"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... Do some calculations for scattering, modify aParticleChange")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n G4double "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetMeanFreePath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Track"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" G4double"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" G4ForceCondition"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Just a constant mean free path for demonstration")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("class")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EnergyAbsorption")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token base-clause"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4VDiscreteProcess")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("public")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... Constructors, destructor, etc.")]),t._v("\n\n G4VParticleChange"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PostStepDoIt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Track"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" track"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Step"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("Initialize")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("track"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... Do some calculations for energy absorption, modify aParticleChange")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n G4double "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetMeanFreePath")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Track"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" G4double"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" G4ForceCondition"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("override")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Another constant mean free path for demonstration")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("在物理列表中添加:")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MyPhysicsList.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4ParticleDefinition.hh"')])]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token macro property"}},[s("span",{pre:!0,attrs:{class:"token directive-hash"}},[t._v("#")]),s("span",{pre:!0,attrs:{class:"token directive keyword"}},[t._v("include")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"G4ProcessManager.hh"')])]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("MyPhysicsList")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ConstructProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... Other setup code")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Get the process manager for ions (or whatever particle you're interested in)")]),t._v("\n G4ParticleDefinition"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" ion "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("G4Ion")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("IonDefinition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n G4ProcessManager"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" pmanager "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" ion"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("GetProcessManager")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Add the custom processes")]),t._v("\n SimpleElasticScattering"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" elasticScattering "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SimpleElasticScattering")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n EnergyAbsorption"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" energyAbsorption "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("EnergyAbsorption")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n pmanager"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("AddDiscreteProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("elasticScattering"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n pmanager"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("->")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("AddDiscreteProcess")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("energyAbsorption"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ... Other code for adding standard processes")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h1",{attrs:{id:"蒙特卡洛程序嵌入"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#蒙特卡洛程序嵌入"}},[t._v("#")]),t._v(" 蒙特卡洛程序嵌入")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[t._v("G4VParticleChange"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("YourProcess")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PostStepDoIt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Track"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" track"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" G4Step"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v(" step"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("Initialize")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("track"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Execute your methods")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("FreeLength")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ChoseCollisionAtom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("EleEnergyLoss")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("EmissionAngle")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("IonNewCondition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Update particle state in aParticleChange (not shown)")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Check whether the ion is still under processing")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" IonFlag "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("OutOrNot")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IonFlag"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// If IonFlag is changed by OutOrNot() to indicate the ion's journey is done,")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// you might need additional logic here to finalize the ion's record.")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("在 Geant4 中,如果一个粒子已经不再需要进一步处理,你通常需要更新这个粒子的状态,以便 Geant4 知道不再需要追踪这个粒子。这通常是通过设置 "),s("code",[t._v("G4Track")]),t._v(" 的状态来完成的,具体来说,是通过 "),s("code",[t._v("aParticleChange")]),t._v(" 对象(这通常是 "),s("code",[t._v("G4VParticleChange")]),t._v(" 类型或其子类)。")]),t._v(" "),s("p",[t._v("一个简单的例子:")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("some_condition"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Replace this with your actual stopping condition")]),t._v("\n aParticleChange"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ProposeTrackStatus")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("fStopAndKill"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n")])])]),s("p",[t._v("在这里,"),s("code",[t._v("fStopAndKill")]),t._v(" 是一个枚举值,表示该粒子应停止并被“杀死”,即不再被追踪。其他可用的状态还包括 "),s("code",[t._v("fStopButAlive")]),t._v("(停止但仍然“存活”,可能在以后的时间步重新开始)和 "),s("code",[t._v("fAlive")]),t._v("(继续运动)。")]),t._v(" "),s("p",[t._v("如果在 "),s("code",[t._v("PostStepDoIt")]),t._v(" 函数中确定粒子需要被停止,你可以通过上面的代码片段来告诉 Geant4。这样,Geant4 在执行完该步骤后就会知道不再需要对这个粒子进行后续计算。")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/62.f7a284a6.js b/assets/js/62.f7a284a6.js new file mode 100644 index 0000000..94965c3 --- /dev/null +++ b/assets/js/62.f7a284a6.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{357:function(t,s,a){"use strict";a.r(s);var n=a(14),r=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2023-09-05-c-trim-程序"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2023-09-05-c-trim-程序"}},[t._v("#")]),t._v(" 2023.09.05-C++ Trim 程序")]),t._v(" "),s("h2",{attrs:{id:"每个粒子端到端的计算"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#每个粒子端到端的计算"}},[t._v("#")]),t._v(" 每个粒子端到端的计算")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("DoOneIon")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" IonFlag"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// init the orginal paramters for current ions")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("InitialIon")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tIonFlag "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IonFlag "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the current ion are under processing")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("FreeLength")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ChoseCollisionAtom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("EleEnergyLoss")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("EmissionAngle")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("IonNewCondition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ProcessRecorder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("OutOrNot")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IonFlag"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// end of one ions")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("CollisionRecording")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add the results of this ion to the recording arraies")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"initialion"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#initialion"}},[t._v("#")]),t._v(" "),s("code",[t._v("InitialIon()")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("InitialIon")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n\tE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IonEnergyEV"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Energy")]),t._v("\n\tCOSIN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cos")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ALPHA"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// direction to the normal")]),t._v("\n\tSINY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" COSIN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tSINE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sin")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ALPHA"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tCOSY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" SINE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tCurrentLayer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tIonWayLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tIonCollisionNo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"具体计算"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#具体计算"}},[t._v("#")]),t._v(" 具体计算")]),t._v(" "),s("h3",{attrs:{id:"_1-freelength"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-freelength"}},[t._v("#")]),t._v(" 1. "),s("code",[t._v("FreeLength()")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("FreeLength")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" tempvalue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// when the ion energy is high")]),t._v("\n\tIonCollisionNo"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" E "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" F"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tEEG "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" EPSDG"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tPMAX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" A"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EEG "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EEG"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.125")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EEG"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tIonFreeLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" PMAX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" PMAX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" ARHO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// when the ion enrgy is low")]),t._v("\n\n\ttempvalue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PKURandom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IonCollisionNo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tIonFreeLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tempvalue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("AMIN1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IonFreeLength"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" channelwidth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" IonFreeLength"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ul",[s("li",[s("code",[t._v("ReducedCollEnergy")]),t._v(': 同样表示与被选中的原子碰撞后的"减少的"能量。')]),t._v(" "),s("li",[s("code",[t._v("E")]),t._v(": 未定义在这个函数中,但似乎是离子或粒子的能量。")]),t._v(" "),s("li",[s("code",[t._v("F[CurrentLayer]")]),t._v(": 当前层对应的一个因子,用于计算"),s("code",[t._v("ReducedCollEnergy")]),t._v("。")]),t._v(" "),s("li",[s("code",[t._v("EEG")]),t._v(": 一个与"),s("code",[t._v("ReducedCollEnergy")]),t._v("和"),s("code",[t._v("EPSDG[CurrentLayer]")]),t._v("有关的参数。")]),t._v(" "),s("li",[s("code",[t._v("EPSDG[CurrentLayer]")]),t._v(": 与当前层有关的一个常数或参数。")]),t._v(" "),s("li",[s("code",[t._v("PMAX[CurrentLayer]")]),t._v(": 当前层中的最大动量或概率。")]),t._v(" "),s("li",[s("code",[t._v("A[CurrentLayer]")]),t._v(": 当前层对应的一个参数或常数。")]),t._v(" "),s("li",[s("code",[t._v("IonFreeLength")]),t._v(": 离子的自由路径长度。")]),t._v(" "),s("li",[s("code",[t._v("ARHO[CurrentLayer]")]),t._v(": 当前层的密度或者与密度相关的一个参数。")]),t._v(" "),s("li",[s("code",[t._v("channelwidth")]),t._v(": 一个与离子自由路径长度有关的参数或者常数。")])]),t._v(" "),s("h3",{attrs:{id:"使用到的变量"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用到的变量"}},[t._v("#")]),t._v(" 使用到的变量:")]),t._v(" "),s("p",[s("code",[t._v("E")]),t._v(", "),s("code",[t._v("F")]),t._v(", "),s("code",[t._v("EPSDG")]),t._v(", "),s("code",[t._v("A")]),t._v(", "),s("code",[t._v("ARHO")])]),t._v(" "),s("h3",{attrs:{id:"输出-改变-的变量"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#输出-改变-的变量"}},[t._v("#")]),t._v(" 输出(改变)的变量:")]),t._v(" "),s("p",[s("code",[t._v("IonCollisionNo")]),t._v(", "),s("code",[t._v("ReducedCollEnergy")]),t._v(", "),s("code",[t._v("IonFreeLength")]),t._v(", "),s("code",[t._v("PMAX")])]),t._v(" "),s("h3",{attrs:{id:"_2-chosecollisionatom"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-chosecollisionatom"}},[t._v("#")]),t._v(" 2. "),s("code",[t._v("ChoseCollisionAtom()")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ChoseCollisionAtom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" MaxElement"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" tempRandValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\ttempRandValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PKURandom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tempRandValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\ttempRandValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PKURandom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\tP "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" PMAX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tempRandValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tMaxElement "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" LayerElementNo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// decided which kinds of atoms to be knocked!")]),t._v("\n\n\ttempRandValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PKURandom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("CurrentElement "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" CurrentElement "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" MaxElement"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" CurrentElement"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("++")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\ttempRandValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tempRandValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" TargetAtomConc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentElement"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tempRandValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("break")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("tempRandValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tCurrentElement "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" LayerElementNo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" FItemp"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentElement"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" E"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tB "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" P "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" ScreenLen"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentElement"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" TargetAtomNumber"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentElement"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ul",[s("li",[s("code",[t._v("P")]),t._v(": 未定义在这个函数中,但在函数内部进行了计算。可能是与粒子动量或概率有关的一个参数。")]),t._v(" "),s("li",[s("code",[t._v("PMAX[CurrentLayer]")]),t._v(": 当前层中的最大动量或概率。")]),t._v(" "),s("li",[s("code",[t._v("CurrentLayer")]),t._v(": 当前所在的层编号。")]),t._v(" "),s("li",[s("code",[t._v("LayerElementNo[CurrentLayer]")]),t._v(": 当前层包含的元素(原子)种类数量。")]),t._v(" "),s("li",[s("code",[t._v("CurrentElement")]),t._v(": 当前正在考虑的元素(原子)的编号。")]),t._v(" "),s("li",[s("code",[t._v("TargetAtomConc[CurrentLayer][CurrentElement]")]),t._v(": 当前层和元素对应的原子浓度或概率。")]),t._v(" "),s("li",[s("code",[t._v("ReducedCollEnergy")]),t._v(': 表示与被选中的原子碰撞后的"减少的"能量。')]),t._v(" "),s("li",[s("code",[t._v("FItemp[CurrentLayer][CurrentElement]")]),t._v(": 与当前层和元素有关的一个因子,用于计算"),s("code",[t._v("ReducedCollEnergy")]),t._v("。")]),t._v(" "),s("li",[s("code",[t._v("E")]),t._v(": 未定义在这个函数中,但用于计算"),s("code",[t._v("ReducedCollEnergy")]),t._v(",可能是粒子的能量。")]),t._v(" "),s("li",[s("code",[t._v("B")]),t._v(": 另一个与碰撞有关的参数。")]),t._v(" "),s("li",[s("code",[t._v("ScreenLen[CurrentLayer][CurrentElement]")]),t._v(": 与当前层和元素有关的一个参数,用于计算"),s("code",[t._v("B")]),t._v("。")]),t._v(" "),s("li",[s("code",[t._v("TargetAtomNumber[CurrentLayer][CurrentElement]")]),t._v(": 返回的是当前层和元素对应的目标原子的编号。")])]),t._v(" "),s("h3",{attrs:{id:"使用到的变量-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用到的变量-2"}},[t._v("#")]),t._v(" 使用到的变量:")]),t._v(" "),s("p",[s("code",[t._v("PMAX")]),t._v(", "),s("code",[t._v("FItemp")]),t._v(", "),s("code",[t._v("E")]),t._v(", "),s("code",[t._v("ScreenLen")])]),t._v(" "),s("h3",{attrs:{id:"改变的变量"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#改变的变量"}},[t._v("#")]),t._v(" 改变的变量:")]),t._v(" "),s("p",[s("code",[t._v("P")]),t._v(", "),s("code",[t._v("ReducedCollEnergy")]),t._v(", "),s("code",[t._v("B")])]),t._v(" "),s("h2",{attrs:{id:"_3-eleenergyloss"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-eleenergyloss"}},[t._v("#")]),t._v(" 3. "),s("code",[t._v("EleEnergyLoss()")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("EleEnergyLoss")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" Ion_Se"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tIE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("E "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" IonEnergyKeV "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v(".5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tSEE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" SE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("IE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("E "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" IonEnergyKeV"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tSEE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" SE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("E "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" IonEnergyKeV"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tDEE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IonFreeLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" SEE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tIon_Se "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" DEE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" Ion_Se"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("ul",[s("li",[s("code",[t._v("double Ion_Se")]),t._v(": 存储电子或离子的能量损失。")]),t._v(" "),s("li",[s("code",[t._v("IE")]),t._v(": 一个与离子或粒子能量"),s("code",[t._v("E")]),t._v("有关的整数变量。")]),t._v(" "),s("li",[s("code",[t._v("E")]),t._v(": 离子或粒子的能量,未在此函数内定义。")]),t._v(" "),s("li",[s("code",[t._v("IonEnergyKeV")]),t._v(": 离子能量的一个特定单位(千电子伏特,KeV)。")]),t._v(" "),s("li",[s("code",[t._v("SEE")]),t._v(": 与离子或粒子能量损失有关的一个参数。")]),t._v(" "),s("li",[s("code",[t._v("SE[CurrentLayer][IE]")]),t._v(": 当前层和能量级对应的能量损失率。")]),t._v(" "),s("li",[s("code",[t._v("DEE")]),t._v(": 实际能量损失,是"),s("code",[t._v("IonFreeLength")]),t._v("(离子的自由路径长度)和"),s("code",[t._v("SEE")]),t._v("(能量损失率)的乘积。")])]),t._v(" "),s("h3",{attrs:{id:"使用的变量"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用的变量"}},[t._v("#")]),t._v(" 使用的变量:")]),t._v(" "),s("p",[s("code",[t._v("E")]),t._v(", "),s("code",[t._v("IonEnergyKeV")]),t._v(", "),s("code",[t._v("SE")]),t._v(", "),s("code",[t._v("IonFreeLength")])]),t._v(" "),s("h3",{attrs:{id:"改变的变量-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#改变的变量-2"}},[t._v("#")]),t._v(" 改变的变量:")]),t._v(" "),s("p",[s("code",[t._v("DEE")]),t._v(",")]),t._v(" "),s("h2",{attrs:{id:"_4-emissionangle"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-emissionangle"}},[t._v("#")]),t._v(" 4. "),s("code",[t._v("EmissionAngle()")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("EmissionAngle")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" AngleValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" Q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// using the magic method")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\tR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tRR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.7")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\tRR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.7")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" RR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("RR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t\tR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RR"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("do")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\tEX1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.18175")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exp")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.1998")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tEX2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.50986")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exp")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.94229")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tEX3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.28022")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exp")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.4029")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tEX4 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.028171")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exp")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.20162")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tV "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EX1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" EX2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" EX3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" EX4"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tV1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("V "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.1998")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" EX1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.94229")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" EX2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.4092")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" EX3 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.20162")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" EX4"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t\t\tFR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" R "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" V "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" R "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tFR1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("R "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("V "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" V1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tQ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" FR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" FR1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" R "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" Q"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("while")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fabs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Q "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" R"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t\tROC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" V"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" V1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tSQE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ReducedCollEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tCC "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.011615")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" SQE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0071222")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" SQE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tAA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.99229")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" SQE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" CC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tFF "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("AA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" AA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" AA"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("9.3066")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" ReducedCollEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("14.813")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" ReducedCollEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tDELTA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("R "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" AA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" FF "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("FF "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tCO "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DELTA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" ROC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("R "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" ROC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tC2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" CO "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" CO"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tS2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" C2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("S2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("printf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\n%d %lf\\n"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" ElapsedIonNo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tCT "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" C2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tST "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" CT "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" CT"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// using the RusefScattering methods")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\tS2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" B "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" ReducedCollEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("S2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("printf")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"\\n%d %lf\\n"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" ElapsedIonNo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" B"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tC2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" S2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tCT "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" C2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\tST "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" CT "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" CT"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\tAngleValue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("acos")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("CT"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" AngleValue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"使用的变量-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用的变量-2"}},[t._v("#")]),t._v(" 使用的变量:")]),t._v(" "),s("p",[s("code",[t._v("ReducedCollEnergy")]),t._v(", "),s("code",[t._v("B")]),t._v(",")]),t._v(" "),s("h3",{attrs:{id:"改变的变量-3"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#改变的变量-3"}},[t._v("#")]),t._v(" 改变的变量:")]),t._v(" "),s("p",[s("code",[t._v("RR")]),t._v(", "),s("code",[t._v("ST")]),t._v(", "),s("code",[t._v("S2")]),t._v(", "),s("code",[t._v("CT")]),t._v(",")]),t._v(" "),s("h2",{attrs:{id:"_5-ionnewcondition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-ionnewcondition"}},[t._v("#")]),t._v(" 5. "),s("code",[t._v("IonNewCondition()")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("IonNewCondition")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("MAX")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" X1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// MAX is not OK!!!!!!!!!!!!!!!!!!!!!!!!!")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("float")]),t._v(" tempvalue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tDEN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" recoilfactor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentElement"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" S2 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" E"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" E "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" DEN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" DEE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("DEE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" MAX"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tMAX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" DEE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tIonWayLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IonWayLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" IonFreeLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" DistanceNuclear"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tX "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" X "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IonFreeLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" DistanceNuclear"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" COSIN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" Y "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("IonFreeLength "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" DistanceNuclear"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" COSY"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("AMIN1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fabs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("X "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" channelwidth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tJ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("AMIN1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fabs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Y "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" channelwidth"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("50.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ALPHA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("!=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&&")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Y "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tJ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\ttempvalue "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("PKURandom")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tPHI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" PI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" tempvalue"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tPSI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("atan")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("ST "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("CT "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" M1_to_M2"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentElement"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PSI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tPSI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" PSI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" PI"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tX1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v("COSIN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" COSY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("SINE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" SINY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fabs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("X1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tX1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" X1 "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("fabs")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("X1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tDELTA "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" PHI "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("acos")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("X1"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tCOSIN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" COSIN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cos")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PSI"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" SINE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sin")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PSI"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cos")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PHI"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tCOSY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" COSY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cos")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PSI"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" SINY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sin")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("PSI"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("cos")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("DELTA"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tSINY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" COSY "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" COSY"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\tSINE "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sqrt")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" COSIN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" COSIN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"使用的变量-3"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用的变量-3"}},[t._v("#")]),t._v(" 使用的变量:")]),t._v(" "),s("p",[s("code",[t._v("recoilfactor")]),t._v(", "),s("code",[t._v("DistanceNuclear")]),t._v(", "),s("code",[t._v("IonFreeLength")]),t._v(", "),s("code",[t._v("channelwidth")]),t._v(", "),s("code",[t._v("ALPHA")]),t._v(", "),s("code",[t._v("M1_to_M2")]),t._v(",")]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("channelwidth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tchannelwidth "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.01")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" LayertoSurface"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// for recording, the total sample are dividied into 100 segment")]),t._v("\n")])])]),s("h3",{attrs:{id:"改变的变量-4"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#改变的变量-4"}},[t._v("#")]),t._v(" 改变的变量:")]),t._v(" "),s("p",[s("code",[t._v("DEN")]),t._v(", "),s("code",[t._v("E")]),t._v(", "),s("code",[t._v("IonWayLength")]),t._v(", "),s("code",[t._v("COSIN")]),t._v(", "),s("code",[t._v("COSY")]),t._v(", "),s("code",[t._v("X")]),t._v(", "),s("code",[t._v("Y")]),t._v(", "),s("code",[t._v("I")]),t._v(", "),s("code",[t._v("J")]),t._v(", "),s("code",[t._v("PHI")]),t._v(", "),s("code",[t._v("PSI")]),t._v(", "),s("code",[t._v("SINE")]),t._v(", "),s("code",[t._v("SINY")]),t._v(", "),s("code",[t._v("DELTA")]),t._v(",")]),t._v(" "),s("h2",{attrs:{id:"_6-processrecorder"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_6-processrecorder"}},[t._v("#")]),t._v(" 6. "),s("code",[t._v("ProcessRecorder()")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("void")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ProcessRecorder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("double")]),t._v(" EPSD"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" EN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// total energy")]),t._v("\n\tMTOT"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" MTOT"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DEN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DEE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// the nuclear energy loss treamting process")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("DEN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" DisEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\tPhoneEDis"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" PhoneEDis"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DEN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\tEPSD "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" DamageEFract"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" DEN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Modified Kinchin-Pease model")]),t._v("\n\t\tEN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" DEN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" ElectronEFract"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EPSD "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EPSD"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.75")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3.4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("pow")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EPSD"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("6.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" DisEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\tPhoneEDis"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" PhoneEDis"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DEN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\n\t\t\tMVAC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" MVAC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tIVAC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IVAC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//!!!!")]),t._v("\n\t\t\t\tRPHON"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RPHON"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" EN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" DisEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Multi-defect production!")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("EN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2.5")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" DisEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\t\tMVAC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" MVAC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" EN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" DisEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\t\tRPHON"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RPHON"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DisEnergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" EN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\t\tRVAC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RVAC"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.0")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.4")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("*")]),t._v(" EN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v(" DisEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\t\t\tMION"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" MION"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DEN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" EN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\tRION"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" RION"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DEN "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" EN"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n\t"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// eletric energy loss treating process")]),t._v("\n\tIonizatinEDis"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" IonizatinEDis"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DEE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n\tMION"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" MION"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("I "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("-")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("J"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("+")]),t._v(" DEE"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"使用的变量-4"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用的变量-4"}},[t._v("#")]),t._v(" 使用的变量:")]),t._v(" "),s("p",[s("code",[t._v("I")]),t._v(", "),s("code",[t._v("J")]),t._v(", "),s("code",[t._v("DEN")]),t._v(", "),s("code",[t._v("DEE")]),t._v(", "),s("code",[t._v("DisEnergy")]),t._v(", "),s("code",[t._v("DamageEFract")]),t._v(", "),s("code",[t._v("ElectronEFract")]),t._v(",")]),t._v(" "),s("h3",{attrs:{id:"改变的变量-5"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#改变的变量-5"}},[t._v("#")]),t._v(" 改变的变量:")]),t._v(" "),s("p",[s("code",[t._v("MTOT")]),t._v(", "),s("code",[t._v("PhoneEDis")]),t._v(", "),s("code",[t._v("MVAC")]),t._v(", "),s("code",[t._v("IVAC")]),t._v(", "),s("code",[t._v("RPHON")]),t._v(", "),s("code",[t._v("RVAC")]),t._v(", "),s("code",[t._v("MION")]),t._v(", "),s("code",[t._v("RION")]),t._v(", "),s("code",[t._v("IonizatinEDis")]),t._v(",")]),t._v(" "),s("h2",{attrs:{id:"_7-outornot-int-ionflag"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_7-outornot-int-ionflag"}},[t._v("#")]),t._v(" 7. "),s("code",[t._v("OutOrNot(int &Ionflag)")])]),t._v(" "),s("div",{staticClass:"language-cpp extra-class"},[s("pre",{pre:!0,attrs:{class:"language-cpp"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("PKU_MC")]),s("span",{pre:!0,attrs:{class:"token double-colon punctuation"}},[t._v("::")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("OutOrNot")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("int")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("Ionflag"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("X "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\tIonflag "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("X "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" LayertoSurface"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\tCurrentLayer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("X "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" LayertoSurface"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t\tCurrentLayer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v("\n\t\t\tCurrentLayer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("X "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">=")]),t._v(" LayertoSurface"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("CurrentLayer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\t\tIonflag "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("E "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" StoppingEnergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n\t\tIonflag "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t\t"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\t"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h3",{attrs:{id:"使用的变量-5"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#使用的变量-5"}},[t._v("#")]),t._v(" 使用的变量:")]),t._v(" "),s("p",[s("code",[t._v("X")]),t._v(", "),s("code",[t._v("LayertoSurface")]),t._v(", "),s("code",[t._v("StoppingEnergy")]),t._v(", "),s("code",[t._v("E")]),t._v(",")]),t._v(" "),s("h3",{attrs:{id:"改变的变量-6"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#改变的变量-6"}},[t._v("#")]),t._v(" 改变的变量:")]),t._v(" "),s("p",[s("code",[t._v("Ionflag")]),t._v(",")]),t._v(" "),s("h1",{attrs:{id:"一些注意点"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#一些注意点"}},[t._v("#")]),t._v(" 一些注意点")]),t._v(" "),s("ol",[s("li",[t._v("while 大循环内部其实就是一个 step,那这些 step 里使用到的变量应该是继承在 event 里一直用的,但是在 event 结束后这些变量在哪里初始化的")])])])}),[],!1,null,null,null);s.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/63.6b95cbac.js b/assets/js/63.6b95cbac.js new file mode 100644 index 0000000..30e7fa9 --- /dev/null +++ b/assets/js/63.6b95cbac.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{358:function(t,s,n){"use strict";n.r(s);var a=n(14),e=Object(a.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"_2023-12-18-geant4自动化"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2023-12-18-geant4自动化"}},[t._v("#")]),t._v(" 2023.12.18-Geant4自动化")]),t._v(" "),s("h2",{attrs:{id:"_1-cmakelists-txt与run-mac的自动创建"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-cmakelists-txt与run-mac的自动创建"}},[t._v("#")]),t._v(" 1. "),s("code",[t._v("CMakeLists.txt")]),t._v("与"),s("code",[t._v("run.mac")]),t._v("的自动创建")]),t._v(" "),s("div",{staticClass:"language-python extra-class"},[s("pre",{pre:!0,attrs:{class:"language-python"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Python script to generate CMakeLists.txt and run.mac files with customizable parameters.")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_cmake_lists")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("project_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" executable_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" files_to_copy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v('"""\n Creates a CMakeLists.txt with customizable project and executable names.\n Args:\n - project_name: Name of the project\n - executable_name: Name of the executable\n - files_to_copy: List of files to copy\n Returns:\n - A string containing the contents of the CMakeLists.txt file\n """')]),t._v("\n cmake_template "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v('f"""cmake_minimum_required(VERSION 3.16)\nproject(')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("project_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(')\n\n# default build type: Debug\nif(NOT CMAKE_BUILD_TYPE)\n set(CMAKE_BUILD_TYPE Debug)\nendif()\n\n#----------------------------------------------------------------------------\n# Find Geant4 package, activating all available UI and Vis drivers by default\n# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui\n# to build a batch mode only executable\n#\noption(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)\nif(WITH_GEANT4_UIVIS)\n find_package(Geant4 REQUIRED ui_all vis_all)\nelse()\n find_package(Geant4 REQUIRED)\nendif()\n\n#----------------------------------------------------------------------------\n# Setup Geant4 include directories and compile definitions\n# Setup include directory for this project\n#\ninclude_directories(${{PROJECT_SOURCE_DIR}}/include)\ninclude(${{Geant4_USE_FILE}})\n\n#----------------------------------------------------------------------------\n# Locate sources and headers for this project\n# NB: headers are included so they will show up in IDEs\n#\nfile(GLOB sources ${{PROJECT_SOURCE_DIR}}/src/*.cc)\nfile(GLOB headers ${{PROJECT_SOURCE_DIR}}/include/*.hh)\n\n#----------------------------------------------------------------------------\n# Add the executable, and link it to the Geant4 libraries\n#\nadd_executable(')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("executable_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" main.cc ${{sources}} ${{headers}})\n# target_compile_definitions(")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("executable_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" PUBLIC G4GEOM_USE_USOLIDS)\ntarget_link_libraries(")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("executable_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(" ${{Geant4_LIBRARIES}})\n\n#----------------------------------------------------------------------------\n# Copy all scripts to the build directory, i.e. the directory in which we\n# build PKU_Trim_Geant4. This is so that we can run the executable directly\n# because it relies on these scripts being in the current working directory.\n#\nset(FILES_TO_COPY")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("files_to_copy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v(')\nforeach(_script ${{FILES_TO_COPY}})\n configure_file(\n ${{PROJECT_SOURCE_DIR}}/${{_script}}\n ${{PROJECT_BINARY_DIR}}/${{_script}}\n COPYONLY\n )\nendforeach()\n"""')])]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" cmake_template\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("def")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("create_run_mac")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n numberOfThreads"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputFileName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" iondefinition"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" ionenergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" numberOfIons\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v('"""\n Creates a run.mac file with customizable parameters.\n Args:\n - numberOfThreads: Number of threads\n - outputFileName: Name of the output file\n - iondefinition: Ion definition (Z A Q E)\n - ionenergy: Ion energy\n - numberOfIons: Number of ions\n Returns:\n - A string containing the contents of the run.mac file\n """')]),t._v("\n run_mac_content "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string-interpolation"}},[s("span",{pre:!0,attrs:{class:"token string"}},[t._v('f"""# Macro file for the runtime control of the example\n\n# Minimal run.mac file for testing the application\n\n# Set number of threads\n# /run/numberOfThreads ')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("numberOfThreads"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\n# /tracking/verbose 2\n\n# Initialize kernel\n/run/initialize\n/myApp/setOutputFileName ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("outputFileName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\n\n# Start simulation\n/gun/particle ion\n/gun/ion ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("iondefinition"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\n/gun/energy ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("ionenergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("\n/run/beamOn ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("numberOfIons"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('\n"""')])]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),t._v(" run_mac_content\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" __name__ "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"__main__"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Default values")]),t._v("\n project_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PKU_Trim_Geant4"')]),t._v("\n executable_name "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"PKU_Trim_Geant4"')]),t._v("\n files_to_copy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token triple-quoted-string string"}},[t._v('"""\n init_vis.mac\n vis.mac\n run.mac\n scoef.data\n scoefh.data\n thresholds.txt\n """')]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generate CMakeLists.txt")]),t._v("\n cmake_content "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" create_cmake_lists"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("project_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" executable_name"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" files_to_copy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n outputFileName "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"FinFET_p_2MeV.txt"')]),t._v("\n iondefinition "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1 1 0 0"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Z A Q E")]),t._v("\n ionenergy "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"2 MeV"')]),t._v("\n numberOfIons "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10000")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Generate run.mac")]),t._v("\n run_mac_content "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" create_run_mac"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" outputFileName"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" iondefinition"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" ionenergy"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" numberOfIons\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Define the paths for the output files")]),t._v("\n cmake_lists_path "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./CMakeLists.txt"')]),t._v("\n run_mac_path "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./run.mac"')]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Write the contents to the respective files")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("with")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cmake_lists_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" cmake_file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n cmake_file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("write"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("cmake_content"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("with")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("run_mac_path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"w"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" run_mac_file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v("\n run_mac_file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("write"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("run_mac_content"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n")])])]),s("h3",{attrs:{id:"cmakelists-txt中"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cmakelists-txt中"}},[t._v("#")]),t._v(" "),s("code",[t._v("CMakeLists.txt")]),t._v("中:")]),t._v(" "),s("p",[s("code",[t._v("executable_name")]),t._v(":生成的可执行文件名")]),t._v(" "),s("p",[s("code",[t._v("files_to_copy")]),t._v(":需要复制到build文件夹中的内容")]),t._v(" "),s("h3",{attrs:{id:"run-mac中"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#run-mac中"}},[t._v("#")]),t._v(" "),s("code",[t._v("run.mac")]),t._v("中")]),t._v(" "),s("p",[s("code",[t._v("numberOfThreads")]),t._v(":Geant4运行时使用的核心数(若使用Docker可不填)")]),t._v(" "),s("p",[s("code",[t._v("outputFileName")]),t._v(":Geant4产生的数据文件名")]),t._v(" "),s("p",[s("code",[t._v("iondefinition")]),t._v(":入射离子类型 # Z A Q E")]),t._v(" "),s("p",[s("code",[t._v("ionenergy")]),t._v(":入射离子能量")]),t._v(" "),s("p",[s("code",[t._v("numberOfIons")]),t._v(":入射离子数")]),t._v(" "),s("h2",{attrs:{id:"_2-docker自动化"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-docker自动化"}},[t._v("#")]),t._v(" 2. Docker自动化")]),t._v(" "),s("h3",{attrs:{id:"dockerfile"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#dockerfile"}},[t._v("#")]),t._v(" "),s("code",[t._v("Dockerfile")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-docker extra-class"},[s("pre",{pre:!0,attrs:{class:"language-docker"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 原单Geant4镜像")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token instruction"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("FROM")]),t._v(" outispku/geant4:v1")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 指定启动脚本")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token instruction"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("COPY")]),t._v(" start.sh /")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token instruction"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("RUN")]),t._v(" chmod +x /start.sh")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token instruction"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("RUN")]),t._v(" mkdir program")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token instruction"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("ENTRYPOINT")]),t._v(" ["),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/start.sh"')]),t._v("]")]),t._v("\n")])])]),s("h3",{attrs:{id:"start-sh"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#start-sh"}},[t._v("#")]),t._v(" "),s("code",[t._v("start.sh")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[s("span",{pre:!0,attrs:{class:"token shebang important"}},[t._v("#!/bin/bash")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Source Geant4 environment scripts")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("source")]),t._v(" /geant4/bin/geant4.sh\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("source")]),t._v(" /geant4/share/Geant4/geant4make/geant4make.sh\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 获取系统的线程数")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("NUM_THREADS")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$(")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("expr")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("$(")]),t._v("nproc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" - "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v(")")])]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" /program\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 构建命令")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("CMD_TO_ADD")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/run/numberOfThreads '),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$NUM_THREADS")]),t._v('"')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 将命令添加到 run.mac 的第一行")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 注意不要重复添加")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("sed")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-i")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1i '),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$CMD_TO_ADD")]),t._v('"')]),t._v(" ./run.mac\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 定义目录路径")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token assign-left variable"}},[t._v("BUILD_DIR")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"/program/build"')]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 检查目录是否存在")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-d")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$BUILD_DIR")]),t._v('"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("then")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 如果目录存在,删除它")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("rm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-rf")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$BUILD_DIR")]),t._v('"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fi")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 创建新的目录")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mkdir")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-p")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"'),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$BUILD_DIR")]),t._v('"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("cd")]),t._v(" build\ncmake "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("make")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-j")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("$NUM_THREADS")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# PKU_Trim_Geant4 为程序名称(可执行文件),由CMakeLists.txt中的add_executable(PKU_Trim_Geant4 PKU_Trim_Geant4.cc)决定")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# 使用前请修改")]),t._v("\n./PKU_Trim_Geant4 run.mac "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v(" /dev/null "),s("span",{pre:!0,attrs:{class:"token operator"}},[s("span",{pre:!0,attrs:{class:"token file-descriptor important"}},[t._v("2")]),t._v(">>")]),t._v("error.txt\n")])])]),s("ol",[s("li",[s("p",[t._v("默认采用处理器最大核心数减1作为使用的核心数量")])]),t._v(" "),s("li",[s("p",[t._v("默认程序名为"),s("code",[t._v("PKU_Trim_Geant4")]),t._v(",若在CMakeLists中修改,请重新使用Dockerfile创建镜像")]),t._v(" "),s("div",{staticClass:"language-docker extra-class"},[s("pre",{pre:!0,attrs:{class:"language-docker"}},[s("code",[t._v("docker build -t outispku/geant4:v2 . \n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# -t 后为新镜像名")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("创建共享文件路径并运行容器")]),t._v(" "),s("div",{staticClass:"language-docker extra-class"},[s("pre",{pre:!0,attrs:{class:"language-docker"}},[s("code",[t._v("docker run -v D:\\FinFET:/program --name geant4_program outispku/geant4:v2\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# -v 后为映射本地路径到容器内(共享项目文件)(program为容器内路径,请不要修改)")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# --name 为容器名")]),t._v("\n")])])])])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/64.1282629e.js b/assets/js/64.1282629e.js new file mode 100644 index 0000000..f8f015e --- /dev/null +++ b/assets/js/64.1282629e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[64],{356:function(t,l,s){"use strict";s.r(l);var o=s(14),r=Object(o.a)({},(function(){var t=this._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[t("h1",{attrs:{id:"helloworld"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#helloworld"}},[this._v("#")]),this._v(" Helloworld")])])}),[],!1,null,null,null);l.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/7.8f9464b0.js b/assets/js/7.8f9464b0.js new file mode 100644 index 0000000..1b7f83a --- /dev/null +++ b/assets/js/7.8f9464b0.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{313:function(t,e,s){"use strict";s.r(e);const o=["There's nothing here.","How did we get here?","That's a Four-Oh-Four.","Looks like we've got some broken links."];var n={methods:{getMsg:()=>o[Math.floor(Math.random()*o.length)]}},h=s(14),i=Object(h.a)(n,(function(){var t=this._self._c;return t("div",{staticClass:"theme-container"},[t("div",{staticClass:"theme-default-content"},[t("h1",[this._v("404")]),this._v(" "),t("blockquote",[this._v(this._s(this.getMsg()))]),this._v(" "),t("RouterLink",{attrs:{to:"/"}},[this._v("\n Take me home.\n ")])],1)])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/app.0f4568d7.js b/assets/js/app.0f4568d7.js new file mode 100644 index 0000000..a5b0300 --- /dev/null +++ b/assets/js/app.0f4568d7.js @@ -0,0 +1,16 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(e){function t(t){for(var r,a,s=t[0],l=t[1],c=t[2],h=0,p=[];h
'};function i(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=i(e,r.minimum,1),n.status=1===e?null:e;var l=n.render(!t),c=l.querySelector(r.barSelector),u=r.speed,h=r.easing;return l.offsetWidth,a((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,function(e,t,n){var i;return(i="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,i}(e,u,h)),1===e?(s(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){s(l,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*i(Math.random()*t,.1,.95)),t=i(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var i,a=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),u=document.querySelector(r.parent);return s(a,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(i=t.querySelector(r.spinnerSelector))&&p(i),u!=document.body&&c(u,"nprogress-custom-parent"),u.appendChild(t),t},n.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var a=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()})),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var r,i=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);i--;)if((r=e[i]+o)in n)return r;return t}(n))}function r(e,t,r){t=n(t),e.style[t]=r}return function(e,t){var n,i,o=arguments;if(2==o.length)for(n in t)void 0!==(i=t[n])&&t.hasOwnProperty(n)&&r(e,n,i);else r(e,o[1],o[2])}}();function l(e,t){return("string"==typeof e?e:h(e)).indexOf(" "+t+" ")>=0}function c(e,t){var n=h(e),r=n+t;l(n,t)||(e.className=r.substring(1))}function u(e,t){var n,r=h(e);l(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function h(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n})?r.call(t,n,t,e):r)||(e.exports=i)},function(e,t,n){"use strict";var r=n(0),i=n(46).f,o=n(12),a=n(91),s=n(32),l=n(61),c=n(119);e.exports=function(e,t){var n,u,h,p,f,d=e.target,v=e.global,m=e.stat;if(n=v?r:m?r[d]||s(d,{}):r[d]&&r[d].prototype)for(u in t){if(p=t[u],h=e.dontCallGetSet?(f=i(n,u))&&f.value:n[u],!c(v?u:d+(m?".":"#")+u,e.forced)&&void 0!==h){if(typeof p==typeof h)continue;l(p,h)}(e.sham||h&&h.sham)&&o(p,"sham",!0),a(n,u,p,e)}}},function(e,t,n){"use strict";var r=n(25),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},function(e,t,n){"use strict";var r=n(3);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},function(e,t,n){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){"use strict";var r=n(47),i=n(48);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r=n(0),i=n(1),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e]):r[e]&&r[e][t]}},function(e,t,n){"use strict";var r=n(1),i=n(101),o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not a function")}},function(e,t,n){"use strict";var r=n(0),i=n(56),o=n(8),a=n(58),s=n(54),l=n(53),c=r.Symbol,u=i("wks"),h=l?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){return o(u,e)||(u[e]=s&&o(c,e)?c[e]:h("Symbol."+e)),u[e]}},function(e,t,n){"use strict";var r=n(57),i=n(0),o=n(32),a=e.exports=i["__core-js_shared__"]||o("__core-js_shared__",{});(a.versions||(a.versions=[])).push({version:"3.36.0",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.36.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(e,t,n){"use strict";var r=n(0),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},function(e,t,n){"use strict";var r=n(48),i=Object;e.exports=function(e){return i(r(e))}},function(e,t,n){"use strict";var r=n(7),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not an object")}},function(e,t,n){"use strict";var r=n(116);e.exports=function(e){return r(e.length)}},function(e,t,n){var r=n(143),i=n(10),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},function(e,t,n){var r=n(9)(n(6),"Map");e.exports=r},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(163),i=n(170),o=n(172),a=n(173),s=n(174);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(4),i=n(43),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(11),i=n(10);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){"use strict";var r=n(23),i=n(33),o=n(35),a=n(138),s=n(140);r({target:"Array",proto:!0,arity:1,forced:n(3)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=i(this),n=o(t),r=arguments.length;s(n+r);for(var l=0;l0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},function(e,t,n){"use strict";var r=n(31);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},function(e,t,n){"use strict";e.exports=!1},function(e,t,n){"use strict";var r=n(2),i=0,o=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},function(e,t,n){"use strict";var r=n(5),i=n(3),o=n(103);e.exports=!r&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";var r=n(8),i=n(110),o=n(46),a=n(15);e.exports=function(e,t,n){for(var s=i(t),l=a.f,c=o.f,u=0;uu))return!1;var p=l.get(e),f=l.get(t);if(p&&f)return p==t&&f==e;var d=-1,v=!0,m=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++d-1&&e%1==0&&e]/;e.exports=function(e){var t,n=""+e,i=r.exec(n);if(!i)return n;var o="",a=0,s=0;for(a=i.index;a=t||n<0||m&&e-c>=o}function E(){var e=f();if(b(e))return _(e);s=setTimeout(E,function(e){var n=t-(e-l);return m?p(n,o-(e-c)):n}(e))}function _(e){return s=void 0,g&&r?y(e):(r=i=void 0,a)}function A(){var e=f(),n=b(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return C(l);if(m)return s=setTimeout(E,t),y(l)}return void 0===s&&(s=setTimeout(E,t)),a}return t=v(t)||0,d(n)&&(u=!!n.leading,o=(m="maxWait"in n)?h(v(n.maxWait)||0,t):o,g="trailing"in n?!!n.trailing:g),A.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=i=s=void 0},A.flush=function(){return void 0===s?a:_(f())},A}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){"use strict";var r=n(1),i=n(15),o=n(93),a=n(32);e.exports=function(e,t,n,s){s||(s={});var l=s.enumerable,c=void 0!==s.name?s.name:t;if(r(n)&&o(n,c,s),s.global)l?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},function(e,t,n){"use strict";var r=n(132),i=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},function(e,t,n){"use strict";var r=n(2),i=n(3),o=n(1),a=n(8),s=n(5),l=n(105).CONFIGURABLE,c=n(106),u=n(107),h=u.enforce,p=u.get,f=String,d=Object.defineProperty,v=r("".slice),m=r("".replace),g=r([].join),y=s&&!i((function(){return 8!==d((function(){}),"length",{value:8}).length})),C=String(String).split("String"),b=e.exports=function(e,t,n){"Symbol("===v(f(t),0,7)&&(t="["+m(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||l&&e.name!==t)&&(s?d(e,"name",{value:t,configurable:!0}):e.name=t),y&&n&&a(n,"arity")&&e.length!==n.arity&&d(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=h(e);return a(r,"source")||(r.source=g(C,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return o(this)&&p(this).source||c(this)}),"toString")},function(e,t,n){var r=n(83);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e,t,n){e.exports=n(240)},function(e,t,n){"use strict";var r=n(23),i=n(120).left,o=n(121),a=n(55);r({target:"Array",proto:!0,forced:!n(122)&&a>79&&a<83||!o("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);t.f=o?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},function(e,t,n){"use strict";var r=n(24),i=n(7),o=n(51),a=n(100),s=n(102),l=n(30),c=TypeError,u=l("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var n,l=a(e,u);if(l){if(void 0===t&&(t="default"),n=r(l,e,t),!i(n)||o(n))return n;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},function(e,t,n){"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(e,t,n){"use strict";var r=n(29),i=n(49);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},function(e,t,n){"use strict";var r=String;e.exports=function(e){try{return r(e)}catch(e){return"Object"}}},function(e,t,n){"use strict";var r=n(24),i=n(1),o=n(7),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&i(n=e.toString)&&!o(s=r(n,e)))return s;if(i(n=e.valueOf)&&!o(s=r(n,e)))return s;if("string"!==t&&i(n=e.toString)&&!o(s=r(n,e)))return s;throw new a("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(0),i=n(7),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,n){"use strict";var r=n(5),i=n(3);e.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(e,t,n){"use strict";var r=n(5),i=n(8),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),l=s&&"something"===function(){}.name,c=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:c}},function(e,t,n){"use strict";var r=n(2),i=n(1),o=n(31),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},function(e,t,n){"use strict";var r,i,o,a=n(108),s=n(0),l=n(7),c=n(12),u=n(8),h=n(31),p=n(109),f=n(60),d=s.TypeError,v=s.WeakMap;if(a||h.state){var m=h.state||(h.state=new v);m.get=m.get,m.has=m.has,m.set=m.set,r=function(e,t){if(m.has(e))throw new d("Object already initialized");return t.facade=e,m.set(e,t),t},i=function(e){return m.get(e)||{}},o=function(e){return m.has(e)}}else{var g=p("state");f[g]=!0,r=function(e,t){if(u(e,g))throw new d("Object already initialized");return t.facade=e,c(e,g,t),t},i=function(e){return u(e,g)?e[g]:{}},o=function(e){return u(e,g)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw new d("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){"use strict";var r=n(0),i=n(1),o=r.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},function(e,t,n){"use strict";var r=n(56),i=n(58),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},function(e,t,n){"use strict";var r=n(28),i=n(2),o=n(111),a=n(118),s=n(34),l=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(s(e)),n=a.f;return n?l(t,n(e)):t}},function(e,t,n){"use strict";var r=n(112),i=n(117).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(27),a=n(113).indexOf,s=n(60),l=r([].push);e.exports=function(e,t){var n,r=o(e),c=0,u=[];for(n in r)!i(s,n)&&i(r,n)&&l(u,n);for(;t.length>c;)i(r,n=t[c++])&&(~a(u,n)||l(u,n));return u}},function(e,t,n){"use strict";var r=n(27),i=n(114),o=n(35),a=function(e){return function(t,n,a){var s=r(t),l=o(s);if(0===l)return!e&&-1;var c,u=i(a,l);if(e&&n!=n){for(;l>u;)if((c=s[u++])!=c)return!0}else for(;l>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},function(e,t,n){"use strict";var r=n(62),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},function(e,t,n){"use strict";var r=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var t=+e;return(t>0?i:r)(t)}},function(e,t,n){"use strict";var r=n(62),i=Math.min;e.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}},function(e,t,n){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){"use strict";t.f=Object.getOwnPropertySymbols},function(e,t,n){"use strict";var r=n(3),i=n(1),o=/#|\.prototype\./,a=function(e,t){var n=l[s(e)];return n===u||n!==c&&(i(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},function(e,t,n){"use strict";var r=n(29),i=n(33),o=n(47),a=n(35),s=TypeError,l="Reduce of empty array with no initial value",c=function(e){return function(t,n,c,u){var h=i(t),p=o(h),f=a(h);if(r(n),0===f&&c<2)throw new s(l);var d=e?f-1:0,v=e?-1:1;if(c<2)for(;;){if(d in p){u=p[d],d+=v;break}if(d+=v,e?d<0:f<=d)throw new s(l)}for(;e?d>=0:f>d;d+=v)d in p&&(u=n(u,p[d],d,h));return u}};e.exports={left:c(!1),right:c(!0)}},function(e,t,n){"use strict";var r=n(3);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},function(e,t,n){"use strict";var r=n(0),i=n(16);e.exports="process"===i(r.process)},function(e,t,n){"use strict";var r=n(23),i=n(0),o=n(124),a=n(125),s=i.WebAssembly,l=7!==new Error("e",{cause:7}).cause,c=function(e,t){var n={};n[e]=a(e,t,l),r({global:!0,constructor:!0,arity:1,forced:l},n)},u=function(e,t){if(s&&s[e]){var n={};n[e]=a("WebAssembly."+e,t,l),r({target:"WebAssembly",stat:!0,constructor:!0,arity:1,forced:l},n)}};c("Error",(function(e){return function(t){return o(e,this,arguments)}})),c("EvalError",(function(e){return function(t){return o(e,this,arguments)}})),c("RangeError",(function(e){return function(t){return o(e,this,arguments)}})),c("ReferenceError",(function(e){return function(t){return o(e,this,arguments)}})),c("SyntaxError",(function(e){return function(t){return o(e,this,arguments)}})),c("TypeError",(function(e){return function(t){return o(e,this,arguments)}})),c("URIError",(function(e){return function(t){return o(e,this,arguments)}})),u("CompileError",(function(e){return function(t){return o(e,this,arguments)}})),u("LinkError",(function(e){return function(t){return o(e,this,arguments)}})),u("RuntimeError",(function(e){return function(t){return o(e,this,arguments)}}))},function(e,t,n){"use strict";var r=n(25),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},function(e,t,n){"use strict";var r=n(28),i=n(8),o=n(12),a=n(52),s=n(63),l=n(61),c=n(129),u=n(130),h=n(131),p=n(134),f=n(135),d=n(5),v=n(57);e.exports=function(e,t,n,m){var g=m?2:1,y=e.split("."),C=y[y.length-1],b=r.apply(null,y);if(b){var E=b.prototype;if(!v&&i(E,"cause")&&delete E.cause,!n)return b;var _=r("Error"),A=t((function(e,t){var n=h(m?t:e,void 0),r=m?new b(e):new b;return void 0!==n&&o(r,"message",n),f(r,A,r.stack,2),this&&a(E,this)&&u(r,this,A),arguments.length>g&&p(r,arguments[g]),r}));if(A.prototype=E,"Error"!==C?s?s(A,_):l(A,_,{name:!0}):d&&"stackTraceLimit"in b&&(c(A,b,"stackTraceLimit"),c(A,b,"prepareStackTrace")),l(A,b),!v)try{E.name!==C&&o(E,"name",C),E.constructor=A}catch(e){}return A}}},function(e,t,n){"use strict";var r=n(2),i=n(29);e.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},function(e,t,n){"use strict";var r=n(128),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o("Can't set "+i(e)+" as a prototype")}},function(e,t,n){"use strict";var r=n(7);e.exports=function(e){return r(e)||null===e}},function(e,t,n){"use strict";var r=n(15).f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},function(e,t,n){"use strict";var r=n(1),i=n(7),o=n(63);e.exports=function(e,t,n){var a,s;return o&&r(a=t.constructor)&&a!==n&&i(s=a.prototype)&&s!==n.prototype&&o(e,s),e}},function(e,t,n){"use strict";var r=n(92);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},function(e,t,n){"use strict";var r=n(133),i=n(1),o=n(16),a=n(30)("toStringTag"),s=Object,l="Arguments"===o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?n:l?o(t):"Object"===(r=o(t))&&i(t.callee)?"Arguments":r}},function(e,t,n){"use strict";var r={};r[n(30)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){"use strict";var r=n(7),i=n(12);e.exports=function(e,t){r(t)&&"cause"in t&&i(e,"cause",t.cause)}},function(e,t,n){"use strict";var r=n(12),i=n(136),o=n(137),a=Error.captureStackTrace;e.exports=function(e,t,n,s){o&&(a?a(e,t):r(e,"stack",i(n,s)))}},function(e,t,n){"use strict";var r=n(2),i=Error,o=r("".replace),a=String(new i("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,l=s.test(a);e.exports=function(e,t){if(l&&"string"==typeof e&&!i.prepareStackTrace)for(;t--;)e=o(e,s,"");return e}},function(e,t,n){"use strict";var r=n(3),i=n(26);e.exports=!r((function(){var e=new Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",i(1,7)),7!==e.stack)}))},function(e,t,n){"use strict";var r=n(5),i=n(139),o=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(i(e)&&!a(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},function(e,t,n){"use strict";var r=n(16);e.exports=Array.isArray||function(e){return"Array"===r(e)}},function(e,t,n){"use strict";var r=TypeError;e.exports=function(e){if(e>9007199254740991)throw r("Maximum allowed index exceeded");return e}},function(e,t,n){var r=n(64),i=n(142);e.exports=function e(t,n,o,a,s){var l=-1,c=t.length;for(o||(o=i),s||(s=[]);++l0&&o(u)?n>1?e(u,n-1,o,a,s):r(s,u):a||(s[s.length]=u)}return s}},function(e,t,n){var r=n(13),i=n(36),o=n(4),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},function(e,t,n){var r=n(11),i=n(10);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},function(e,t,n){var r=n(13),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(147),i=n(203),o=n(44),a=n(4),s=n(213);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},function(e,t,n){var r=n(148),i=n(202),o=n(82);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(66),i=n(70);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var c=n[a];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a-1}},function(e,t,n){var r=n(18);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(17);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(17),i=n(37),o=n(39);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(68),i=n(160),o=n(38),a=n(69),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,h=c.hasOwnProperty,p=RegExp("^"+u.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?p:s).test(a(e))}},function(e,t,n){var r,i=n(161),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(6)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(164),i=n(17),o=n(37);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(165),i=n(166),o=n(167),a=n(168),s=n(169);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,n){var r=n(72),i=n(225),o=n(230),a=n(73),s=n(231),l=n(40);e.exports=function(e,t,n){var c=-1,u=i,h=e.length,p=!0,f=[],d=f;if(n)p=!1,u=o;else if(h>=200){var v=t?null:s(e);if(v)return l(v);p=!1,u=a,d=new r}else d=t?[]:f;e:for(;++c-1}},function(e,t,n){var r=n(227),i=n(228),o=n(229);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},function(e,t){e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o=0&&Math.floor(t)===t&&isFinite(e)}function v(e){return a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function m(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===h?JSON.stringify(e,g,2):String(e)}function g(e,t){return t&&t.__v_isRef?t.value:t}function y(e){var t=parseFloat(e);return isNaN(t)?e:t}function C(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(r,1)}}var _=Object.prototype.hasOwnProperty;function A(e,t){return _.call(e,t)}function x(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var B=/-(\w)/g,w=x((function(e){return e.replace(B,(function(e,t){return t?t.toUpperCase():""}))})),S=x((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),k=/\B([A-Z])/g,O=x((function(e){return e.replace(k,"-$1").toLowerCase()}));var P=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function L(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function $(e,t){for(var n in t)e[n]=t[n];return e}function F(e){for(var t={},n=0;n0,Q=X&&X.indexOf("edge/")>0;X&&X.indexOf("android");var ee=X&&/iphone|ipad|ipod|ios/.test(X);X&&/chrome\/\d+/.test(X),X&&/phantomjs/.test(X);var te,ne=X&&X.match(/firefox\/(\d+)/),re={}.watch,ie=!1;if(J)try{var oe={};Object.defineProperty(oe,"passive",{get:function(){ie=!0}}),window.addEventListener("test-passive",null,oe)}catch(e){}var ae=function(){return void 0===te&&(te=!J&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),te},se=J&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function le(e){return"function"==typeof e&&/native code/.test(e.toString())}var ce,ue="undefined"!=typeof Symbol&&le(Symbol)&&"undefined"!=typeof Reflect&&le(Reflect.ownKeys);ce="undefined"!=typeof Set&&le(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var he=null;function pe(e){void 0===e&&(e=null),e||he&&he._scope.off(),he=e,e&&e._scope.on()}var fe=function(){function e(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),de=function(e){void 0===e&&(e="");var t=new fe;return t.text=e,t.isComment=!0,t};function ve(e){return new fe(void 0,void 0,void 0,String(e))}function me(e){var t=new fe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}"function"==typeof SuppressedError&&SuppressedError;var ge=0,ye=[],Ce=function(){function e(){this._pending=!1,this.id=ge++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,ye.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var n=0,r=t.length;n0&&(Xe((c=e(c,"".concat(n||"","_").concat(r)))[0])&&Xe(h)&&(p[u]=ve(h.text+c[0].text),c.shift()),p.push.apply(p,c)):l(c)?Xe(h)?p[u]=ve(h.text+c):""!==c&&p.push(ve(c)):Xe(c)&&Xe(h)?p[u]=ve(h.text+c.text):(s(t._isVList)&&a(c.tag)&&o(c.key)&&a(n)&&(c.key="__vlist".concat(n,"_").concat(r,"__")),p.push(c)));return p}(e):void 0}function Xe(e){return a(e)&&a(e.text)&&!1===e.isComment}function Ye(e,t){var n,r,o,s,l=null;if(i(e)||"string"==typeof e)for(l=new Array(e.length),n=0,r=e.length;n0,s=t?!!t.$stable:!a,l=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&i&&i!==r&&l===i.$key&&!a&&!i.$hasNormal)return i;for(var c in o={},t)t[c]&&"$"!==c[0]&&(o[c]=mt(e,n,c,t[c]))}else o={};for(var u in n)u in o||(o[u]=gt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=o),H(o,"$stable",s),H(o,"$key",l),H(o,"$hasNormal",a),o}function mt(e,t,n,r){var o=function(){var t=he;pe(e);var n=arguments.length?r.apply(null,arguments):r({}),o=(n=n&&"object"==typeof n&&!i(n)?[n]:Je(n))&&n[0];return pe(t),n&&(!o||1===n.length&&o.isComment&&!dt(o))?void 0:n};return r.proxy&&Object.defineProperty(t,n,{get:o,enumerable:!0,configurable:!0}),o}function gt(e,t){return function(){return e[t]}}function yt(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};H(t,"_v_attr_proxy",!0),Ct(t,e.$attrs,r,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||Ct(e._listenersProxy={},e.$listeners,r,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||Et(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:P(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return Ge(e,t,n)}))}}}function Ct(e,t,n,r,i){var o=!1;for(var a in t)a in e?t[a]!==n[a]&&(o=!0):(o=!0,bt(e,a,r,i));for(var a in e)a in t||(o=!0,delete e[a]);return o}function bt(e,t,n,r){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return n[r][t]}})}function Et(e,t){for(var n in t)e[n]=t[n];for(var n in e)n in t||delete e[n]}var _t=null;function At(e,t){return(e.__esModule||ue&&"Module"===e[Symbol.toStringTag])&&(e=e.default),u(e)?t.extend(e):e}function xt(e){if(i(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(cn=function(){return un.now()})}var hn=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function pn(){var e,t;for(ln=cn(),an=!0,tn.sort(hn),sn=0;snsn&&tn[n].id>e.id;)n--;tn.splice(n+1,0,e)}else tn.push(e);on||(on=!0,It(pn))}}function dn(e,t){if(e){for(var n=Object.create(null),r=ue?Reflect.ownKeys(e):Object.keys(e),i=0;i-1)if(o&&!A(i,"default"))a=!1;else if(""===a||a===O(e)){var l=Tn(String,i.type);(l<0||s-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function Yn(e,t){var n=e.cache,r=e.keys,i=e._vnode,o=e.$vnode;for(var a in n){var s=n[a];if(s){var l=s.name;l&&!t(l)&&Zn(n,a,r,i)}}o.componentOptions.children=void 0}function Zn(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,E(n,t)}Wn.prototype._init=function(e){var t=this;t._uid=qn++,t._isVue=!0,t.__v_skip=!0,t._scope=new Ne(!0),t._scope.parent=void 0,t._scope._vm=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Pn(Hn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._provided=n?n._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Jt(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,i=n&&n.context;e.$slots=pt(t._renderChildren,i),e.$scopedSlots=n?vt(e.$parent,n.data.scopedSlots,e.$slots):r,e._c=function(t,n,r,i){return Bt(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return Bt(e,t,n,r,i,!0)};var o=n&&n.data;$e(e,"$attrs",o&&o.attrs||r,null,!0),$e(e,"$listeners",t._parentListeners||r,null,!0)}(t),en(t,"beforeCreate",void 0,!1),function(e){var t=dn(e.$options.inject,e);t&&(ke(!1),Object.keys(t).forEach((function(n){$e(e,n,t[n])})),ke(!0))}(t),In(t),function(e){var t=e.$options.provide;if(t){var n=c(t)?t.call(e):t;if(!u(n))return;for(var r=ze(e),i=ue?Reflect.ownKeys(n):Object.keys(n),o=0;o1?L(n):n;for(var r=L(arguments,1),i='event handler for "'.concat(e,'"'),o=0,a=n.length;oparseInt(this.max)&&Zn(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)Zn(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){Yn(e,(function(e){return Xn(t,e)}))})),this.$watch("exclude",(function(t){Yn(e,(function(e){return!Xn(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=xt(e),n=t&&t.componentOptions;if(n){var r=Jn(n),i=this.include,o=this.exclude;if(i&&(!r||!Xn(i,r))||o&&r&&Xn(o,r))return t;var a=this.cache,s=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):t.key;a[l]?(t.componentInstance=a[l].componentInstance,E(s,l),s.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return z}};Object.defineProperty(e,"config",t),e.util={warn:An,extend:$,mergeOptions:Pn,defineReactive:$e},e.set=Fe,e.delete=je,e.nextTick=It,e.observable=function(e){return Le(e),e},e.options=Object.create(null),M.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,$(e.options.components,er),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=L(arguments,1);return n.unshift(this),c(e.install)?e.install.apply(e,n):c(e)&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Pn(this.options,e),this}}(e),Kn(e),function(e){M.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&p(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&c(n)&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Wn),Object.defineProperty(Wn.prototype,"$isServer",{get:ae}),Object.defineProperty(Wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Wn,"FunctionalRenderContext",{value:vn}),Wn.version="2.7.16";var tr=C("style,class"),nr=C("input,textarea,option,select,progress"),rr=C("contenteditable,draggable,spellcheck"),ir=C("events,caret,typing,plaintext-only"),or=C("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ar="http://www.w3.org/1999/xlink",sr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},lr=function(e){return sr(e)?e.slice(6,e.length):""},cr=function(e){return null==e||!1===e};function ur(e){for(var t=e.data,n=e,r=e;a(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=hr(r.data,t));for(;a(n=n.parent);)n&&n.data&&(t=hr(t,n.data));return function(e,t){if(a(e)||a(t))return pr(e,fr(t));return""}(t.staticClass,t.class)}function hr(e,t){return{staticClass:pr(e.staticClass,t.staticClass),class:a(e.class)?[e.class,t.class]:t.class}}function pr(e,t){return e?t?e+" "+t:e:t||""}function fr(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,i=e.length;r-1?Dr(e,t,n):or(t)?cr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):rr(t)?e.setAttribute(t,function(e,t){return cr(t)||"false"===t?"false":"contenteditable"===e&&ir(t)?t:"true"}(t,n)):sr(t)?cr(n)?e.removeAttributeNS(ar,lr(t)):e.setAttributeNS(ar,t,n):Dr(e,t,n)}function Dr(e,t,n){if(cr(n))e.removeAttribute(t);else{if(Y&&!Z&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Vr={create:Rr,update:Rr};function Ir(e,t){var n=t.elm,r=t.data,i=e.data;if(!(o(r.staticClass)&&o(r.class)&&(o(i)||o(i.staticClass)&&o(i.class)))){var s=ur(t),l=n._transitionClasses;a(l)&&(s=pr(s,fr(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Gr,Mr={create:Ir,update:Ir};function Nr(e,t,n){var r=Gr;return function i(){var o=t.apply(null,arguments);null!==o&&qr(e,i,n,r)}}var zr=Lt&&!(ne&&Number(ne[1])<=53);function Ur(e,t,n,r){if(zr){var i=ln,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Gr.addEventListener(e,t,ie?{capture:n,passive:r}:n)}function qr(e,t,n,r){(r||Gr).removeEventListener(e,t._wrapper||t,n)}function Hr(e,t){if(!o(e.data.on)||!o(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Gr=t.elm||e.elm,function(e){if(a(e.__r)){var t=Y?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}a(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),He(n,r,Ur,qr,Nr,t.context),Gr=void 0}}var Wr,Kr={create:Hr,update:Hr,destroy:function(e){return Hr(e,xr)}};function Jr(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var n,r,i=t.elm,l=e.data.domProps||{},c=t.data.domProps||{};for(n in(a(c.__ob__)||s(c._v_attr_proxy))&&(c=t.data.domProps=$({},c)),l)n in c||(i[n]="");for(n in c){if(r=c[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===l[n])continue;1===i.childNodes.length&&i.removeChild(i.childNodes[0])}if("value"===n&&"PROGRESS"!==i.tagName){i._value=r;var u=o(r)?"":String(r);Xr(i,u)&&(i.value=u)}else if("innerHTML"===n&&mr(i.tagName)&&o(i.innerHTML)){(Wr=Wr||document.createElement("div")).innerHTML="".concat(r,"");for(var h=Wr.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;h.firstChild;)i.appendChild(h.firstChild)}else if(r!==l[n])try{i[n]=r}catch(e){}}}}function Xr(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(a(r)){if(r.number)return y(n)!==y(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var Yr={create:Jr,update:Jr},Zr=x((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function Qr(e){var t=ei(e.style);return e.staticStyle?$(e.staticStyle,t):t}function ei(e){return Array.isArray(e)?F(e):"string"==typeof e?Zr(e):e}var ti,ni=/^--/,ri=/\s*!important$/,ii=function(e,t,n){if(ni.test(t))e.style.setProperty(t,n);else if(ri.test(n))e.style.setProperty(O(t),n.replace(ri,""),"important");else{var r=ai(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(ci).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" ".concat(e.getAttribute("class")||""," ");n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function hi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(ci).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" ".concat(e.getAttribute("class")||""," "),r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function pi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&$(t,fi(e.name||"v")),$(t,e),t}return"string"==typeof e?fi(e):void 0}}var fi=x((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),di=J&&!Z,vi="transition",mi="transitionend",gi="animation",yi="animationend";di&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(vi="WebkitTransition",mi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(gi="WebkitAnimation",yi="webkitAnimationEnd"));var Ci=J?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function bi(e){Ci((function(){Ci(e)}))}function Ei(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ui(e,t))}function _i(e,t){e._transitionClasses&&E(e._transitionClasses,t),hi(e,t)}function Ai(e,t,n){var r=Bi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s="transition"===i?mi:yi,l=0,c=function(){e.removeEventListener(s,u),n()},u=function(t){t.target===e&&++l>=a&&c()};setTimeout((function(){l0&&(n="transition",u=a,h=o.length):"animation"===t?c>0&&(n="animation",u=c,h=l.length):h=(n=(u=Math.max(a,c))>0?a>c?"transition":"animation":null)?"transition"===n?o.length:l.length:0,{type:n,timeout:u,propCount:h,hasTransform:"transition"===n&&xi.test(r[vi+"Property"])}}function wi(e,t){for(;e.length1}function $i(e,t){!0!==t.data.show&&ki(t)}var Fi=function(e){var t,n,r={},c=e.modules,u=e.nodeOps;for(t=0;td?b(e,o(n[g+1])?null:n[g+1].elm,n,f,g,r):f>g&&_(t,h,d)}(h,v,g,n,c):a(g)?(a(e.text)&&u.setTextContent(h,""),b(h,null,g,0,g.length-1,n)):a(v)?_(v,0,v.length-1):a(e.text)&&u.setTextContent(h,""):e.text!==t.text&&u.setTextContent(h,t.text),a(d)&&a(f=d.hook)&&a(f=f.postpatch)&&f(e,t)}}}function w(e,t,n){if(s(n)&&a(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,a.selected!==o&&(a.selected=o);else if(D(Vi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function Di(e,t){return t.every((function(t){return!D(t,e)}))}function Vi(e){return"_value"in e?e._value:e.value}function Ii(e){e.target.composing=!0}function Gi(e){e.target.composing&&(e.target.composing=!1,Mi(e.target,"input"))}function Mi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Ni(e){return!e.componentInstance||e.data&&e.data.transition?e:Ni(e.componentInstance._vnode)}var zi={model:ji,show:{bind:function(e,t,n){var r=t.value,i=(n=Ni(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,ki(n,(function(){e.style.display=o}))):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Ni(n)).data&&n.data.transition?(n.data.show=!0,r?ki(n,(function(){e.style.display=e.__vOriginalDisplay})):Oi(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Ui={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function qi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?qi(xt(t.children)):e}function Hi(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var r in i)t[w(r)]=i[r];return t}function Wi(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var Ki=function(e){return e.tag||dt(e)},Ji=function(e){return"show"===e.name},Xi={name:"transition",props:Ui,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(Ki)).length){0;var r=this.mode;0;var i=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return i;var o=qi(i);if(!o)return i;if(this._leaving)return Wi(e,i);var a="__transition-".concat(this._uid,"-");o.key=null==o.key?o.isComment?a+"comment":a+o.tag:l(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var s=(o.data||(o.data={})).transition=Hi(this),c=this._vnode,u=qi(c);if(o.data.directives&&o.data.directives.some(Ji)&&(o.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(o,u)&&!dt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var h=u.data.transition=$({},s);if("out-in"===r)return this._leaving=!0,We(h,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),Wi(e,i);if("in-out"===r){if(dt(o))return c;var p,f=function(){p()};We(s,"afterEnter",f),We(s,"enterCancelled",f),We(h,"delayLeave",(function(e){p=e}))}}return i}}},Yi=$({tag:String,moveClass:String},Ui);function Zi(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Qi(e){e.data.newPos=e.elm.getBoundingClientRect()}function eo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate(".concat(r,"px,").concat(i,"px)"),o.transitionDuration="0s"}}delete Yi.mode;var to={Transition:Xi,TransitionGroup:{props:Yi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Yt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Hi(this),s=0;s-1?yr[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:yr[e]=/HTMLUnknownElement/.test(t.toString())},$(Wn.options.directives,zi),$(Wn.options.components,to),Wn.prototype.__patch__=J?Fi:j,Wn.prototype.$mount=function(e,t){return function(e,t,n){var r;e.$el=t,e.$options.render||(e.$options.render=de),en(e,"beforeMount"),r=function(){e._update(e._render(),n)},new qt(e,r,j,{before:function(){e._isMounted&&!e._isDestroyed&&en(e,"beforeUpdate")}},!0),n=!1;var i=e._preWatchers;if(i)for(var o=0;o=0&&(t=e.slice(r),e=e.slice(0,r));var i=e.indexOf("?");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{path:e,query:n,hash:t}}(i.path||""),c=t&&t.path||"/",u=l.path?Ao(l.path,c,n||i.append):c,h=function(e,t,n){void 0===t&&(t={});var r,i=n||co;try{r=i(e||"")}catch(e){r={}}for(var o in t){var a=t[o];r[o]=Array.isArray(a)?a.map(lo):lo(a)}return r}(l.query,i.query,r&&r.options.parseQuery),p=i.hash||l.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:u,query:h,hash:p}}var Uo,qo=function(){},Ho={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var t=this,n=this.$router,r=this.$route,i=n.resolve(this.to,r,this.append),o=i.location,a=i.route,s=i.href,l={},c=n.options.linkActiveClass,u=n.options.linkExactActiveClass,h=null==c?"router-link-active":c,p=null==u?"router-link-exact-active":u,f=null==this.activeClass?h:this.activeClass,d=null==this.exactActiveClass?p:this.exactActiveClass,v=a.redirectedFrom?po(null,zo(a.redirectedFrom),null,n):a;l[d]=yo(r,v,this.exactPath),l[f]=this.exact||this.exactPath?l[d]:function(e,t){return 0===e.path.replace(ho,"/").indexOf(t.path.replace(ho,"/"))&&(!t.hash||e.hash===t.hash)&&function(e,t){for(var n in t)if(!(n in e))return!1;return!0}(e.query,t.query)}(r,v);var m=l[d]?this.ariaCurrentValue:null,g=function(e){Wo(e)&&(t.replace?n.replace(o,qo):n.push(o,qo))},y={click:Wo};Array.isArray(this.event)?this.event.forEach((function(e){y[e]=g})):y[this.event]=g;var C={class:l},b=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:a,navigate:g,isActive:l[f],isExactActive:l[d]});if(b){if(1===b.length)return b[0];if(b.length>1||!b.length)return 0===b.length?e():e("span",{},b)}if("a"===this.tag)C.on=y,C.attrs={href:s,"aria-current":m};else{var E=function e(t){var n;if(t)for(var r=0;r-1&&(s.params[p]=n.params[p]);return s.path=No(u.path,s.params),l(u,s,a)}if(s.path){s.params={};for(var f=0;f-1}function xa(e,t){return Aa(e)&&e._isRouter&&(null==t||e.type===t)}function Ba(e,t,n){var r=function(i){i>=e.length?n():e[i]?t(e[i],(function(){r(i+1)})):r(i+1)};r(0)}function wa(e){return function(t,n,r){var i=!1,o=0,a=null;Sa(e,(function(e,t,n,s){if("function"==typeof e&&void 0===e.cid){i=!0,o++;var l,c=Pa((function(t){var i;((i=t).__esModule||Oa&&"Module"===i[Symbol.toStringTag])&&(t=t.default),e.resolved="function"==typeof t?t:Uo.extend(t),n.components[s]=t,--o<=0&&r()})),u=Pa((function(e){var t="Failed to resolve async component "+s+": "+e;a||(a=Aa(e)?e:new Error(t),r(a))}));try{l=e(c,u)}catch(e){u(e)}if(l)if("function"==typeof l.then)l.then(c,u);else{var h=l.component;h&&"function"==typeof h.then&&h.then(c,u)}}})),i||r()}}function Sa(e,t){return ka(e.map((function(e){return Object.keys(e.components).map((function(n){return t(e.components[n],e.instances[n],e,n)}))})))}function ka(e){return Array.prototype.concat.apply([],e)}var Oa="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Pa(e){var t=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!t)return t=!0,e.apply(this,n)}}var La=function(e,t){this.router=e,this.base=function(e){if(!e)if(Ko){var t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else e="/";"/"!==e.charAt(0)&&(e="/"+e);return e.replace(/\/$/,"")}(t),this.current=vo,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function $a(e,t,n,r){var i=Sa(e,(function(e,r,i,o){var a=function(e,t){"function"!=typeof e&&(e=Uo.extend(e));return e.options[t]}(e,t);if(a)return Array.isArray(a)?a.map((function(e){return n(e,r,i,o)})):n(a,r,i,o)}));return ka(r?i.reverse():i)}function Fa(e,t){if(t)return function(){return e.apply(t,arguments)}}La.prototype.listen=function(e){this.cb=e},La.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))},La.prototype.onError=function(e){this.errorCbs.push(e)},La.prototype.transitionTo=function(e,t,n){var r,i=this;try{r=this.router.match(e,this.current)}catch(e){throw this.errorCbs.forEach((function(t){t(e)})),e}var o=this.current;this.confirmTransition(r,(function(){i.updateRoute(r),t&&t(r),i.ensureURL(),i.router.afterHooks.forEach((function(e){e&&e(r,o)})),i.ready||(i.ready=!0,i.readyCbs.forEach((function(e){e(r)})))}),(function(e){n&&n(e),e&&!i.ready&&(xa(e,ya.redirected)&&o===vo||(i.ready=!0,i.readyErrorCbs.forEach((function(t){t(e)}))))}))},La.prototype.confirmTransition=function(e,t,n){var r=this,i=this.current;this.pending=e;var o,a,s=function(e){!xa(e)&&Aa(e)&&(r.errorCbs.length?r.errorCbs.forEach((function(t){t(e)})):console.error(e)),n&&n(e)},l=e.matched.length-1,c=i.matched.length-1;if(yo(e,i)&&l===c&&e.matched[l]===i.matched[c])return this.ensureURL(),e.hash&&aa(this.router,i,e,!1),s(((a=Ea(o=i,e,ya.duplicated,'Avoided redundant navigation to current location: "'+o.fullPath+'".')).name="NavigationDuplicated",a));var u=function(e,t){var n,r=Math.max(e.length,t.length);for(n=0;n0)){var t=this.router,n=t.options.scrollBehavior,r=va&&n;r&&this.listeners.push(oa());var i=function(){var n=e.current,i=Ra(e.base);e.current===vo&&i===e._startLocation||e.transitionTo(i,(function(e){r&&aa(t,e,n,!0)}))};window.addEventListener("popstate",i),this.listeners.push((function(){window.removeEventListener("popstate",i)}))}},t.prototype.go=function(e){window.history.go(e)},t.prototype.push=function(e,t,n){var r=this,i=this.current;this.transitionTo(e,(function(e){ma(xo(r.base+e.fullPath)),aa(r.router,e,i,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this,i=this.current;this.transitionTo(e,(function(e){ga(xo(r.base+e.fullPath)),aa(r.router,e,i,!1),t&&t(e)}),n)},t.prototype.ensureURL=function(e){if(Ra(this.base)!==this.current.fullPath){var t=xo(this.base+this.current.fullPath);e?ma(t):ga(t)}},t.prototype.getCurrentLocation=function(){return Ra(this.base)},t}(La);function Ra(e){var t=window.location.pathname,n=t.toLowerCase(),r=e.toLowerCase();return!e||n!==r&&0!==n.indexOf(xo(r+"/"))||(t=t.slice(e.length)),(t||"/")+window.location.search+window.location.hash}var Ta=function(e){function t(t,n,r){e.call(this,t,n),r&&function(e){var t=Ra(e);if(!/^\/#/.test(t))return window.location.replace(xo(e+"/#"+t)),!0}(this.base)||Da()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setupListeners=function(){var e=this;if(!(this.listeners.length>0)){var t=this.router.options.scrollBehavior,n=va&&t;n&&this.listeners.push(oa());var r=function(){var t=e.current;Da()&&e.transitionTo(Va(),(function(r){n&&aa(e.router,r,t,!0),va||Ma(r.fullPath)}))},i=va?"popstate":"hashchange";window.addEventListener(i,r),this.listeners.push((function(){window.removeEventListener(i,r)}))}},t.prototype.push=function(e,t,n){var r=this,i=this.current;this.transitionTo(e,(function(e){Ga(e.fullPath),aa(r.router,e,i,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this,i=this.current;this.transitionTo(e,(function(e){Ma(e.fullPath),aa(r.router,e,i,!1),t&&t(e)}),n)},t.prototype.go=function(e){window.history.go(e)},t.prototype.ensureURL=function(e){var t=this.current.fullPath;Va()!==t&&(e?Ga(t):Ma(t))},t.prototype.getCurrentLocation=function(){return Va()},t}(La);function Da(){var e=Va();return"/"===e.charAt(0)||(Ma("/"+e),!1)}function Va(){var e=window.location.href,t=e.indexOf("#");return t<0?"":e=e.slice(t+1)}function Ia(e){var t=window.location.href,n=t.indexOf("#");return(n>=0?t.slice(0,n):t)+"#"+e}function Ga(e){va?ma(Ia(e)):window.location.hash=e}function Ma(e){va?ga(Ia(e)):window.location.replace(Ia(e))}var Na=function(e){function t(t,n){e.call(this,t,n),this.stack=[],this.index=-1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.push=function(e,t,n){var r=this;this.transitionTo(e,(function(e){r.stack=r.stack.slice(0,r.index+1).concat(e),r.index++,t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this;this.transitionTo(e,(function(e){r.stack=r.stack.slice(0,r.index).concat(e),t&&t(e)}),n)},t.prototype.go=function(e){var t=this,n=this.index+e;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){var e=t.current;t.index=n,t.updateRoute(r),t.router.afterHooks.forEach((function(t){t&&t(r,e)}))}),(function(e){xa(e,ya.duplicated)&&(t.index=n)}))}},t.prototype.getCurrentLocation=function(){var e=this.stack[this.stack.length-1];return e?e.fullPath:"/"},t.prototype.ensureURL=function(){},t}(La),za=function(e){void 0===e&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=Yo(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback="history"===t&&!va&&!1!==e.fallback,this.fallback&&(t="hash"),Ko||(t="abstract"),this.mode=t,t){case"history":this.history=new ja(this,e.base);break;case"hash":this.history=new Ta(this,e.base,this.fallback);break;case"abstract":this.history=new Na(this,e.base);break;default:0}},Ua={currentRoute:{configurable:!0}};za.prototype.match=function(e,t,n){return this.matcher.match(e,t,n)},Ua.currentRoute.get=function(){return this.history&&this.history.current},za.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",(function(){var n=t.apps.indexOf(e);n>-1&&t.apps.splice(n,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()})),!this.app){this.app=e;var n=this.history;if(n instanceof ja||n instanceof Ta){var r=function(e){n.setupListeners(),function(e){var r=n.current,i=t.options.scrollBehavior;va&&i&&"fullPath"in e&&aa(t,e,r,!1)}(e)};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(e){t.apps.forEach((function(t){t._route=e}))}))}},za.prototype.beforeEach=function(e){return Ha(this.beforeHooks,e)},za.prototype.beforeResolve=function(e){return Ha(this.resolveHooks,e)},za.prototype.afterEach=function(e){return Ha(this.afterHooks,e)},za.prototype.onReady=function(e,t){this.history.onReady(e,t)},za.prototype.onError=function(e){this.history.onError(e)},za.prototype.push=function(e,t,n){var r=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){r.history.push(e,t,n)}));this.history.push(e,t,n)},za.prototype.replace=function(e,t,n){var r=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){r.history.replace(e,t,n)}));this.history.replace(e,t,n)},za.prototype.go=function(e){this.history.go(e)},za.prototype.back=function(){this.go(-1)},za.prototype.forward=function(){this.go(1)},za.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map((function(e){return Object.keys(e.components).map((function(t){return e.components[t]}))}))):[]},za.prototype.resolve=function(e,t,n){var r=zo(e,t=t||this.history.current,n,this),i=this.match(r,t),o=i.redirectedFrom||i.fullPath;return{location:r,route:i,href:function(e,t,n){var r="hash"===n?"#"+t:t;return e?xo(e+"/"+r):r}(this.history.base,o,this.mode),normalizedTo:r,resolved:i}},za.prototype.getRoutes=function(){return this.matcher.getRoutes()},za.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==vo&&this.history.transitionTo(this.history.getCurrentLocation())},za.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==vo&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(za.prototype,Ua);var qa=za;function Ha(e,t){return e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}za.install=function e(t){if(!e.installed||Uo!==t){e.installed=!0,Uo=t;var n=function(e){return void 0!==e},r=function(e,t){var r=e.$options._parentVnode;n(r)&&n(r=r.data)&&n(r=r.registerRouteInstance)&&r(e,t)};t.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,r(this,this)},destroyed:function(){r(this)}}),Object.defineProperty(t.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this._routerRoot._route}}),t.component("RouterView",Eo),t.component("RouterLink",Ho);var i=t.config.optionMergeStrategies;i.beforeRouteEnter=i.beforeRouteLeave=i.beforeRouteUpdate=i.created}},za.version="3.6.5",za.isNavigationFailure=xa,za.NavigationFailureType=ya,za.START_LOCATION=vo,Ko&&window.Vue&&window.Vue.use(za);n(96);n(123),n(45);var Wa={"components/AlgoliaSearchBox":()=>Promise.all([n.e(0),n.e(13)]).then(n.bind(null,310)),"components/DropdownLink":()=>Promise.all([n.e(0),n.e(14)]).then(n.bind(null,256)),"components/DropdownTransition":()=>Promise.all([n.e(0),n.e(19)]).then(n.bind(null,244)),"components/Home":()=>Promise.all([n.e(0),n.e(16)]).then(n.bind(null,282)),"components/Navbar":()=>Promise.all([n.e(0),n.e(1)]).then(n.bind(null,307)),"components/NavLink":()=>n.e(23).then(n.bind(null,243)),"components/NavLinks":()=>Promise.all([n.e(0),n.e(12)]).then(n.bind(null,267)),"components/Page":()=>Promise.all([n.e(0),n.e(11)]).then(n.bind(null,283)),"components/PageEdit":()=>Promise.all([n.e(0),n.e(17)]).then(n.bind(null,269)),"components/PageNav":()=>Promise.all([n.e(0),n.e(15)]).then(n.bind(null,270)),"components/Sidebar":()=>Promise.all([n.e(0),n.e(10)]).then(n.bind(null,284)),"components/SidebarButton":()=>Promise.all([n.e(0),n.e(20)]).then(n.bind(null,285)),"components/SidebarGroup":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,268)),"components/SidebarLink":()=>Promise.all([n.e(0),n.e(18)]).then(n.bind(null,257)),"components/SidebarLinks":()=>Promise.all([n.e(0),n.e(3)]).then(n.bind(null,255)),"global-components/Badge":()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,315)),"global-components/CodeBlock":()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,311)),"global-components/CodeGroup":()=>Promise.all([n.e(0),n.e(6)]).then(n.bind(null,312)),"layouts/404":()=>n.e(7).then(n.bind(null,313)),"layouts/Layout":()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,314)),NotFound:()=>n.e(7).then(n.bind(null,313)),Layout:()=>Promise.all([n.e(0),n.e(1),n.e(2)]).then(n.bind(null,314))},Ka={"v-b24efa9a":()=>n.e(31).then(n.bind(null,316)),"v-73f1d486":()=>n.e(32).then(n.bind(null,317)),"v-616a2bd1":()=>n.e(34).then(n.bind(null,318)),"v-1de65ad4":()=>n.e(33).then(n.bind(null,319)),"v-7b397256":()=>n.e(36).then(n.bind(null,320)),"v-0d8d83a2":()=>n.e(21).then(n.bind(null,321)),"v-35f865e3":()=>n.e(22).then(n.bind(null,322)),"v-5529e8e5":()=>n.e(37).then(n.bind(null,323)),"v-a58f3c46":()=>n.e(24).then(n.bind(null,324)),"v-1b5ef8cc":()=>n.e(35).then(n.bind(null,325)),"v-82f1c112":()=>n.e(38).then(n.bind(null,326)),"v-4a08a0ed":()=>n.e(39).then(n.bind(null,327)),"v-684930b0":()=>n.e(25).then(n.bind(null,328)),"v-4e706958":()=>n.e(27).then(n.bind(null,329)),"v-c0256cdc":()=>n.e(28).then(n.bind(null,330)),"v-3d196975":()=>n.e(40).then(n.bind(null,331)),"v-42a60b32":()=>n.e(26).then(n.bind(null,332)),"v-4075f022":()=>n.e(29).then(n.bind(null,333)),"v-7c6e1710":()=>n.e(43).then(n.bind(null,334)),"v-17521110":()=>n.e(41).then(n.bind(null,335)),"v-4d37d972":()=>n.e(45).then(n.bind(null,336)),"v-22b21eac":()=>n.e(44).then(n.bind(null,337)),"v-5820d42c":()=>n.e(46).then(n.bind(null,338)),"v-460e207e":()=>n.e(47).then(n.bind(null,339)),"v-b7036e02":()=>n.e(48).then(n.bind(null,340)),"v-4f74fc89":()=>n.e(49).then(n.bind(null,341)),"v-5bcf313c":()=>n.e(42).then(n.bind(null,342)),"v-018fe7d9":()=>n.e(50).then(n.bind(null,343)),"v-2832db09":()=>n.e(54).then(n.bind(null,344)),"v-60f1b38c":()=>n.e(55).then(n.bind(null,345)),"v-a9374808":()=>n.e(52).then(n.bind(null,346)),"v-83c37b1c":()=>n.e(56).then(n.bind(null,347)),"v-3325c5ea":()=>n.e(30).then(n.bind(null,348)),"v-746efd44":()=>n.e(51).then(n.bind(null,349)),"v-60fcb6e3":()=>n.e(57).then(n.bind(null,350)),"v-14b38dcc":()=>n.e(53).then(n.bind(null,351)),"v-1454065a":()=>n.e(58).then(n.bind(null,352)),"v-4353bce0":()=>n.e(59).then(n.bind(null,353)),"v-de532b9a":()=>n.e(60).then(n.bind(null,354)),"v-0dd1e8ac":()=>n.e(61).then(n.bind(null,355)),"v-2f1ebe3a":()=>n.e(64).then(n.bind(null,356)),"v-391322e8":()=>n.e(62).then(n.bind(null,357)),"v-7b684336":()=>n.e(63).then(n.bind(null,358))};function Ja(e){const t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}const Xa=/-(\w)/g,Ya=Ja(e=>e.replace(Xa,(e,t)=>t?t.toUpperCase():"")),Za=/\B([A-Z])/g,Qa=Ja(e=>e.replace(Za,"-$1").toLowerCase()),es=Ja(e=>e.charAt(0).toUpperCase()+e.slice(1));function ts(e,t){if(!t)return;if(e(t))return e(t);return t.includes("-")?e(es(Ya(t))):e(es(t))||e(Qa(t))}const ns=Object.assign({},Wa,Ka),rs=e=>ns[e],is=e=>Ka[e],os=e=>Wa[e],as=e=>Wn.component(e);function ss(e){return ts(is,e)}function ls(e){return ts(os,e)}function cs(e){return ts(rs,e)}function us(e){return ts(as,e)}function hs(...e){return Promise.all(e.filter(e=>e).map(async e=>{if(!us(e)&&cs(e)){const t=await cs(e)();Wn.component(e,t.default)}}))}function ps(e,t){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[e]=t)}var fs=n(87),ds=n.n(fs),vs=n(88),ms=n.n(vs),gs={created(){if(this.siteMeta=this.$site.headTags.filter(([e])=>"meta"===e).map(([e,t])=>t),this.$ssrContext){const t=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(e=t)?e.map(e=>{let t="{t+=` ${n}="${ms()(e[n])}"`}),t+">"}).join("\n "):"",this.$ssrContext.canonicalLink=Cs(this.$canonicalUrl)}var e},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const e=this.getMergedMetaTags();this.currentMetaTags=bs(e,this.currentMetaTags)},getMergedMetaTags(){const e=this.$page.frontmatter.meta||[];return ds()([{name:"description",content:this.$description}],e,this.siteMeta,Es)},updateCanonicalLink(){ys(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",Cs(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){bs(null,this.currentMetaTags),ys()}};function ys(){const e=document.querySelector("link[rel='canonical']");e&&e.remove()}function Cs(e=""){return e?``:""}function bs(e,t){if(t&&[...t].filter(e=>e.parentNode===document.head).forEach(e=>document.head.removeChild(e)),e)return e.map(e=>{const t=document.createElement("meta");return Object.keys(e).forEach(n=>{t.setAttribute(n,e[n])}),document.head.appendChild(t),t})}function Es(e){for(const t of["name","property","itemprop"])if(e.hasOwnProperty(t))return e[t]+t;return JSON.stringify(e)}var _s=n(89),As={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(_s)()((function(){this.setActiveHash()}),300),setActiveHash(){const e=[].slice.call(document.querySelectorAll(".sidebar-link")),t=[].slice.call(document.querySelectorAll(".header-anchor")).filter(t=>e.some(e=>e.hash===t.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),r=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),i=window.innerHeight+n;for(let e=0;e=o.parentElement.offsetTop+10&&(!a||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},xs=n(22),Bs=n.n(xs),ws=[gs,As,{mounted(){Bs.a.configure({showSpinner:!1}),this.$router.beforeEach((e,t,n)=>{e.path===t.path||Wn.component(e.name)||Bs.a.start(),n()}),this.$router.afterEach(()=>{Bs.a.done(),this.isSidebarOpen=!1})}}],Ss={name:"GlobalLayout",computed:{layout(){const e=this.getLayout();return ps("layout",e),Wn.component(e)}},methods:{getLayout(){if(this.$page.path){const e=this.$page.frontmatter.layout;return e&&(this.$vuepress.getLayoutAsyncComponent(e)||this.$vuepress.getVueComponent(e))?e:"Layout"}return"NotFound"}}},ks=n(14),Os=Object(ks.a)(Ss,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(e,t,n){switch(t){case"components":e[t]||(e[t]={}),Object.assign(e[t],n);break;case"mixins":e[t]||(e[t]=[]),e[t].push(...n);break;default:throw new Error("Unknown option name.")}}(Os,"mixins",ws);const Ps=[{name:"v-b24efa9a",path:"/Chip/Chip/1.%20%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-b24efa9a").then(n)}},{path:"/Chip/Chip/1. 一生一芯计划.html",redirect:"/Chip/Chip/1.%20%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92.html"},{path:"/Chip/Chip/1. 一生一芯计划.html",redirect:"/Chip/Chip/1.%20%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92.html"},{name:"v-73f1d486",path:"/Chip/Chip/2.%202024.02.21-Chisel.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-73f1d486").then(n)}},{path:"/Chip/Chip/2. 2024.02.21-Chisel.html",redirect:"/Chip/Chip/2.%202024.02.21-Chisel.html"},{path:"/Chip/Chip/2. 2024.02.21-Chisel.html",redirect:"/Chip/Chip/2.%202024.02.21-Chisel.html"},{name:"v-616a2bd1",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/02.Verilog%20%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-616a2bd1").then(n)}},{path:"/Chip/Chip/2023.11.07-Verilog语法/02.Verilog 数值表示.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/02.Verilog%20%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA.html"},{path:"/Chip/Chip/2023.11.07-Verilog语法/02.Verilog 数值表示.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/02.Verilog%20%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA.html"},{name:"v-1de65ad4",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/01.Verilog%20%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-1de65ad4").then(n)}},{path:"/Chip/Chip/2023.11.07-Verilog语法/01.Verilog 基础语法.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/01.Verilog%20%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95.html"},{path:"/Chip/Chip/2023.11.07-Verilog语法/01.Verilog 基础语法.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/01.Verilog%20%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95.html"},{name:"v-7b397256",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/04.Verilog%20%E8%A1%A8%E8%BE%BE%E5%BC%8F.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-7b397256").then(n)}},{path:"/Chip/Chip/2023.11.07-Verilog语法/04.Verilog 表达式.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/04.Verilog%20%E8%A1%A8%E8%BE%BE%E5%BC%8F.html"},{path:"/Chip/Chip/2023.11.07-Verilog语法/04.Verilog 表达式.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/04.Verilog%20%E8%A1%A8%E8%BE%BE%E5%BC%8F.html"},{name:"v-0d8d83a2",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.15-Vivado.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-0d8d83a2").then(n)}},{path:"/Chip/Chip/2023.11.07-Verilog语法/2023.11.15-Vivado.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.15-Vivado.html"},{path:"/Chip/Chip/2023.11.07-Verilog语法/2023.11.15-Vivado.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.15-Vivado.html"},{name:"v-35f865e3",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.16-%E9%98%BB%E5%A1%9E%E4%B8%8E%E9%9D%9E%E9%98%BB%E5%A1%9E%E8%B5%8B%E5%80%BC.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-35f865e3").then(n)}},{path:"/Chip/Chip/2023.11.07-Verilog语法/2023.11.16-阻塞与非阻塞赋值.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.16-%E9%98%BB%E5%A1%9E%E4%B8%8E%E9%9D%9E%E9%98%BB%E5%A1%9E%E8%B5%8B%E5%80%BC.html"},{path:"/Chip/Chip/2023.11.07-Verilog语法/2023.11.16-阻塞与非阻塞赋值.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.16-%E9%98%BB%E5%A1%9E%E4%B8%8E%E9%9D%9E%E9%98%BB%E5%A1%9E%E8%B5%8B%E5%80%BC.html"},{name:"v-5529e8e5",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-5529e8e5").then(n)}},{name:"v-a58f3c46",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/10.Verilog%20%E5%A4%9A%E8%B7%AF%E5%88%86%E6%94%AF%E8%AF%AD%E5%8F%A5.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-a58f3c46").then(n)}},{path:"/Chip/Chip/2023.11.07-Verilog语法/10.Verilog 多路分支语句.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/10.Verilog%20%E5%A4%9A%E8%B7%AF%E5%88%86%E6%94%AF%E8%AF%AD%E5%8F%A5.html"},{path:"/Chip/Chip/2023.11.07-Verilog语法/10.Verilog 多路分支语句.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/10.Verilog%20%E5%A4%9A%E8%B7%AF%E5%88%86%E6%94%AF%E8%AF%AD%E5%8F%A5.html"},{name:"v-1b5ef8cc",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/03.Verilog%20%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-1b5ef8cc").then(n)}},{path:"/Chip/Chip/2023.11.07-Verilog语法/03.Verilog 数据类型.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/03.Verilog%20%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B.html"},{path:"/Chip/Chip/2023.11.07-Verilog语法/03.Verilog 数据类型.html",redirect:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/03.Verilog%20%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B.html"},{name:"v-82f1c112",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1%20Introduction%20to%20Scala.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-82f1c112").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1 Introduction to Scala.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1%20Introduction%20to%20Scala.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1 Introduction to Scala.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1%20Introduction%20to%20Scala.html"},{name:"v-4a08a0ed",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1%20First%20Chisel%20Module.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-4a08a0ed").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1 First Chisel Module.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1%20First%20Chisel%20Module.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1 First Chisel Module.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1%20First%20Chisel%20Module.html"},{name:"v-684930b0",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2%20Combinational%20Logic.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-684930b0").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2 Combinational Logic.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2%20Combinational%20Logic.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2 Combinational Logic.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2%20Combinational%20Logic.html"},{name:"v-4e706958",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4%20Sequential%20Logic.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-4e706958").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4 Sequential Logic.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4%20Sequential%20Logic.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4 Sequential Logic.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4%20Sequential%20Logic.html"},{name:"v-c0256cdc",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5%20FIR%20Filter.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-c0256cdc").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5 FIR Filter.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5%20FIR%20Filter.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5 FIR Filter.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5%20FIR%20Filter.html"},{name:"v-3d196975",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6%20More%20on%20ChiselTest.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-3d196975").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6 More on ChiselTest.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6%20More%20on%20ChiselTest.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6 More on ChiselTest.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6%20More%20on%20ChiselTest.html"},{name:"v-42a60b32",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3%20Control%20Flow.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-42a60b32").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3 Control Flow.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3%20Control%20Flow.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3 Control Flow.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3%20Control%20Flow.html"},{name:"v-4075f022",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1%20Generators%20Parameters.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-4075f022").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1 Generators Parameters.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1%20Generators%20Parameters.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1 Generators Parameters.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1%20Generators%20Parameters.html"},{name:"v-7c6e1710",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4%20Higher-Order%20Functions.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-7c6e1710").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4 Higher-Order Functions.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4%20Higher-Order%20Functions.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4 Higher-Order Functions.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4%20Higher-Order%20Functions.html"},{name:"v-17521110",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2%20Generators%20Collections.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-17521110").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2 Generators Collections.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2%20Generators%20Collections.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2 Generators Collections.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2%20Generators%20Collections.html"},{name:"v-4d37d972",path:"/Chip/Chip/%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92/%E9%A2%84%E5%AD%A6%E4%B9%A0%E9%98%B6%E6%AE%B5.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-4d37d972").then(n)}},{path:"/Chip/Chip/一生一芯计划/预学习阶段.html",redirect:"/Chip/Chip/%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92/%E9%A2%84%E5%AD%A6%E4%B9%A0%E9%98%B6%E6%AE%B5.html"},{path:"/Chip/Chip/一生一芯计划/预学习阶段.html",redirect:"/Chip/Chip/%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92/%E9%A2%84%E5%AD%A6%E4%B9%A0%E9%98%B6%E6%AE%B5.html"},{name:"v-22b21eac",path:"/Chip/Chip/3.%202023.11.07-Verilog%E8%AF%AD%E6%B3%95.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-22b21eac").then(n)}},{path:"/Chip/Chip/3. 2023.11.07-Verilog语法.html",redirect:"/Chip/Chip/3.%202023.11.07-Verilog%E8%AF%AD%E6%B3%95.html"},{path:"/Chip/Chip/3. 2023.11.07-Verilog语法.html",redirect:"/Chip/Chip/3.%202023.11.07-Verilog%E8%AF%AD%E6%B3%95.html"},{name:"v-5820d42c",path:"/Chip/",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-5820d42c").then(n)}},{path:"/Chip/index.html",redirect:"/Chip/"},{name:"v-460e207e",path:"/LeetCode/LeetCode/2024.02.22-BFS.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-460e207e").then(n)}},{name:"v-b7036e02",path:"/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752%20%E6%89%93%E5%BC%80%E8%BD%AC%E7%9B%98%E9%94%81%EF%BC%88BFS%EF%BC%89.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-b7036e02").then(n)}},{path:"/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752 打开转盘锁(BFS).html",redirect:"/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752%20%E6%89%93%E5%BC%80%E8%BD%AC%E7%9B%98%E9%94%81%EF%BC%88BFS%EF%BC%89.html"},{path:"/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752 打开转盘锁(BFS).html",redirect:"/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752%20%E6%89%93%E5%BC%80%E8%BD%AC%E7%9B%98%E9%94%81%EF%BC%88BFS%EF%BC%89.html"},{name:"v-4f74fc89",path:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-4f74fc89").then(n)}},{path:"/LeetCode/LeetCode/2024.03.05-二叉树.html",redirect:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91.html"},{path:"/LeetCode/LeetCode/2024.03.05-二叉树.html",redirect:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91.html"},{name:"v-5bcf313c",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3%20Interlude%20Chisel%20Standard%20Library.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-5bcf313c").then(n)}},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3 Interlude Chisel Standard Library.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3%20Interlude%20Chisel%20Standard%20Library.html"},{path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3 Interlude Chisel Standard Library.html",redirect:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3%20Interlude%20Chisel%20Standard%20Library.html"},{name:"v-018fe7d9",path:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-104%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E6%9C%80%E5%A4%A7%E6%B7%B1%E5%BA%A6%20c6649929175d46038db921b552f2a235.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-018fe7d9").then(n)}},{path:"/LeetCode/LeetCode/2024.03.05-二叉树/2024 03 05-104 二叉树的最大深度 c6649929175d46038db921b552f2a235.html",redirect:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-104%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E6%9C%80%E5%A4%A7%E6%B7%B1%E5%BA%A6%20c6649929175d46038db921b552f2a235.html"},{path:"/LeetCode/LeetCode/2024.03.05-二叉树/2024 03 05-104 二叉树的最大深度 c6649929175d46038db921b552f2a235.html",redirect:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-104%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E6%9C%80%E5%A4%A7%E6%B7%B1%E5%BA%A6%20c6649929175d46038db921b552f2a235.html"},{name:"v-2832db09",path:"/",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-2832db09").then(n)}},{path:"/index.html",redirect:"/"},{name:"v-60f1b38c",path:"/Research/",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-60f1b38c").then(n)}},{path:"/Research/index.html",redirect:"/Research/"},{name:"v-a9374808",path:"/LeetCode/LeetCode/2024.03.10-%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-a9374808").then(n)}},{path:"/LeetCode/LeetCode/2024.03.10-滑动窗口.html",redirect:"/LeetCode/LeetCode/2024.03.10-%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3.html"},{path:"/LeetCode/LeetCode/2024.03.10-滑动窗口.html",redirect:"/LeetCode/LeetCode/2024.03.10-%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3.html"},{name:"v-83c37b1c",path:"/Research/Research/2023-Geant4.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-83c37b1c").then(n)}},{name:"v-3325c5ea",path:"/Research/Research/2023-Geant4/2023.02.13-%E5%9C%A8%E8%B6%85%E7%AE%97%E4%B8%8A%E6%90%AD%E5%BB%BASingularity%E7%8E%AF%E5%A2%83%E5%B9%B6%E9%85%8D%E7%BD%AEGeant4.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-3325c5ea").then(n)}},{path:"/Research/Research/2023-Geant4/2023.02.13-在超算上搭建Singularity环境并配置Geant4.html",redirect:"/Research/Research/2023-Geant4/2023.02.13-%E5%9C%A8%E8%B6%85%E7%AE%97%E4%B8%8A%E6%90%AD%E5%BB%BASingularity%E7%8E%AF%E5%A2%83%E5%B9%B6%E9%85%8D%E7%BD%AEGeant4.html"},{path:"/Research/Research/2023-Geant4/2023.02.13-在超算上搭建Singularity环境并配置Geant4.html",redirect:"/Research/Research/2023-Geant4/2023.02.13-%E5%9C%A8%E8%B6%85%E7%AE%97%E4%B8%8A%E6%90%AD%E5%BB%BASingularity%E7%8E%AF%E5%A2%83%E5%B9%B6%E9%85%8D%E7%BD%AEGeant4.html"},{name:"v-746efd44",path:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-543%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84%209db6d046b0954b45b96ca749922a2ece.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-746efd44").then(n)}},{path:"/LeetCode/LeetCode/2024.03.05-二叉树/2024 03 05-543 二叉树的直径 9db6d046b0954b45b96ca749922a2ece.html",redirect:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-543%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84%209db6d046b0954b45b96ca749922a2ece.html"},{path:"/LeetCode/LeetCode/2024.03.05-二叉树/2024 03 05-543 二叉树的直径 9db6d046b0954b45b96ca749922a2ece.html",redirect:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-543%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84%209db6d046b0954b45b96ca749922a2ece.html"},{name:"v-60fcb6e3",path:"/Research/Research/2023-Geant4/2023.02.27-%E5%A4%84%E7%90%86Geant4%E8%8E%B7%E5%8F%96%E7%9A%84%E6%95%B0%E6%8D%AE.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-60fcb6e3").then(n)}},{path:"/Research/Research/2023-Geant4/2023.02.27-处理Geant4获取的数据.html",redirect:"/Research/Research/2023-Geant4/2023.02.27-%E5%A4%84%E7%90%86Geant4%E8%8E%B7%E5%8F%96%E7%9A%84%E6%95%B0%E6%8D%AE.html"},{path:"/Research/Research/2023-Geant4/2023.02.27-处理Geant4获取的数据.html",redirect:"/Research/Research/2023-Geant4/2023.02.27-%E5%A4%84%E7%90%86Geant4%E8%8E%B7%E5%8F%96%E7%9A%84%E6%95%B0%E6%8D%AE.html"},{name:"v-14b38dcc",path:"/LeetCode/",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-14b38dcc").then(n)}},{path:"/LeetCode/index.html",redirect:"/LeetCode/"},{name:"v-1454065a",path:"/Research/Research/2023-Geant4/2023.03.12-PKA%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-1454065a").then(n)}},{path:"/Research/Research/2023-Geant4/2023.03.12-PKA数据处理.html",redirect:"/Research/Research/2023-Geant4/2023.03.12-PKA%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86.html"},{path:"/Research/Research/2023-Geant4/2023.03.12-PKA数据处理.html",redirect:"/Research/Research/2023-Geant4/2023.03.12-PKA%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86.html"},{name:"v-4353bce0",path:"/Research/Research/2023-Geant4/2023.05.23-Geant4%E5%A4%9A%E7%B2%92%E5%AD%90%E6%BA%90%E8%AE%BE%E7%BD%AE.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-4353bce0").then(n)}},{path:"/Research/Research/2023-Geant4/2023.05.23-Geant4多粒子源设置.html",redirect:"/Research/Research/2023-Geant4/2023.05.23-Geant4%E5%A4%9A%E7%B2%92%E5%AD%90%E6%BA%90%E8%AE%BE%E7%BD%AE.html"},{path:"/Research/Research/2023-Geant4/2023.05.23-Geant4多粒子源设置.html",redirect:"/Research/Research/2023-Geant4/2023.05.23-Geant4%E5%A4%9A%E7%B2%92%E5%AD%90%E6%BA%90%E8%AE%BE%E7%BD%AE.html"},{name:"v-de532b9a",path:"/Research/Research/2023-Geant4/2023.06.14-Geant4%E5%90%84%E7%89%88%E6%9C%AC%E7%9A%84%E5%AE%89%E8%A3%85.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-de532b9a").then(n)}},{path:"/Research/Research/2023-Geant4/2023.06.14-Geant4各版本的安装.html",redirect:"/Research/Research/2023-Geant4/2023.06.14-Geant4%E5%90%84%E7%89%88%E6%9C%AC%E7%9A%84%E5%AE%89%E8%A3%85.html"},{path:"/Research/Research/2023-Geant4/2023.06.14-Geant4各版本的安装.html",redirect:"/Research/Research/2023-Geant4/2023.06.14-Geant4%E5%90%84%E7%89%88%E6%9C%AC%E7%9A%84%E5%AE%89%E8%A3%85.html"},{name:"v-0dd1e8ac",path:"/Research/Research/2023-Geant4/2023.08.28-Geant4%E8%87%AA%E5%AE%9A%E4%B9%89PhysicsList.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-0dd1e8ac").then(n)}},{path:"/Research/Research/2023-Geant4/2023.08.28-Geant4自定义PhysicsList.html",redirect:"/Research/Research/2023-Geant4/2023.08.28-Geant4%E8%87%AA%E5%AE%9A%E4%B9%89PhysicsList.html"},{path:"/Research/Research/2023-Geant4/2023.08.28-Geant4自定义PhysicsList.html",redirect:"/Research/Research/2023-Geant4/2023.08.28-Geant4%E8%87%AA%E5%AE%9A%E4%B9%89PhysicsList.html"},{name:"v-2f1ebe3a",path:"/about/",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-2f1ebe3a").then(n)}},{path:"/about/index.html",redirect:"/about/"},{name:"v-391322e8",path:"/Research/Research/2023-Geant4/2023.09.05-C++%20Trim%E7%A8%8B%E5%BA%8F.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-391322e8").then(n)}},{path:"/Research/Research/2023-Geant4/2023.09.05-C++ Trim程序.html",redirect:"/Research/Research/2023-Geant4/2023.09.05-C++%20Trim%E7%A8%8B%E5%BA%8F.html"},{path:"/Research/Research/2023-Geant4/2023.09.05-C++ Trim程序.html",redirect:"/Research/Research/2023-Geant4/2023.09.05-C++%20Trim%E7%A8%8B%E5%BA%8F.html"},{name:"v-7b684336",path:"/Research/Research/2023-Geant4/2023.12.18-Geant4%E8%87%AA%E5%8A%A8%E5%8C%96.html",component:Os,beforeEnter:(e,t,n)=>{hs("Layout","v-7b684336").then(n)}},{path:"/Research/Research/2023-Geant4/2023.12.18-Geant4自动化.html",redirect:"/Research/Research/2023-Geant4/2023.12.18-Geant4%E8%87%AA%E5%8A%A8%E5%8C%96.html"},{path:"/Research/Research/2023-Geant4/2023.12.18-Geant4自动化.html",redirect:"/Research/Research/2023-Geant4/2023.12.18-Geant4%E8%87%AA%E5%8A%A8%E5%8C%96.html"},{path:"*",component:Os}],Ls={title:"Personal Blog --from OutisLi",description:"",base:"/Blog/",headTags:[],pages:[{title:"1. 一生一芯计划",frontmatter:{},regularPath:"/Chip/Chip/1.%20%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92.html",relativePath:"Chip/Chip/1. 一生一芯计划.md",key:"v-b24efa9a",path:"/Chip/Chip/1.%20%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92.html",headers:[{level:2,title:"预学习阶段",slug:"预学习阶段"}],createdTime:170977737e4},{title:"2. 2024.02.21-Chisel",frontmatter:{},regularPath:"/Chip/Chip/2.%202024.02.21-Chisel.html",relativePath:"Chip/Chip/2. 2024.02.21-Chisel.md",key:"v-73f1d486",path:"/Chip/Chip/2.%202024.02.21-Chisel.html",headers:[{level:2,title:"2024.02.21-Chisel Bootcamp",slug:"_2024-02-21-chisel-bootcamp"}],createdTime:170977737e4},{title:"2. Verilog 数值表示",frontmatter:{},regularPath:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/02.Verilog%20%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA.html",relativePath:"Chip/Chip/2023.11.07-Verilog语法/02.Verilog 数值表示.md",key:"v-616a2bd1",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/02.Verilog%20%E6%95%B0%E5%80%BC%E8%A1%A8%E7%A4%BA.html",headers:[{level:2,title:"数值种类",slug:"数值种类"},{level:2,title:"整数数值表示方法",slug:"整数数值表示方法"},{level:3,title:"指明位宽:",slug:"指明位宽"},{level:3,title:"不指明位宽:",slug:"不指明位宽"},{level:3,title:"负数表示",slug:"负数表示"},{level:2,title:"实数表示方法",slug:"实数表示方法"},{level:3,title:"十进制:",slug:"十进制"},{level:3,title:"科学计数法:",slug:"科学计数法"},{level:2,title:"字符串表示方法",slug:"字符串表示方法"}],createdTime:170977737e4},{title:"1. Verilog 基础语法",frontmatter:{},regularPath:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/01.Verilog%20%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95.html",relativePath:"Chip/Chip/2023.11.07-Verilog语法/01.Verilog 基础语法.md",key:"v-1de65ad4",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/01.Verilog%20%E5%9F%BA%E7%A1%80%E8%AF%AD%E6%B3%95.html",headers:[{level:2,title:"格式",slug:"格式"},{level:3,title:"不换行(不推荐)",slug:"不换行-不推荐"},{level:3,title:"换行(推荐)",slug:"换行-推荐"},{level:2,title:"注释",slug:"注释"},{level:2,title:"标识符与关键字",slug:"标识符与关键字"},{level:3,title:"实例",slug:"实例"}],createdTime:170977737e4},{title:"4. Verilog 表达式",frontmatter:{},regularPath:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/04.Verilog%20%E8%A1%A8%E8%BE%BE%E5%BC%8F.html",relativePath:"Chip/Chip/2023.11.07-Verilog语法/04.Verilog 表达式.md",key:"v-7b397256",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/04.Verilog%20%E8%A1%A8%E8%BE%BE%E5%BC%8F.html",headers:[{level:3,title:"表达式",slug:"表达式"},{level:2,title:"实例",slug:"实例"},{level:3,title:"操作数",slug:"操作数"},{level:2,title:"实例",slug:"实例-2"},{level:3,title:"操作符",slug:"操作符"},{level:3,title:"算术操作符",slug:"算术操作符"},{level:2,title:"实例",slug:"实例-3"},{level:2,title:"实例",slug:"实例-4"},{level:2,title:"实例",slug:"实例-5"},{level:2,title:"实例",slug:"实例-6"},{level:3,title:"关系操作符",slug:"关系操作符"},{level:2,title:"实例",slug:"实例-7"},{level:3,title:"等价操作符",slug:"等价操作符"},{level:2,title:"实例",slug:"实例-8"},{level:3,title:"逻辑操作符",slug:"逻辑操作符"},{level:2,title:"实例",slug:"实例-9"},{level:3,title:"按位操作符",slug:"按位操作符"},{level:2,title:"实例",slug:"实例-10"},{level:3,title:"归约操作符",slug:"归约操作符"},{level:3,title:"移位操作符",slug:"移位操作符"},{level:2,title:"实例",slug:"实例-11"},{level:3,title:"拼接操作符",slug:"拼接操作符"},{level:2,title:"实例",slug:"实例-12"},{level:3,title:"条件操作符",slug:"条件操作符"},{level:2,title:"实例",slug:"实例-13"}],createdTime:170977737e4},{title:"2023.11.15-Vivado",frontmatter:{},regularPath:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.15-Vivado.html",relativePath:"Chip/Chip/2023.11.07-Verilog语法/2023.11.15-Vivado.md",key:"v-0d8d83a2",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.15-Vivado.html",headers:[{level:2,title:"1. RTL Schematic & Synthesis Schematic",slug:"_1-rtl-schematic-synthesis-schematic"},{level:2,title:"2. Project 汇总中的 LUT,FF,IO,BUFG",slug:"_2-project-汇总中的-lut-ff-io-bufg"},{level:2,title:"3. FPGA 的组成构造",slug:"_3-fpga-的组成构造"}],createdTime:170972353e4},{title:"2023.11.16-阻塞与非阻塞赋值",frontmatter:{},regularPath:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.16-%E9%98%BB%E5%A1%9E%E4%B8%8E%E9%9D%9E%E9%98%BB%E5%A1%9E%E8%B5%8B%E5%80%BC.html",relativePath:"Chip/Chip/2023.11.07-Verilog语法/2023.11.16-阻塞与非阻塞赋值.md",key:"v-35f865e3",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/2023.11.16-%E9%98%BB%E5%A1%9E%E4%B8%8E%E9%9D%9E%E9%98%BB%E5%A1%9E%E8%B5%8B%E5%80%BC.html",headers:[{level:3,title:"阻塞赋值(Blocking Assignment)",slug:"阻塞赋值-blocking-assignment"},{level:3,title:"非阻塞赋值(Non-Blocking Assignment)",slug:"非阻塞赋值-non-blocking-assignment"}],createdTime:170972353e4},{title:"2024.02.21-Chisel BootCamp",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.md",key:"v-5529e8e5",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.html",headers:[{level:2,title:"2024.02.21-1. Introduction to Scala",slug:"_2024-02-21-1-introduction-to-scala"},{level:2,title:"2024.02.23-2.1 First Chisel Module",slug:"_2024-02-23-2-1-first-chisel-module"},{level:2,title:"2024.02.24-2.2 Combinational Logic",slug:"_2024-02-24-2-2-combinational-logic"},{level:2,title:"2024.02.25-2.3 Control Flow",slug:"_2024-02-25-2-3-control-flow"},{level:2,title:"2024.02.26-2.4 Sequential Logic",slug:"_2024-02-26-2-4-sequential-logic"},{level:2,title:"2024.02.28-2.5 FIR Filter",slug:"_2024-02-28-2-5-fir-filter"},{level:2,title:"2024.02.29-2.6 More on ChiselTest",slug:"_2024-02-29-2-6-more-on-chiseltest"},{level:2,title:"2024.03.01-3.1 Generators: Parameters",slug:"_2024-03-01-3-1-generators-parameters"},{level:2,title:"2024.03.03-3.2 Generators: Collections",slug:"_2024-03-03-3-2-generators-collections"},{level:2,title:"2024.03.04-3.3 Interlude: Chisel Standard Library",slug:"_2024-03-04-3-3-interlude-chisel-standard-library"},{level:2,title:"2024.03.05-3.4 Higher-Order Functions",slug:"_2024-03-05-3-4-higher-order-functions"}],createdTime:170977737e4},{title:"10. Verilog 多路分支语句",frontmatter:{},regularPath:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/10.Verilog%20%E5%A4%9A%E8%B7%AF%E5%88%86%E6%94%AF%E8%AF%AD%E5%8F%A5.html",relativePath:"Chip/Chip/2023.11.07-Verilog语法/10.Verilog 多路分支语句.md",key:"v-a58f3c46",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/10.Verilog%20%E5%A4%9A%E8%B7%AF%E5%88%86%E6%94%AF%E8%AF%AD%E5%8F%A5.html",headers:[{level:3,title:"关键词:case,选择器",slug:"关键词-case-选择器"},{level:2,title:"case 语句",slug:"case-语句"},{level:3,title:"case 语句支持嵌套使用。",slug:"case-语句支持嵌套使用。"},{level:3,title:"实例",slug:"实例"},{level:3,title:"例如,对 4 路选择器的 case 语句进行扩展,举例如下:",slug:"例如-对-4-路选择器的-case-语句进行扩展-举例如下"},{level:2,title:"casex/casez 语句",slug:"casex-casez-语句"},{level:3,title:"例如用 casez 语句来实现一个 4bit 控制端的 4 路选择选择器。",slug:"例如用-casez-语句来实现一个-4bit-控制端的-4-路选择选择器。"}],createdTime:170972353e4},{title:"3. Verilog 数据类型",frontmatter:{},regularPath:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/03.Verilog%20%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B.html",relativePath:"Chip/Chip/2023.11.07-Verilog语法/03.Verilog 数据类型.md",key:"v-1b5ef8cc",path:"/Chip/Chip/2023.11.07-Verilog%E8%AF%AD%E6%B3%95/03.Verilog%20%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B.html",headers:[{level:2,title:"线网(wire)",slug:"线网-wire"},{level:2,title:"寄存器(reg)",slug:"寄存器-reg"},{level:2,title:"向量",slug:"向量"},{level:2,title:"整数,实数,时间寄存器变量",slug:"整数-实数-时间寄存器变量"},{level:3,title:"整数(integer)",slug:"整数-integer"},{level:3,title:"实数(real)",slug:"实数-real"},{level:3,title:"时间(time)",slug:"时间-time"},{level:3,title:"数组",slug:"数组"},{level:2,title:"存储器",slug:"存储器"},{level:2,title:"参数",slug:"参数"},{level:2,title:"字符串",slug:"字符串"}],createdTime:170977737e4},{title:"2024.02.21-1. Introduction to Scala",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1%20Introduction%20to%20Scala.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1 Introduction to Scala.md",key:"v-82f1c112",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.21-1%20Introduction%20to%20Scala.html",headers:[{level:2,title:"Variables and Constants - var and val",slug:"variables-and-constants-var-and-val"},{level:2,title:"Conditionals",slug:"conditionals"},{level:2,title:"Methods (Functions)",slug:"methods-functions"},{level:2,title:"Overloading Functions",slug:"overloading-functions"},{level:3,title:"Recursive and Nested Functions",slug:"recursive-and-nested-functions"},{level:3,title:"Named Parameters and Parameter Defaults",slug:"named-parameters-and-parameter-defaults"},{level:2,title:"Lists",slug:"lists"},{level:2,title:"for Statement",slug:"for-statement"},{level:2,title:"Packages and Imports",slug:"packages-and-imports"},{level:2,title:"Class",slug:"class"},{level:3,title:"Creating an Instance of a Class",slug:"creating-an-instance-of-a-class"},{level:2,title:"Code Blocks",slug:"code-blocks"},{level:3,title:"Parameterized Code Blocks",slug:"parameterized-code-blocks"}],createdTime:170977737e4},{title:"2024.02.23-2.1 First Chisel Module",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1%20First%20Chisel%20Module.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1 First Chisel Module.md",key:"v-4a08a0ed",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.23-2.1%20First%20Chisel%20Module.html",headers:[{level:2,title:"Setup",slug:"setup"},{level:2,title:"Example Module",slug:"example-module"},{level:3,title:"Generate Verilog",slug:"generate-verilog"},{level:3,title:"Generate Firrtl",slug:"generate-firrtl"},{level:2,title:"Example Tester",slug:"example-tester"},{level:2,title:'Appendix: A Note on "printf" Debugging',slug:"appendix-a-note-on-printf-debugging"}],createdTime:170977737e4},{title:"2024.02.24-2.2 Combinational Logic",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2%20Combinational%20Logic.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2 Combinational Logic.md",key:"v-684930b0",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.24-2.2%20Combinational%20Logic.html",headers:[{level:2,title:"Common Operators",slug:"common-operators"},{level:2,title:"Mux and Concatenation",slug:"mux-and-concatenation"},{level:2,title:"MAC: multiply accumulate function",slug:"mac-multiply-accumulate-function"},{level:2,title:"Arbiter",slug:"arbiter"},{level:2,title:"Parameterized Adder",slug:"parameterized-adder"}],createdTime:170977737e4},{title:"2024.02.26-2.4 Sequential Logic",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4%20Sequential%20Logic.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4 Sequential Logic.md",key:"v-4e706958",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.26-2.4%20Sequential%20Logic.html",headers:[{level:2,title:"Registers",slug:"registers"},{level:3,title:"RegInit",slug:"reginit"},{level:3,title:"RegNext",slug:"regnext"},{level:2,title:"Shift Register",slug:"shift-register"},{level:3,title:"Parameterized Shift Register",slug:"parameterized-shift-register"},{level:2,title:"Appendix: Explicit clock and reset",slug:"appendix-explicit-clock-and-reset"},{level:3,title:"Example: Multi-Clock Module",slug:"example-multi-clock-module"}],createdTime:170977737e4},{title:"2024.02.28-2.5 FIR Filter",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5%20FIR%20Filter.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5 FIR Filter.md",key:"v-c0256cdc",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.28-2.5%20FIR%20Filter.html",headers:[{level:2,title:"FIR Filter Generator",slug:"fir-filter-generator"}],createdTime:170977737e4},{title:"2024.02.29-2.6 More on ChiselTest",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6%20More%20on%20ChiselTest.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6 More on ChiselTest.md",key:"v-3d196975",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.29-2.6%20More%20on%20ChiselTest.html",headers:[{level:2,title:"Modules with Decoupled Interfaces",slug:"modules-with-decoupled-interfaces"},{level:3,title:"EnqueueNow and expectDequeueNow",slug:"enqueuenow-and-expectdequeuenow"},{level:3,title:"EnqueueSeq and DequeueSeq",slug:"enqueueseq-and-dequeueseq"},{level:2,title:"Fork and Join",slug:"fork-and-join"}],createdTime:170977737e4},{title:"2024.02.25-2.3 Control Flow",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3%20Control%20Flow.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3 Control Flow.md",key:"v-42a60b32",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.02.25-2.3%20Control%20Flow.html",headers:[{level:2,title:"Last Connect Semantics",slug:"last-connect-semantics"},{level:2,title:"when, elsewhen, and otherwise",slug:"when-elsewhen-and-otherwise"},{level:2,title:"The Wire Construct",slug:"the-wire-construct"},{level:3,title:"Exercise: Polynomial",slug:"exercise-polynomial"},{level:3,title:"Exercise: Finite State Machine",slug:"exercise-finite-state-machine"}],createdTime:170977737e4},{title:"2024.03.01-3.1 Generators: Parameters",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1%20Generators%20Parameters.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1 Generators Parameters.md",key:"v-4075f022",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.01-3.1%20Generators%20Parameters.html",headers:[{level:2,title:"Parameter Passing",slug:"parameter-passing"},{level:3,title:"Example: Parameterized Scala Object",slug:"example-parameterized-scala-object"},{level:3,title:"Example: Parameterized Chisel Object",slug:"example-parameterized-chisel-object"},{level:3,title:"Example: Parameterized 4-input Sort",slug:"example-parameterized-4-input-sort"},{level:2,title:"Option and Defualt Arguments",slug:"option-and-defualt-arguments"},{level:3,title:"Options for Parameters with Defaults",slug:"options-for-parameters-with-defaults"},{level:2,title:"Match/Case Statements",slug:"match-case-statements"},{level:3,title:"Example: Value Matching",slug:"example-value-matching"},{level:3,title:"Example: Multiple Value Matching",slug:"example-multiple-value-matching"},{level:3,title:"Example: Type Matching",slug:"example-type-matching"},{level:3,title:"Example: Multiple Type Matching",slug:"example-multiple-type-matching"},{level:3,title:"Example: Type Matching and Erasure",slug:"example-type-matching-and-erasure"},{level:2,title:"IOs with Optional Fields",slug:"ios-with-optional-fields"},{level:3,title:"Example: Optional IO with Option",slug:"example-optional-io-with-option"},{level:3,title:"Example: Optional IO with Zero-Width Wires",slug:"example-optional-io-with-zero-width-wires"},{level:2,title:"Implicits",slug:"implicits"},{level:3,title:"Implicit Arguments",slug:"implicit-arguments"},{level:3,title:"Example: Implicit Cats",slug:"example-implicit-cats"},{level:3,title:"Example: Implicit Logging",slug:"example-implicit-logging"},{level:3,title:"Implicit Conversions",slug:"implicit-conversions"},{level:3,title:"Example: Implicit Conversion",slug:"example-implicit-conversion"}],createdTime:170977737e4},{title:"2024.03.05-3.4 Higher-Order Functions",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4%20Higher-Order%20Functions.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4 Higher-Order Functions.md",key:"v-7c6e1710",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.05-3.4%20Higher-Order%20Functions.html",headers:[{level:2,title:"A Tale of Two FIRs",slug:"a-tale-of-two-firs"},{level:2,title:"Functions as Arguments",slug:"functions-as-arguments"},{level:3,title:"Practice in Scala",slug:"practice-in-scala"},{level:3,title:"Example: map",slug:"example-map"},{level:3,title:"Example: zipWithIndex",slug:"example-zipwithindex"},{level:3,title:"Example: reduce",slug:"example-reduce"},{level:3,title:"Example: fold",slug:"example-fold"}],createdTime:170977737e4},{title:"2024.03.03-3.2 Generators: Collections",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2%20Generators%20Collections.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2 Generators Collections.md",key:"v-17521110",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.03-3.2%20Generators%20Collections.html",headers:[{level:2,title:"Generators and Collections",slug:"generators-and-collections"},{level:3,title:"FIR Golden Model",slug:"fir-golden-model"},{level:3,title:"Seq",slug:"seq"},{level:3,title:"寄存器",slug:"寄存器"},{level:3,title:"Poke",slug:"poke"},{level:3,title:"更新寄存器",slug:"更新寄存器"},{level:3,title:"计算输出",slug:"计算输出"},{level:3,title:"Test circuit using the golden model",slug:"test-circuit-using-the-golden-model"},{level:3,title:"Example: Parameterized FIR Generator",slug:"example-parameterized-fir-generator"},{level:3,title:"Test a bunch of different sized FIR filters",slug:"test-a-bunch-of-different-sized-fir-filters"},{level:2,title:"Hardware Collections",slug:"hardware-collections"},{level:3,title:"Example: Add run-time configurable taps to our FIR",slug:"example-add-run-time-configurable-taps-to-our-fir"},{level:3,title:"Example: 32-bit RISC-V Processor",slug:"example-32-bit-risc-v-processor"}],createdTime:170977737e4},{title:"预学习阶段",frontmatter:{},regularPath:"/Chip/Chip/%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92/%E9%A2%84%E5%AD%A6%E4%B9%A0%E9%98%B6%E6%AE%B5.html",relativePath:"Chip/Chip/一生一芯计划/预学习阶段.md",key:"v-4d37d972",path:"/Chip/Chip/%E4%B8%80%E7%94%9F%E4%B8%80%E8%8A%AF%E8%AE%A1%E5%88%92/%E9%A2%84%E5%AD%A6%E4%B9%A0%E9%98%B6%E6%AE%B5.html",createdTime:170972353e4},{title:"3. 2023.11.07-Verilog语法",frontmatter:{},regularPath:"/Chip/Chip/3.%202023.11.07-Verilog%E8%AF%AD%E6%B3%95.html",relativePath:"Chip/Chip/3. 2023.11.07-Verilog语法.md",key:"v-22b21eac",path:"/Chip/Chip/3.%202023.11.07-Verilog%E8%AF%AD%E6%B3%95.html",headers:[{level:2,title:"01. Verilog 基础语法",slug:"_01-verilog-基础语法"},{level:2,title:"02. Verilog 数值表示",slug:"_02-verilog-数值表示"},{level:2,title:"03. Verilog 数据类型",slug:"_03-verilog-数据类型"},{level:2,title:"04. Verilog 表达式",slug:"_04-verilog-表达式"},{level:2,title:"10. Verilog 多路分支语句",slug:"_10-verilog-多路分支语句"},{level:2,title:"2023.11.15-Vivado",slug:"_2023-11-15-vivado"},{level:2,title:"2023.11.16-阻塞与非阻塞赋值",slug:"_2023-11-16-阻塞与非阻塞赋值"}],createdTime:170977737e4},{title:"SoC Design",frontmatter:{},regularPath:"/Chip/",relativePath:"Chip/README.md",key:"v-5820d42c",path:"/Chip/",headers:[{level:2,title:"1. 一生一芯计划",slug:"_1-一生一芯计划"},{level:2,title:"2. 2024.02.21-Chisel",slug:"_2-2024-02-21-chisel"},{level:2,title:"3. 2023.11.07-Verilog语法",slug:"_3-2023-11-07-verilog语法"}],createdTime:170972353e4},{title:"2024.02.22-BFS",frontmatter:{},regularPath:"/LeetCode/LeetCode/2024.02.22-BFS.html",relativePath:"LeetCode/LeetCode/2024.02.22-BFS.md",key:"v-460e207e",path:"/LeetCode/LeetCode/2024.02.22-BFS.html",headers:[{level:2,title:"2024.02.22-752.打开转盘锁(BFS)",slug:"_2024-02-22-752-打开转盘锁-bfs"}],createdTime:170977737e4},{title:"2024.02.22-752.打开转盘锁(BFS)",frontmatter:{},regularPath:"/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752%20%E6%89%93%E5%BC%80%E8%BD%AC%E7%9B%98%E9%94%81%EF%BC%88BFS%EF%BC%89.html",relativePath:"LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752 打开转盘锁(BFS).md",key:"v-b7036e02",path:"/LeetCode/LeetCode/2024.02.22-BFS/2024.02.22-752%20%E6%89%93%E5%BC%80%E8%BD%AC%E7%9B%98%E9%94%81%EF%BC%88BFS%EF%BC%89.html",headers:[{level:2,title:"Hint:",slug:"hint"}],createdTime:170977737e4},{title:"2024.03.05-二叉树",frontmatter:{},regularPath:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91.html",relativePath:"LeetCode/LeetCode/2024.03.05-二叉树.md",key:"v-4f74fc89",path:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91.html",headers:[{level:2,title:"2024.03.05-104.二叉树的最大深度",slug:"_2024-03-05-104-二叉树的最大深度"},{level:2,title:"2024.03.05-543.二叉树的直径",slug:"_2024-03-05-543-二叉树的直径"}],createdTime:170977737e4},{title:"2024.03.04-3.3 Interlude: Chisel Standard Library",frontmatter:{},regularPath:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3%20Interlude%20Chisel%20Standard%20Library.html",relativePath:"Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3 Interlude Chisel Standard Library.md",key:"v-5bcf313c",path:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/2024.03.04-3.3%20Interlude%20Chisel%20Standard%20Library.html",headers:[{level:2,title:"Decoupled: A Standard Ready-Valid Interface",slug:"decoupled-a-standard-ready-valid-interface"},{level:3,title:"组件",slug:"组件"},{level:3,title:"数据传输",slug:"数据传输"},{level:3,title:"使用场景",slug:"使用场景"},{level:3,title:"代码示例",slug:"代码示例"},{level:2,title:"Queue",slug:"queue"},{level:2,title:"Arbiter",slug:"arbiter"},{level:2,title:"Misc Function Blocks",slug:"misc-function-blocks"},{level:3,title:"Bitwise Utilities",slug:"bitwise-utilities"},{level:3,title:"PopCount",slug:"popcount"},{level:3,title:"Reverse",slug:"reverse"},{level:3,title:"OneHot encoding utilities",slug:"onehot-encoding-utilities"},{level:3,title:"UIntToOH",slug:"uinttooh"},{level:3,title:"OHToUInt",slug:"ohtouint"},{level:3,title:"MUX",slug:"mux"},{level:3,title:"PriorityMux",slug:"prioritymux"},{level:3,title:"OneHot Mux: Mux1H",slug:"onehot-mux-mux1h"},{level:3,title:"Counter",slug:"counter"}],createdTime:170977737e4},{title:"2024.03.05-104.二叉树的最大深度",frontmatter:{},regularPath:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-104%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E6%9C%80%E5%A4%A7%E6%B7%B1%E5%BA%A6%20c6649929175d46038db921b552f2a235.html",relativePath:"LeetCode/LeetCode/2024.03.05-二叉树/2024 03 05-104 二叉树的最大深度 c6649929175d46038db921b552f2a235.md",key:"v-018fe7d9",path:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-104%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E6%9C%80%E5%A4%A7%E6%B7%B1%E5%BA%A6%20c6649929175d46038db921b552f2a235.html",createdTime:170977737e4},{title:"Home",frontmatter:{home:!0,heroText:"Outis Li",tagline:"Personal Blog",actionText:"预览 →",actionLink:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.md",features:[{title:"简洁至上",details:"以 Markdown 为中心的项目结构,以最少的配置帮助你专注于写作。"},{title:"Vue驱动",details:"享受 Vue + webpack 的开发体验,在 Markdown 中使用 Vue 组件,同时可以使用 Vue 来开发自定义主题。"},{title:"高性能",details:"VuePress 为每个页面预渲染生成静态的 HTML,同时在页面被加载的时候,将作为 SPA 运行。"}],footer:"Licensed under Apache 2.0 | Copyright © 2023-Present Outis Li"},regularPath:"/",relativePath:"README.md",key:"v-2832db09",path:"/",createdTime:170972353e4},{title:"Research",frontmatter:{},regularPath:"/Research/",relativePath:"Research/README.md",key:"v-60f1b38c",path:"/Research/",createdTime:170977737e4},{title:"2024.03.10-滑动窗口",frontmatter:{},regularPath:"/LeetCode/LeetCode/2024.03.10-%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3.html",relativePath:"LeetCode/LeetCode/2024.03.10-滑动窗口.md",key:"v-a9374808",path:"/LeetCode/LeetCode/2024.03.10-%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3.html",createdTime:170977737e4},{title:"2023-Geant4",frontmatter:{},regularPath:"/Research/Research/2023-Geant4.html",relativePath:"Research/Research/2023-Geant4.md",key:"v-83c37b1c",path:"/Research/Research/2023-Geant4.html",headers:[{level:2,title:"2023.02.13-在超算上搭建Singularity环境并配置Geant4",slug:"_2023-02-13-在超算上搭建singularity环境并配置geant4"},{level:2,title:"2023.06.14-Geant4各版本的安装",slug:"_2023-06-14-geant4各版本的安装"},{level:2,title:"2023.02.27-处理Geant4获取的数据",slug:"_2023-02-27-处理geant4获取的数据"},{level:2,title:"2023.05.23-Geant4多粒子源设置",slug:"_2023-05-23-geant4多粒子源设置"},{level:2,title:"2023.03.12-PKA数据处理",slug:"_2023-03-12-pka数据处理"},{level:2,title:"2023.08.28-Geant4自定义PhysicsList",slug:"_2023-08-28-geant4自定义physicslist"},{level:2,title:"2023.09.05-C++ Trim程序",slug:"_2023-09-05-c-trim程序"},{level:2,title:"2023.12.18-Geant4自动化",slug:"_2023-12-18-geant4自动化"}],createdTime:170977737e4},{title:"2023.02.13-在超算上搭建Singularity环境并配置Geant4",frontmatter:{},regularPath:"/Research/Research/2023-Geant4/2023.02.13-%E5%9C%A8%E8%B6%85%E7%AE%97%E4%B8%8A%E6%90%AD%E5%BB%BASingularity%E7%8E%AF%E5%A2%83%E5%B9%B6%E9%85%8D%E7%BD%AEGeant4.html",relativePath:"Research/Research/2023-Geant4/2023.02.13-在超算上搭建Singularity环境并配置Geant4.md",key:"v-3325c5ea",path:"/Research/Research/2023-Geant4/2023.02.13-%E5%9C%A8%E8%B6%85%E7%AE%97%E4%B8%8A%E6%90%AD%E5%BB%BASingularity%E7%8E%AF%E5%A2%83%E5%B9%B6%E9%85%8D%E7%BD%AEGeant4.html",headers:[{level:2,title:"I. 制作singularity包",slug:"i-制作singularity包"},{level:3,title:"1. 进入fakeroot节点",slug:"_1-进入fakeroot节点"},{level:3,title:"2. 制作并进入sandbox镜像",slug:"_2-制作并进入sandbox镜像"},{level:3,title:"3. 配置geant4环境",slug:"_3-配置geant4环境"},{level:3,title:"4. 打包",slug:"_4-打包"},{level:2,title:"II. 配置go&singularity",slug:"ii-配置go-singularity"},{level:3,title:"1. 配置go环境",slug:"_1-配置go环境"},{level:3,title:"2. 安装singularity",slug:"_2-安装singularity"},{level:3,title:"3. 环境变量",slug:"_3-环境变量"},{level:2,title:"III. 启用singularity",slug:"iii-启用singularity"},{level:3,title:"1. 将SIF镜像下载到常规节点",slug:"_1-将sif镜像下载到常规节点"},{level:3,title:"2. 转换成sandbox镜像并启用",slug:"_2-转换成sandbox镜像并启用"},{level:3,title:"3. 配置环境变量",slug:"_3-配置环境变量"},{level:2,title:"IV. 附录",slug:"iv-附录"},{level:3,title:"1. SIF容器与sandbox相互转换",slug:"_1-sif容器与sandbox相互转换"},{level:3,title:"2. 在fakeroot节点上删除sandbox镜像",slug:"_2-在fakeroot节点上删除sandbox镜像"}],createdTime:170977737e4},{title:"2024.03.05-543.二叉树的直径",frontmatter:{},regularPath:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-543%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84%209db6d046b0954b45b96ca749922a2ece.html",relativePath:"LeetCode/LeetCode/2024.03.05-二叉树/2024 03 05-543 二叉树的直径 9db6d046b0954b45b96ca749922a2ece.md",key:"v-746efd44",path:"/LeetCode/LeetCode/2024.03.05-%E4%BA%8C%E5%8F%89%E6%A0%91/2024%2003%2005-543%20%E4%BA%8C%E5%8F%89%E6%A0%91%E7%9A%84%E7%9B%B4%E5%BE%84%209db6d046b0954b45b96ca749922a2ece.html",createdTime:170977737e4},{title:"2023.02.27-处理Geant4获取的数据",frontmatter:{},regularPath:"/Research/Research/2023-Geant4/2023.02.27-%E5%A4%84%E7%90%86Geant4%E8%8E%B7%E5%8F%96%E7%9A%84%E6%95%B0%E6%8D%AE.html",relativePath:"Research/Research/2023-Geant4/2023.02.27-处理Geant4获取的数据.md",key:"v-60fcb6e3",path:"/Research/Research/2023-Geant4/2023.02.27-%E5%A4%84%E7%90%86Geant4%E8%8E%B7%E5%8F%96%E7%9A%84%E6%95%B0%E6%8D%AE.html",headers:[{level:2,title:"直方图 Histogram",slug:"直方图-histogram"},{level:2,title:"热力图 Heatmap",slug:"热力图-heatmap"}],createdTime:170977737e4},{title:"LeetCode",frontmatter:{},regularPath:"/LeetCode/",relativePath:"LeetCode/README.md",key:"v-14b38dcc",path:"/LeetCode/",headers:[{level:2,title:"2024.02.22-BFS",slug:"_2024-02-22-bfs"},{level:2,title:"2024.03.05-二叉树",slug:"_2024-03-05-二叉树"},{level:2,title:"2024.03.10-滑动窗口",slug:"_2024-03-10-滑动窗口"}],createdTime:170972353e4},{title:"2023.03.12-PKA数据处理",frontmatter:{},regularPath:"/Research/Research/2023-Geant4/2023.03.12-PKA%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86.html",relativePath:"Research/Research/2023-Geant4/2023.03.12-PKA数据处理.md",key:"v-1454065a",path:"/Research/Research/2023-Geant4/2023.03.12-PKA%E6%95%B0%E6%8D%AE%E5%A4%84%E7%90%86.html",createdTime:170977737e4},{title:"2023.05.23-Geant4多粒子源设置",frontmatter:{},regularPath:"/Research/Research/2023-Geant4/2023.05.23-Geant4%E5%A4%9A%E7%B2%92%E5%AD%90%E6%BA%90%E8%AE%BE%E7%BD%AE.html",relativePath:"Research/Research/2023-Geant4/2023.05.23-Geant4多粒子源设置.md",key:"v-4353bce0",path:"/Research/Research/2023-Geant4/2023.05.23-Geant4%E5%A4%9A%E7%B2%92%E5%AD%90%E6%BA%90%E8%AE%BE%E7%BD%AE.html",createdTime:170977737e4},{title:"2023.06.14-Geant4各版本的安装",frontmatter:{},regularPath:"/Research/Research/2023-Geant4/2023.06.14-Geant4%E5%90%84%E7%89%88%E6%9C%AC%E7%9A%84%E5%AE%89%E8%A3%85.html",relativePath:"Research/Research/2023-Geant4/2023.06.14-Geant4各版本的安装.md",key:"v-de532b9a",path:"/Research/Research/2023-Geant4/2023.06.14-Geant4%E5%90%84%E7%89%88%E6%9C%AC%E7%9A%84%E5%AE%89%E8%A3%85.html",headers:[{level:2,title:"安装依赖",slug:"安装依赖"},{level:2,title:"下载安装Geant4",slug:"下载安装geant4"}],createdTime:170977737e4},{title:"2023.08.28-Geant4 自定义 PhysicsList",frontmatter:{},regularPath:"/Research/Research/2023-Geant4/2023.08.28-Geant4%E8%87%AA%E5%AE%9A%E4%B9%89PhysicsList.html",relativePath:"Research/Research/2023-Geant4/2023.08.28-Geant4自定义PhysicsList.md",key:"v-0dd1e8ac",path:"/Research/Research/2023-Geant4/2023.08.28-Geant4%E8%87%AA%E5%AE%9A%E4%B9%89PhysicsList.html",headers:[{level:2,title:"一个最简单的例子",slug:"一个最简单的例子"},{level:3,title:"main:",slug:"main"},{level:2,title:"自定义物理列表类:",slug:"自定义物理列表类"},{level:2,title:"自定义碰撞过程类:",slug:"自定义碰撞过程类"},{level:2,title:"1. 关于必须重新定义的函数:",slug:"_1-关于必须重新定义的函数"},{level:2,title:"2. 关于 aParticleChange:",slug:"_2-关于-aparticlechange"},{level:2,title:"3. GetMeanFreePath 的作用",slug:"_3-getmeanfreepath-的作用"},{level:2,title:"4. 多物理过程情形",slug:"_4-多物理过程情形"},{level:3,title:"说明:",slug:"说明"},{level:3,title:"示例:",slug:"示例"}],createdTime:170977737e4},{title:"Helloworld",frontmatter:{},regularPath:"/about/",relativePath:"about/README.md",key:"v-2f1ebe3a",path:"/about/",createdTime:170972353e4},{title:"2023.09.05-C++ Trim 程序",frontmatter:{},regularPath:"/Research/Research/2023-Geant4/2023.09.05-C++%20Trim%E7%A8%8B%E5%BA%8F.html",relativePath:"Research/Research/2023-Geant4/2023.09.05-C++ Trim程序.md",key:"v-391322e8",path:"/Research/Research/2023-Geant4/2023.09.05-C++%20Trim%E7%A8%8B%E5%BA%8F.html",headers:[{level:2,title:"每个粒子端到端的计算",slug:"每个粒子端到端的计算"},{level:3,title:"InitialIon()",slug:"initialion"},{level:2,title:"具体计算",slug:"具体计算"},{level:3,title:"1. FreeLength()",slug:"_1-freelength"},{level:3,title:"使用到的变量:",slug:"使用到的变量"},{level:3,title:"输出(改变)的变量:",slug:"输出-改变-的变量"},{level:3,title:"2. ChoseCollisionAtom()",slug:"_2-chosecollisionatom"},{level:3,title:"使用到的变量:",slug:"使用到的变量-2"},{level:3,title:"改变的变量:",slug:"改变的变量"},{level:2,title:"3. EleEnergyLoss()",slug:"_3-eleenergyloss"},{level:3,title:"使用的变量:",slug:"使用的变量"},{level:3,title:"改变的变量:",slug:"改变的变量-2"},{level:2,title:"4. EmissionAngle()",slug:"_4-emissionangle"},{level:3,title:"使用的变量:",slug:"使用的变量-2"},{level:3,title:"改变的变量:",slug:"改变的变量-3"},{level:2,title:"5. IonNewCondition()",slug:"_5-ionnewcondition"},{level:3,title:"使用的变量:",slug:"使用的变量-3"},{level:3,title:"改变的变量:",slug:"改变的变量-4"},{level:2,title:"6. ProcessRecorder()",slug:"_6-processrecorder"},{level:3,title:"使用的变量:",slug:"使用的变量-4"},{level:3,title:"改变的变量:",slug:"改变的变量-5"},{level:2,title:"7. OutOrNot(int &Ionflag)",slug:"_7-outornot-int-ionflag"},{level:3,title:"使用的变量:",slug:"使用的变量-5"},{level:3,title:"改变的变量:",slug:"改变的变量-6"}],createdTime:170977737e4},{title:"2023.12.18-Geant4自动化",frontmatter:{},regularPath:"/Research/Research/2023-Geant4/2023.12.18-Geant4%E8%87%AA%E5%8A%A8%E5%8C%96.html",relativePath:"Research/Research/2023-Geant4/2023.12.18-Geant4自动化.md",key:"v-7b684336",path:"/Research/Research/2023-Geant4/2023.12.18-Geant4%E8%87%AA%E5%8A%A8%E5%8C%96.html",headers:[{level:2,title:"1. CMakeLists.txt与run.mac的自动创建",slug:"_1-cmakelists-txt与run-mac的自动创建"},{level:3,title:"CMakeLists.txt中:",slug:"cmakelists-txt中"},{level:3,title:"run.mac中",slug:"run-mac中"},{level:2,title:"2. Docker自动化",slug:"_2-docker自动化"},{level:3,title:"Dockerfile:",slug:"dockerfile"},{level:3,title:"start.sh:",slug:"start-sh"}],createdTime:170977737e4}],themeConfig:{logo:"/assets/img/good.png",nav:[{text:"Home",link:"/"},{text:"Research",items:[{text:"Geant4",link:"/Research/Research/2023-Geant4.md"},{text:"tbc",items:[{text:"tbc",link:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.md"},{text:"tbc",link:"/Chip/Chip/2.%202024.02.21-Chisel.md"}]},{text:"tbc",items:[{text:"tbc",link:"/Chip/Chip/3.%202023.11.07-Verilog语法.md"},{text:"tbc",link:"/Chip/Chip/3.%202023.11.07-Verilog语法.md"}]}]},{text:"LeetCode",items:[{text:"BFS",link:"/LeetCode/Leetcode/2024.02.22-BFS.md"},{text:"二叉树",link:"/LeetCode/Leetcode/2024.03.05-二叉树.md"},{text:"滑动窗口",link:"/LeetCode/Leetcode/2024.03.10-滑动窗口.md"}]},{text:"Chip",items:[{text:"一生一芯",items:[{text:"预学习",link:"/Chip/Chip/1.%20一生一芯计划.md"},{text:"B阶段",link:"/Chip/Chip/1.%20一生一芯计划.md"},{text:"A阶段",link:"/Chip/Chip/1.%20一生一芯计划.md"}]},{text:"Chisel",items:[{text:"Outline",link:"/Chip/Chip/2.%202024.02.21-Chisel.md"},{text:"Bootcamp",link:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.md"}]},{text:"Verilog",items:[{text:"Outline",link:"/Chip/Chip/3.%202023.11.07-Verilog语法.md"},{text:"Basic",link:"/Chip/Chip/3.%202023.11.07-Verilog语法.md"}]}]},{text:"Others",items:[{text:"tbc",items:[{text:"tbc",link:"/Chip/Chip/1.%20一生一芯计划.md"},{text:"tbc",link:"/Chip/Chip/1.%20一生一芯计划.md"},{text:"tbc",link:"/Chip/Chip/1.%20一生一芯计划.md"}]},{text:"tbc",items:[{text:"tbc",link:"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot.md"},{text:"tbc",link:"/Chip/Chip/2.%202024.02.21-Chisel.md"}]},{text:"tbc",items:[{text:"tbc",link:"/Chip/Chip/3.%202023.11.07-Verilog语法.md"},{text:"tbc",link:"/Chip/Chip/3.%202023.11.07-Verilog语法.md"}]}]},{text:"External",link:"https://google.com"}],sidebarDepth:2,displayAllHeaders:!1,activeHeaderLinks:!0}};n(234);Wn.component("Badge",()=>Promise.all([n.e(0),n.e(4)]).then(n.bind(null,315))),Wn.component("CodeBlock",()=>Promise.all([n.e(0),n.e(5)]).then(n.bind(null,311))),Wn.component("CodeGroup",()=>Promise.all([n.e(0),n.e(6)]).then(n.bind(null,312)));n(235),n(236),n(237);var $s=[{},({Vue:e})=>{e.mixin({computed:{$dataBlock(){return this.$options.__data__block__}}})},{},{},({siteData:e,options:t})=>{e.themeConfig.sidebar={"/Chip/Chip/2024.02.21-Chisel/2024.02.21-ChiselBoot/":[{title:"2024 02 21 Chisel Boot",collapsable:!1,sidebarDepth:1,children:["2024.02.21-1 Introduction to Scala","2024.02.23-2.1 First Chisel Module","2024.02.24-2.2 Combinational Logic","2024.02.25-2.3 Control Flow","2024.02.26-2.4 Sequential Logic","2024.02.28-2.5 FIR Filter","2024.02.29-2.6 More on ChiselTest","2024.03.01-3.1 Generators Parameters","2024.03.03-3.2 Generators Collections","2024.03.04-3.3 Interlude Chisel Standard Library","2024.03.05-3.4 Higher-Order Functions"]}],"/LeetCode/LeetCode/2024.02.22-BFS/":[{title:"2024 02 22 BFS",collapsable:!1,sidebarDepth:1,children:["2024.02.22-752 打开转盘锁(BFS)"]}],"/LeetCode/LeetCode/2024.03.05-二叉树/":[{title:"2024.03.05-二叉树",collapsable:!1,sidebarDepth:1,children:["2024 03 05-104 二叉树的最大深度 c6649929175d46038db921b552f2a235","2024 03 05-543 二叉树的直径 9db6d046b0954b45b96ca749922a2ece"]}],"/Chip/Chip/2023.11.07-Verilog语法/":[{title:"2023.11.07-Verilog语法",collapsable:!1,sidebarDepth:1,children:["01.Verilog 基础语法","02.Verilog 数值表示","03.Verilog 数据类型","04.Verilog 表达式","10.Verilog 多路分支语句","2023.11.15-Vivado","2023.11.16-阻塞与非阻塞赋值"]}],"/Research/Research/2023-Geant4/":[{title:"2023 Geant4",collapsable:!1,sidebarDepth:1,children:["2023.02.13-在超算上搭建Singularity环境并配置Geant4","2023.02.27-处理Geant4获取的数据","2023.03.12-PKA数据处理","2023.05.23-Geant4多粒子源设置","2023.06.14-Geant4各版本的安装","2023.08.28-Geant4自定义PhysicsList","2023.09.05-C++ Trim程序","2023.12.18-Geant4自动化"]}],"/Chip/Chip/2024.02.21-Chisel/":[{title:"2024 02 21 Chisel",collapsable:!1,sidebarDepth:1,children:["2024.02.21-ChiselBoot"]}],"/LeetCode/LeetCode/":[{title:"Leet Code",collapsable:!1,sidebarDepth:1,children:["2024.02.22-BFS","2024.03.05-二叉树","2024.03.10-滑动窗口"]}],"/Research/Research/":[{title:"Research",collapsable:!1,sidebarDepth:1,children:["2023-Geant4"]}],"/Chip/Chip/一生一芯计划/":[{title:"一生一芯计划",collapsable:!1,sidebarDepth:1,children:["预学习阶段"]}],"/Chip/Chip/":[{title:"Chip",collapsable:!1,sidebarDepth:1,children:["1. 一生一芯计划","2. 2024.02.21-Chisel","3. 2023.11.07-Verilog语法"]}],"/Research/":[{title:"Research",collapsable:!1,sidebarDepth:1,children:[""]}],"/LeetCode/":[{title:"Leet Code",collapsable:!1,sidebarDepth:1,children:[""]}],"/about/":[{title:"About",collapsable:!1,sidebarDepth:1,children:[""]}],"/Chip/":[{title:"Chip",collapsable:!1,sidebarDepth:1,children:[""]}]}},({Vue:e})=>{const{ignoredElements:t}=e.config;t.every(e=>"/^mjx-/"!==e.toString())&&t.push(/^mjx-/)}],Fs=[];class js extends class{constructor(){this.store=new Wn({data:{state:{}}})}$get(e){return this.store.state[e]}$set(e,t){Wn.set(this.store.state,e,t)}$emit(...e){this.store.$emit(...e)}$on(...e){this.store.$on(...e)}}{}Object.assign(js.prototype,{getPageAsyncComponent:ss,getLayoutAsyncComponent:ls,getAsyncComponent:cs,getVueComponent:us});var Rs={install(e){const t=new js;e.$vuepress=t,e.prototype.$vuepress=t}};function Ts(e,t){const n=t.toLowerCase();return e.options.routes.some(e=>e.path.toLowerCase()===n)}var Ds={props:{pageKey:String,slotKey:{type:String,default:"default"}},render(e){const t=this.pageKey||this.$parent.$page.key;return ps("pageKey",t),Wn.component(t)||Wn.component(t,ss(t)),Wn.component(t)?e(t):e("")}},Vs={functional:!0,props:{slotKey:String,required:!0},render:(e,{props:t,slots:n})=>e("div",{class:["content__"+t.slotKey]},n()[t.slotKey])},Is={computed:{openInNewWindowTitle(){return this.$themeLocaleConfig.openNewWindowText||"(opens new window)"}}},Gs=(n(238),n(239),Object(ks.a)(Is,(function(){var e=this._self._c;return e("span",[e("svg",{staticClass:"icon outbound",attrs:{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",x:"0px",y:"0px",viewBox:"0 0 100 100",width:"15",height:"15"}},[e("path",{attrs:{fill:"currentColor",d:"M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"}}),this._v(" "),e("polygon",{attrs:{fill:"currentColor",points:"45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"}})]),this._v(" "),e("span",{staticClass:"sr-only"},[this._v(this._s(this.openInNewWindowTitle))])])}),[],!1,null,null,null).exports),Ms={functional:!0,render(e,{parent:t,children:n}){if(t._isMounted)return n;t.$once("hook:mounted",()=>{t.$forceUpdate()})}};Wn.config.productionTip=!1,Wn.use(qa),Wn.use(Rs),Wn.mixin(function(e,t,n=Wn){!function(e){e.locales&&Object.keys(e.locales).forEach(t=>{e.locales[t].path=t});Object.freeze(e)}(t),n.$vuepress.$set("siteData",t);const r=new(e(n.$vuepress.$get("siteData"))),i=Object.getOwnPropertyDescriptors(Object.getPrototypeOf(r)),o={};return Object.keys(i).reduce((e,t)=>(t.startsWith("$")&&(e[t]=i[t].get),e),o),{computed:o}}(e=>class{setPage(e){this.__page=e}get $site(){return e}get $themeConfig(){return this.$site.themeConfig}get $frontmatter(){return this.$page.frontmatter}get $localeConfig(){const{locales:e={}}=this.$site;let t,n;for(const r in e)"/"===r?n=e[r]:0===this.$page.path.indexOf(r)&&(t=e[r]);return t||n||{}}get $siteTitle(){return this.$localeConfig.title||this.$site.title||""}get $canonicalUrl(){const{canonicalUrl:e}=this.$page.frontmatter;return"string"==typeof e&&e}get $title(){const e=this.$page,{metaTitle:t}=this.$page.frontmatter;if("string"==typeof t)return t;const n=this.$siteTitle,r=e.frontmatter.home?null:e.frontmatter.title||e.title;return n?r?r+" | "+n:n:r||"VuePress"}get $description(){const e=function(e){if(e){const t=e.filter(e=>"description"===e.name)[0];if(t)return t.content}}(this.$page.frontmatter.meta);return e||(this.$page.frontmatter.description||this.$localeConfig.description||this.$site.description||"")}get $lang(){return this.$page.frontmatter.lang||this.$localeConfig.lang||"en-US"}get $localePath(){return this.$localeConfig.path||"/"}get $themeLocaleConfig(){return(this.$site.themeConfig.locales||{})[this.$localePath]||{}}get $page(){return this.__page?this.__page:function(e,t){for(let n=0;nn||(e.hash?!Wn.$vuepress.$get("disableScrollBehavior")&&{selector:decodeURIComponent(e.hash)}:{x:0,y:0})});!function(e){e.beforeEach((t,n,r)=>{if(Ts(e,t.path))r();else if(/(\/|\.html)$/.test(t.path))if(/\/$/.test(t.path)){const n=t.path.replace(/\/$/,"")+".html";Ts(e,n)?r(n):r()}else r();else{const n=t.path+"/",i=t.path+".html";Ts(e,i)?r(i):Ts(e,n)?r(n):r()}})}(n);const r={};try{await Promise.all($s.filter(e=>"function"==typeof e).map(t=>t({Vue:Wn,options:r,router:n,siteData:Ls,isServer:e})))}catch(e){console.error(e)}return{app:new Wn(Object.assign(r,{router:n,render:e=>e("div",{attrs:{id:"app"}},[e("RouterView",{ref:"layout"}),e("div",{class:"global-ui"},Fs.map(t=>e(t)))])})),router:n}}(!1).then(({app:e,router:t})=>{t.onReady(()=>{e.$mount("#app")})})}]); \ No newline at end of file diff --git a/assets/js/vendors~docsearch.b873aa2e.js b/assets/js/vendors~docsearch.b873aa2e.js new file mode 100644 index 0000000..b294901 --- /dev/null +++ b/assets/js/vendors~docsearch.b873aa2e.js @@ -0,0 +1,3 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{308:function(t,e,n){ +/*! docsearch 2.6.3 | © Algolia | github.com/algolia/docsearch */ +var r;"undefined"!=typeof self&&self,r=function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=22)}([function(t,e,n){"use strict";var r,i=n(1);function s(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}t.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(t){if(void 0===t&&(t=navigator.userAgent),/(msie|trident)/i.test(t)){var e=t.match(/(msie |rv:)(\d+(.\d+)?)/i);if(e)return e[2]}return!1},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(t){return"number"==typeof t},toStr:function(t){return null==t?"":t+""},cloneDeep:function(t){var e=this.mixin({},t),n=this;return this.each(e,(function(t,r){t&&(n.isArray(t)?e[r]=[].concat(t):n.isObject(t)&&(e[r]=n.cloneDeep(t)))})),e},error:function(t){throw new Error(t)},every:function(t,e){var n=!0;return t?(this.each(t,(function(r,i){n&&(n=e.call(null,r,i,t)&&n)})),!!n):n},any:function(t,e){var n=!1;return t?(this.each(t,(function(r,i){if(e.call(null,r,i,t))return n=!0,!1})),n):n},getUniqueId:(r=0,function(){return r++}),templatify:function(t){if(this.isFunction(t))return t;var e=i.element(t);return"SCRIPT"===e.prop("tagName")?function(){return e.text()}:function(){return String(t)}},defer:function(t){setTimeout(t,0)},noop:function(){},formatPrefix:function(t,e){return e?"":t+"-"},className:function(t,e,n){return(n?"":".")+t+e},escapeHighlightedString:function(t,e,n){e=e||"";var r=document.createElement("div");r.appendChild(document.createTextNode(e)),n=n||"";var i=document.createElement("div");i.appendChild(document.createTextNode(n));var o=document.createElement("div");return o.appendChild(document.createTextNode(t)),o.innerHTML.replace(RegExp(s(r.innerHTML),"g"),e).replace(RegExp(s(i.innerHTML),"g"),n)}}},function(t,e,n){"use strict";t.exports={element:null}},function(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,e,i){if("[object Function]"!==r.call(e))throw new TypeError("iterator must be a function");var s=t.length;if(s===+s)for(var o=0;o was loaded but did not call our provided callback"),JSONPScriptError:s("JSONPScriptError"," + +