반응형
피연산자를 오른쪽 또는 왼쪽으로 이동시키고 크기는 일정하게 유지합니다.
>> : 시프트된 비트가 손실되고 벡터가 0으로 채워집니다.
>> : 왼쪽 이동 비트가 MSB로 채워집니다.
피연산자는 unsigned으로 간주해야 합니다.
a = 4’b1010 b = 4’b10X0
Character
|
Operation performed
|
Example
|
Type
|
>>
|
Logical shift right
|
b >> 1 results 4’b010X
|
Binary
|
<<
|
Logical shift left
|
a << 2 results 4’b1000
|
Binary
|
>>>
|
Arithmetic shift right
|
b >>> 1 results 4’b110X
|
Binary
|
<<<
|
Arithmetic shift left
|
a <<< 2 results 4’b1000
|
Binary
|
>>=
|
Logic shift assign
|
a >>= b (a = a >> b)
|
Binary
|
<<=
|
Logic shift assign
|
a <<= b (a = a << b)
|
Binary
|
>>>=
|
Arithmetic shift assign
|
a >>>= b (a = a >>> b)
|
Binary
|
<<<=
|
Arithmetic shift assign
|
a <<<= b (a = a <<< b)
|
Binary
|
728x90
반응형
'Language > Verilog & SV' 카테고리의 다른 글
[Verilog & SV] task "automatic" vs "static" (0) | 2025.06.09 |
---|---|
[System Verilog] Mailbox? (0) | 2025.04.09 |
[Verilog & SV] 논리 연산자(Logical Operators) (0) | 2025.04.09 |
[Verilog & SV] Bitwise, 감소 연산자(Reduction Operators) (0) | 2025.04.09 |
[Verilog & SV] 산술연산자(Arithmetic Operators) (0) | 2025.04.09 |