Programming/Verilog2018. 1. 19. 07:51

reduction operator는

벡터에 대해서 1개의 bit로 연산을 해준다.

가장 편리한(?) 예제로는 parity 계산

bitwise and를 비트별로 계산할걸 reduction을 쓰면 한번에 끝난다.

근데 bitwise 연산자랑 일항 축약 연산자랑 어떻게 구분하지?


unary reduction operator

reg r_C;

&4'b1101;

r_C = |4'b0010;

[링크 : https://www.nandland.com/verilog/examples/example-reduction-operators.html]


bitwise operator

reg r_A = 1'b1;

reg r_B = 1'b0;

assign w_AND_SCALAR = r_A & r_B;

[링크 : https://www.nandland.com/verilog/examples/example-bitwise-operators.html]



+

아.. 그래서 unary 연산자 였군..

어떻게 보면 포인터와 비슷한 방식으로 단항으로 사용이 되고

항이 두개면 무조건 bitwise로 연산이 되려나?

즉, reduction은 무조건 변환 후 대입 정도만 허용되고

bitwise는 두항을 계산하고 2다른 걸 연속적으로 하는 식이 가능 할 것으로 보인다.


+

https://www.utdallas.edu/~akshay.sridharan/index_files/Page5212.htm

'Programming > Verilog' 카테고리의 다른 글

verilog 모델링 유형  (0) 2018.01.20
verilog Concatenation, Replication operator  (0) 2018.01.19
베릴로그 순차적 구조적  (2) 2018.01.18
structural vs behavioral verilog  (0) 2018.01.12
verilog vector instance  (0) 2018.01.09
Posted by 구차니